diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index da98f41bb2..6a1f864780 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -184,6 +184,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostAppsReq' + x-codegen: + method: authorize x-codeSamples: - lang: Shell label: cURL @@ -230,6 +232,8 @@ paths: summary: List Applications description: Retrieve a list of applications. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: Shell label: cURL @@ -282,6 +286,8 @@ paths: password: type: string description: The User's password. + x-codegen: + method: createSession x-codeSamples: - lang: JavaScript label: JS Client @@ -332,6 +338,8 @@ paths: summary: User Logout x-authenticated: true description: Deletes the current session for the logged in user. + x-codegen: + method: deleteSession x-codeSamples: - lang: JavaScript label: JS Client @@ -376,6 +384,8 @@ paths: summary: Get Current User x-authenticated: true description: Gets the currently logged in User. + x-codegen: + method: getSession x-codeSamples: - lang: JavaScript label: JS Client @@ -434,6 +444,8 @@ paths: description: The ID of the batch job. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client @@ -494,6 +506,8 @@ paths: description: The ID of the batch job. schema: type: string + x-codegen: + method: confirm x-codeSamples: - lang: JavaScript label: JS Client @@ -552,6 +566,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostBatchesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -849,6 +865,9 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetBatchParams x-codeSamples: - lang: JavaScript label: JS Client @@ -909,6 +928,8 @@ paths: description: The ID of the Batch Job schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -974,6 +995,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsToCollectionReq' + x-codegen: + method: addProducts x-codeSamples: - lang: Shell label: cURL @@ -1031,6 +1054,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' + x-codegen: + method: removeProducts x-codeSamples: - lang: Shell label: cURL @@ -1082,6 +1107,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCollectionsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -1243,6 +1270,9 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetCollectionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -1303,6 +1333,8 @@ paths: description: The ID of the Collection. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -1362,6 +1394,8 @@ paths: description: The ID of the Product Collection schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -1426,6 +1460,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -1515,6 +1551,9 @@ paths: schema: type: number default: '20' + x-codegen: + method: list + queryParams: AdminGetCurrenciesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -1565,6 +1604,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -1624,6 +1665,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq + x-codegen: + method: addCustomers x-codeSamples: - lang: JavaScript label: JS Client @@ -1706,6 +1749,8 @@ paths: schema: $ref: >- #/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq + x-codegen: + method: removeCustomers x-codeSamples: - lang: JavaScript label: JS Client @@ -1776,7 +1821,13 @@ paths: summary: Create a Customer Group description: Creates a CustomerGroup. x-authenticated: true - parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -1832,20 +1883,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. get: operationId: GetCustomerGroups summary: List Customer Groups @@ -1968,6 +2005,9 @@ paths: groups of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetCustomerGroupsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -2028,6 +2068,8 @@ paths: description: The ID of the Customer Group schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -2101,6 +2143,9 @@ paths: group. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetCustomerGroupsGroupParams x-codeSamples: - lang: JavaScript label: JS Client @@ -2165,6 +2210,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -2233,6 +2280,31 @@ paths: description: The ID of the customer group. schema: type: string + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: 'a search term to search email, first_name, and last_name.' + schema: + type: string + x-codegen: + method: listCustomers + queryParams: AdminGetGroupsGroupCustomersParams x-codeSamples: - lang: JavaScript label: JS Client @@ -2291,8 +2363,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCustomersReq' - tags: - - Customer + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -2333,6 +2405,8 @@ paths: security: - api_token: [] - cookie_auth: [] + tags: + - Customer responses: '201': description: OK @@ -2380,6 +2454,9 @@ paths: 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 @@ -2450,6 +2527,8 @@ paths: 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 @@ -2524,6 +2603,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCustomersCustomerReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -2598,6 +2679,8 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: addRegion x-codeSamples: - lang: JavaScript label: JS Client @@ -2665,6 +2748,8 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: removeRegion x-codeSamples: - lang: JavaScript label: JS Client @@ -2751,6 +2836,9 @@ paths: schema: $ref: >- #/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq + x-codegen: + method: addConditionResourceBatch + queryParams: AdminPostDiscountsDiscountConditionsConditionBatchParams x-codeSamples: - lang: JavaScript label: JS Client @@ -2846,6 +2934,8 @@ paths: schema: $ref: >- #/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq + x-codegen: + method: deleteConditionResourceBatch x-codeSamples: - lang: JavaScript label: JS Client @@ -2938,6 +3028,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' + x-codegen: + method: createCondition + queryParams: AdminPostDiscountsDiscountConditionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3006,12 +3099,12 @@ paths: parameters: - in: query name: expand - description: (Comma separated) Which fields should be expanded in each customer. + 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 each customer. + description: (Comma separated) Which fields should be retrieved in the results. schema: type: string requestBody: @@ -3019,6 +3112,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDiscountsReq' + x-codegen: + method: create + queryParams: AdminPostDiscountsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3153,6 +3249,9 @@ paths: description: Comma separated list of relations to include in the results. schema: type: string + x-codegen: + method: list + queryParams: AdminGetDiscountsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3216,6 +3315,13 @@ paths: description: The ID of the Discount to create the dynamic code from." schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq' + x-codegen: + method: createDynamicCode x-codeSamples: - lang: JavaScript label: JS Client @@ -3272,26 +3378,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - code - properties: - code: - type: string - description: The unique code that will be used to redeem the Discount. - usage_limit: - type: number - default: '1' - description: amount of times the discount can be applied. - metadata: - type: object - description: >- - An optional set of key-value paris to hold additional - information. '/discounts/{discount_id}/conditions/{condition_id}': delete: operationId: DeleteDiscountsDiscountConditionsCondition @@ -3321,6 +3407,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: deleteCondition + queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3397,6 +3486,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: getCondition + queryParams: AdminGetDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3486,6 +3578,9 @@ paths: schema: $ref: >- #/components/schemas/AdminPostDiscountsDiscountConditionsCondition + x-codegen: + method: updateCondition + queryParams: AdminPostDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3559,6 +3654,8 @@ paths: description: The ID of the Discount schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -3628,6 +3725,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetDiscountParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3708,6 +3808,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' + x-codegen: + method: update + queryParams: AdminPostDiscountsDiscountParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3782,6 +3885,8 @@ paths: description: The ID of the Discount schema: type: string + x-codegen: + method: deleteDynamicCode x-codeSamples: - lang: JavaScript label: JS Client @@ -3852,6 +3957,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieveByCode + queryParams: AdminGetDiscountsDiscountCodeParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3910,6 +4018,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDraftOrdersReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -4012,6 +4122,9 @@ paths: and display IDs of draft orders schema: type: string + x-codegen: + method: list + queryParams: AdminGetDraftOrdersParams x-codeSamples: - lang: JavaScript label: JS Client @@ -4077,6 +4190,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' + x-codegen: + method: addLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -4145,6 +4260,8 @@ paths: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -4204,6 +4321,8 @@ paths: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -4270,6 +4389,8 @@ paths: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: removeLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -4342,6 +4463,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -4411,6 +4534,8 @@ paths: description: The Draft Order id. schema: type: string + x-codegen: + method: markPaid x-codeSamples: - lang: JavaScript label: JS Client @@ -4477,6 +4602,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -4545,6 +4672,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostGiftCardsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -4623,6 +4752,9 @@ paths: 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 @@ -4683,6 +4815,8 @@ paths: description: The ID of the Gift Card to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -4742,6 +4876,8 @@ paths: description: The ID of the Gift Card. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -4808,6 +4944,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -4863,6 +5001,700 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/inventory-items/{id}/location-levels': + post: + operationId: PostInventoryItemsInventoryItemLocationLevels + summary: Create an Inventory Location Level for a given Inventory Item. + description: Creates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { + location_id: 'sloc', + stocked_quantity: 10, + }) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "location_id": "sloc", + "stocked_quantity": 10 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetInventoryItemsInventoryItemLocationLevels + summary: List stock levels of a given location. + description: Lists stock levels of a given location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: offset + description: How many stock locations levels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations levels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.listLocationLevels(inventoryItemId) + + .then(({ inventory_item }) => { + console.log(inventory_item.location_levels); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/inventory-items/{id}': + delete: + operationId: DeleteInventoryItemsInventoryItem + summary: Delete an Inventory Item + description: Delete an Inventory Item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.delete(inventoryItemId) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/inventory-items/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - InventoryItem + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetInventoryItemsInventoryItem + summary: Retrive an Inventory Item. + description: Retrives an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.retrieve(inventoryItemId) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/inventory-items/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItem + summary: Update an Inventory Item. + description: Updates an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsInventoryItemReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.update(inventoryItemId, { + origin_country: "US", + }) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/inventory-items/{id}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "origin_country": "US" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + '/inventory-items/{id}/location-levels/{location_id}': + delete: + operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation + summary: Delete a location level of an Inventory Item. + description: Delete a location level of an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, + locationId) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel + summary: Update an Inventory Location Level for a given Inventory Item. + description: Updates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, + locationId, { + stocked_quantity: 15, + }) + + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "stocked_quantity": 15 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items: + get: + operationId: GetInventoryItems + summary: List inventory items. + description: Lists inventory items. + x-authenticated: true + parameters: + - in: query + name: offset + description: How many inventory items to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of inventory items returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + - in: query + name: q + description: >- + Query used for searching product inventory items and their + properties. + schema: + type: string + - in: query + name: location_id + style: form + explode: false + description: Locations ids to search for. + schema: + type: array + items: + type: string + - in: query + name: id + description: id to search for. + schema: + type: string + - in: query + name: sku + description: sku to search for. + schema: + type: string + - in: query + name: origin_country + description: origin_country to search for. + schema: + type: string + - in: query + name: mid_code + description: mid_code to search for. + schema: + type: string + - in: query + name: material + description: material to search for. + schema: + type: string + - in: query + name: hs_code + description: hs_code to search for. + schema: + type: string + - in: query + name: weight + description: weight to search for. + schema: + type: string + - in: query + name: length + description: length to search for. + schema: + type: string + - in: query + name: height + description: height to search for. + schema: + type: string + - in: query + name: width + description: width to search for. + schema: + type: string + - in: query + name: requires_shipping + description: requires_shipping to search for. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.inventoryItems.list() + + .then(({ inventory_items }) => { + console.log(inventory_items.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/inventory-items' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: >- + #/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /invites/accept: post: operationId: PostInvitesInviteAccept @@ -4873,6 +5705,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' + x-codegen: + method: accept x-codeSamples: - lang: JavaScript label: JS Client @@ -4949,6 +5783,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostInvitesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -5011,6 +5847,8 @@ paths: summary: Lists Invites description: Lists all Invites x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client @@ -5071,6 +5909,8 @@ paths: description: The ID of the Invite schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -5131,6 +5971,8 @@ paths: description: The ID of the Invite schema: type: string + x-codegen: + method: resend x-codeSamples: - lang: JavaScript label: JS Client @@ -5189,6 +6031,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostNotesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -5271,6 +6115,9 @@ paths: description: The ID which the notes belongs to schema: type: string + x-codegen: + method: list + queryParams: AdminGetNotesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -5329,6 +6176,8 @@ paths: description: The ID of the Note to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -5388,6 +6237,8 @@ paths: description: The ID of the note to retrieve. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -5452,6 +6303,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostNotesNoteReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -5568,6 +6421,9 @@ paths: notifications or not schema: type: string + x-codegen: + method: list + queryParams: AdminGetNotificationsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -5635,6 +6491,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' + x-codegen: + method: resend x-codeSamples: - lang: JavaScript label: JS Client @@ -5700,6 +6558,8 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' x-authenticated: true + x-codegen: + method: addLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -5768,6 +6628,8 @@ paths: description: The ID of the OrderEdit. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client @@ -5823,6 +6685,8 @@ paths: description: The ID of the order edit. schema: type: string + x-codegen: + method: confirm x-codeSamples: - lang: JavaScript label: JS Client @@ -5876,6 +6740,8 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsReq' x-authenticated: true + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -5965,6 +6831,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: list + queryParams: GetOrderEditsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -6030,6 +6899,8 @@ paths: description: The ID of the order edit item to delete from order. schema: type: string + x-codegen: + method: removeLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -6099,6 +6970,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -6171,6 +7044,8 @@ paths: description: The ID of the Order Edit Item Change to delete. schema: type: string + x-codegen: + method: deleteItemChange x-codeSamples: - lang: JavaScript label: JS Client @@ -6222,6 +7097,8 @@ paths: description: The ID of the Order Edit to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -6280,6 +7157,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: GetOrderEditsOrderEditParams x-codeSamples: - lang: JavaScript label: JS Client @@ -6343,6 +7223,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -6410,6 +7292,8 @@ paths: description: The ID of the Order Edit to request confirmation from. schema: type: string + x-codegen: + method: requestConfirmation x-codeSamples: - lang: JavaScript label: JS Client @@ -6460,7 +7344,6 @@ paths: Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced. - x-authenticated: true parameters: - in: path name: id @@ -6468,6 +7351,14 @@ paths: description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShippingMethodsReq' + x-authenticated: true + x-codegen: + method: addShippingMethod x-codeSamples: - lang: JavaScript label: JS Client @@ -6525,31 +7416,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - price - - option_id - properties: - price: - type: integer - description: >- - The price (excluding VAT) that should be charged for the - Shipping Method - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - data: - type: object - description: >- - The data required for the Shipping Option to create a - Shipping Method. This will depend on the Fulfillment - Provider. '/orders/{id}/archive': post: operationId: PostOrdersOrderArchive @@ -6563,6 +7429,8 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: archive x-codeSamples: - lang: JavaScript label: JS Client @@ -6629,6 +7497,8 @@ paths: description: The ID of the Claim. schema: type: string + x-codegen: + method: cancelClaim x-codeSamples: - lang: JavaScript label: JS Client @@ -6702,6 +7572,8 @@ paths: description: The ID of the Fulfillment. schema: type: string + x-codegen: + method: cancelClaimFulfillment x-codeSamples: - lang: JavaScript label: JS Client @@ -6776,6 +7648,8 @@ paths: description: The ID of the Fulfillment. schema: type: string + x-codegen: + method: cancelSwapFulfillment x-codeSamples: - lang: JavaScript label: JS Client @@ -6844,6 +7718,8 @@ paths: description: The ID of the Fulfillment schema: type: string + x-codegen: + method: cancelFulfillment x-codeSamples: - lang: JavaScript label: JS Client @@ -6908,6 +7784,8 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client @@ -6974,6 +7852,8 @@ paths: description: The ID of the Swap. schema: type: string + x-codegen: + method: cancelSwap x-codeSamples: - lang: JavaScript label: JS Client @@ -7035,6 +7915,8 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: capturePayment x-codeSamples: - lang: JavaScript label: JS Client @@ -7095,6 +7977,8 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client @@ -7166,6 +8050,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' + x-codegen: + method: createClaimShipment x-codeSamples: - lang: JavaScript label: JS Client @@ -7240,6 +8126,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' + x-codegen: + method: createClaim x-codeSamples: - lang: JavaScript label: JS Client @@ -7327,6 +8215,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' + x-codegen: + method: createFulfillment x-codeSamples: - lang: JavaScript label: JS Client @@ -7492,6 +8382,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' + x-codegen: + method: createShipment x-codeSamples: - lang: JavaScript label: JS Client @@ -7571,6 +8463,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' + x-codegen: + method: createSwapShipment x-codeSamples: - lang: JavaScript label: JS Client @@ -7647,6 +8541,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' + x-codegen: + method: createSwap x-codeSamples: - lang: JavaScript label: JS Client @@ -7737,6 +8633,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq + x-codegen: + method: fulfillClaim x-codeSamples: - lang: JavaScript label: JS Client @@ -7810,6 +8708,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq + x-codegen: + method: fulfillSwap x-codeSamples: - lang: JavaScript label: JS Client @@ -7871,6 +8771,19 @@ paths: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetOrdersOrderParams x-codeSamples: - lang: JavaScript label: JS Client @@ -7935,6 +8848,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -8282,6 +9197,9 @@ paths: the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetOrdersParams x-codeSamples: - lang: JavaScript label: JS Client @@ -8351,6 +9269,8 @@ paths: description: The ID of the Swap. schema: type: string + x-codegen: + method: processSwapPayment x-codeSamples: - lang: JavaScript label: JS Client @@ -8417,6 +9337,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' + x-codegen: + method: refundPayment x-codeSamples: - lang: JavaScript label: JS Client @@ -8494,6 +9416,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' + x-codegen: + method: requestReturn x-codeSamples: - lang: JavaScript label: JS Client @@ -8584,6 +9508,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' + x-codegen: + method: updateClaim x-codeSamples: - lang: JavaScript label: JS Client @@ -8652,6 +9578,8 @@ paths: description: The ID of the Payment Collection to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -8712,6 +9640,9 @@ paths: 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 @@ -8775,6 +9706,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -8842,6 +9775,8 @@ paths: description: The ID of the PaymentCollection. schema: type: string + x-codegen: + method: markAsAuthorized x-codeSamples: - lang: JavaScript label: JS Client @@ -8901,6 +9836,8 @@ paths: description: The ID of the Payment. schema: type: string + x-codegen: + method: capturePayment x-codeSamples: - lang: JavaScript label: JS Client @@ -8961,6 +9898,9 @@ paths: description: The ID of the Payment. schema: type: string + x-codegen: + method: retrieve + queryParams: GetPaymentsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -9026,6 +9966,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPaymentRefundsReq' + x-codegen: + method: refundPayment x-codeSamples: - lang: JavaScript label: JS Client @@ -9103,6 +10045,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' + x-codegen: + method: addPrices x-codeSamples: - lang: JavaScript label: JS Client @@ -9189,6 +10133,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' + x-codegen: + method: deletePrices x-codeSamples: - lang: JavaScript label: JS Client @@ -9259,6 +10205,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -9480,6 +10428,9 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetPriceListPaginationParams x-codeSamples: - lang: JavaScript label: JS Client @@ -9540,6 +10491,8 @@ paths: description: The ID of the Price List to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -9599,6 +10552,8 @@ paths: description: The ID of the Price List. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -9663,6 +10618,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -9739,6 +10696,8 @@ paths: description: The ID of the product from which the money amount will be deleted. schema: type: string + x-codegen: + method: deleteProductPrices x-codeSamples: - lang: JavaScript label: JS Client @@ -9809,6 +10768,8 @@ paths: description: The ID of the variant from which the money amount will be deleted. schema: type: string + x-codegen: + method: deleteVariantPrices x-codeSamples: - lang: JavaScript label: JS Client @@ -10037,6 +10998,9 @@ paths: the result. schema: type: string + x-codegen: + method: listProducts + queryParams: AdminGetPriceListsPriceListProductsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -10084,45 +11048,79 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /product-categories: + '/product-categories/{id}/products/batch': post: - operationId: PostProductCategories - summary: Create a Product Category - description: Creates a Product Category. + 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) Which fields should be expanded in each product - category. + description: (Comma separated) Category fields to be expanded in the response. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be retrieved in each product - category. + description: (Comma separated) Category fields to be retrieved in the response. schema: type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/AdminPostProductCategoriesReq' + $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' \ + 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 '{ - "name": "Jeans", + "product_ids": [ + { + "id": "{product_id}" + } + ] }' security: - api_token: [] @@ -10135,10 +11133,182 @@ paths: content: application/json: schema: - type: object - properties: - product_category: - $ref: '#/components/schemas/ProductCategory' + $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': @@ -10203,7 +11373,25 @@ paths: 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: > @@ -10222,21 +11410,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminProductCategoriesListRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10262,7 +11436,24 @@ paths: 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: > @@ -10281,21 +11472,7 @@ paths: content: application/json: schema: - 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 the product category was deleted successfully or - not. - default: true + $ref: '#/components/schemas/AdminProductCategoriesCategoryDeleteRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10320,7 +11497,35 @@ paths: 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: > @@ -10339,10 +11544,7 @@ paths: content: application/json: schema: - type: object - properties: - product_category: - $ref: '#/components/schemas/ProductCategory' + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10386,7 +11588,27 @@ paths: 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: > @@ -10411,10 +11633,7 @@ paths: content: application/json: schema: - type: object - properties: - product_category: - $ref: '#/components/schemas/ProductCategory' + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10523,6 +11742,9 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetProductTagsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -10666,6 +11888,9 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -10731,6 +11956,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' + x-codegen: + method: addOption x-codeSamples: - lang: JavaScript label: JS Client @@ -10797,6 +12024,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -10944,6 +12173,20 @@ paths: type: array items: type: string + - in: query + name: category_id + style: form + explode: false + description: Category IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id + schema: + type: boolean - in: query name: title description: title to search for. @@ -11061,6 +12304,9 @@ paths: description: the field used to order the products. schema: type: string + x-codegen: + method: list + queryParams: AdminGetProductsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -11128,6 +12374,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' + x-codegen: + method: createVariant x-codeSamples: - lang: JavaScript label: JS Client @@ -11242,6 +12490,9 @@ paths: schema: type: integer default: 100 + x-codegen: + method: listVariants + queryParams: AdminGetProductsVariantsParams x-codeSamples: - lang: Shell label: cURL @@ -11297,6 +12548,8 @@ paths: description: The ID of the Product Option. schema: type: string + x-codegen: + method: deleteOption x-codeSamples: - lang: JavaScript label: JS Client @@ -11367,6 +12620,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' + x-codegen: + method: updateOption x-codeSamples: - lang: JavaScript label: JS Client @@ -11435,6 +12690,8 @@ paths: description: The ID of the Product. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -11494,6 +12751,8 @@ paths: description: The ID of the Product. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -11558,6 +12817,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -11633,6 +12894,8 @@ paths: description: The ID of the Product Variant. schema: type: string + x-codegen: + method: deleteVariant x-codeSamples: - lang: JavaScript label: JS Client @@ -11703,6 +12966,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' + x-codegen: + method: updateVariant x-codeSamples: - lang: JavaScript label: JS Client @@ -11783,6 +13048,8 @@ paths: summary: List Tags Usage Number description: Retrieves a list of Product Tags with how many times each is used. x-authenticated: true + x-codegen: + method: listTags x-codeSamples: - lang: JavaScript label: JS Client @@ -11837,6 +13104,8 @@ paths: summary: List Product Types description: Retrieves a list of Product Types. x-authenticated: true + x-codegen: + method: listTypes x-codeSamples: - lang: JavaScript label: JS Client @@ -11902,6 +13171,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' + x-codegen: + method: setMetadata x-codeSamples: - lang: JavaScript label: JS Client @@ -11979,6 +13250,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq + x-codegen: + method: addSalesChannelsBatch x-codeSamples: - lang: JavaScript label: JS Client @@ -12061,6 +13334,8 @@ paths: schema: $ref: >- #/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq + x-codegen: + method: deleteSalesChannelsBatch x-codeSamples: - lang: JavaScript label: JS Client @@ -12136,6 +13411,8 @@ paths: schema: $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' x-authenticated: true + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -12224,6 +13501,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: list + queryParams: GetPublishableApiKeysParams x-codeSamples: - lang: JavaScript label: JS Client @@ -12283,6 +13563,8 @@ paths: description: The ID of the PublishableApiKeys to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -12332,6 +13614,8 @@ paths: schema: type: string x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -12397,6 +13681,9 @@ paths: description: Query used for searching sales channels' names and descriptions. schema: type: string + x-codegen: + method: listSalesChannels + queryParams: GetPublishableApiKeySalesChannelsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -12458,6 +13745,8 @@ paths: schema: type: string x-authenticated: true + x-codegen: + method: revoke x-codeSamples: - lang: JavaScript label: JS Client @@ -12524,6 +13813,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -12597,6 +13888,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' + x-codegen: + method: addCountry x-codeSamples: - lang: JavaScript label: JS Client @@ -12671,6 +13964,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq + x-codegen: + method: addFulfillmentProvider x-codeSamples: - lang: JavaScript label: JS Client @@ -12744,6 +14039,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' + x-codegen: + method: addPaymentProvider x-codeSamples: - lang: JavaScript label: JS Client @@ -12810,6 +14107,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -12931,6 +14230,9 @@ paths: description: >- Date comparison for when resulting region was deleted, i.e. less than, greater than etc. + x-codegen: + method: list + queryParams: AdminGetRegionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -12991,6 +14293,8 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -13050,6 +14354,8 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -13114,6 +14420,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsRegionReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -13182,6 +14490,8 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: retrieveFulfillmentOptions x-codeSamples: - lang: JavaScript label: JS Client @@ -13252,6 +14562,8 @@ paths: externalDocs: url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' description: See a list of codes. + x-codegen: + method: deleteCountry x-codeSamples: - lang: JavaScript label: JS Client @@ -13318,6 +14630,8 @@ paths: description: The ID of the Fulfillment Provider. schema: type: string + x-codegen: + method: deleteFulfillmentProvider x-codeSamples: - lang: JavaScript label: JS Client @@ -13385,6 +14699,8 @@ paths: description: The ID of the Payment Provider. schema: type: string + x-codegen: + method: deletePaymentProvider x-codeSamples: - lang: JavaScript label: JS Client @@ -13832,6 +15148,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostReturnReasonsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -13894,6 +15212,8 @@ paths: summary: List Return Reasons description: Retrieves a list of Return Reasons. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client @@ -13954,6 +15274,8 @@ paths: description: The ID of the return reason schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -14013,6 +15335,8 @@ paths: description: The ID of the Return Reason. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -14077,6 +15401,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -14144,6 +15470,8 @@ paths: description: The ID of the Return. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client @@ -14209,6 +15537,9 @@ paths: schema: type: number default: '0' + x-codegen: + method: list + queryParams: AdminGetReturnsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -14275,6 +15606,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' + x-codegen: + method: receive x-codeSamples: - lang: JavaScript label: JS Client @@ -14359,6 +15692,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq + x-codegen: + method: addProducts x-codeSamples: - lang: JavaScript label: JS Client @@ -14440,6 +15775,8 @@ paths: schema: $ref: >- #/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq + x-codegen: + method: removeProducts x-codeSamples: - lang: JavaScript label: JS Client @@ -14522,6 +15859,8 @@ paths: schema: $ref: >- #/components/schemas/AdminPostSalesChannelsChannelStockLocationsReq + x-codegen: + method: addLocation x-codeSamples: - lang: JavaScript label: JS Client @@ -14595,6 +15934,8 @@ paths: schema: $ref: >- #/components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq + x-codegen: + method: removeLocation x-codeSamples: - lang: JavaScript label: JS Client @@ -14661,6 +16002,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostSalesChannelsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -14840,6 +16183,9 @@ paths: channel of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetSalesChannelsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -14900,6 +16246,8 @@ paths: description: The ID of the Sales channel. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -14959,6 +16307,8 @@ paths: description: The ID of the Sales channel. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -15023,6 +16373,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -15089,6 +16441,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingOptionsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -15174,6 +16528,9 @@ paths: schema: type: boolean description: Flag for fetching admin specific options + x-codegen: + method: list + queryParams: AdminGetShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -15234,6 +16591,8 @@ paths: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -15293,6 +16652,8 @@ paths: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -15357,6 +16718,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -15435,6 +16798,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingProfilesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -15495,6 +16860,8 @@ paths: summary: List Shipping Profiles description: Retrieves a list of Shipping Profile. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client @@ -15555,6 +16922,8 @@ paths: description: The ID of the Shipping Profile. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -15614,6 +16983,8 @@ paths: description: The ID of the Shipping Profile. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -15677,6 +17048,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingProfilesProfileReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -15754,6 +17127,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostStockLocationsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -15923,6 +17298,9 @@ paths: location of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetStockLocationsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -15971,6 +17349,66 @@ paths: '500': $ref: '#/components/responses/500_error' '/stock-locations/{id}': + delete: + operationId: DeleteStockLocationsStockLocation + summary: Delete a Stock Location + description: Delete a Stock Location + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.stockLocations.delete(stock_location_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/stock-locations/{id}' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - StockLocation + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + format: stock_location + deleted: + type: boolean + description: Whether or not the Stock Location was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' get: operationId: GetStockLocationsStockLocation summary: Get a Stock Location @@ -15993,6 +17431,9 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetStockLocationsLocationParams x-codeSamples: - lang: JavaScript label: JS Client @@ -16055,6 +17496,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostStockLocationsLocationReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -16126,6 +17569,8 @@ paths: 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 @@ -16188,6 +17633,8 @@ paths: 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 @@ -16241,6 +17688,8 @@ paths: summary: Get Store details description: Retrieves the Store details x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -16296,6 +17745,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostStoreReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -16357,6 +17808,8 @@ paths: summary: List Payment Providers description: Retrieves the configured Payment Providers x-authenticated: true + x-codegen: + method: listPaymentProviders x-codeSamples: - lang: JavaScript label: JS Client @@ -16410,6 +17863,8 @@ paths: summary: List Tax Providers description: Retrieves the configured Tax Providers x-authenticated: true + x-codegen: + method: listTaxProviders x-codeSamples: - lang: JavaScript label: JS Client @@ -16470,6 +17925,8 @@ paths: description: The ID of the Swap. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -16536,6 +17993,9 @@ paths: type: number default: '0' x-authenticated: true + x-codegen: + method: list + queryParams: AdminGetSwapsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -16617,6 +18077,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' + x-codegen: + method: addProductTypes + queryParams: AdminPostTaxRatesTaxRateProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -16711,6 +18174,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' + x-codegen: + method: removeProductTypes + queryParams: AdminDeleteTaxRatesTaxRateProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -16806,6 +18272,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' + x-codegen: + method: addProducts + queryParams: AdminPostTaxRatesTaxRateProductsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -16900,6 +18369,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' + x-codegen: + method: removeProducts + queryParams: AdminDeleteTaxRatesTaxRateProductsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -16995,6 +18467,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: addShippingOptions + queryParams: AdminPostTaxRatesTaxRateShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -17091,6 +18566,9 @@ paths: schema: $ref: >- #/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq + x-codegen: + method: removeShippingOptions + queryParams: AdminDeleteTaxRatesTaxRateShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -17181,6 +18659,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesReq' + x-codegen: + method: create + queryParams: AdminPostTaxRatesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -17319,6 +18800,9 @@ paths: type: array items: type: string + x-codegen: + method: list + queryParams: AdminGetTaxRatesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -17379,6 +18863,8 @@ paths: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -17456,6 +18942,9 @@ paths: items: type: string x-authenticated: true + x-codegen: + method: retrieve + queryParams: AdminGetTaxRatesTaxRateParams x-codeSamples: - lang: JavaScript label: JS Client @@ -17538,6 +19027,9 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' + x-codegen: + method: update + queryParams: AdminPostTaxRatesTaxRateParams x-codeSamples: - lang: JavaScript label: JS Client @@ -17875,6 +19367,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminCreateUserRequest' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -17937,6 +19431,8 @@ paths: summary: List Users description: Retrieves all users. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client @@ -17995,6 +19491,8 @@ paths: description: The ID of the User. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client @@ -18054,6 +19552,8 @@ paths: description: The ID of the User. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -18118,6 +19618,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminUpdateUserRequest' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -18184,6 +19686,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminResetPasswordTokenRequest' + x-codegen: + method: sendResetPasswordToken x-codeSamples: - lang: JavaScript label: JS Client @@ -18250,6 +19754,8 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminResetPasswordRequest' + x-codegen: + method: resetPassword x-codeSamples: - lang: JavaScript label: JS Client @@ -18307,6 +19813,71 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/variants/{id}/inventory': + get: + operationId: GetVariantsVariantInventory + summary: Get inventory of Variant. + description: Returns the available inventory of a Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Product Variant id to get inventory for. + schema: + type: string + x-codegen: + method: getInventory + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/variants' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + variant: + type: object + $ref: '#/components/schemas/AdminGetVariantsVariantInventoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /variants: get: operationId: GetVariants @@ -18405,6 +19976,9 @@ paths: description: >- filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: AdminGetVariantsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -18667,7 +20241,7 @@ components: ```tsx @@ -18797,48 +20371,71 @@ components: title: Address description: An address. type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at properties: id: type: string description: ID of the address example: addr_01G8ZC9VS1XVE149MGH2J7QSSH customer_id: - type: string description: ID of the customer this address belongs to + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: Available if the relation `customer` is expanded. - type: array - items: - type: object - description: A customer object. + nullable: true + $ref: '#/components/schemas/Customer' company: - type: string description: Company name + nullable: true + type: string example: Acme first_name: - type: string description: First name + nullable: true + type: string example: Arno last_name: - type: string description: Last name + nullable: true + type: string example: Willms address_1: - type: string description: Address line 1 + nullable: true + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + nullable: true + type: string example: Suite 369 city: - type: string description: City + nullable: true + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + nullable: true + type: string externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements @@ -18846,18 +20443,22 @@ components: example: st country: description: A country object. Available if the relation `country` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Country' province: - type: string description: Province + nullable: true + type: string example: Kentucky postal_code: - type: string description: Postal Code + nullable: true + type: string example: 72093 phone: - type: string description: Phone Number + nullable: true + type: string example: 16128234334802 created_at: type: string @@ -18868,12 +20469,14 @@ components: description: The date with timezone at which the resource was updated. format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white BatchJob: @@ -18881,21 +20484,36 @@ components: description: A Batch Job. type: object required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status - type + - updated_at properties: id: - type: string description: The unique identifier for the batch job. + type: string example: batch_01G8T782965PYFG0751G0Z38B4 type: - type: string description: The type of batch job. + type: string enum: - product-import - product-export status: - type: string description: The status of the batch job. + type: string enum: - created - pre_processed @@ -18906,19 +20524,22 @@ components: - failed default: created created_by: - type: string description: The unique identifier of the user that created the batch job. + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: description: >- A user object. Available if the relation `created_by_user` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/User' context: - type: object description: >- The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object example: shape: prices: @@ -18936,43 +20557,47 @@ components: - variant.prices - images dry_run: - type: boolean description: Specify if the job must apply the modifications or not. + type: boolean default: false result: - type: object description: The result of the batch job. - properties: - count: - type: number - advancement_count: - type: number - progress: - type: number - errors: - type: object + nullable: true + allOf: + - type: object + example: {} + - type: object properties: - message: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: type: string - code: - oneOf: - - type: string - - type: number - err: - type: array - stat_descriptors: - type: object - properties: - key: - type: string - name: - type: string - message: - type: string - file_key: - type: string - file_size: - type: number + file_size: + type: number example: errors: - err: [] @@ -18983,67 +20608,97 @@ components: name: Product count to export message: There will be 8 products exported by this action pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true type: string - description: The date from which the job has been pre processed. format: date-time processing_at: - type: string description: The date the job is processing at. + nullable: true + type: string format: date-time confirmed_at: - type: string description: The date when the confirmation has been done. + nullable: true + type: string format: date-time completed_at: - type: string description: The date of the completion. + nullable: true + type: string format: date-time canceled_at: - type: string description: The date of the concellation. + nullable: true + type: string format: date-time failed_at: - type: string description: The date when the job failed. + nullable: true + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was last updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time Cart: title: Cart description: Represents a user cart type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The cart's ID + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 email: - type: string description: The email associated with the cart + nullable: true + type: string format: email billing_address_id: - type: string description: The billing address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_address_id: - type: string description: The shipping address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. @@ -19051,54 +20706,58 @@ components: items: $ref: '#/components/schemas/LineItem' region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' discounts: - type: array description: Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array - description: Available if the relation `gift_cards` is expanded. items: - type: object - description: A gift card object. + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' customer_id: - type: string description: The customer's ID + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Customer' payment_session: description: The selected payment session in the cart. + nullable: true $ref: '#/components/schemas/PaymentSession' payment_sessions: - type: array description: The payment sessions created on the cart. + type: array items: $ref: '#/components/schemas/PaymentSession' payment_id: - type: string description: The payment's ID if available + nullable: true + type: string example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. + nullable: true $ref: '#/components/schemas/Payment' shipping_methods: - type: array description: The shipping methods added to the cart. + type: array items: $ref: '#/components/schemas/ShippingMethod' type: - type: string description: The cart's type. + type: string enum: - default - swap @@ -19107,93 +20766,109 @@ components: - claim default: default completed_at: - type: string description: The date with timezone at which the cart was completed. + nullable: true + type: string format: date-time payment_authorized_at: - type: string description: The date with timezone at which the payment was authorized. + nullable: true + type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. context: - type: object description: >- The context of the cart which can include info like IP or user agent. + nullable: true + type: object example: ip: '::1' user_agent: PostmanRuntime/7.29.2 sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null sales_channel: description: >- A sales channel object. Available if the relation `sales_channel` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/SalesChannel' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white shipping_total: - type: integer description: The total of shipping + type: integer example: 1000 discount_total: - type: integer description: The total of discount - example: 800 - tax_total: type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: description: The total of tax + type: integer example: 0 refunded_total: - type: integer description: >- The total amount refunded if the order associated with this cart is returned. + type: integer example: 0 total: - type: integer description: The total amount of the cart + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the cart + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 ClaimImage: title: Claim Image @@ -19201,39 +20876,47 @@ components: type: object required: - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: - type: string description: The claim image's ID + type: string example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 claim_item_id: - type: string description: The ID of the claim item associated with the image + type: string claim_item: description: >- A claim item object. Available if the relation `claim_item` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ClaimItem' url: - type: string description: The URL of the image + type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimItem: @@ -19244,18 +20927,24 @@ components: type: object required: - claim_order_id + - created_at + - deleted_at + - id - item_id - - variant_id - - reason + - metadata + - note - quantity + - reason + - updated_at + - variant_id properties: id: - type: string description: The claim item's ID + type: string example: citm_01G8ZH853Y6TFXWPG5EYE81X63 images: - type: array description: Available if the relation `images` is expanded. + type: array items: $ref: '#/components/schemas/ClaimImage' claim_order_id: @@ -19265,13 +20954,15 @@ components: description: >- A claim order object. Available if the relation `claim_order` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ClaimOrder' item_id: description: The ID of the line item that the claim item refers to. type: string example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. + nullable: true $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. @@ -19279,7 +20970,8 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: A variant object. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ProductVariant' reason: description: The reason for the claim type: string @@ -19290,6 +20982,7 @@ components: - other note: description: 'An optional note about the claim, for additional information' + nullable: true type: string example: I don't like it. quantity: @@ -19306,20 +20999,22 @@ components: items: $ref: '#/components/schemas/ClaimTag' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimOrder: @@ -19330,27 +21025,41 @@ components: and can contain additional information about fulfillments and returns. type: object required: - - type + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The claim's ID + type: string example: claim_01G8ZH853Y6TFXWPG5EYE81X63 type: + description: The claim's type type: string enum: - refund - replace payment_status: - type: string description: The status of the claim's payment + type: string enum: - na - not_refunded - refunded default: na fulfillment_status: + description: The claim's fulfillment status type: string enum: - not_fulfilled @@ -19381,18 +21090,22 @@ components: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Order' return_order: description: >- A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded - type: object + nullable: true + $ref: '#/components/schemas/Return' shipping_address_id: description: The ID of the address that the new items should be shipped to + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. @@ -19406,40 +21119,46 @@ components: $ref: '#/components/schemas/Fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim + nullable: true type: integer example: 1000 canceled_at: description: The date with timezone at which the claim was canceled. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white no_notification: description: >- Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key @@ -19451,31 +21170,38 @@ components: easy filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The claim tag's ID + type: string example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 value: description: The value that the claim tag holds type: string example: Damaged created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Country: @@ -19483,27 +21209,29 @@ components: description: Country details type: object required: + - display_name + - id - iso_2 - iso_3 - - num_code - name - - display_name + - num_code + - region_id properties: id: - type: string description: The country's ID + type: string example: 109 iso_2: - type: string description: The 2 character ISO code of the country in lower case + type: string example: it externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. iso_3: - type: string description: The 2 character ISO code of the country in lower case + type: string example: ita externalDocs: url: >- @@ -19526,21 +21254,23 @@ components: type: string example: Italy region_id: - type: string description: The region ID this country is associated with. + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' Currency: title: Currency description: Currency type: object required: - code + - name - symbol - symbol_native - - name properties: code: description: The 3 character ISO code for the currency. @@ -19564,6 +21294,7 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean + default: false CustomShippingOption: title: Custom Shipping Option description: >- @@ -19572,12 +21303,18 @@ components: price for a particular Shipping Option type: object required: + - cart_id + - created_at + - deleted_at + - id + - metadata - price - shipping_option_id + - updated_at properties: id: - type: string description: The custom shipping option's ID + type: string example: cso_01G8X99XNB77DMFBJFWX6DN9V9 price: description: >- @@ -19595,81 +21332,87 @@ components: description: >- A shipping option object. Available if the relation `shipping_option` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ShippingOption' cart_id: description: The ID of the Cart that the custom shipping option is attached to + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Cart' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white - includes_tax: - description: >- - [EXPERIMENTAL] Indicates if the custom shipping option price include - tax - type: boolean CustomerGroup: title: Customer Group description: Represents a customer group type: object required: + - created_at + - deleted_at + - id + - metadata - name + - updated_at properties: id: - type: string description: The customer group's ID + type: string example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 name: - type: string description: The name of the customer group + type: string example: VIP customers: - type: array description: >- The customers that belong to the customer group. Available if the relation `customers` is expanded. - items: - type: object - description: A customer object. - price_lists: type: array + items: + $ref: '#/components/schemas/Customer' + price_lists: description: >- The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + type: array items: $ref: '#/components/schemas/PriceList' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Customer: @@ -19677,30 +21420,44 @@ components: description: Represents a customer type: object required: + - billing_address_id + - created_at + - deleted_at - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at properties: id: - type: string description: The customer's ID + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 email: - type: string description: The customer's email + type: string format: email first_name: - type: string description: The customer's first name + nullable: true + type: string example: Arno last_name: - type: string description: The customer's last name + nullable: true + type: string example: Willms billing_address_id: - type: string description: The customer's billing address ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. @@ -19708,19 +21465,19 @@ components: items: $ref: '#/components/schemas/Address' phone: - type: string description: The customer's phone number + nullable: true + type: string example: 16128234334802 has_account: - type: boolean description: Whether the customer has an account or not + type: boolean default: false orders: description: Available if the relation `orders` is expanded. type: array items: - type: object - description: An order object. + $ref: '#/components/schemas/Order' groups: description: >- The customer groups the customer belongs to. Available if the @@ -19729,20 +21486,22 @@ components: items: $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionCustomerGroup: @@ -19750,8 +21509,11 @@ components: description: Associates a discount condition with a customer group type: object required: - - customer_group_id - condition_id + - created_at + - customer_group_id + - metadata + - updated_at properties: customer_group_id: description: The ID of the Product Tag @@ -19763,21 +21525,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. + nullable: true $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductCollection: @@ -19785,8 +21550,11 @@ components: description: Associates a discount condition with a product collection type: object required: - - product_collection_id - condition_id + - created_at + - metadata + - product_collection_id + - updated_at properties: product_collection_id: description: The ID of the Product Collection @@ -19798,21 +21566,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. + nullable: true $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductTag: @@ -19820,8 +21591,11 @@ components: description: Associates a discount condition with a product tag type: object required: - - product_tag_id - condition_id + - created_at + - metadata + - product_tag_id + - updated_at properties: product_tag_id: description: The ID of the Product Tag @@ -19833,21 +21607,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. + nullable: true $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductType: @@ -19855,8 +21632,11 @@ components: description: Associates a discount condition with a product type type: object required: - - product_type_id - condition_id + - created_at + - metadata + - product_type_id + - updated_at properties: product_type_id: description: The ID of the Product Tag @@ -19868,21 +21648,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProduct: @@ -19890,8 +21673,11 @@ components: description: Associates a discount condition with a product type: object required: - - product_id - condition_id + - created_at + - metadata + - product_id + - updated_at properties: product_id: description: The ID of the Product Tag @@ -19903,21 +21689,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. + nullable: true $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountCondition: @@ -19925,13 +21714,18 @@ components: description: Holds rule conditions for when a discount is applicable type: object required: - - type - - operator + - created_at + - deleted_at - discount_rule_id + - id + - metadata + - operator + - type + - updated_at properties: id: - type: string description: The discount condition's ID + type: string example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: The type of the Condition @@ -19949,11 +21743,12 @@ components: - in - not_in discount_rule_id: - type: string description: The ID of the discount rule associated with the condition + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' products: description: >- @@ -19961,58 +21756,55 @@ components: Available if the relation `products` is expanded. type: array items: - type: object - description: A product object. + $ref: '#/components/schemas/Product' product_types: description: >- - product types associated with this condition if type = + Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. type: array items: - type: object - description: A product type object. + $ref: '#/components/schemas/ProductType' product_tags: description: >- - product tags associated with this condition if type = product_tags. + Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. type: array items: - type: object - description: A product tag object. + $ref: '#/components/schemas/ProductTag' product_collections: description: >- - product collections associated with this condition if type = + Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. type: array items: - type: object - description: A product collection object. + $ref: '#/components/schemas/ProductCollection' customer_groups: description: >- - customer groups associated with this condition if type = + Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountRule: @@ -20022,12 +21814,19 @@ components: to a Cart. type: object required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata - type + - updated_at - value properties: id: - type: string description: The discount rule's ID + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C type: description: >- @@ -20042,6 +21841,7 @@ components: example: percentage description: description: A short description of the discount + nullable: true type: string example: 10 Percent value: @@ -20052,6 +21852,7 @@ components: example: 10 allocation: description: The scope that the discount should apply to. + nullable: true type: string enum: - total @@ -20063,23 +21864,24 @@ components: be used. Available if the relation `conditions` is expanded. type: array items: - type: object - description: A discount condition object. + $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Discount: @@ -20090,11 +21892,24 @@ components: type: object required: - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration properties: id: - type: string description: The discount's ID + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN code: description: >- @@ -20109,11 +21924,13 @@ components: type: boolean example: false rule_id: - type: string description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- @@ -20122,13 +21939,15 @@ components: type: boolean example: false parent_discount_id: - type: string description: >- The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. + nullable: true $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. @@ -20136,11 +21955,13 @@ components: format: date-time ends_at: description: The time at which the discount can no longer be used. + nullable: true type: string format: date-time valid_duration: - type: string description: Duration the discount runs between + nullable: true + type: string example: P3Y6M4DT12H30M5S regions: description: >- @@ -20148,10 +21969,10 @@ components: relation `regions` is expanded. type: array items: - type: object - description: A region object. + $ref: '#/components/schemas/Region' usage_limit: description: The maximum number of times that a discount can be used. + nullable: true type: integer example: 100 usage_count: @@ -20160,92 +21981,112 @@ components: example: 50 default: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DraftOrder: title: DraftOrder description: Represents a draft order type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at properties: id: - type: string description: The draft order's ID + type: string example: dorder_01G8TJFKBG38YYFQ035MSVG03C status: - type: string description: The status of the draft order + type: string enum: - open - completed default: open display_id: - type: string description: The draft order's display ID + type: string example: 2 cart_id: - type: string description: The ID of the cart associated with the draft order. + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Cart' order_id: - type: string description: The ID of the order associated with the draft order. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Order' canceled_at: - type: string description: The date the draft order was canceled at. + nullable: true + type: string format: date-time completed_at: - type: string description: The date the draft order was completed at. + nullable: true + type: string format: date-time no_notification_order: - type: boolean description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white FulfillmentItem: @@ -22161,6 +24002,14 @@ components: A product category object. Available if the relation `parent_category` is expanded. type: object + products: + description: >- + products associated with category. Available if the relation + `products` is expanded. + type: array + items: + type: object + description: A product object. created_at: type: string description: The date with timezone at which the resource was created. @@ -22839,6 +24688,14 @@ components: items: type: object description: A sales channel object. + categories: + description: >- + The product's associated categories. Available if the relation + `categories` is expanded. + type: array + items: + type: object + description: A category object. created_at: type: string description: The date with timezone at which the resource was created. @@ -24183,6 +26040,78 @@ components: description: An optional key-value map with additional details example: car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Inventory Item. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May + be used by Fulfillment Providers to pass customs information to + shipping carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time ReservationItemDTO: title: Reservation item description: Represents a reservation of an inventory item at a stock location @@ -24222,6 +26151,50 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: >- + the total stock quantity of an inventory item at the given location + ID + type: number + reserved_quantity: + description: >- + the reserved stock quantity of an inventory item at the given + location ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time PricedVariant: title: Priced Product Variant type: object @@ -24297,6 +26270,10 @@ components: type: string description: Stock location address' complement example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa city: type: string description: Stock location address' city @@ -24735,12 +26712,24 @@ components: description: The ids of the customers to add type: array items: + type: object required: - id properties: id: description: ID of the customer type: string + AdminPostCustomerGroupsReq: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. AdminDeleteCustomerGroupsGroupCustomerBatchReq: type: object required: @@ -24750,6 +26739,7 @@ components: description: The ids of the customers to remove type: array items: + type: object required: - id properties: @@ -24872,6 +26862,7 @@ components: groups: type: array items: + type: object required: - id properties: @@ -24891,6 +26882,7 @@ components: description: The resources to be added to the discount condition type: array items: + type: object required: - id properties: @@ -25072,6 +27064,21 @@ components: metadata: description: An optional set of key-value pairs to hold additional information. type: object + AdminPostDiscountsDiscountDynamicCodesReq: + type: object + required: + - code + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + usage_limit: + type: number + description: Maximum times the discount can be used + default: 1 + metadata: + type: object + description: An optional set of key-value pairs to hold additional information. AdminDeleteDiscountsDiscountConditionsConditionBatchReq: type: object required: @@ -25081,6 +27088,7 @@ components: description: The resources to be deleted from the discount condition type: array items: + type: object required: - id properties: @@ -25594,6 +27602,160 @@ components: metadata: description: An optional set of key-value pairs to hold additional information. type: object + AdminPostInventoryItemsItemLocationLevelsReq: + type: object + required: + - location_id + - stocked_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number + AdminInventoryItemsRes: + type: object + properties: + inventory_item: + $ref: '#/components/schemas/InventoryItemDTO' + AdminInventoryItemsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Inventory Item. + object: + type: string + description: The type of the object that was deleted. + format: inventory_item + deleted: + type: boolean + description: Whether or not the Inventory Item was deleted. + default: true + AdminInventoryItemsListRes: + type: object + properties: + inventory_items: + type: array + items: + $ref: '#/components/schemas/InventoryItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsListWithVariantsAndLocationLevelsRes: + type: object + properties: + inventory_items: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryItemDTO' + - type: object + properties: + location_levels: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryLevelDTO' + variants: + type: array + items: + allOf: + - $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsLocationLevelsRes: + type: object + properties: + id: + description: The id of the location + location_levels: + description: List of stock levels at a given location + type: array + items: + $ref: '#/components/schemas/InventoryLevelDTO' + AdminPostInventoryItemsInventoryItemReq: + type: object + properties: + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Inventory Item. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May + be used by Fulfillment Providers to pass customs information to + shipping carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + AdminPostInventoryItemsItemLocationLevelsLevelReq: + type: object + properties: + stocked_quantity: + description: >- + the total stock quantity of an inventory item at the given location + ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number AdminPostInvitesInviteAcceptReq: type: object required: @@ -25827,6 +27989,25 @@ components: internal_note: description: An optional note to create or update for the order edit. type: string + AdminPostOrdersOrderShippingMethodsReq: + type: object + required: + - price + - option_id + properties: + price: + type: number + description: >- + The price (excluding VAT) that should be charged for the Shipping + Method + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + date: + type: object + description: >- + The data required for the Shipping Option to create a Shipping + Method. This will depend on the Fulfillment Provider. AdminPostOrdersOrderClaimsClaimShipmentsReq: type: object required: @@ -25860,6 +28041,7 @@ components: description: The Claim Items that the Claim will consist of. type: array items: + type: object required: - item_id - quantity @@ -25910,6 +28092,7 @@ components: Replace. type: array items: + type: object required: - variant_id - quantity @@ -25924,6 +28107,7 @@ components: description: The Shipping Methods to send the additional Line Items with. type: array items: + type: object properties: id: description: The ID of an existing Shipping Method @@ -25934,6 +28118,11 @@ components: price: description: The price to charge for the Shipping Method type: integer + data: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object shipping_address: type: object description: >- @@ -25958,6 +28147,7 @@ components: description: The Line Items to include in the Fulfillment. type: array items: + type: object required: - item_id - quantity @@ -26028,6 +28218,7 @@ components: description: The Line Items to return as part of the Swap. type: array items: + type: object required: - item_id - quantity @@ -26062,6 +28253,7 @@ components: description: The new items to send to the Customer. type: array items: + type: object required: - variant_id - quantity @@ -26078,6 +28270,7 @@ components: from. type: array items: + type: object required: - option_id - price @@ -26161,6 +28354,7 @@ components: description: The Line Items that will be returned. type: array items: + type: object required: - item_id - quantity @@ -26213,6 +28407,7 @@ components: description: The Claim Items that the Claim will consist of. type: array items: + type: object required: - id - images @@ -26271,6 +28466,7 @@ components: description: The Shipping Methods to send the additional Line Items with. type: array items: + type: object properties: id: description: The ID of an existing Shipping Method @@ -26281,6 +28477,11 @@ components: price: description: The price to charge for the Shipping Method type: integer + data: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object no_notification: description: If set to true no notification will be send related to this Swap. type: boolean @@ -26413,6 +28614,7 @@ components: description: The prices to update or add. type: array items: + type: object required: - amount - variant_id @@ -26488,6 +28690,7 @@ components: description: The prices of the Price List. type: array items: + type: object required: - amount - variant_id @@ -26521,6 +28724,7 @@ components: type: array description: A list of customer groups that the Price List applies to. items: + type: object required: - id properties: @@ -26670,6 +28874,7 @@ components: description: The prices of the Price List. type: array items: + type: object required: - amount - variant_id @@ -26706,6 +28911,7 @@ components: type: array description: A list of customer groups that the Price List applies to. items: + type: object required: - id properties: @@ -26715,6 +28921,22 @@ 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: @@ -26737,6 +28959,57 @@ components: 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: @@ -26861,6 +29134,7 @@ components: description: Tags to associate the Product with. type: array items: + type: object required: - value properties: @@ -26874,18 +29148,30 @@ components: description: '[EXPERIMENTAL] Sales channels to associate the Product with.' type: array items: + type: object required: - id properties: id: description: The ID of an existing Sales channel. type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string options: description: >- The Options that the Product should have. These define on which properties the Product's Product Variants will differ. type: array items: + type: object required: - title properties: @@ -26896,6 +29182,7 @@ components: description: A list of Product Variants to create with the Product. type: array items: + type: object required: - title properties: @@ -26960,6 +29247,7 @@ components: prices: type: array items: + type: object required: - amount properties: @@ -26989,6 +29277,7 @@ components: options: type: array items: + type: object required: - value properties: @@ -27089,6 +29378,7 @@ components: prices: type: array items: + type: object required: - amount properties: @@ -27120,6 +29410,7 @@ components: options: type: array items: + type: object required: - option_id - value @@ -27223,6 +29514,7 @@ components: tags: type: array items: + type: object properties: id: description: The ID of the tag. @@ -27313,6 +29605,7 @@ components: description: Tags to associate the Product with. type: array items: + type: object required: - value properties: @@ -27326,16 +29619,28 @@ components: description: '[EXPERIMENTAL] Sales channels to associate the Product with.' type: array items: + type: object required: - id properties: id: description: The ID of an existing Sales channel. type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string variants: description: A list of Product Variants to create with the Product. type: array items: + type: object properties: id: description: The ID of the Product Variant. @@ -27400,6 +29705,7 @@ components: prices: type: array items: + type: object required: - amount properties: @@ -27432,6 +29738,7 @@ components: options: type: array items: + type: object required: - option_id - value @@ -27529,6 +29836,7 @@ components: prices: type: array items: + type: object required: - amount properties: @@ -27560,6 +29868,7 @@ components: options: type: array items: + type: object required: - option_id - value @@ -27979,6 +30288,7 @@ components: description: The Line Items that have been received. type: array items: + type: object required: - item_id - quantity @@ -28156,6 +30466,7 @@ components: be available. type: array items: + type: object required: - type - amount @@ -28235,6 +30546,7 @@ components: be available. type: array items: + type: object required: - type - amount @@ -28258,10 +30570,18 @@ components: type: object required: - name + - type properties: name: description: The name of the Shipping Profile type: string + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom AdminDeleteShippingProfileRes: type: object properties: @@ -28294,6 +30614,26 @@ components: name: description: The name of the Shipping Profile type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + products: + description: >- + An optional array of product ids to associate with the Shipping + Profile + type: array + shipping_options: + description: >- + An optional array of shipping option ids to associate with the + Shipping Profile + type: array AdminPostStockLocationsReq: type: object required: @@ -28312,6 +30652,20 @@ components: car: white address: $ref: '#/components/schemas/StockLocationAddressInput' + AdminStockLocationsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + default: stock_location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true AdminStockLocationsRes: type: object properties: @@ -28736,6 +31090,28 @@ components: metadata: description: An optional set of key-value pairs with additional information. type: object + AdminGetVariantsVariantInventoryRes: + type: object + properties: + id: + description: the id of the variant + type: string + inventory: + description: the stock location address ID + type: string + sales_channel_availability: + type: object + description: An optional key-value map with additional details + properties: + channel_name: + description: Sales channel name + type: string + channel_id: + description: Sales channel id + type: string + available_quantity: + description: Available quantity in sales channel + type: number AdminVariantsListRes: type: object properties: diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index da98f41bb2..e93e15caff 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -2,110 +2,60 @@ openapi: 3.0.0 info: version: 1.0.0 title: Medusa Admin API - description: > - API reference for Medusa's Admin endpoints. All endpoints are prefixed with - `/admin`. - + description: | + API reference for Medusa's Admin endpoints. All endpoints are prefixed with `/admin`. ## Authentication - - There are two ways to send authenticated requests to the Medusa server: - Using a user's API token, or using a Cookie Session ID. - + There are two ways to send authenticated requests to the Medusa server: Using a user's API token, or using a Cookie Session ID. - ## Expanding Fields + In many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response. - In many endpoints you'll find an `expand` query parameter that can be passed - to the endpoint. You can use the `expand` query parameter to unpack an - entity's relations and return them in the response. + For example, when you list customers you can also retrieve their groups by passing to the `expand` query parameter the value `groups`. + You can expand more than one relation by separating the relations in the `expand` query parameter with a comma. For example, to retrieve both the orders and the groups of a customer, pass to the `expand` query parameter the value `groups,orders`. - For example, when you list customers you can also retrieve their groups by - passing to the `expand` query parameter the value `groups`. - - - You can expand more than one relation by separating the relations in the - `expand` query parameter with a comma. For example, to retrieve both the - orders and the groups of a customer, pass to the `expand` query parameter - the value `groups,orders`. - - - Please note that the parameters you pass to `expand` replace any relations - that are expanded by default. - + Please note that the parameters you pass to `expand` replace any relations that are expanded by default. ## Selecting Fields + In many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response. - In many endpoints you'll find a `fields` query parameter that can be passed - to the endpoint. You can use the `fields` query parameter to specify which - fields in the entity should be returned in the response. + You can pass more than one field by seperating the field names in the `fields` query parameter with a comma. + Only the fields you pass to `field` will be retrieved and returned in the response. Any fields that are returned by default will not be returned in this case. This does not affect relations. - You can pass more than one field by seperating the field names in the - `fields` query parameter with a comma. - - - Only the fields you pass to `field` will be retrieved and returned in the - response. Any fields that are returned by default will not be returned in - this case. This does not affect relations. - - - For example, to only select the `title` and `description` fields of a - product, pass to the `fields` query parameter the value `title,description`. - + For example, to only select the `title` and `description` fields of a product, pass to the `fields` query parameter the value `title,description`. ## Pagination - ### Query Parameters + In listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`. - In listing endpoints, such as list customers or list products, you can - control the pagination using the query parameters `limit` and `offset`. - - - `limit` is used to specify the maximum number of items that can be return in - the response. `offset` is used to specify how many items to skip before - returning the resulting entities. - - - You can use the `offset` query parameter to change between pages. For - example, if the limit is 50, at page 1 the offset should be 0; at page 2 the - offset should be 50, and so on. + `limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities. + You can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on. ### Response Fields + In listing fields, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`. - In listing fields, aside from the entities retrieved, there are three - pagination-related fields returned: `count`, `limit`, and `offset`. + Similarly to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result. + `count` is the total number of available items of this entity. It can be used to determine how many pages are there. - Similarly to the query parameters, `limit` is the maximum number of items - that can be returned in the response, and `field` is the number of items - that were skipped before the entities in the result. - - - `count` is the total number of available items of this entity. It can be - used to determine how many pages are there. - - - For example, if the `count` is 100 and the `limit` is 50, you can divide the - `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + For example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. license: name: MIT - url: 'https://github.com/medusajs/medusa/blob/master/LICENSE' + url: https://github.com/medusajs/medusa/blob/master/LICENSE tags: - name: Auth - description: >- - Auth endpoints that allow authorization of admin Users and manages their - sessions. + description: Auth endpoints that allow authorization of admin Users and manages their sessions. - name: App description: App endpoints that allow handling apps in Medusa. - name: Batch Job @@ -121,9 +71,7 @@ tags: - name: Discount description: Discount endpoints that allow handling discounts in Medusa. - name: Discount Condition - description: >- - Discount Condition endpoints that allow handling discount conditions in - Medusa. + description: Discount Condition endpoints that allow handling discount conditions in Medusa. - name: Draft Order description: Draft Order endpoints that allow handling draft orders in Medusa. - name: Gift Card @@ -157,9 +105,7 @@ tags: - name: Shipping Option description: Shipping Option endpoints that allow handling shipping options in Medusa. - name: Shipping Profile - description: >- - Shipping Profile endpoints that allow handling shipping profiles in - Medusa. + description: Shipping Profile endpoints that allow handling shipping profiles in Medusa. - name: Store description: Store endpoints that allow handling stores in Medusa. - name: Swap @@ -171,7 +117,7 @@ tags: - name: User description: User endpoints that allow handling users in Medusa. servers: - - url: 'https://api.medusa-commerce.com/admin' + - url: https://api.medusa-commerce.com/admin paths: /apps/authorizations: post: @@ -184,17 +130,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostAppsReq' + x-codegen: + method: authorize x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/apps/authorizations' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/apps/authorizations' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "application_name": "example", "state": "ready", @@ -230,6 +174,8 @@ paths: summary: List Applications description: Retrieve a list of applications. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: Shell label: cURL @@ -282,15 +228,14 @@ paths: password: type: string description: The User's password. + x-codegen: + method: createSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.admin.auth.createSession({ email: 'user@example.com', password: 'supersecret' @@ -332,24 +277,20 @@ paths: summary: User Logout x-authenticated: true description: Deletes the current session for the logged in user. + x-codegen: + method: deleteSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.auth.deleteSession() - lang: Shell label: cURL - source: > - curl --location --request DELETE 'https://medusa-url.com/admin/auth' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/auth' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -376,19 +317,16 @@ paths: summary: Get Current User x-authenticated: true description: Gets the currently logged in User. + x-codegen: + method: getSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.auth.getSession() - .then(({ user }) => { console.log(user.id); }); @@ -421,7 +359,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}/cancel': + /batch-jobs/{id}/cancel: post: operationId: PostBatchJobsBatchJobCancel summary: Cancel a Batch Job @@ -434,28 +372,23 @@ paths: description: The ID of the batch job. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.batchJobs.cancel(batch_job_id) - .then(({ batch_job }) => { console.log(batch_job.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -481,7 +414,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}/confirm': + /batch-jobs/{id}/confirm: post: operationId: PostBatchJobsBatchJobConfirmProcessing summary: Confirm a Batch Job @@ -494,28 +427,23 @@ paths: description: The ID of the batch job. schema: type: string + x-codegen: + method: confirm x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.batchJobs.confirm(batch_job_id) - .then(({ batch_job }) => { console.log(batch_job.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs/{id}/confirm' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -552,17 +480,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostBatchesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.batchJobs.create({ type: 'product-export', context: {}, @@ -572,14 +498,10 @@ paths: }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/batch-jobs' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/batch-jobs' \ --header 'Content-Type: application/json' \ - --header 'Authorization: Bearer {api_token}' \ - --data-raw '{ "type": "product-export", "context": { } @@ -652,9 +574,7 @@ paths: name: confirmed_at style: form explode: false - description: >- - Date comparison for when resulting collections was confirmed, i.e. - less than, greater than etc. + description: Date comparison for when resulting collections was confirmed, i.e. less than, greater than etc. schema: type: object properties: @@ -678,9 +598,7 @@ paths: name: pre_processed_at style: form explode: false - description: >- - Date comparison for when resulting collections was pre processed, - i.e. less than, greater than etc. + description: Date comparison for when resulting collections was pre processed, i.e. less than, greater than etc. schema: type: object properties: @@ -704,9 +622,7 @@ paths: name: completed_at style: form explode: false - description: >- - Date comparison for when resulting collections was completed, i.e. - less than, greater than etc. + description: Date comparison for when resulting collections was completed, i.e. less than, greater than etc. schema: type: object properties: @@ -730,9 +646,7 @@ paths: name: failed_at style: form explode: false - description: >- - Date comparison for when resulting collections was failed, i.e. less - than, greater than etc. + description: Date comparison for when resulting collections was failed, i.e. less than, greater than etc. schema: type: object properties: @@ -756,9 +670,7 @@ paths: name: canceled_at style: form explode: false - description: >- - Date comparison for when resulting collections was canceled, i.e. - less than, greater than etc. + description: Date comparison for when resulting collections was canceled, i.e. less than, greater than etc. schema: type: object properties: @@ -785,25 +697,19 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each order of - the result. + description: (Comma separated) Which fields should be expanded in each order of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each order of - the result. + description: (Comma separated) Which fields should be included in each order of the result. schema: type: string - in: query name: created_at style: form explode: false - description: >- - Date comparison for when resulting collections was created, i.e. - less than, greater than etc. + description: Date comparison for when resulting collections was created, i.e. less than, greater than etc. schema: type: object properties: @@ -827,9 +733,7 @@ paths: name: updated_at style: form explode: false - description: >- - Date comparison for when resulting collections was updated, i.e. - less than, greater than etc. + description: Date comparison for when resulting collections was updated, i.e. less than, greater than etc. schema: type: object properties: @@ -849,28 +753,24 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetBatchParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.batchJobs.list() - .then(({ batch_jobs, limit, offset, count }) => { console.log(batch_jobs.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/batch-jobs' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/batch-jobs' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -896,7 +796,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/batch-jobs/{id}': + /batch-jobs/{id}: get: operationId: GetBatchJobsBatchJob summary: Get a Batch Job @@ -909,28 +809,23 @@ paths: description: The ID of the Batch Job schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.batchJobs.retrieve(batch_job_id) - .then(({ batch_job }) => { console.log(batch_job.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/batch-jobs/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/batch-jobs/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -956,7 +851,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}/products/batch': + /collections/{id}/products/batch: post: operationId: PostProductsToCollection summary: Update Products @@ -974,17 +869,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsToCollectionReq' + x-codegen: + method: addProducts x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "product_ids": [ "prod_01G1G5V2MBA328390B5AXJ610F" @@ -1031,17 +924,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeleteProductsFromCollectionReq' + x-codegen: + method: removeProducts x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}/products/batch' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "product_ids": [ "prod_01G1G5V2MBA328390B5AXJ610F" @@ -1082,34 +973,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCollectionsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.collections.create({ title: 'New Collection' }) - .then(({ collection }) => { console.log(collection.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "New Collection" }' @@ -1172,9 +1056,7 @@ paths: type: string - in: query name: discount_condition_id - description: >- - The discount condition id on which to filter the product - collections. + description: The discount condition id on which to filter the product collections. schema: type: string - in: query @@ -1243,28 +1125,24 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetCollectionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.collections.list() - .then(({ collections, limit, offset, count }) => { console.log(collections.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/collections' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -1290,7 +1168,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/collections/{id}': + /collections/{id}: delete: operationId: DeleteCollectionsCollection summary: Delete a Collection @@ -1303,28 +1181,23 @@ paths: description: The ID of the Collection. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.collections.delete(collection_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/collections/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -1362,28 +1235,23 @@ paths: description: The ID of the Product Collection schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.collections.retrieve(collection_id) - .then(({ collection }) => { console.log(collection.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/collections/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -1426,34 +1294,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCollectionsCollectionReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.collections.update(collection_id, { title: 'New Collection' }) - .then(({ collection }) => { console.log(collection.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/collections/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/collections/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "New Collection" }' @@ -1515,28 +1376,24 @@ paths: schema: type: number default: '20' + x-codegen: + method: list + queryParams: AdminGetCurrenciesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.currencies.list() - .then(({ currencies, count, offset, limit }) => { console.log(currencies.length); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/currencies' \ --header 'Authorization: Bearer {api_token}' tags: - Currency @@ -1547,7 +1404,7 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminCurrenciesListRes' - '/currencies/{code}': + /currencies/{code}: post: operationId: PostCurrenciesCurrency summary: Update a Currency @@ -1565,34 +1422,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCurrenciesCurrencyReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.currencies.update(code, { includes_tax: true }) - .then(({ currency }) => { console.log(currency.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/currencies/{code}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/currencies/{code}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "includes_tax": true }' @@ -1605,11 +1455,11 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminCurrenciesRes' - '/customer-groups/{id}/customers/batch': + /customer-groups/{id}/customers/batch: post: operationId: PostCustomerGroupsGroupCustomersBatch summary: Add Customers - description: 'Adds a list of customers, represented by id''s, to a customer group.' + description: Adds a list of customers, represented by id's, to a customer group. x-authenticated: true parameters: - in: path @@ -1622,19 +1472,16 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq + $ref: '#/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq' + x-codegen: + method: addCustomers x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.addCustomers(customer_group_id, { customer_ids: [ { @@ -1642,21 +1489,15 @@ paths: } ] }) - .then(({ customer_group }) => { console.log(customer_group.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "customer_ids": [ { @@ -1691,7 +1532,7 @@ paths: delete: operationId: DeleteCustomerGroupsGroupCustomerBatch summary: Remove Customers - description: 'Removes a list of customers, represented by id''s, from a customer group.' + description: Removes a list of customers, represented by id's, from a customer group. x-authenticated: true parameters: - in: path @@ -1704,19 +1545,16 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq + $ref: '#/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq' + x-codegen: + method: removeCustomers x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.removeCustomers(customer_group_id, { customer_ids: [ { @@ -1724,21 +1562,15 @@ paths: } ] }) - .then(({ customer_group }) => { console.log(customer_group.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}/customers/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "customer_ids": [ { @@ -1776,35 +1608,32 @@ paths: summary: Create a Customer Group description: Creates a CustomerGroup. x-authenticated: true - parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostCustomerGroupsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.create({ name: 'VIP' }) - .then(({ customer_group }) => { console.log(customer_group.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "VIP" }' @@ -1832,20 +1661,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. get: operationId: GetCustomerGroups summary: List Customer Groups @@ -1963,33 +1778,27 @@ paths: default: 10 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each customer - groups of the result. + description: (Comma separated) Which fields should be expanded in each customer groups of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetCustomerGroupsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.list() - .then(({ customer_groups, limit, offset, count }) => { console.log(customer_groups.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2015,7 +1824,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}': + /customer-groups/{id}: delete: operationId: DeleteCustomerGroupsCustomerGroup summary: Delete a Customer Group @@ -2028,28 +1837,23 @@ paths: description: The ID of the Customer Group schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.delete(customer_group_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/customer-groups/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2089,40 +1893,32 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in the customer - group. + description: (Comma separated) Which fields should be expanded in the customer group. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in the customer - group. + description: (Comma separated) Which fields should be included in the customer group. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetCustomerGroupsGroupParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.retrieve(customer_group_id) - .then(({ customer_group }) => { console.log(customer_group.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2165,34 +1961,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCustomerGroupsGroupReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.update(customer_group_id, { name: 'VIP' }) - .then(({ customer_group }) => { console.log(customer_group.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/customer-groups/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/customer-groups/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "VIP" }' @@ -2220,7 +2009,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customer-groups/{id}/customers': + /customer-groups/{id}/customers: get: operationId: GetCustomerGroupsGroupCustomers summary: List Customers @@ -2233,28 +2022,46 @@ paths: description: The ID of the customer group. schema: type: string + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: a search term to search email, first_name, and last_name. + schema: + type: string + x-codegen: + method: listCustomers + queryParams: AdminGetGroupsGroupCustomersParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.customerGroups.listCustomers(customer_group_id) - .then(({ customers }) => { console.log(customers.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/customer-groups/{id}/customers' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2291,39 +2098,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCustomersReq' - tags: - - Customer + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + 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", @@ -2333,6 +2131,8 @@ paths: security: - api_token: [] - cookie_auth: [] + tags: + - Customer responses: '201': description: OK @@ -2377,31 +2177,27 @@ paths: type: string - in: query name: q - description: 'a search term to search email, first_name, and last_name.' + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/customers' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2427,7 +2223,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/customers/{id}': + /customers/{id}: get: operationId: GetCustomersCustomer summary: Get a Customer @@ -2450,28 +2246,23 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/customers/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2524,34 +2315,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostCustomersCustomerReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + 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" }' @@ -2579,7 +2363,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/regions/{region_id}': + /discounts/{id}/regions/{region_id}: post: operationId: PostDiscountsDiscountRegionsRegion summary: Add Region @@ -2598,28 +2382,23 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: addRegion x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.addRegion(discount_id, region_id) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2649,9 +2428,7 @@ paths: operationId: DeleteDiscountsDiscountRegionsRegion summary: Remove Region x-authenticated: true - description: >- - Removes a Region from the list of Regions that a Discount can be used - in. + description: Removes a Region from the list of Regions that a Discount can be used in. parameters: - in: path name: id @@ -2665,28 +2442,23 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: removeRegion x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.removeRegion(discount_id, region_id) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/regions/{region_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -2712,7 +2484,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{discount_id}/conditions/{condition_id}/batch': + /discounts/{discount_id}/conditions/{condition_id}/batch: post: operationId: PostDiscountsDiscountConditionsConditionBatch summary: Add Batch Resources @@ -2733,54 +2505,41 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which relations should be expanded in each - discount of the result. + description: (Comma separated) Which relations should be expanded in each discount of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each discount - of the result. + description: (Comma separated) Which fields should be included in each discount of the result. schema: type: string requestBody: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq' + x-codegen: + method: addConditionResourceBatch + queryParams: AdminPostDiscountsDiscountConditionsConditionBatchParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.discounts.addConditionResourceBatch(discount_id, - condition_id, { + medusa.admin.discounts.addConditionResourceBatch(discount_id, condition_id, { resources: [{ id: item_id }] }) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "resources": [{ "id": "item_id" }] }' @@ -2828,54 +2587,40 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which relations should be expanded in each - discount of the result. + description: (Comma separated) Which relations should be expanded in each discount of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each discount - of the result. + description: (Comma separated) Which fields should be included in each discount of the result. schema: type: string requestBody: content: application/json: schema: - $ref: >- - #/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq + $ref: '#/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq' + x-codegen: + method: deleteConditionResourceBatch x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.discounts.deleteConditionResourceBatch(discount_id, - condition_id, { + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, condition_id, { resources: [{ id: item_id }] }) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "resources": [{ "id": "item_id" }] }' @@ -2903,14 +2648,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{discount_id}/conditions': + /discounts/{discount_id}/conditions: post: operationId: PostDiscountsDiscountConditions summary: Create a Condition - description: >- - Creates a DiscountCondition. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` should be - provided. + description: Creates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. x-authenticated: true parameters: - in: path @@ -2921,16 +2663,12 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. + description: (Comma separated) Which fields should be expanded in each product of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + description: (Comma separated) Which fields should be included in each product of the result. schema: type: string requestBody: @@ -2938,36 +2676,29 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDiscountsDiscountConditions' + x-codegen: + method: createCondition + queryParams: AdminPostDiscountsDiscountConditionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - import { DiscountConditionOperator } from "@medusajs/medusa" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.createCondition(discount_id, { operator: DiscountConditionOperator.IN }) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "operator": "in" }' @@ -3000,18 +2731,16 @@ paths: operationId: PostDiscounts summary: Creates a Discount x-authenticated: true - description: >- - Creates a Discount with a given set of rules that define how the - Discount behaves. + description: Creates a Discount with a given set of rules that define how the Discount behaves. parameters: - in: query name: expand - description: (Comma separated) Which fields should be expanded in each customer. + 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 each customer. + description: (Comma separated) Which fields should be retrieved in the results. schema: type: string requestBody: @@ -3019,19 +2748,17 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDiscountsReq' + x-codegen: + method: create + queryParams: AdminPostDiscountsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - import { AllocationType, DiscountRuleType } from "@medusajs/medusa" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.create({ code: 'TEST', rule: { @@ -3043,20 +2770,15 @@ paths: is_dynamic: false, is_disabled: false }) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "code": "TEST", "rule": { @@ -3113,19 +2835,13 @@ paths: - fixed - percentage - free_shipping - description: >- - The type of the Discount, can be `fixed` for discounts that - reduce the price by a fixed amount, `percentage` for - percentage reductions or `free_shipping` for shipping - vouchers. + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. allocation: type: string enum: - total - item - description: >- - The value that the discount represents; this will depend on - the type of the discount + description: The value that the discount represents; this will depend on the type of the discount - in: query name: is_dynamic description: Return only dynamic discounts. @@ -3153,28 +2869,24 @@ paths: description: Comma separated list of relations to include in the results. schema: type: string + x-codegen: + method: list + queryParams: AdminGetDiscountsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.list() - .then(({ discounts, limit, offset, count }) => { console.log(discounts.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3200,14 +2912,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/dynamic-codes': + /discounts/{id}/dynamic-codes: post: operationId: PostDiscountsDiscountDynamicCodes summary: Create a Dynamic Code - description: >- - Creates a dynamic unique code that can map to a parent Discount. This is - useful if you want to automatically generate codes with the same - behaviour. + description: Creates a dynamic unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour. x-authenticated: true parameters: - in: path @@ -3216,35 +2925,33 @@ paths: description: The ID of the Discount to create the dynamic code from." schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq' + x-codegen: + method: createDynamicCode x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.createDynamicCode(discount_id, { code: 'TEST', usage_limit: 1 }) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "code": "TEST" }' @@ -3272,27 +2979,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - code - properties: - code: - type: string - description: The unique code that will be used to redeem the Discount. - usage_limit: - type: number - default: '1' - description: amount of times the discount can be applied. - metadata: - type: object - description: >- - An optional set of key-value paris to hold additional - information. - '/discounts/{discount_id}/conditions/{condition_id}': + /discounts/{discount_id}/conditions/{condition_id}: delete: operationId: DeleteDiscountsDiscountConditionsCondition summary: Delete a Condition @@ -3321,29 +3008,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: deleteCondition + queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.deleteCondition(discount_id, condition_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3397,29 +3079,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: getCondition + queryParams: AdminGetDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.getCondition(discount_id, condition_id) - .then(({ discount_condition }) => { console.log(discount_condition.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' - \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3448,10 +3125,7 @@ paths: post: operationId: PostDiscountsDiscountConditionsCondition summary: Update a Condition - description: >- - Updates a DiscountCondition. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` should be - provided. + description: Updates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. x-authenticated: true parameters: - in: path @@ -3468,55 +3142,43 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. + description: (Comma separated) Which fields should be expanded in each item of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each item of - the result. + description: (Comma separated) Which fields should be included in each item of the result. schema: type: string requestBody: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostDiscountsDiscountConditionsCondition + $ref: '#/components/schemas/AdminPostDiscountsDiscountConditionsCondition' + x-codegen: + method: updateCondition + queryParams: AdminPostDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.updateCondition(discount_id, condition_id, { products: [ product_id ] }) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "products": [ "prod_01G1G5V2MBA328390B5AXJ610F" @@ -3546,7 +3208,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}': + /discounts/{id}: delete: operationId: DeleteDiscountsDiscount summary: Delete a Discount @@ -3559,28 +3221,23 @@ paths: description: The ID of the Discount schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.delete(discount_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3628,28 +3285,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetDiscountParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.retrieve(discount_id) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3678,9 +3331,7 @@ paths: post: operationId: PostDiscountsDiscount summary: Update a Discount - description: >- - Updates a Discount with a given set of rules that define how the - Discount behaves. + description: Updates a Discount with a given set of rules that define how the Discount behaves. x-authenticated: true parameters: - in: path @@ -3691,16 +3342,12 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. + description: (Comma separated) Which fields should be expanded in each item of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each item of - the result. + description: (Comma separated) Which fields should be included in each item of the result. schema: type: string requestBody: @@ -3708,34 +3355,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDiscountsDiscountReq' + x-codegen: + method: update + queryParams: AdminPostDiscountsDiscountParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.update(discount_id, { code: 'TEST' }) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/discounts/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/discounts/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "code": "TEST" }' @@ -3763,7 +3404,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/{id}/dynamic-codes/{code}': + /discounts/{id}/dynamic-codes/{code}: delete: operationId: DeleteDiscountsDiscountDynamicCodesCode summary: Delete a Dynamic Code @@ -3782,28 +3423,23 @@ paths: description: The ID of the Discount schema: type: string + x-codegen: + method: deleteDynamicCode x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.deleteDynamicCode(discount_id, code) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/discounts/{id}/dynamic-codes/{code}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3829,7 +3465,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/discounts/code/{code}': + /discounts/code/{code}: get: operationId: GetDiscountsDiscountCode summary: Get Discount by Code @@ -3852,28 +3488,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieveByCode + queryParams: AdminGetDiscountsDiscountCodeParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.discounts.retrieveByCode(code) - .then(({ discount }) => { console.log(discount.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/discounts/code/{code}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/discounts/code/{code}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3910,17 +3542,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDraftOrdersReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.create({ email: 'user@example.com', region_id, @@ -3935,20 +3565,15 @@ paths: } ], }) - .then(({ draft_order }) => { console.log(draft_order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com", "region_id": "{region_id}" @@ -4007,33 +3632,27 @@ paths: default: '50' - in: query name: q - description: >- - a search term to search emails in carts associated with draft orders - and display IDs of draft orders + description: a search term to search emails in carts associated with draft orders and display IDs of draft orders schema: type: string + x-codegen: + method: list + queryParams: AdminGetDraftOrdersParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.list() - .then(({ draft_orders, limit, offset, count }) => { console.log(draft_orders.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/draft-orders' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/draft-orders' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4059,7 +3678,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items': + /draft-orders/{id}/line-items: post: operationId: PostDraftOrdersDraftOrderLineItems summary: Create a Line Item @@ -4077,34 +3696,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq' + x-codegen: + method: addLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.addLineItem(draft_order_id, { quantity: 1 }) - .then(({ draft_order }) => { console.log(draft_order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "quantity": 1 }' @@ -4132,7 +3744,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}': + /draft-orders/{id}: delete: operationId: DeleteDraftOrdersDraftOrder summary: Delete a Draft Order @@ -4145,28 +3757,23 @@ paths: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.delete(draft_order_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4204,28 +3811,23 @@ paths: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.retrieve(draft_order_id) - .then(({ draft_order }) => { console.log(draft_order.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/draft-orders/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/draft-orders/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4251,7 +3853,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/line-items/{line_id}': + /draft-orders/{id}/line-items/{line_id}: delete: operationId: DeleteDraftOrdersDraftOrderLineItemsItem summary: Delete a Line Item @@ -4270,29 +3872,23 @@ paths: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: removeLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.removeLineItem(draft_order_id, item_id) - .then(({ draft_order }) => { console.log(draft_order.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4340,37 +3936,28 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq' + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.updateLineItem(draft_order_id, line_id, { quantity: 1 }) - .then(({ draft_order }) => { console.log(draft_order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/line-items/{line_id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "quantity": 1 }' @@ -4398,7 +3985,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/draft-orders/{id}/pay': + /draft-orders/{id}/pay: post: summary: Registers a Payment operationId: PostDraftOrdersDraftOrderRegisterPayment @@ -4411,28 +3998,23 @@ paths: description: The Draft Order id. schema: type: string + x-codegen: + method: markPaid x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.markPaid(draft_order_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}/pay' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4445,8 +4027,7 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes + $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderRegisterPaymentRes' '400': $ref: '#/components/responses/400_error' '401': @@ -4459,7 +4040,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/admin/draft-orders/{id}': + /admin/draft-orders/{id}: post: operationId: PostDraftOrdersDraftOrder summary: Update a Draft Order @@ -4477,34 +4058,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostDraftOrdersDraftOrderReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.draftOrders.update(draft_order_id, { email: "user@example.com" }) - .then(({ draft_order }) => { console.log(draft_order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/draft-orders/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/draft-orders/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com" }' @@ -4536,43 +4110,34 @@ paths: 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. + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + 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}" }' @@ -4623,28 +4188,24 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/gift-cards' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4670,7 +4231,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{id}': + /gift-cards/{id}: delete: operationId: DeleteGiftCardsGiftCard summary: Delete a Gift Card @@ -4683,28 +4244,23 @@ paths: description: The ID of the Gift Card to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/gift-cards/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4742,28 +4298,23 @@ paths: description: The ID of the Gift Card. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/gift-cards/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -4792,9 +4343,7 @@ paths: 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. + 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 @@ -4808,34 +4357,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostGiftCardsGiftCardReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + 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}" }' @@ -4863,6 +4405,624 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /inventory-items/{id}/location-levels: + post: + operationId: PostInventoryItemsInventoryItemLocationLevels + summary: Create an Inventory Location Level for a given Inventory Item. + description: Creates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { + location_id: 'sloc', + stocked_quantity: 10, + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "location_id": "sloc", + "stocked_quantity": 10 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + get: + operationId: GetInventoryItemsInventoryItemLocationLevels + summary: List stock levels of a given location. + description: Lists stock levels of a given location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: offset + description: How many stock locations levels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations levels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.listLocationLevels(inventoryItemId) + .then(({ inventory_item }) => { + console.log(inventory_item.location_levels); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items/{id}: + delete: + operationId: DeleteInventoryItemsInventoryItem + summary: Delete an Inventory Item + description: Delete an Inventory Item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.delete(inventoryItemId) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - InventoryItem + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsDeleteRes' + '400': + $ref: '#/components/responses/400_error' + get: + operationId: GetInventoryItemsInventoryItem + summary: Retrive an Inventory Item. + description: Retrives an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.retrieve(inventoryItemId) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItem + summary: Update an Inventory Item. + description: Updates an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsInventoryItemReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.update(inventoryItemId, { + origin_country: "US", + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "origin_country": "US" + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items/{id}/location-levels/{location_id}: + delete: + operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation + summary: Delete a location level of an Inventory Item. + description: Delete a location level of an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + post: + operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel + summary: Update an Inventory Location Level for a given Inventory Item. + description: Updates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, locationId, { + stocked_quantity: 15, + }) + .then(({ inventory_item }) => { + console.log(inventory_item.id); + }); + - lang: Shell + label: cURL + source: | + curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "stocked_quantity": 15 + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + /inventory-items: + get: + operationId: GetInventoryItems + summary: List inventory items. + description: Lists inventory items. + x-authenticated: true + parameters: + - in: query + name: offset + description: How many inventory items to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of inventory items returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + - in: query + name: q + description: Query used for searching product inventory items and their properties. + schema: + type: string + - in: query + name: location_id + style: form + explode: false + description: Locations ids to search for. + schema: + type: array + items: + type: string + - in: query + name: id + description: id to search for. + schema: + type: string + - in: query + name: sku + description: sku to search for. + schema: + type: string + - in: query + name: origin_country + description: origin_country to search for. + schema: + type: string + - in: query + name: mid_code + description: mid_code to search for. + schema: + type: string + - in: query + name: material + description: material to search for. + schema: + type: string + - in: query + name: hs_code + description: hs_code to search for. + schema: + type: string + - in: query + name: weight + description: weight to search for. + schema: + type: string + - in: query + name: length + description: length to search for. + schema: + type: string + - in: query + name: height + description: height to search for. + schema: + type: string + - in: query + name: width + description: width to search for. + schema: + type: string + - in: query + name: requires_shipping + description: requires_shipping to search for. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.inventoryItems.list() + .then(({ inventory_items }) => { + console.log(inventory_items.length); + }); + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \ + --header 'Authorization: Bearer {api_token}' \ + --header 'Content-Type: application/json' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /invites/accept: post: operationId: PostInvitesInviteAccept @@ -4873,17 +5033,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostInvitesInviteAcceptReq' + x-codegen: + method: accept x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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: { @@ -4892,24 +5050,18 @@ paths: password: 'supersecret' } }) - .then(() => { // successful }) - .catch(() => { // an error occurred }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/invites/accept' \ - + 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": { @@ -4949,39 +5101,31 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostInvitesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + 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" @@ -5011,28 +5155,23 @@ paths: summary: Lists Invites description: Lists all Invites x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' - \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/invites' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5058,7 +5197,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/invites/{invite_id}': + /invites/{invite_id}: delete: operationId: DeleteInvitesInvite summary: Delete an Invite @@ -5071,28 +5210,23 @@ paths: description: The ID of the Invite schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/invites/{invite_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5118,7 +5252,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/invites/{invite_id}/resend': + /invites/{invite_id}/resend: post: operationId: PostInvitesInviteResend summary: Resend an Invite @@ -5131,32 +5265,26 @@ paths: description: The ID of the Invite schema: type: string + x-codegen: + method: resend x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/invites/{invite_id}/resend' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5189,36 +5317,29 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostNotesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.notes.create({ resource_id, resource_type: 'order', value: 'We delivered this order' }) - .then(({ note }) => { console.log(note.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST 'https://medusa-url.com/admin/notes' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/notes' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "resource_id": "{resource_id}", "resource_type": "order", @@ -5271,19 +5392,17 @@ paths: description: The ID which the notes belongs to schema: type: string + x-codegen: + method: list + queryParams: AdminGetNotesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.notes.list() - .then(({ notes, limit, offset, count }) => { console.log(notes.length); }); @@ -5316,7 +5435,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/notes/{id}': + /notes/{id}: delete: operationId: DeleteNotesNote summary: Delete a Note @@ -5329,28 +5448,23 @@ paths: description: The ID of the Note to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.notes.delete(note_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/notes/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/notes/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5388,28 +5502,23 @@ paths: description: The ID of the note to retrieve. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.notes.retrieve(note_id) - .then(({ note }) => { console.log(note.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/notes/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/notes/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5452,34 +5561,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostNotesNoteReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.notes.update(note_id, { value: 'We delivered this order' }) - .then(({ note }) => { console.log(note.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/notes/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/notes/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "value": "We delivered this order" }' @@ -5516,9 +5618,7 @@ paths: parameters: - in: query name: offset - description: >- - The number of notifications to skip before starting to collect the - notifications set + description: The number of notifications to skip before starting to collect the notifications set schema: type: integer default: 0 @@ -5555,41 +5655,32 @@ paths: 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 + 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 + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/notifications' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5615,13 +5706,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/notifications/{id}/resend': + /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 + description: Resends a previously sent notifications, with the same data but optionally to a different address x-authenticated: true parameters: - in: path @@ -5635,28 +5724,23 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostNotificationsNotificationResendReq' + x-codegen: + method: resend x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/notifications/{id}/resend' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5682,7 +5766,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items': + /order-edits/{id}/items: post: operationId: PostOrderEditsEditLineItems summary: Add a Line Item @@ -5700,37 +5784,29 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsReq' x-authenticated: true + x-codegen: + method: addLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.addLineItem(order_edit_id, { variant_id, quantity }) - .then(({ order_edit }) => { console.log(order_edit.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - - --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", - "quantity": 3 }' + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", "quantity": 3 }' security: - api_token: [] - cookie_auth: [] @@ -5755,7 +5831,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/cancel': + /order-edits/{id}/cancel: post: operationId: PostOrderEditsOrderEditCancel summary: Cancel an OrderEdit @@ -5768,27 +5844,23 @@ paths: description: The ID of the OrderEdit. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.cancel(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5810,7 +5882,7 @@ paths: $ref: '#/components/responses/not_found_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/confirm': + /order-edits/{id}/confirm: post: operationId: PostOrderEditsOrderEditConfirm summary: Confirms an OrderEdit @@ -5823,27 +5895,23 @@ paths: description: The ID of the order edit. schema: type: string + x-codegen: + method: confirm x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.confirm(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -5876,33 +5944,26 @@ paths: schema: $ref: '#/components/schemas/AdminPostOrderEditsReq' x-authenticated: true + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.create({ order_id }) .then(({ order_edit }) => { console.log(order_edit.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - - --data-raw '{ "order_id": "my_order_id", "internal_note": - "my_optional_note" }' + --data-raw '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }' security: - api_token: [] - cookie_auth: [] @@ -5965,27 +6026,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: list + queryParams: GetOrderEditsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.list() .then(({ order_edits, count, limit, offset }) => { console.log(order_edits.length) }) - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/order-edits' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6011,7 +6069,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/items/{item_id}': + /order-edits/{id}/items/{item_id}: delete: operationId: DeleteOrderEditsOrderEditLineItemsLineItem summary: Delete a Line Item @@ -6030,27 +6088,23 @@ paths: description: The ID of the order edit item to delete from order. schema: type: string + x-codegen: + method: removeLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.removeLineItem(order_edit_id, line_item_id) .then(({ order_edit }) => { console.log(order_edit.id) }) - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6099,19 +6153,16 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq' + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, - { + medusa.admin.orderEdits.updateLineItem(order_edit_id, line_item_id, { quantity: 5 }) .then(({ order_edit }) => { @@ -6119,14 +6170,10 @@ paths: }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "quantity": 5 }' security: - api_token: [] @@ -6152,7 +6199,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/changes/{change_id}': + /order-edits/{id}/changes/{change_id}: delete: operationId: DeleteOrderEditsOrderEditItemChange summary: Delete a Line Item Change @@ -6171,29 +6218,23 @@ paths: description: The ID of the Order Edit Item Change to delete. schema: type: string + x-codegen: + method: deleteItemChange x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.orderEdits.deleteItemChange(order_edit_id, - item_change_id) + medusa.admin.orderEdits.deleteItemChange(order_edit_id, item_change_id) .then(({ id, object, deleted }) => { console.log(id) }) - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}/changes/{change_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6209,7 +6250,7 @@ paths: $ref: '#/components/schemas/AdminOrderEditItemChangeDeleteRes' '400': $ref: '#/components/responses/400_error' - '/order-edits/{id}': + /order-edits/{id}: delete: operationId: DeleteOrderEditsOrderEdit summary: Delete an Order Edit @@ -6222,27 +6263,23 @@ paths: description: The ID of the Order Edit to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.delete(order_edit_id) .then(({ id, object, deleted }) => { console.log(id) }) - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/order-edits/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/order-edits/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6280,27 +6317,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: GetOrderEditsOrderEditParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.retrieve(orderEditId) .then(({ order_edit }) => { console.log(order_edit.id) }) - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/order-edits/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/order-edits/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6343,17 +6377,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrderEditsOrderEditReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.update(order_edit_id, { internal_note: "internal reason XY" }) @@ -6362,14 +6394,10 @@ paths: }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "internal_note": "internal reason XY" }' @@ -6397,7 +6425,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/request': + /order-edits/{id}/request: post: operationId: PostOrderEditsOrderEditRequest summary: Request Confirmation @@ -6410,27 +6438,23 @@ paths: description: The ID of the Order Edit to request confirmation from. schema: type: string + x-codegen: + method: requestConfirmation x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orderEdits.requestConfirmation(order_edit_id) .then({ order_edit }) => { console.log(order_edit.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/order-edits/{id}/request' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/request' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6452,15 +6476,11 @@ paths: $ref: '#/components/responses/not_found_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/shipping-methods': + /orders/{id}/shipping-methods: post: operationId: PostOrdersOrderShippingMethods summary: Add a Shipping Method - description: >- - Adds a Shipping Method to an Order. If another Shipping Method exists - with the same Shipping Profile, the previous Shipping Method will be - replaced. - x-authenticated: true + description: Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced. parameters: - in: path name: id @@ -6468,35 +6488,34 @@ paths: description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminPostOrdersOrderShippingMethodsReq' + x-authenticated: true + x-codegen: + method: addShippingMethod x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.addShippingMethod(order_id, { price: 1000, option_id }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipping-methods' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "price": 1000, "option_id": "{option_id}" @@ -6525,32 +6544,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - price - - option_id - properties: - price: - type: integer - description: >- - The price (excluding VAT) that should be charged for the - Shipping Method - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - data: - type: object - description: >- - The data required for the Shipping Option to create a - Shipping Method. This will depend on the Fulfillment - Provider. - '/orders/{id}/archive': + /orders/{id}/archive: post: operationId: PostOrdersOrderArchive summary: Archive Order @@ -6563,28 +6557,23 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: archive x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.archive(order_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/archive' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/archive' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6610,7 +6599,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/cancel': + /orders/{id}/claims/{claim_id}/cancel: post: operationId: PostOrdersClaimCancel summary: Cancel a Claim @@ -6629,29 +6618,23 @@ paths: description: The ID of the Claim. schema: type: string + x-codegen: + method: cancelClaim x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.cancelClaim(order_id, claim_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6677,7 +6660,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel': + /orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel: post: operationId: PostOrdersClaimFulfillmentsCancel summary: Cancel Claim Fulfillment @@ -6702,30 +6685,23 @@ paths: description: The ID of the Fulfillment. schema: type: string + x-codegen: + method: cancelClaimFulfillment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, - fulfillment_id) - + medusa.admin.orders.cancelClaimFulfillment(order_id, claim_id, fulfillment_id) .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6751,7 +6727,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel': + /orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel: post: operationId: PostOrdersSwapFulfillmentsCancel summary: Cancel Swap's Fulfilmment @@ -6776,30 +6752,23 @@ paths: description: The ID of the Fulfillment. schema: type: string + x-codegen: + method: cancelSwapFulfillment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, - fulfillment_id) - + medusa.admin.orders.cancelSwapFulfillment(order_id, swap_id, fulfillment_id) .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6825,7 +6794,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/fulfillments/{fulfillment_id}/cancel': + /orders/{id}/fulfillments/{fulfillment_id}/cancel: post: operationId: PostOrdersOrderFulfillmentsCancel summary: Cancels a Fulfilmment @@ -6844,29 +6813,23 @@ paths: description: The ID of the Fulfillment schema: type: string + x-codegen: + method: cancelFulfillment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.cancelFulfillment(order_id, fulfillment_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillments/{fulfillment_id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6892,14 +6855,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/cancel': + /orders/{id}/cancel: post: operationId: PostOrdersOrderCancel summary: Cancel an Order - description: >- - Registers an Order as canceled. This triggers a flow that will cancel - any created Fulfillments and Payments, may fail if the Payment or - Fulfillment Provider is unable to cancel the Payment/Fulfillment. + description: Registers an Order as canceled. This triggers a flow that will cancel any created Fulfillments and Payments, may fail if the Payment or Fulfillment Provider is unable to cancel the Payment/Fulfillment. x-authenticated: true parameters: - in: path @@ -6908,28 +6868,23 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.cancel(order_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/cancel' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -6955,7 +6910,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/cancel': + /orders/{id}/swaps/{swap_id}/cancel: post: operationId: PostOrdersSwapCancel summary: Cancels a Swap @@ -6974,29 +6929,23 @@ paths: description: The ID of the Swap. schema: type: string + x-codegen: + method: cancelSwap x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.cancelSwap(order_id, swap_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{order_id}/swaps/{swap_id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -7022,7 +6971,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/capture': + /orders/{id}/capture: post: operationId: PostOrdersOrderCapture summary: Capture Order's Payment @@ -7035,28 +6984,23 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: capturePayment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.capturePayment(order_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/capture' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/capture' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -7082,7 +7026,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/complete': + /orders/{id}/complete: post: operationId: PostOrdersOrderComplete summary: Complete an Order @@ -7095,28 +7039,23 @@ paths: description: The ID of the Order. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.complete(order_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/complete' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/complete' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -7142,7 +7081,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/shipments': + /orders/{id}/claims/{claim_id}/shipments: post: operationId: PostOrdersOrderClaimsClaimShipments summary: Create Claim Shipment @@ -7166,35 +7105,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq' + x-codegen: + method: createClaimShipment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.createClaimShipment(order_id, claim_id, { fulfillment_id }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/shipments' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "fulfillment_id": "{fulfillment_id}" }' @@ -7222,7 +7153,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/claims': + /order/{id}/claims: post: operationId: PostOrdersOrderClaims summary: Create a Claim @@ -7240,17 +7171,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderClaimsReq' + x-codegen: + method: createClaim x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.createClaim(order_id, { type: 'refund', claim_items: [ @@ -7260,20 +7189,15 @@ paths: } ] }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "type": "refund", "claim_items": [ @@ -7307,13 +7231,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/fulfillment': + /orders/{id}/fulfillment: post: operationId: PostOrdersOrderFulfillments summary: Create a Fulfillment - description: >- - Creates a Fulfillment of an Order - will notify Fulfillment Providers to - prepare a shipment. + description: Creates a Fulfillment of an Order - will notify Fulfillment Providers to prepare a shipment. x-authenticated: true parameters: - in: path @@ -7327,17 +7249,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderFulfillmentsReq' + x-codegen: + method: createFulfillment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.createFulfillment(order_id, { items: [ { @@ -7346,20 +7266,15 @@ paths: } ] }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/fulfillment' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "items": [ { @@ -7392,13 +7307,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/line-items/{line_item_id}/reserve': + /orders/{id}/line-items/{line_item_id}/reserve: post: operationId: PostOrdersOrderLineItemReservations summary: Create a Reservation for a line item - description: >- - Creates a Reservation for a line item at a specified location, - optionally for a partial quantity. + description: Creates a Reservation for a line item at a specified location, optionally for a partial quantity. x-authenticated: true parameters: - in: path @@ -7421,32 +7334,22 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.createReservation(order_id, line_item_id, { location_id }) - .then(({ reservation }) => { console.log(reservation.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/line-items/{line_item_id}/reservations' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "location_id": "loc_1" }' @@ -7474,7 +7377,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/shipment': + /orders/{id}/shipment: post: operationId: PostOrdersOrderShipment summary: Create a Shipment @@ -7492,34 +7395,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderShipmentReq' + x-codegen: + method: createShipment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.createShipment(order_id, { fulfillment_id }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/shipment' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/shipment' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "fulfillment_id": "{fulfillment_id}" }' @@ -7547,7 +7443,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/shipments': + /orders/{id}/swaps/{swap_id}/shipments: post: operationId: PostOrdersOrderSwapsSwapShipments summary: Create Swap Shipment @@ -7571,35 +7467,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq' + x-codegen: + method: createSwapShipment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.createSwapShipment(order_id, swap_id, { fulfillment_id }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/shipments' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "fulfillment_id": "{fulfillment_id}" }' @@ -7627,13 +7515,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/swaps': + /order/{id}/swaps: post: operationId: PostOrdersOrderSwaps summary: Create a Swap - description: >- - Creates a Swap. Swaps are used to handle Return of previously purchased - goods and Fulfillment of replacements simultaneously. + description: Creates a Swap. Swaps are used to handle Return of previously purchased goods and Fulfillment of replacements simultaneously. x-authenticated: true parameters: - in: path @@ -7647,17 +7533,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderSwapsReq' + x-codegen: + method: createSwap x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.createSwap(order_id, { return_items: [ { @@ -7666,20 +7550,15 @@ paths: } ] }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "return_items": [ { @@ -7712,7 +7591,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/claims/{claim_id}/fulfillments': + /orders/{id}/claims/{claim_id}/fulfillments: post: operationId: PostOrdersOrderClaimsClaimFulfillments summary: Create Claim Fulfillment @@ -7735,31 +7614,24 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq + $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq' + x-codegen: + method: fulfillClaim x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.fulfillClaim(order_id, claim_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}/fulfillments' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -7785,7 +7657,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/fulfillments': + /orders/{id}/swaps/{swap_id}/fulfillments: post: operationId: PostOrdersOrderSwapsSwapFulfillments summary: Create Swap Fulfillment @@ -7808,31 +7680,24 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq + $ref: '#/components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq' + x-codegen: + method: fulfillSwap x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.fulfillSwap(order_id, swap_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/fulfillments' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -7858,7 +7723,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}': + /orders/{id}: get: operationId: GetOrdersOrder summary: Get an Order @@ -7871,28 +7736,34 @@ paths: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetOrdersOrderParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.retrieve(order_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/orders/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -7935,34 +7806,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.update(order_id, { email: 'user@example.com' }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/adasda' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/adasda' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com" }' @@ -7990,7 +7854,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/reservations': + /orders/{id}/reservations: get: operationId: GetOrdersOrderReservations summary: Get reservations for an Order @@ -8018,25 +7882,18 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.retrieveReservations(order_id) - .then(({ reservations }) => { console.log(reservations[0].id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/orders/{id}/reservations' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders/{id}/reservations' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -8071,9 +7928,7 @@ paths: parameters: - in: query name: q - description: >- - Query used for searching orders by shipping address first name, - orders' email, and orders' display ID + description: Query used for searching orders by shipping address first name, orders' email, and orders' display ID schema: type: string - in: query @@ -8173,7 +8028,7 @@ paths: schema: type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. - in: query name: tax_rate @@ -8270,40 +8125,32 @@ paths: default: 50 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each order of - the result. + description: (Comma separated) Which fields should be expanded in each order of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each order of - the result. + description: (Comma separated) Which fields should be included in each order of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetOrdersParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.list() - .then(({ orders, limit, offset, count }) => { console.log(orders.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET 'https://medusa-url.com/admin/orders' - \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/orders' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -8329,14 +8176,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/swaps/{swap_id}/process-payment': + /orders/{id}/swaps/{swap_id}/process-payment: post: operationId: PostOrdersOrderSwapsSwapProcessPayment summary: Process Swap Payment - description: >- - When there are differences between the returned and shipped Products in - a Swap, the difference must be processed. Either a Refund will be issued - or a Payment will be captured. + description: When there are differences between the returned and shipped Products in a Swap, the difference must be processed. Either a Refund will be issued or a Payment will be captured. x-authenticated: true parameters: - in: path @@ -8351,29 +8195,23 @@ paths: description: The ID of the Swap. schema: type: string + x-codegen: + method: processSwapPayment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.processSwapPayment(order_id, swap_id) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/swaps/{swap_id}/process-payment' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -8399,7 +8237,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/refund': + /orders/{id}/refund: post: operationId: PostOrdersOrderRefunds summary: Create a Refund @@ -8417,35 +8255,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderRefundsReq' + x-codegen: + method: refundPayment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.refundPayment(order_id, { amount: 1000, reason: 'Do not like it' }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/adasda/refund' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/adasda/refund' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "amount": 1000, "reason": "Do not like it" @@ -8474,13 +8305,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}/return': + /orders/{id}/return: post: operationId: PostOrdersOrderReturns summary: Request a Return - description: >- - Requests a Return. If applicable a return label will be created and - other plugins notified. + description: Requests a Return. If applicable a return label will be created and other plugins notified. x-authenticated: true parameters: - in: path @@ -8494,17 +8323,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderReturnsReq' + x-codegen: + method: requestReturn x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.requestReturn(order_id, { items: [ { @@ -8513,20 +8340,15 @@ paths: } ] }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/return' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/return' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "items": [ { @@ -8560,7 +8382,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order/{id}/claims/{claim_id}': + /order/{id}/claims/{claim_id}: post: operationId: PostOrdersOrderClaimsClaim summary: Update a Claim @@ -8584,34 +8406,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostOrdersOrderClaimsClaimReq' + x-codegen: + method: updateClaim x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.orders.updateClaim(order_id, claim_id, { no_notification: true }) - .then(({ order }) => { console.log(order.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/orders/{id}/claims/{claim_id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "no_notification": true }' @@ -8639,7 +8454,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}': + /payment-collections/{id}: delete: operationId: DeletePaymentCollectionsPaymentCollection summary: Del a PaymentCollection @@ -8652,27 +8467,23 @@ paths: description: The ID of the Payment Collection to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/payment-collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -8712,27 +8523,24 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/payment-collections/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -8775,17 +8583,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminUpdatePaymentCollectionsReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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" }) @@ -8794,14 +8600,10 @@ paths: }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/payment-collections/{id}' \ - + 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" }' @@ -8829,7 +8631,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/authorize': + /payment-collections/{id}/authorize: post: operationId: PostPaymentCollectionsPaymentCollectionAuthorize summary: Mark Authorized @@ -8842,27 +8644,23 @@ paths: description: The ID of the PaymentCollection. schema: type: string + x-codegen: + method: markAsAuthorized x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/payment-collections/{id}/authorize' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -8888,7 +8686,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payments/{id}/capture': + /payments/{id}/capture: post: operationId: PostPaymentsPaymentCapture summary: Capture a Payment @@ -8901,28 +8699,23 @@ paths: description: The ID of the Payment. schema: type: string + x-codegen: + method: capturePayment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/payments/{id}/capture' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -8948,7 +8741,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payments/{id}': + /payments/{id}: get: operationId: GetPaymentsPayment summary: Get Payment details @@ -8961,28 +8754,24 @@ paths: description: The ID of the Payment. schema: type: string + x-codegen: + method: retrieve + queryParams: GetPaymentsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/payments/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -9008,7 +8797,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payments/{id}/refund': + /payments/{id}/refund: post: operationId: PostPaymentsPaymentRefunds summary: Create a Refund @@ -9026,36 +8815,29 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPaymentRefundsReq' + x-codegen: + method: refundPayment x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + 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", @@ -9085,7 +8867,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/prices/batch': + /price-lists/{id}/prices/batch: post: operationId: PostPriceListsPriceListPricesBatch summary: Update Prices @@ -9103,17 +8885,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPriceListPricesPricesReq' + x-codegen: + method: addPrices x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.addPrices(price_list_id, { prices: [ { @@ -9123,20 +8903,15 @@ paths: } ] }) - .then(({ price_list }) => { console.log(price_list.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "prices": [ { @@ -9179,9 +8954,7 @@ paths: - in: path name: id required: true - description: >- - The ID of the Price List that the Money Amounts (Prices) that will - be deleted belongs to. + description: The ID of the Price List that the Money Amounts (Prices) that will be deleted belongs to. schema: type: string requestBody: @@ -9189,36 +8962,29 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeletePriceListPricesPricesReq' + x-codegen: + method: deletePrices x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.deletePrices(price_list_id, { price_ids: [ price_id ] }) - .then(({ ids, object, deleted }) => { console.log(ids.length); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/prices/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "price_ids": [ "adasfa" @@ -9259,19 +9025,16 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPriceListsPriceListReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - import { PriceListType } from "@medusajs/medusa" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.create({ name: 'New Price List', description: 'A new price list', @@ -9284,20 +9047,15 @@ paths: } ] }) - .then(({ price_list }) => { console.log(price_list.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/price-lists' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "New Price List", "description": "A new price list", @@ -9354,9 +9112,7 @@ paths: default: '0' - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each item of - the result. + description: (Comma separated) Which fields should be expanded in each item of the result. schema: type: string - in: query @@ -9371,9 +9127,7 @@ paths: type: string - in: query name: q - description: >- - query to search in price list description, price list name, and - customer group name fields. + description: query to search in price list description, price list name, and customer group name fields. schema: type: string - in: query @@ -9480,28 +9234,24 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetPriceListPaginationParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.list() - .then(({ price_lists, limit, offset, count }) => { console.log(price_lists.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/price-lists' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -9527,7 +9277,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}': + /price-lists/{id}: delete: operationId: DeletePriceListsPriceList summary: Delete a Price List @@ -9540,28 +9290,23 @@ paths: description: The ID of the Price List to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.delete(price_list_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -9599,28 +9344,23 @@ paths: description: The ID of the Price List. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.retrieve(price_list_id) - .then(({ price_list }) => { console.log(price_list.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/price-lists/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -9663,34 +9403,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostPriceListsPriceListPriceListReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.update(price_list_id, { name: 'New Price List' }) - .then(({ price_list }) => { console.log(price_list.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/price-lists/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/price-lists/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "New Price List" }' @@ -9718,7 +9451,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/products/{product_id}/prices': + /price-lists/{id}/products/{product_id}/prices: delete: operationId: DeletePriceListsPriceListProductsProductPrices summary: Delete Product's Prices @@ -9728,9 +9461,7 @@ paths: - in: path name: id required: true - description: >- - The ID of the Price List that the Money Amounts that will be deleted - belongs to. + description: The ID of the Price List that the Money Amounts that will be deleted belongs to. schema: type: string - in: path @@ -9739,30 +9470,23 @@ paths: description: The ID of the product from which the money amount will be deleted. schema: type: string + x-codegen: + method: deleteProductPrices x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.priceLists.deleteProductPrices(price_list_id, - product_id) - + medusa.admin.priceLists.deleteProductPrices(price_list_id, product_id) .then(({ ids, object, deleted }) => { console.log(ids.length); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/products/{product_id}/prices' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -9788,7 +9512,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/variants/{variant_id}/prices': + /price-lists/{id}/variants/{variant_id}/prices: delete: operationId: DeletePriceListsPriceListVariantsVariantPrices summary: Delete Variant's Prices @@ -9798,9 +9522,7 @@ paths: - in: path name: id required: true - description: >- - The ID of the Price List that the Money Amounts that will be deleted - belongs to. + description: The ID of the Price List that the Money Amounts that will be deleted belongs to. schema: type: string - in: path @@ -9809,30 +9531,23 @@ paths: description: The ID of the variant from which the money amount will be deleted. schema: type: string + x-codegen: + method: deleteVariantPrices x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.priceLists.deleteVariantPrices(price_list_id, - variant_id) - + medusa.admin.priceLists.deleteVariantPrices(price_list_id, variant_id) .then(({ ids, object, deleted }) => { console.log(ids); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/price-lists/{id}/variants/{variant_id}/prices' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -9858,7 +9573,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/price-lists/{id}/products': + /price-lists/{id}/products: get: operationId: GetPriceListsPriceListProducts summary: List Products @@ -9873,9 +9588,7 @@ paths: type: string - in: query name: q - description: >- - Query used for searching product title and description, variant - title and sku, and collection title. + description: Query used for searching product title and description, variant title and sku, and collection title. schema: type: string - in: query @@ -10025,40 +9738,32 @@ paths: default: 50 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. + description: (Comma separated) Which fields should be expanded in each product of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + description: (Comma separated) Which fields should be included in each product of the result. schema: type: string + x-codegen: + method: listProducts + queryParams: AdminGetPriceListsPriceListProductsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.priceLists.listProducts(price_list_id) - .then(({ products, limit, offset, count }) => { console.log(products.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/price-lists/{id}/products' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/price-lists/{id}/products' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -10084,45 +9789,67 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - /product-categories: + /product-categories/{id}/products/batch: post: - operationId: PostProductCategories - summary: Create a Product Category - description: Creates a Product Category. + 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) Which fields should be expanded in each product - category. + description: (Comma separated) Category fields to be expanded in the response. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be retrieved in each product - category. + description: (Comma separated) Category fields to be retrieved in the response. schema: type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/AdminPostProductCategoriesReq' + $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' \ - + 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 '{ - "name": "Jeans", + "product_ids": [ + { + "id": "{product_id}" + } + ] }' security: - api_token: [] @@ -10135,10 +9862,162 @@ paths: content: application/json: schema: - type: object - properties: - product_category: - $ref: '#/components/schemas/ProductCategory' + $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': @@ -10191,25 +10070,32 @@ paths: default: 100 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in the product - category. + 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. + 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -10222,21 +10108,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/AdminProductCategoriesListRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10249,7 +10121,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/product-categories/{id}': + /product-categories/{id}: delete: operationId: DeleteProductCategoriesCategory summary: Delete a Product Category @@ -10262,13 +10134,23 @@ paths: 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}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -10281,21 +10163,7 @@ paths: content: application/json: schema: - 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 the product category was deleted successfully or - not. - default: true + $ref: '#/components/schemas/AdminProductCategoriesCategoryDeleteRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10320,13 +10188,34 @@ paths: 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -10339,10 +10228,7 @@ paths: content: application/json: schema: - type: object - properties: - product_category: - $ref: '#/components/schemas/ProductCategory' + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10369,16 +10255,12 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each product - category. + 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. + description: (Comma separated) Which fields should be retrieved in each product category. schema: type: string requestBody: @@ -10386,17 +10268,28 @@ paths: 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}' \ - + 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" }' @@ -10411,10 +10304,7 @@ paths: content: application/json: schema: - type: object - properties: - product_category: - $ref: '#/components/schemas/ProductCategory' + $ref: '#/components/schemas/AdminProductCategoriesCategoryRes' '400': $ref: '#/components/responses/400_error' '401': @@ -10523,28 +10413,24 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetProductTagsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.productTags.list() - .then(({ product_tags }) => { console.log(product_tags.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/product-tags' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-tags' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -10666,28 +10552,24 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.productTypes.list() - .then(({ product_types }) => { console.log(product_types.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/product-types' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-types' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -10713,7 +10595,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/options': + /products/{id}/options: post: operationId: PostProductsProductOptions summary: Add an Option @@ -10731,34 +10613,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductOptionsReq' + x-codegen: + method: addOption x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.addOption(product_id, { title: 'Size' }) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/options' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "Size" }' @@ -10797,36 +10672,29 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.create({ title: 'Shirt', is_giftcard: false, discountable: true }) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/products' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/products' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "Shirt" }' @@ -10862,9 +10730,7 @@ paths: parameters: - in: query name: q - description: >- - Query used for searching product title and description, variant - title and sku, and collection title. + description: Query used for searching product title and description, variant title and sku, and collection title. schema: type: string - in: query @@ -10944,6 +10810,20 @@ paths: type: array items: type: string + - in: query + name: category_id + style: form + explode: false + description: Category IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id + schema: + type: boolean - in: query name: title description: title to search for. @@ -11044,16 +10924,12 @@ paths: default: 50 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each product of - the result. + description: (Comma separated) Which fields should be expanded in each product of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each product of - the result. + description: (Comma separated) Which fields should be included in each product of the result. schema: type: string - in: query @@ -11061,28 +10937,24 @@ paths: description: the field used to order the products. schema: type: string + x-codegen: + method: list + queryParams: AdminGetProductsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.list() - .then(({ products, limit, offset, count }) => { console.log(products.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/products' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/products' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11108,13 +10980,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/variants': + /products/{id}/variants: post: operationId: PostProductsProductVariants summary: Create a Product Variant - description: >- - Creates a Product Variant. Each Product Variant must have a unique - combination of Product Option Values. + description: Creates a Product Variant. Each Product Variant must have a unique combination of Product Option Values. x-authenticated: true parameters: - in: path @@ -11128,17 +10998,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductVariantsReq' + x-codegen: + method: createVariant x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.createVariant(product_id, { title: 'Color', prices: [ @@ -11155,20 +11023,15 @@ paths: ], inventory_quantity: 100 }) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/variants' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/variants' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "Color", "prices": [ @@ -11242,13 +11105,14 @@ paths: schema: type: integer default: 100 + x-codegen: + method: listVariants + queryParams: AdminGetProductsVariantsParams x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/{id}/variants' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/{id}/variants' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11274,15 +11138,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/options/{option_id}': + /products/{id}/options/{option_id}: delete: operationId: DeleteProductsProductOptionsOption summary: Delete a Product Option - description: >- - Deletes a Product Option. Before a Product Option can be deleted all - Option Values for the Product Option must be the same. You may, for - example, have to delete some of your variants prior to deleting the - Product Option + description: Deletes a Product Option. Before a Product Option can be deleted all Option Values for the Product Option must be the same. You may, for example, have to delete some of your variants prior to deleting the Product Option x-authenticated: true parameters: - in: path @@ -11297,28 +11157,23 @@ paths: description: The ID of the Product Option. schema: type: string + x-codegen: + method: deleteOption x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.deleteOption(product_id, option_id) - .then(({ option_id, object, delete, product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11367,34 +11222,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductOptionsOption' + x-codegen: + method: updateOption x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.updateOption(product_id, option_id, { title: 'Size' }) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/options/{option_id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "Size" }' @@ -11422,7 +11270,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}': + /products/{id}: delete: operationId: DeleteProductsProduct summary: Delete a Product @@ -11435,28 +11283,23 @@ paths: description: The ID of the Product. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.delete(product_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/asfsaf' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/asfsaf' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11494,28 +11337,23 @@ paths: description: The ID of the Product. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.retrieve(product_id) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11558,35 +11396,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.update(product_id, { title: 'Shirt', images: [] }) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "Size" }' @@ -11614,7 +11445,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/variants/{variant_id}': + /products/{id}/variants/{variant_id}: delete: operationId: DeleteProductsProductVariantsVariant summary: Delete a Product Variant @@ -11633,28 +11464,23 @@ paths: description: The ID of the Product Variant. schema: type: string + x-codegen: + method: deleteVariant x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.deleteVariant(product_id, variant_id) - .then(({ variant_id, object, deleted, product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/products/{id}/variants/{variant_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11703,17 +11529,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductVariantsVariantReq' + x-codegen: + method: updateVariant x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.updateVariant(product_id, variant_id, { title: 'Color', prices: [ @@ -11730,20 +11554,15 @@ paths: ], inventory_quantity: 100 }) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/asfsaf/variants/saaga' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "Color", "prices": [ @@ -11783,28 +11602,23 @@ paths: summary: List Tags Usage Number description: Retrieves a list of Product Tags with how many times each is used. x-authenticated: true + x-codegen: + method: listTags x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.listTags() - .then(({ tags }) => { console.log(tags.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/tag-usage' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/tag-usage' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11837,28 +11651,23 @@ paths: summary: List Product Types description: Retrieves a list of Product Types. x-authenticated: true + x-codegen: + method: listTypes x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.listTypes() - .then(({ types }) => { console.log(types.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/products/types' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/products/types' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -11884,7 +11693,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}/metadata': + /products/{id}/metadata: post: operationId: PostProductsProductMetadata summary: Set Product Metadata @@ -11902,36 +11711,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostProductsProductMetadataReq' + x-codegen: + method: setMetadata x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.products.setMetadata(product_id, { - key: 'test', value: 'true' }) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/products/{id}/metadata' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/products/{id}/metadata' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "key": "test", "value": "true" @@ -11960,7 +11761,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/publishable-api-keys/{id}/sales-channels/batch': + /publishable-api-keys/{id}/sales-channels/batch: post: operationId: PostPublishableApiKeySalesChannelsChannelsBatch summary: Add SalesChannels @@ -11977,41 +11778,32 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq + $ref: '#/components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq' + x-codegen: + method: addSalesChannelsBatch x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, - { + medusa.admin.publishableApiKeys.addSalesChannelsBatch(publishableApiKeyId, { sales_channel_ids: [ { id: channel_id } ] }) - .then(({ publishable_api_key }) => { console.log(publishable_api_key.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pak_id}/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "sales_channel_ids": [ { @@ -12059,41 +11851,32 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq + $ref: '#/components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq' + x-codegen: + method: deleteSalesChannelsBatch x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, - { + medusa.admin.publishableApiKeys.deleteSalesChannelsBatch(publishableApiKeyId, { sales_channel_ids: [ { id: channel_id } ] }) - .then(({ publishable_api_key }) => { console.log(publishable_api_key.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "sales_channel_ids": [ { @@ -12136,34 +11919,27 @@ paths: schema: $ref: '#/components/schemas/AdminPostPublishableApiKeysReq' x-authenticated: true + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.publishableApiKeys.create({ title }) - .then(({ publishable_api_key }) => { console.log(publishable_api_key.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/publishable-api-keys' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "Web API Key" }' @@ -12224,27 +12000,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: list + queryParams: GetPublishableApiKeysParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.publishableApiKeys.list() .then(({ publishable_api_keys, count, limit, offset }) => { console.log(publishable_api_keys) }) - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/publishable-api-keys' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -12270,7 +12043,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/publishable-api-keys/{id}': + /publishable-api-keys/{id}: delete: operationId: DeletePublishableApiKeysPublishableApiKey summary: Delete PublishableApiKey @@ -12283,28 +12056,23 @@ paths: description: The ID of the PublishableApiKeys to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.publishableApiKeys.delete(publishableApiKeyId) - .then(({ id, object, deleted }) => { console.log(id) }) - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -12332,28 +12100,23 @@ paths: schema: type: string x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.publishableApiKeys.retrieve(publishableApiKeyId) - .then(({ publishable_api_key }) => { console.log(publishable_api_key.id) }) - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -12379,7 +12142,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/publishable-api-keys/{id}/sales-channels': + /publishable-api-keys/{id}/sales-channels: get: operationId: GetPublishableApiKeySalesChannels summary: List SalesChannels @@ -12397,28 +12160,24 @@ paths: description: Query used for searching sales channels' names and descriptions. schema: type: string + x-codegen: + method: listSalesChannels + queryParams: GetPublishableApiKeySalesChannelsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.publishableApiKeys.listSalesChannels() .then(({ sales_channels }) => { console.log(sales_channels.length) }) - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' - \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/sales-channels' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -12431,8 +12190,7 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPublishableApiKeysListSalesChannelsRes + $ref: '#/components/schemas/AdminPublishableApiKeysListSalesChannelsRes' '400': $ref: '#/components/responses/400_error' '401': @@ -12445,7 +12203,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/publishable-api-keys/{id}/revoke': + /publishable-api-keys/{id}/revoke: post: operationId: PostPublishableApiKeysPublishableApiKeyRevoke summary: Revoke PublishableApiKey @@ -12458,28 +12216,23 @@ paths: schema: type: string x-authenticated: true + x-codegen: + method: revoke x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.publishableApiKeys.revoke(publishableApiKeyId) .then(({ publishable_api_key }) => { console.log(publishable_api_key.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-keys/{pka_id}/revoke' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -12505,7 +12258,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/publishable-api-key/{id}': + /publishable-api-key/{id}: post: operationId: PostPublishableApiKysPublishableApiKey summary: Update PublishableApiKey @@ -12522,36 +12275,28 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq + $ref: '#/components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.publishableApiKeys.update(publishableApiKeyId, { title: "new title" }) - .then(({ publishable_api_key }) => { console.log(publishable_api_key.id) }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/publishable-api-key/{pka_id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "title": "new title" }' @@ -12579,7 +12324,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/countries': + /regions/{id}/countries: post: operationId: PostRegionsRegionCountries summary: Add Country @@ -12597,34 +12342,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsRegionCountriesReq' + x-codegen: + method: addCountry x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.addCountry(region_id, { country_code: 'dk' }) - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/regions/{region_id}/countries' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{region_id}/countries' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "country_code": "dk" }' @@ -12652,7 +12390,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/fulfillment-providers': + /regions/{id}/fulfillment-providers: post: operationId: PostRegionsRegionFulfillmentProviders summary: Add Fulfillment Provider @@ -12669,36 +12407,28 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq + $ref: '#/components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq' + x-codegen: + method: addFulfillmentProvider x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.addFulfillmentProvider(region_id, { provider_id: 'manual' }) - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "provider_id": "manual" }' @@ -12726,7 +12456,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/payment-providers': + /regions/{id}/payment-providers: post: operationId: PostRegionsRegionPaymentProviders summary: Add Payment Provider @@ -12744,34 +12474,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsRegionPaymentProvidersReq' + x-codegen: + method: addPaymentProvider x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.addPaymentProvider(region_id, { provider_id: 'manual' }) - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}/payment-providers' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "provider_id": "manual" }' @@ -12810,17 +12533,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.create({ name: 'Europe', currency_code: 'eur', @@ -12835,20 +12556,15 @@ paths: 'DK' ] }) - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/regions' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "Europe", "currency_code": "eur", @@ -12912,47 +12628,37 @@ paths: schema: type: object required: false - description: >- - Date comparison for when resulting region was created, i.e. less - than, greater than etc. + description: Date comparison for when resulting region was created, i.e. less than, greater than etc. - in: query name: updated_at schema: type: object required: false - description: >- - Date comparison for when resulting region was updated, i.e. less - than, greater than etc. + description: Date comparison for when resulting region was updated, i.e. less than, greater than etc. - in: query name: deleted_at schema: type: object required: false - description: >- - Date comparison for when resulting region was deleted, i.e. less - than, greater than etc. + description: Date comparison for when resulting region was deleted, i.e. less than, greater than etc. + x-codegen: + method: list + queryParams: AdminGetRegionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.list() - .then(({ regions, limit, offset, count }) => { console.log(regions.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET 'https://medusa-url.com/admin/regions' - \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -12978,7 +12684,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}': + /regions/{id}: delete: operationId: DeleteRegionsRegion summary: Delete a Region @@ -12991,28 +12697,23 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.delete(region_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13050,28 +12751,23 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.retrieve(region_id) - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/regions/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13114,34 +12810,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostRegionsRegionReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.update(region_id, { name: 'Europe' }) - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/regions/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/regions/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "Europe" }' @@ -13169,7 +12858,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/fulfillment-options': + /regions/{id}/fulfillment-options: get: operationId: GetRegionsRegionFulfillmentOptions summary: List Fulfillment Options @@ -13182,28 +12871,23 @@ paths: description: The ID of the Region. schema: type: string + x-codegen: + method: retrieveFulfillmentOptions x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.retrieveFulfillmentOptions(region_id) - .then(({ fulfillment_options }) => { console.log(fulfillment_options.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/regions/{id}/fulfillment-options' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13216,8 +12900,7 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes + $ref: '#/components/schemas/AdminGetRegionsRegionFulfillmentOptionsRes' '400': $ref: '#/components/responses/400_error' '401': @@ -13230,7 +12913,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/countries/{country_code}': + /regions/{id}/countries/{country_code}: delete: operationId: PostRegionsRegionCountriesCountry summary: Delete Country @@ -13250,30 +12933,25 @@ paths: schema: type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. + x-codegen: + method: deleteCountry x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.deleteCountry(region_id, 'dk') - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/countries/dk' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13299,7 +12977,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/fulfillment-providers/{provider_id}': + /regions/{id}/fulfillment-providers/{provider_id}: delete: operationId: PostRegionsRegionFulfillmentProvidersProvider summary: Del. Fulfillment Provider @@ -13318,29 +12996,23 @@ paths: description: The ID of the Fulfillment Provider. schema: type: string + x-codegen: + method: deleteFulfillmentProvider x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.deleteFulfillmentProvider(region_id, 'manual') - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/fulfillment-providers/manual' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13366,7 +13038,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}/payment-providers/{provider_id}': + /regions/{id}/payment-providers/{provider_id}: delete: operationId: PostRegionsRegionPaymentProvidersProvider summary: Delete Payment Provider @@ -13385,29 +13057,23 @@ paths: description: The ID of the Payment Provider. schema: type: string + x-codegen: + method: deletePaymentProvider x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.regions.deletePaymentProvider(region_id, 'manual') - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/regions/{id}/payment-providers/manual' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13437,9 +13103,7 @@ paths: post: operationId: PostReservations summary: Creates a Reservation - description: >- - Creates a Reservation which can be associated with any resource as - required. + description: Creates a Reservation which can be associated with any resource as required. x-authenticated: true requestBody: content: @@ -13449,31 +13113,21 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + 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", @@ -13550,14 +13204,10 @@ paths: description: filter by reservation quantity greater than this number lte: type: number - description: >- - filter by reservation quantity less than or equal to this - 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 + 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. @@ -13572,25 +13222,19 @@ paths: default: 20 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in the product - category. + 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. + 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/product-categories' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13616,7 +13260,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/reservations/{id}': + /reservations/{id}: delete: operationId: DeleteReservationsReservation summary: Delete a Reservation @@ -13632,25 +13276,18 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/reservations/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13703,25 +13340,18 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/reservations/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13750,9 +13380,7 @@ paths: post: operationId: PostReservationsReservation summary: Updates a Reservation - description: >- - Updates a Reservation which can be associated with any resource as - required. + description: Updates a Reservation which can be associated with any resource as required. x-authenticated: true parameters: - in: path @@ -13769,31 +13397,22 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + 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, }' @@ -13832,35 +13451,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostReturnReasonsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.returnReasons.create({ label: 'Damaged', value: 'damaged' }) - .then(({ return_reason }) => { console.log(return_reason.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/return-reasons' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/return-reasons' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "label": "Damaged", "value": "damaged" @@ -13894,28 +13506,23 @@ paths: summary: List Return Reasons description: Retrieves a list of Return Reasons. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.returnReasons.list() - .then(({ return_reasons }) => { console.log(return_reasons.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/return-reasons' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/return-reasons' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -13941,7 +13548,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/return-reasons/{id}': + /return-reasons/{id}: delete: operationId: DeleteReturnReason summary: Delete a Return Reason @@ -13954,28 +13561,23 @@ paths: description: The ID of the return reason schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.returnReasons.delete(return_reason_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/return-reasons/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -14013,28 +13615,23 @@ paths: description: The ID of the Return Reason. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.returnReasons.retrieve(return_reason_id) - .then(({ return_reason }) => { console.log(return_reason.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/return-reasons/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -14077,34 +13674,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostReturnReasonsReasonReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.returnReasons.update(return_reason_id, { label: 'Damaged' }) - .then(({ return_reason }) => { console.log(return_reason.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/return-reasons/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/return-reasons/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "label": "Damaged" }' @@ -14132,7 +13722,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/returns/{id}/cancel': + /returns/{id}/cancel: post: operationId: PostReturnsReturnCancel summary: Cancel a Return @@ -14144,28 +13734,23 @@ paths: description: The ID of the Return. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/returns/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -14209,28 +13794,24 @@ paths: schema: type: number default: '0' + x-codegen: + method: list + queryParams: AdminGetReturnsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' - \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/returns' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -14256,13 +13837,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/returns/{id}/receive': + /returns/{id}/receive: post: operationId: PostReturnsReturnReceive summary: Receive a Return - description: >- - Registers a Return as received. Updates statuses on Orders and Swaps - accordingly. + description: Registers a Return as received. Updates statuses on Orders and Swaps accordingly. parameters: - in: path name: id @@ -14275,17 +13854,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostReturnsReturnReceiveReq' + x-codegen: + method: receive x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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: [ { @@ -14294,20 +13871,15 @@ paths: } ] }) - .then((data) => { console.log(data.return.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/returns/{id}/receive' \ - + 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": [ { @@ -14340,7 +13912,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/sales-channels/{id}/products/batch': + /sales-channels/{id}/products/batch: post: operationId: PostSalesChannelsChannelProductsBatch summary: Add Products @@ -14357,19 +13929,16 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq + $ref: '#/components/schemas/AdminPostSalesChannelsChannelProductsBatchReq' + x-codegen: + method: addProducts x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.addProducts(sales_channel_id, { product_ids: [ { @@ -14377,20 +13946,15 @@ paths: } ] }) - .then(({ sales_channel }) => { console.log(sales_channel.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/sales-channels/afasf/products/batch' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/afasf/products/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "product_ids": [ { @@ -14438,19 +14002,16 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq + $ref: '#/components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq' + x-codegen: + method: removeProducts x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.removeProducts(sales_channel_id, { product_ids: [ { @@ -14458,20 +14019,15 @@ paths: } ] }) - .then(({ sales_channel }) => { console.log(sales_channel.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "product_ids": [ { @@ -14503,7 +14059,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/sales-channels/{id}/stock-locations': + /sales-channels/{id}/stock-locations: post: operationId: PostSalesChannelsSalesChannelStockLocation summary: Associate a stock location to a Sales Channel @@ -14520,36 +14076,28 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminPostSalesChannelsChannelStockLocationsReq + $ref: '#/components/schemas/AdminPostSalesChannelsChannelStockLocationsReq' + x-codegen: + method: addLocation x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.addLocation(sales_channel_id, { location_id: 'App' }) - .then(({ sales_channel }) => { console.log(sales_channel.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "locaton_id": "stock_location_id" }' @@ -14593,36 +14141,28 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq + $ref: '#/components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq' + x-codegen: + method: removeLocation x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.removeLocation(sales_channel_id, { location_id: 'App' }) - .then(({ sales_channel }) => { console.log(sales_channel.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "locaton_id": "stock_location_id" }' @@ -14661,35 +14201,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostSalesChannelsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.create({ name: 'App', description: 'Mobile app' }) - .then(({ sales_channel }) => { console.log(sales_channel.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/sales-channels' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "App" }' @@ -14828,40 +14361,32 @@ paths: default: 20 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each sales - channel of the result. + description: (Comma separated) Which fields should be expanded in each sales channel of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each sales - channel of the result. + description: (Comma separated) Which fields should be included in each sales channel of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetSalesChannelsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.list() - .then(({ sales_channels, limit, offset, count }) => { console.log(sales_channels.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/sales-channels' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/sales-channels' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -14887,7 +14412,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/sales-channels/{id}': + /sales-channels/{id}: delete: operationId: DeleteSalesChannelsSalesChannel summary: Delete a Sales Channel @@ -14900,28 +14425,23 @@ paths: description: The ID of the Sales channel. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.delete(sales_channel_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/sales-channels/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -14959,28 +14479,23 @@ paths: description: The ID of the Sales channel. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.retrieve(sales_channel_id) - .then(({ sales_channel }) => { console.log(sales_channel.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/sales-channels/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/sales-channels/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15023,34 +14538,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostSalesChannelsSalesChannelReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.salesChannels.update(sales_channel_id, { name: 'App' }) - .then(({ sales_channel }) => { console.log(sales_channel.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/sales-channels/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "App" }' @@ -15089,17 +14597,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingOptionsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingOptions.create({ name: 'PostFake', region_id: "saasf", @@ -15108,20 +14614,15 @@ paths: }, price_type: 'flat_rate' }) - .then(({ shipping_option }) => { console.log(shipping_option.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-options' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-options' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "PostFake", "region_id": "afasf", @@ -15174,28 +14675,24 @@ paths: schema: type: boolean description: Flag for fetching admin specific options + x-codegen: + method: list + queryParams: AdminGetShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingOptions.list() - .then(({ shipping_options, count }) => { console.log(shipping_options.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-options' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-options' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15221,7 +14718,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-options/{id}': + /shipping-options/{id}: delete: operationId: DeleteShippingOptionsOption summary: Delete a Shipping Option @@ -15234,28 +14731,23 @@ paths: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingOptions.delete(option_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-options/{option_id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/shipping-options/{option_id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15293,28 +14785,23 @@ paths: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingOptions.retrieve(option_id) - .then(({ shipping_option }) => { console.log(shipping_option.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-options/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-options/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15357,17 +14844,15 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingOptionsOptionReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingOptions.update(option_id, { name: 'PostFake', requirements: [ @@ -15378,20 +14863,15 @@ paths: } ] }) - .then(({ shipping_option }) => { console.log(shipping_option.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-options/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-options/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "requirements": [ { @@ -15435,34 +14915,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingProfilesReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingProfiles.create({ name: 'Large Products' }) - .then(({ shipping_profile }) => { console.log(shipping_profile.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "Large Products" }' @@ -15495,28 +14968,23 @@ paths: summary: List Shipping Profiles description: Retrieves a list of Shipping Profile. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingProfiles.list() - .then(({ shipping_profiles }) => { console.log(shipping_profiles.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15542,7 +15010,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-profiles/{id}': + /shipping-profiles/{id}: delete: operationId: DeleteShippingProfilesProfile summary: Delete a Shipping Profile @@ -15555,28 +15023,23 @@ paths: description: The ID of the Shipping Profile. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingProfiles.delete(profile_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/shipping-profiles/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15614,28 +15077,23 @@ paths: description: The ID of the Shipping Profile. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingProfiles.retrieve(profile_id) - .then(({ shipping_profile }) => { console.log(shipping_profile.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/shipping-profiles/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/shipping-profiles/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15677,34 +15135,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostShippingProfilesProfileReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.shippingProfiles.update(shipping_profile_id, { name: 'Large Products' }) - .then(({ shipping_profile }) => { console.log(shipping_profile.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/shipping-profiles/{id} \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/shipping-profiles/{id} \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "Large Products" }' @@ -15754,35 +15205,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostStockLocationsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.stockLocations.create({ name: 'Main Warehouse', location_id: 'sloc' }) - .then(({ stock_location }) => { console.log(stock_location.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/stock-locations' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/stock-locations' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "App" }' @@ -15911,40 +15355,32 @@ paths: default: 20 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each stock - location of the result. + description: (Comma separated) Which fields should be expanded in each stock location of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each stock - location of the result. + description: (Comma separated) Which fields should be included in each stock location of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetStockLocationsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.stockLocations.list() - .then(({ stock_locations, limit, offset, count }) => { console.log(stock_locations.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/stock-locations' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/stock-locations' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -15970,7 +15406,61 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/stock-locations/{id}': + /stock-locations/{id}: + delete: + operationId: DeleteStockLocationsStockLocation + summary: Delete a Stock Location + description: Delete a Stock Location + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.stockLocations.delete(stock_location_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) + - lang: Shell + label: cURL + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/stock-locations/{id}' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - StockLocation + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + format: stock_location + deleted: + type: boolean + description: Whether or not the Stock Location was deleted. + default: true + '400': + $ref: '#/components/responses/400_error' get: operationId: GetStockLocationsStockLocation summary: Get a Stock Location @@ -15993,28 +15483,24 @@ paths: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetStockLocationsLocationParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.stockLocations.retrieve(stock_location_id) - .then(({ stock_location }) => { console.log(stock_location.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/stock-locations/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/stock-locations/{id}' \ --header 'Authorization: Bearer {api_token}' \ security: - api_token: [] @@ -16055,34 +15541,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostStockLocationsLocationReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.stockLocations.update(stock_location_id, { name: 'App' }) - .then(({ stock_location }) => { console.log(stock_location.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/stock-locations/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "App" }' @@ -16110,7 +15589,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/store/currencies/{code}': + /store/currencies/{code}: post: operationId: PostStoreCurrenciesCode summary: Add a Currency Code @@ -16124,30 +15603,25 @@ paths: schema: type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/store/currencies/eur' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -16186,30 +15660,25 @@ paths: schema: type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/store/currencies/eur' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -16241,19 +15710,16 @@ paths: summary: Get Store details description: Retrieves the Store details x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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); }); @@ -16296,34 +15762,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostStoreReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' - \ - + 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" }' @@ -16357,28 +15816,23 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/store/payment-providers' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -16410,28 +15864,23 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/store/tax-providers' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -16457,7 +15906,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/swaps/{id}': + /swaps/{id}: get: operationId: GetSwapsSwap summary: Get a Swap @@ -16470,28 +15919,23 @@ paths: description: The ID of the Swap. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/swaps/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -16536,19 +15980,17 @@ paths: type: number default: '0' x-authenticated: true + x-codegen: + method: list + queryParams: AdminGetSwapsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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); }); @@ -16581,7 +16023,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/tax-rates/{id}/product-types/batch': + /tax-rates/{id}/product-types/batch: post: operationId: PostTaxRatesTaxRateProductTypes summary: Add to Product Types @@ -16617,36 +16059,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductTypesReq' + x-codegen: + method: addProductTypes + queryParams: AdminPostTaxRatesTaxRateProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.addProductTypes(tax_rate_id, { product_types: [ product_type_id ] }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "product_types": [ "{product_type_id}" @@ -16711,36 +16147,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq' + x-codegen: + method: removeProductTypes + queryParams: AdminDeleteTaxRatesTaxRateProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.removeProductTypes(tax_rate_id, { product_types: [ product_type_id ] }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/product-types/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "product_types": [ "{product_type_id}" @@ -16770,7 +16200,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/tax-rates/{id}/products/batch': + /tax-rates/{id}/products/batch: post: operationId: PostTaxRatesTaxRateProducts summary: Add to Products @@ -16806,36 +16236,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateProductsReq' + x-codegen: + method: addProducts + queryParams: AdminPostTaxRatesTaxRateProductsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.addProducts(tax_rate_id, { products: [ product_id ] }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "products": [ "{product_id}" @@ -16900,36 +16324,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateProductsReq' + x-codegen: + method: removeProducts + queryParams: AdminDeleteTaxRatesTaxRateProductsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.removeProducts(tax_rate_id, { products: [ product_id ] }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/products/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "products": [ "{product_id}" @@ -16959,7 +16377,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/tax-rates/{id}/shipping-options/batch': + /tax-rates/{id}/shipping-options/batch: post: operationId: PostTaxRatesTaxRateShippingOptions summary: Add to Shipping Options @@ -16995,37 +16413,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: addShippingOptions + queryParams: AdminPostTaxRatesTaxRateShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.addShippingOptions(tax_rate_id, { shipping_options: [ shipping_option_id ] }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "shipping_options": [ "{shipping_option_id}" @@ -17089,39 +16500,31 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq + $ref: '#/components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq' + x-codegen: + method: removeShippingOptions + queryParams: AdminDeleteTaxRatesTaxRateShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.removeShippingOptions(tax_rate_id, { shipping_options: [ shipping_option_id ] }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}/shipping-options/batch' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "shipping_options": [ "{shipping_option_id}" @@ -17181,36 +16584,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesReq' + x-codegen: + method: create + queryParams: AdminPostTaxRatesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.create({ code: 'TEST', name: 'New Tax Rate', region_id }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/tax-rates' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "code": "TEST", "name": "New Tax Rate", @@ -17319,28 +16716,24 @@ paths: type: array items: type: string + x-codegen: + method: list + queryParams: AdminGetTaxRatesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.list() - .then(({ tax_rates, limit, offset, count }) => { console.log(tax_rates.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/tax-rates' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/tax-rates' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -17366,7 +16759,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/tax-rates/{id}': + /tax-rates/{id}: delete: operationId: DeleteTaxRatesTaxRate summary: Delete a Tax Rate @@ -17379,28 +16772,23 @@ paths: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.delete(tax_rate_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/tax-rates/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/tax-rates/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -17456,28 +16844,24 @@ paths: items: type: string x-authenticated: true + x-codegen: + method: retrieve + queryParams: AdminGetTaxRatesTaxRateParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.retrieve(tax_rate_id) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/tax-rates/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/tax-rates/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -17538,34 +16922,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminPostTaxRatesTaxRateReq' + x-codegen: + method: update + queryParams: AdminPostTaxRatesTaxRateParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.taxRates.update(tax_rate_id, { name: 'New Tax Rate' }) - .then(({ tax_rate }) => { console.log(tax_rate.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/tax-rates/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/tax-rates/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "name": "New Tax Rate" }' @@ -17597,9 +16975,7 @@ paths: post: operationId: PostUploadsProtected summary: Protected File Upload - description: >- - Uploads at least one file with ACL or a non-public bucket to the - specific fileservice that is installed in Medusa. + description: Uploads at least one file with ACL or a non-public bucket to the specific fileservice that is installed in Medusa. x-authenticated: true requestBody: content: @@ -17613,31 +16989,21 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.uploads.createProtected(file) - .then(({ uploads }) => { console.log(uploads.length); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/uploads/protected' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads/protected' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: image/jpeg' \ - --form 'files=@""' \ - --form 'files=@""' security: - api_token: [] @@ -17667,9 +17033,7 @@ paths: post: operationId: PostUploads summary: Upload files - description: >- - Uploads at least one file to the specific fileservice that is installed - in Medusa. + description: Uploads at least one file to the specific fileservice that is installed in Medusa. x-authenticated: true requestBody: content: @@ -17683,31 +17047,21 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.uploads.create(file) - .then(({ uploads }) => { console.log(uploads.length); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/uploads' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: image/jpeg' \ - --form 'files=@""' \ - --form 'files=@""' security: - api_token: [] @@ -17746,31 +17100,22 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.uploads.delete({ file_key }) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/uploads' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/uploads' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "file_key": "{file_key}" }' @@ -17812,31 +17157,22 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.uploads.getPresignedDownloadUrl({ file_key }) - .then(({ download_url }) => { console.log(download_url); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/uploads/download-url' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/uploads/download-url' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "file_key": "{file_key}" }' @@ -17875,35 +17211,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminCreateUserRequest' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.users.create({ email: 'user@example.com', password: 'supersecret' }) - .then(({ user }) => { console.log(user.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST 'https://medusa-url.com/admin/users' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/users' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com", "password": "supersecret" @@ -17937,19 +17266,16 @@ paths: summary: List Users description: Retrieves all users. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.users.list() - .then(({ users }) => { console.log(users.length); }); @@ -17982,7 +17308,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/users/{id}': + /users/{id}: delete: operationId: DeleteUsersUser summary: Delete a User @@ -17995,28 +17321,23 @@ paths: description: The ID of the User. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.users.delete(user_id) - .then(({ id, object, deleted }) => { console.log(id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/admin/users/{id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/admin/users/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -18054,28 +17375,23 @@ paths: description: The ID of the User. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.users.retrieve(user_id) - .then(({ user }) => { console.log(user.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/users/{id}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/users/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -18118,34 +17434,27 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminUpdateUserRequest' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.users.update(user_id, { first_name: 'Marcellus' }) - .then(({ user }) => { console.log(user.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/users/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/{id}' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "first_name": "Marcellus" }' @@ -18184,38 +17493,30 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminResetPasswordTokenRequest' + x-codegen: + method: sendResetPasswordToken x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.users.sendResetPasswordToken({ email: 'user@example.com' }) - .then(() => { // successful }) - .catch(() => { // error occurred }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/users/password-token' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/password-token' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com" }' @@ -18250,35 +17551,28 @@ paths: application/json: schema: $ref: '#/components/schemas/AdminResetPasswordRequest' + x-codegen: + method: resetPassword x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.users.resetPassword({ token: 'supersecrettoken', password: 'supersecret' }) - .then(({ user }) => { console.log(user.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/admin/users/reset-password' \ - + source: | + curl --location --request POST 'https://medusa-url.com/admin/users/reset-password' \ --header 'Authorization: Bearer {api_token}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "token": "supersecrettoken", "password": "supersecret" @@ -18307,6 +17601,65 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /variants/{id}/inventory: + get: + operationId: GetVariantsVariantInventory + summary: Get inventory of Variant. + description: Returns the available inventory of a Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Product Variant id to get inventory for. + schema: + type: string + x-codegen: + method: getInventory + x-codeSamples: + - lang: JavaScript + label: JS Client + source: | + import Medusa from "@medusajs/medusa-js" + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + // must be previously logged in or use api token + medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length) + }) + - lang: Shell + label: cURL + source: | + curl --location --request GET 'https://medusa-url.com/admin/variants' \ + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + variant: + type: object + $ref: '#/components/schemas/AdminGetVariantsVariantInventoryRes' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /variants: get: operationId: GetVariants @@ -18397,36 +17750,28 @@ paths: description: filter by inventory quantity greater than this number lte: type: number - description: >- - filter by inventory quantity less than or equal to this - number + description: filter by inventory quantity less than or equal to this number gte: type: number - description: >- - filter by inventory quantity greater than or equal to this - number + description: filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: AdminGetVariantsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.admin.variants.list() - .then(({ variants, limit, offset, count }) => { console.log(variants.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/admin/variants' \ - + source: | + curl --location --request GET 'https://medusa-url.com/admin/variants' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -18472,9 +17817,7 @@ components: $ref: '#/components/schemas/Error' example: code: unknown_error - message: >- - The request conflicted with another request. You may retry the - request with the provided Idempotency-Key. + message: The request conflicted with another request. You may retry the request with the provided Idempotency-Key. type: QueryRunnerAlreadyReleasedError invalid_request_error: description: Invalid Request Error @@ -18555,9 +17898,7 @@ components: multiple_errors: summary: Multiple Errors value: - message: >- - Provided request body contains errors. Please check the data and retry - the request + message: Provided request body contains errors. Please check the data and retry the request errors: - message: first_name must be a string type: invalid_data @@ -18589,88 +17930,49 @@ components: api_token: type: http x-displayName: API Token - description: > + description: | Use a user's API Token to send authenticated requests. - ### How to Add API Token to a User + At the moment, there's no direct way of adding an API Token for a user. The only way it can be done is through directly editing the database. - At the moment, there's no direct way of adding an API Token for a user. - The only way it can be done is through directly editing the database. - - - If you're using a PostgreSQL database, you can run the following - commands in your command line to add API token: - + If you're using a PostgreSQL database, you can run the following commands in your command line to add API token: ```bash - psql -d -U - - UPDATE public.user SET api_token='' WHERE - email=''; - + UPDATE public.user SET api_token='' WHERE email=''; ``` - Where: - - - `` is the name of the database schema you use for the Medusa - server. - - - `` is the name of the user that has privileges over the - database schema. - - - `` is the API token you want to associate with the user. - You can use [this tool to generate a random - token](https://randomkeygen.com/). - - - `` is the email address of the admin user you want to have - this API token. - + - `` is the name of the database schema you use for the Medusa server. + - `` is the name of the user that has privileges over the database schema. + - `` is the API token you want to associate with the user. You can use [this tool to generate a random token](https://randomkeygen.com/). + - `` is the email address of the admin user you want to have this API token. ### How to Use the API Token - - The API token can be used for Bearer Authentication. It's passed in the - `Authorization` header as the following: - + The API token can be used for Bearer Authentication. It's passed in the `Authorization` header as the following: ``` - Authorization: Bearer {api_token} - ``` + In this API reference, you'll find in the cURL request samples the use of `{api_token}`. This is where you must pass the API token. - In this API reference, you'll find in the cURL request samples the use - of `{api_token}`. This is where you must pass the API token. - - - If you're following along with the JS Client request samples, you must - provide the `apiKey` option when creating the Medusa client: - + If you're following along with the JS Client request samples, you must provide the `apiKey` option when creating the Medusa client: ```ts - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, - apiKey: '{api_token}' }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3, apiKey: '{api_token}' }) ``` - - If you're using Medusa React, you can pass the `apiKey` prop to - `MedusaProvider`: - + If you're using Medusa React, you can pass the `apiKey` prop to `MedusaProvider`: ```tsx - - ``` scheme: bearer cookie_auth: @@ -18678,65 +17980,39 @@ components: in: cookie name: connect.sid x-displayName: Cookie Session ID - description: > + description: | Use a cookie session to send authenticated requests. - ### How to Obtain the Cookie Session + If you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the admin user is logged in. - If you're sending requests through a browser, using JS Client, or using - tools like Postman, the cookie session should be automatically set when - the admin user is logged in. - - - If you're sending requests using cURL, you must set the Session ID in - the cookie manually. - - - To do that, send a request to [authenticate the - user](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + If you're sending requests using cURL, you must set the Session ID in the cookie manually. + To do that, send a request to [authenticate the user](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: ```bash - curl -v --location --request POST 'https://medusa-url.com/admin/auth' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com", "password": "supersecret" }' - ``` - - The headers will be logged in the terminal as well as the response. You - should find in the headers a Cookie header similar to this: - + The headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this: ```bash - - Set-Cookie: - connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; - + Set-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; ``` - - Copy the value after `connect.sid` (without the `;` at the end) and pass - it as a cookie in subsequent requests as the following: - + Copy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following: ```bash - curl --location --request GET 'https://medusa-url.com/admin/products' \ - --header 'Cookie: connect.sid={sid}' - ``` - Where `{sid}` is the value of `connect.sid` that you copied. schemas: AddressFields: @@ -18772,8 +18048,7 @@ components: type: string description: The 2 character ISO code of the country in lower case externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. example: st province: @@ -18797,67 +18072,93 @@ components: title: Address description: An address. type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at properties: id: type: string description: ID of the address example: addr_01G8ZC9VS1XVE149MGH2J7QSSH customer_id: - type: string description: ID of the customer this address belongs to + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: Available if the relation `customer` is expanded. - type: array - items: - type: object - description: A customer object. + nullable: true + type: object company: - type: string description: Company name + nullable: true + type: string example: Acme first_name: - type: string description: First name + nullable: true + type: string example: Arno last_name: - type: string description: Last name + nullable: true + type: string example: Willms address_1: - type: string description: Address line 1 + nullable: true + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + nullable: true + type: string example: Suite 369 city: - type: string description: City + nullable: true + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + nullable: true + type: string externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. example: st country: description: A country object. Available if the relation `country` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Country' province: - type: string description: Province + nullable: true + type: string example: Kentucky postal_code: - type: string description: Postal Code + nullable: true + type: string example: 72093 phone: - type: string description: Phone Number + nullable: true + type: string example: 16128234334802 created_at: type: string @@ -18868,12 +18169,14 @@ components: description: The date with timezone at which the resource was updated. format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white BatchJob: @@ -18881,21 +18184,36 @@ components: description: A Batch Job. type: object required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status - type + - updated_at properties: id: - type: string description: The unique identifier for the batch job. + type: string example: batch_01G8T782965PYFG0751G0Z38B4 type: - type: string description: The type of batch job. + type: string enum: - product-import - product-export status: - type: string description: The status of the batch job. + type: string enum: - created - pre_processed @@ -18906,19 +18224,18 @@ components: - failed default: created created_by: - type: string description: The unique identifier of the user that created the batch job. + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: - description: >- - A user object. Available if the relation `created_by_user` is - expanded. - type: object + description: A user object. Available if the relation `created_by_user` is expanded. + nullable: true + $ref: '#/components/schemas/User' context: + description: The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true type: object - description: >- - The context of the batch job, the type of the batch job determines - what the context should contain. example: shape: prices: @@ -18936,43 +18253,47 @@ components: - variant.prices - images dry_run: - type: boolean description: Specify if the job must apply the modifications or not. + type: boolean default: false result: - type: object description: The result of the batch job. - properties: - count: - type: number - advancement_count: - type: number - progress: - type: number - errors: - type: object + nullable: true + allOf: + - type: object + example: {} + - type: object properties: - message: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: type: string - code: - oneOf: - - type: string - - type: number - err: - type: array - stat_descriptors: - type: object - properties: - key: - type: string - name: - type: string - message: - type: string - file_key: - type: string - file_size: - type: number + file_size: + type: number example: errors: - err: [] @@ -18983,67 +18304,97 @@ components: name: Product count to export message: There will be 8 products exported by this action pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true type: string - description: The date from which the job has been pre processed. format: date-time processing_at: - type: string description: The date the job is processing at. + nullable: true + type: string format: date-time confirmed_at: - type: string description: The date when the confirmation has been done. + nullable: true + type: string format: date-time completed_at: - type: string description: The date of the completion. + nullable: true + type: string format: date-time canceled_at: - type: string description: The date of the concellation. + nullable: true + type: string format: date-time failed_at: - type: string description: The date when the job failed. + nullable: true + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was last updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time Cart: title: Cart description: Represents a user cart type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The cart's ID + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 email: - type: string description: The email associated with the cart + nullable: true + type: string format: email billing_address_id: - type: string description: The billing address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_address_id: - type: string description: The shipping address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. @@ -19051,54 +18402,58 @@ components: items: $ref: '#/components/schemas/LineItem' region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' discounts: - type: array description: Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array - description: Available if the relation `gift_cards` is expanded. items: - type: object - description: A gift card object. + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' customer_id: - type: string description: The customer's ID + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. + nullable: true type: object payment_session: description: The selected payment session in the cart. + nullable: true $ref: '#/components/schemas/PaymentSession' payment_sessions: - type: array description: The payment sessions created on the cart. + type: array items: $ref: '#/components/schemas/PaymentSession' payment_id: - type: string description: The payment's ID if available + nullable: true + type: string example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/Payment' + nullable: true + type: object shipping_methods: - type: array description: The shipping methods added to the cart. + type: array items: $ref: '#/components/schemas/ShippingMethod' type: - type: string description: The cart's type. + type: string enum: - default - swap @@ -19107,93 +18462,100 @@ components: - claim default: default completed_at: - type: string description: The date with timezone at which the cart was completed. + nullable: true + type: string format: date-time payment_authorized_at: - type: string description: The date with timezone at which the payment was authorized. + nullable: true + type: string format: date-time idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true type: string - description: >- - Randomly generated key used to continue the completion of a cart in - case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. context: + description: The context of the cart which can include info like IP or user agent. + nullable: true type: object - description: >- - The context of the cart which can include info like IP or user - agent. example: ip: '::1' user_agent: PostmanRuntime/7.29.2 sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null sales_channel: - description: >- - A sales channel object. Available if the relation `sales_channel` is - expanded. - type: object + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white shipping_total: - type: integer description: The total of shipping + type: integer example: 1000 discount_total: - type: integer description: The total of discount - example: 800 - tax_total: type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: description: The total of tax + type: integer example: 0 refunded_total: + description: The total amount refunded if the order associated with this cart is returned. type: integer - description: >- - The total amount refunded if the order associated with this cart is - returned. example: 0 total: - type: integer description: The total amount of the cart + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the cart + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 ClaimImage: title: Claim Image @@ -19201,70 +18563,79 @@ components: type: object required: - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: - type: string description: The claim image's ID + type: string example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 claim_item_id: - type: string description: The ID of the claim item associated with the image - claim_item: - description: >- - A claim item object. Available if the relation `claim_item` is - expanded. - type: object - url: type: string + claim_item: + description: A claim item object. Available if the relation `claim_item` is expanded. + nullable: true + $ref: '#/components/schemas/ClaimItem' + url: description: The URL of the image + type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimItem: title: Claim Item - description: >- - Represents a claimed item along with information about the reasons for - the claim. + description: Represents a claimed item along with information about the reasons for the claim. type: object required: - claim_order_id + - created_at + - deleted_at + - id - item_id - - variant_id - - reason + - metadata + - note - quantity + - reason + - updated_at + - variant_id properties: id: - type: string description: The claim item's ID + type: string example: citm_01G8ZH853Y6TFXWPG5EYE81X63 images: - type: array description: Available if the relation `images` is expanded. + type: array items: $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object item_id: description: The ID of the line item that the claim item refers to. @@ -19272,6 +18643,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. + nullable: true $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. @@ -19279,7 +18651,8 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: A variant object. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ProductVariant' reason: description: The reason for the claim type: string @@ -19289,68 +18662,78 @@ components: - production_failure - other note: - description: 'An optional note about the claim, for additional information' + description: An optional note about the claim, for additional information + nullable: true type: string example: I don't like it. quantity: - description: >- - The quantity of the item that is being claimed; must be less than or - equal to the amount purchased in the original order. + description: The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order. type: integer example: 1 tags: - description: >- - User defined tags for easy filtering and grouping. Available if the - relation 'tags' is expanded. + description: User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. type: array items: $ref: '#/components/schemas/ClaimTag' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimOrder: title: Claim Order - description: >- - Claim Orders represent a group of faulty or missing items. Each claim - order consists of a subset of items associated with an original order, - and can contain additional information about fulfillments and returns. + description: Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. type: object required: - - type + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The claim's ID + type: string example: claim_01G8ZH853Y6TFXWPG5EYE81X63 type: + description: The claim's type type: string enum: - refund - replace payment_status: - type: string description: The status of the claim's payment + type: string enum: - na - not_refunded - refunded default: na fulfillment_status: + description: The claim's fulfillment status type: string enum: - not_fulfilled @@ -19369,9 +18752,7 @@ components: items: $ref: '#/components/schemas/ClaimItem' additional_items: - description: >- - Refers to the new items to be shipped when the claim order has the - type `replace` + description: Refers to the new items to be shipped when the claim order has the type `replace` type: array items: $ref: '#/components/schemas/LineItem' @@ -19381,18 +18762,20 @@ components: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object return_order: - description: >- - A return object. Holds information about the return if the claim is - to be returned. Available if the relation 'return_order' is expanded + description: A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true type: object shipping_address_id: description: The ID of the address that the new items should be shipped to + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. @@ -19403,79 +18786,85 @@ components: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/Fulfillment' + type: object refund_amount: description: The amount that will be refunded in conjunction with the claim + nullable: true type: integer example: 1000 canceled_at: description: The date with timezone at which the claim was canceled. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. + description: Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true type: string - description: >- - Randomly generated key used to continue the completion of the cart - associated with the claim in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. ClaimTag: title: Claim Tag - description: >- - Claim Tags are user defined tags that can be assigned to claim items for - easy filtering and grouping. + description: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The claim tag's ID + type: string example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 value: description: The value that the claim tag holds type: string example: Damaged created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Country: @@ -19483,39 +18872,38 @@ components: description: Country details type: object required: + - display_name + - id - iso_2 - iso_3 - - num_code - name - - display_name + - num_code + - region_id properties: id: - type: string description: The country's ID + type: string example: 109 iso_2: - type: string description: The 2 character ISO code of the country in lower case + type: string example: it externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. iso_3: - type: string description: The 2 character ISO code of the country in lower case + type: string example: ita externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements description: See a list of codes. num_code: description: The numerical ISO code for the country. type: string example: 380 externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements description: See a list of codes. name: description: The normalized country name in upper case. @@ -19526,28 +18914,30 @@ components: type: string example: Italy region_id: - type: string description: The region ID this country is associated with. + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' Currency: title: Currency description: Currency type: object required: - code + - name - symbol - symbol_native - - name properties: code: description: The 3 character ISO code for the currency. type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. symbol: description: The symbol used to indicate the currency. @@ -19564,112 +18954,112 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean + default: false CustomShippingOption: title: Custom Shipping Option - description: >- - Custom Shipping Options are 'overriden' Shipping Options. Store managers - can attach a Custom Shipping Option to a cart in order to set a custom - price for a particular Shipping Option + description: Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option type: object required: + - cart_id + - created_at + - deleted_at + - id + - metadata - price - shipping_option_id + - updated_at properties: id: - type: string description: The custom shipping option's ID + type: string example: cso_01G8X99XNB77DMFBJFWX6DN9V9 price: - description: >- - The custom price set that will override the shipping option's - original price + description: The custom price set that will override the shipping option's original price type: integer example: 1000 shipping_option_id: - description: >- - The ID of the Shipping Option that the custom shipping option - overrides + description: The ID of the Shipping Option that the custom shipping option overrides type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: - description: >- - A shipping option object. Available if the relation - `shipping_option` is expanded. - type: object + description: A shipping option object. Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' cart_id: description: The ID of the Cart that the custom shipping option is attached to + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Cart' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white - includes_tax: - description: >- - [EXPERIMENTAL] Indicates if the custom shipping option price include - tax - type: boolean CustomerGroup: title: Customer Group description: Represents a customer group type: object required: + - created_at + - deleted_at + - id + - metadata - name + - updated_at properties: id: - type: string description: The customer group's ID + type: string example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 name: - type: string description: The name of the customer group + type: string example: VIP customers: + description: The customers that belong to the customer group. Available if the relation `customers` is expanded. type: array - description: >- - The customers that belong to the customer group. Available if the - relation `customers` is expanded. items: - type: object - description: A customer object. + $ref: '#/components/schemas/Customer' price_lists: + description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. type: array - description: >- - The price lists that are associated with the customer group. - Available if the relation `price_lists` is expanded. items: $ref: '#/components/schemas/PriceList' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Customer: @@ -19677,30 +19067,44 @@ components: description: Represents a customer type: object required: + - billing_address_id + - created_at + - deleted_at - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at properties: id: - type: string description: The customer's ID + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 email: - type: string description: The customer's email + type: string format: email first_name: - type: string description: The customer's first name + nullable: true + type: string example: Arno last_name: - type: string description: The customer's last name + nullable: true + type: string example: Willms billing_address_id: - type: string description: The customer's billing address ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. @@ -19708,41 +19112,41 @@ components: items: $ref: '#/components/schemas/Address' phone: - type: string description: The customer's phone number + nullable: true + type: string example: 16128234334802 has_account: - type: boolean description: Whether the customer has an account or not + type: boolean default: false orders: description: Available if the relation `orders` is expanded. type: array items: type: object - description: An order object. groups: - description: >- - The customer groups the customer belongs to. Available if the - relation `groups` is expanded. + description: The customer groups the customer belongs to. Available if the relation `groups` is expanded. type: array items: $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionCustomerGroup: @@ -19750,8 +19154,11 @@ components: description: Associates a discount condition with a customer group type: object required: - - customer_group_id - condition_id + - created_at + - customer_group_id + - metadata + - updated_at properties: customer_group_id: description: The ID of the Product Tag @@ -19763,21 +19170,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. + nullable: true $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductCollection: @@ -19785,8 +19195,11 @@ components: description: Associates a discount condition with a product collection type: object required: - - product_collection_id - condition_id + - created_at + - metadata + - product_collection_id + - updated_at properties: product_collection_id: description: The ID of the Product Collection @@ -19798,21 +19211,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. + nullable: true $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductTag: @@ -19820,8 +19236,11 @@ components: description: Associates a discount condition with a product tag type: object required: - - product_tag_id - condition_id + - created_at + - metadata + - product_tag_id + - updated_at properties: product_tag_id: description: The ID of the Product Tag @@ -19833,21 +19252,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. + nullable: true $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductType: @@ -19855,8 +19277,11 @@ components: description: Associates a discount condition with a product type type: object required: - - product_type_id - condition_id + - created_at + - metadata + - product_type_id + - updated_at properties: product_type_id: description: The ID of the Product Tag @@ -19868,21 +19293,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProduct: @@ -19890,8 +19318,11 @@ components: description: Associates a discount condition with a product type: object required: - - product_id - condition_id + - created_at + - metadata + - product_id + - updated_at properties: product_id: description: The ID of the Product Tag @@ -19903,21 +19334,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. + nullable: true $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountCondition: @@ -19925,13 +19359,18 @@ components: description: Holds rule conditions for when a discount is applicable type: object required: - - type - - operator + - created_at + - deleted_at - discount_rule_id + - id + - metadata + - operator + - type + - updated_at properties: id: - type: string description: The discount condition's ID + type: string example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: The type of the Condition @@ -19949,91 +19388,78 @@ components: - in - not_in discount_rule_id: - type: string description: The ID of the discount rule associated with the condition + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' products: - description: >- - products associated with this condition if type = products. - Available if the relation `products` is expanded. + description: products associated with this condition if type = products. Available if the relation `products` is expanded. type: array items: - type: object - description: A product object. + $ref: '#/components/schemas/Product' product_types: - description: >- - product types associated with this condition if type = - product_types. Available if the relation `product_types` is - expanded. + description: Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. type: array items: - type: object - description: A product type object. + $ref: '#/components/schemas/ProductType' product_tags: - description: >- - product tags associated with this condition if type = product_tags. - Available if the relation `product_tags` is expanded. + description: Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. type: array items: - type: object - description: A product tag object. + $ref: '#/components/schemas/ProductTag' product_collections: - description: >- - product collections associated with this condition if type = - product_collections. Available if the relation `product_collections` - is expanded. + description: Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. type: array items: - type: object - description: A product collection object. + $ref: '#/components/schemas/ProductCollection' customer_groups: - description: >- - customer groups associated with this condition if type = - customer_groups. Available if the relation `customer_groups` is - expanded. + description: Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountRule: title: Discount Rule - description: >- - Holds the rules that governs how a Discount is calculated when applied - to a Cart. + description: Holds the rules that governs how a Discount is calculated when applied to a Cart. type: object required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata - type + - updated_at - value properties: id: - type: string description: The discount rule's ID + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C type: - description: >- - The type of the Discount, can be `fixed` for discounts that reduce - the price by a fixed amount, `percentage` for percentage reductions - or `free_shipping` for shipping vouchers. + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. type: string enum: - fixed @@ -20042,93 +19468,99 @@ components: example: percentage description: description: A short description of the discount + nullable: true type: string example: 10 Percent value: - description: >- - The value that the discount represents; this will depend on the type - of the discount + description: The value that the discount represents; this will depend on the type of the discount type: integer example: 10 allocation: description: The scope that the discount should apply to. + nullable: true type: string enum: - total - item example: total conditions: - description: >- - A set of conditions that can be used to limit when the discount can - be used. Available if the relation `conditions` is expanded. + description: A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. type: array items: - type: object - description: A discount condition object. + $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Discount: title: Discount - description: >- - Represents a discount that can be applied to a cart for promotional - purposes. + description: Represents a discount that can be applied to a cart for promotional purposes. type: object required: - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration properties: id: - type: string description: The discount's ID + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN code: - description: >- - A unique code for the discount - this will be used by the customer - to apply the discount + description: A unique code for the discount - this will be used by the customer to apply the discount type: string example: 10DISC is_dynamic: - description: >- - A flag to indicate if multiple instances of the discount can be - generated. I.e. for newsletter discounts + description: A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts type: boolean example: false rule_id: - type: string description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' is_disabled: - description: >- - Whether the Discount has been disabled. Disabled discounts cannot be - applied to carts + description: Whether the Discount has been disabled. Disabled discounts cannot be applied to carts type: boolean example: false parent_discount_id: + description: The Discount that the discount was created from. This will always be a dynamic discount + nullable: true type: string - description: >- - The Discount that the discount was created from. This will always be - a dynamic discount example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. + nullable: true $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. @@ -20136,22 +19568,22 @@ components: format: date-time ends_at: description: The time at which the discount can no longer be used. + nullable: true type: string format: date-time valid_duration: - type: string description: Duration the discount runs between + nullable: true + type: string example: P3Y6M4DT12H30M5S regions: - description: >- - The Regions in which the Discount can be used. Available if the - relation `regions` is expanded. + description: The Regions in which the Discount can be used. Available if the relation `regions` is expanded. type: array items: - type: object - description: A region object. + $ref: '#/components/schemas/Region' usage_limit: description: The maximum number of times that a discount can be used. + nullable: true type: integer example: 100 usage_count: @@ -20160,99 +19592,114 @@ components: example: 50 default: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DraftOrder: title: DraftOrder description: Represents a draft order type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at properties: id: - type: string description: The draft order's ID + type: string example: dorder_01G8TJFKBG38YYFQ035MSVG03C status: - type: string description: The status of the draft order + type: string enum: - open - completed default: open display_id: - type: string description: The draft order's display ID + type: string example: 2 cart_id: - type: string description: The ID of the cart associated with the draft order. + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: - type: string description: The ID of the order associated with the draft order. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object canceled_at: - type: string description: The date the draft order was canceled at. + nullable: true + type: string format: date-time completed_at: - type: string description: The date the draft order was completed at. + nullable: true + type: string format: date-time no_notification_order: - type: boolean description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean example: false idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true type: string - description: >- - Randomly generated key used to continue the completion of the cart - associated with the draft order in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white FulfillmentItem: title: Fulfillment Item - description: >- - Correlates a Line Item with a Fulfillment, keeping track of the quantity - of the Line Item. + description: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. type: object required: - fulfillment_id @@ -20268,9 +19715,7 @@ components: type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN fulfillment: - description: >- - A fulfillment object. Available if the relation `fulfillment` is - expanded. + description: A fulfillment object. Available if the relation `fulfillment` is expanded. type: object item: description: Available if the relation `item` is expanded. @@ -20281,9 +19726,7 @@ components: example: 1 FulfillmentProvider: title: Fulfillment Provider - description: >- - Represents a fulfillment provider plugin and holds its installation - status. + description: Represents a fulfillment provider plugin and holds its installation status. type: object properties: id: @@ -20291,22 +19734,12 @@ components: type: string example: manual is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean example: true Fulfillment: title: Fulfillment - description: >- - Fulfillments are created once store operators can prepare the purchased - goods. Fulfillments will eventually be shipped and hold information - about how to track shipments. Fulfillments are created through a - provider, which is typically an external shipping aggregator, shipping - partner og 3PL, most plugins will have asynchronous communications with - these providers through webhooks in order to automatically update and - synchronize the state of Fulfillments. + description: Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. type: object required: - provider_id @@ -20320,9 +19753,7 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object swap_id: description: The id of the Swap that the Fulfillment belongs to. @@ -20339,9 +19770,7 @@ components: description: An order object. Available if the relation `order` is expanded. type: object provider_id: - description: >- - The id of the Fulfillment Provider responsible for handling the - fulfillment + description: The id of the Fulfillment Provider responsible for handling the fulfillment type: string example: manual location_id: @@ -20352,33 +19781,23 @@ components: description: Available if the relation `provider` is expanded. $ref: '#/components/schemas/FulfillmentProvider' items: - description: >- - The Fulfillment Items in the Fulfillment - these hold information - about how many of each Line Item has been fulfilled. Available if - the relation `items` is expanded. + description: The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded. type: array items: $ref: '#/components/schemas/FulfillmentItem' tracking_links: - description: >- - The Tracking Links that can be used to track the status of the - Fulfillment, these will usually be provided by the Fulfillment - Provider. Available if the relation `tracking_links` is expanded. + description: The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded. type: array items: $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true - description: >- - The tracking numbers that can be used to track the status of the - fulfillment. + description: The tracking numbers that can be used to track the status of the fulfillment. type: array items: type: string data: - description: >- - This contains all the data necessary for the Fulfillment provider to - handle the fulfillment. + description: This contains all the data necessary for the Fulfillment provider to handle the fulfillment. type: object example: {} shipped_at: @@ -20386,9 +19805,7 @@ components: type: string format: date-time no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. + description: Flag for describing whether or not notifications related to this should be send. type: boolean example: false canceled_at: @@ -20397,12 +19814,9 @@ components: format: date-time idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the - fulfillment in case of failure. + description: Randomly generated key used to continue the completion of the fulfillment in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -20423,9 +19837,7 @@ components: car: white GiftCardTransaction: title: Gift Card Transaction - description: >- - Gift Card Transactions are created once a Customer uses a Gift Card to - pay for their Order + description: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order type: object required: - gift_card_id @@ -20440,9 +19852,7 @@ components: type: string example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ gift_card: - description: >- - A gift card object. Available if the relation `gift_card` is - expanded. + description: A gift card object. Available if the relation `gift_card` is expanded. type: object order_id: description: The ID of the Order that the Gift Card was used to pay for. @@ -20469,9 +19879,7 @@ components: example: 0 GiftCard: title: Gift Card - description: >- - Gift Cards are redeemable and represent a value that can be used towards - the payment of an Order. + description: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. type: object required: - code @@ -20484,9 +19892,7 @@ components: description: The cart's ID example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ code: - description: >- - The unique code that identifies the Gift Card. This is used by the - Customer to redeem the value of the Gift Card. + description: The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card. type: string example: 3RFT-MH2C-Y4YZ-XMN4 value: @@ -20512,9 +19918,7 @@ components: description: An order object. Available if the relation `order` is expanded. type: object is_disabled: - description: >- - Whether the Gift Card has been disabled. Disabled Gift Cards cannot - be applied to carts. + description: Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. type: boolean example: false ends_at: @@ -20544,9 +19948,7 @@ components: car: white IdempotencyKey: title: Idempotency Key - description: >- - Idempotency Key is used to continue a process in case of any failure - that might occur. + description: Idempotency Key is used to continue a process in case of any failure that might occur. type: object required: - idempotency_key @@ -20556,13 +19958,10 @@ components: description: The idempotency key's ID example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A idempotency_key: - description: >- - The unique randomly generated key used to determine the state of a - process. + description: The unique randomly generated key used to determine the state of a process. type: string externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: description: Date which the idempotency key was locked. @@ -20768,12 +20167,7 @@ components: car: white LineItem: title: Line Item - description: >- - Line Items represent purchasable units that can be added to a Cart for - checkout. When Line Items are purchased they will get copied to the - resulting order and can eventually be referenced in Fulfillments and - Returns. Line Items may also be created when processing Swaps and - Claims. + description: Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. type: object required: - title @@ -20810,9 +20204,7 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object tax_lines: description: Available if the relation `tax_lines` is expanded. @@ -20825,9 +20217,7 @@ components: items: $ref: '#/components/schemas/LineItemAdjustment' title: - description: >- - The title of the Line Item, this should be easily identifiable by - the Customer. + description: The title of the Line Item, this should be easily identifiable by the Customer. type: string example: Medusa Coffee Mug description: @@ -20838,8 +20228,7 @@ components: description: A URL string to a small image of the contents of the Line Item. type: string format: uri - example: >- - https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png is_return: description: Is the item being returned type: boolean @@ -20849,28 +20238,19 @@ components: type: boolean example: false should_merge: - description: >- - Flag to indicate if new Line Items with the same variant should be - merged or added as an additional Line Item. + description: Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. type: boolean example: false allow_discounts: - description: >- - Flag to indicate if the Line Item should be included when doing - discount calculations. + description: Flag to indicate if the Line Item should be included when doing discount calculations. type: boolean example: false has_shipping: - description: >- - Flag to indicate if the Line Item has fulfillment associated with - it. + description: Flag to indicate if the Line Item has fulfillment associated with it. type: boolean example: false unit_price: - description: >- - The price of one unit of the content in the Line Item. This should - be in the currency defined by the Cart/Order/Swap/Claim that the - Line Item belongs to. + description: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. type: boolean example: 8000 variant_id: @@ -20878,9 +20258,7 @@ components: type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: - description: >- - A product variant object. The Product Variant contained in the Line - Item. Available if the relation `variant` is expanded. + description: A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. type: object quantity: description: The quantity of the content in the Line Item. @@ -20899,9 +20277,7 @@ components: type: integer example: 0 refundable: - description: >- - The amount that can be refunded from the given Line Item. Takes - taxes and discounts into consideration. + description: The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration. type: integer example: 0 subtotal: @@ -20939,9 +20315,7 @@ components: description: '[EXPERIMENTAL] The id of the original line item' type: string order_edit_id: - description: >- - [EXPERIMENTAL] The ID of the order edit to which a cloned item - belongs + description: '[EXPERIMENTAL] The ID of the order edit to which a cloned item belongs' type: string order_edit: description: '[EXPERIMENTAL] The order edit joined' @@ -20961,13 +20335,7 @@ components: car: white MoneyAmount: title: Money Amount - description: >- - Money Amounts represents an amount that a given Product Variant can be - purcased for. Each Money Amount either has a Currency or Region - associated with it to indicate the pricing in a given Currency or, for - fully region-based pricing, the given price in a specific Region. If - region-based pricing is used the amount will be in the currency defined - for the Reigon. + description: Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. type: object required: - currency_code @@ -20982,27 +20350,21 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. $ref: '#/components/schemas/Currency' amount: - description: >- - The amount in the smallest currecny unit (e.g. cents 100 cents to - charge $1) that the Product Variant will cost. + description: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. type: integer example: 100 min_quantity: - description: >- - The minimum quantity that the Money Amount applies to. If this value - is not set, the Money Amount applies to all quantities. + description: The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. type: integer example: 1 max_quantity: - description: >- - The maximum quantity that the Money Amount applies to. If this value - is not set, the Money Amount applies to all quantities. + description: The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. type: integer example: 1 price_list_id: @@ -21017,9 +20379,7 @@ components: type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: - description: >- - The Product Variant contained in the Line Item. Available if the - relation `variant` is expanded. + description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. type: object region_id: type: string @@ -21047,10 +20407,7 @@ components: car: white Note: title: Note - description: >- - Notes are elements which we can use in association with different - resources to allow users to describe additional information in relation - to these. + description: Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. type: object required: - value @@ -21099,9 +20456,7 @@ components: car: white NotificationProvider: title: Notification Provider - description: >- - Represents a notification provider plugin and holds its installation - status. + description: Represents a notification provider plugin and holds its installation status. type: object required: - id @@ -21111,19 +20466,12 @@ components: type: string example: sendgrid is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean default: true Notification: title: Notification - description: >- - Notifications a communications sent via Notification Providers as a - reaction to internal events such as `order.placed`. Notifications can be - used to show a chronological timeline for communications sent to a - Customer regarding an Order, and enables resends. + description: Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. type: object required: - resource_type @@ -21154,22 +20502,15 @@ components: description: A customer object. Available if the relation `customer` is expanded. type: object to: - description: >- - The address that the Notification was sent to. This will usually be - an email address, but represent other addresses such as a chat bot - user id + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id type: string example: user@example.com data: - description: >- - The data that the Notification was sent with. This contains all the - data necessary for the Notification Provider to initiate a resend. + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. type: object example: {} resends: - description: >- - The resends that have been completed after the original - Notification. + description: The resends that have been completed after the original Notification. type: array items: $ref: '#/components/schemas/NotificationResend' @@ -21217,16 +20558,11 @@ components: description: A customer object. Available if the relation `customer` is expanded. type: object to: - description: >- - The address that the Notification was sent to. This will usually be - an email address, but represent other addresses such as a chat bot - user id + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id type: string example: user@example.com data: - description: >- - The data that the Notification was sent with. This contains all the - data necessary for the Notification Provider to initiate a resend. + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. type: object example: {} parent_id: @@ -21304,7 +20640,7 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/Order' + type: object changes: type: array description: Available if the relation `changes` is expanded. @@ -21316,32 +20652,24 @@ components: example: Included two more items B to the order. created_by: type: string - description: >- - The unique identifier of the user or customer who created the order - edit. + description: The unique identifier of the user or customer who created the order edit. requested_by: type: string - description: >- - The unique identifier of the user or customer who requested the - order edit. + description: The unique identifier of the user or customer who requested the order edit. requested_at: type: string description: The date with timezone at which the edit was requested. format: date-time confirmed_by: type: string - description: >- - The unique identifier of the user or customer who confirmed the - order edit. + description: The unique identifier of the user or customer who confirmed the order edit. confirmed_at: type: string description: The date with timezone at which the edit was confirmed. format: date-time declined_by: type: string - description: >- - The unique identifier of the user or customer who declined the order - edit. + description: The unique identifier of the user or customer who declined the order edit. declined_at: type: string description: The date with timezone at which the edit was declined. @@ -21379,9 +20707,7 @@ components: example: 8200 difference_due: type: integer - description: >- - The difference between the total amount of the order and total - amount of edited order. + description: The difference between the total amount of the order and total amount of edited order. example: 8200 status: type: string @@ -21567,7 +20893,7 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. @@ -21578,70 +20904,52 @@ components: example: 0 discounts: type: array - description: >- - The discounts used in the order. Available if the relation - `discounts` is expanded. + description: The discounts used in the order. Available if the relation `discounts` is expanded. items: type: object description: A discount object. gift_cards: type: array - description: >- - The gift cards used in the order. Available if the relation - `gift_cards` is expanded. + description: The gift cards used in the order. Available if the relation `gift_cards` is expanded. items: type: object description: A gift card object. shipping_methods: type: array - description: >- - The shipping methods used in the order. Available if the relation - `shipping_methods` is expanded. + description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: $ref: '#/components/schemas/ShippingMethod' payments: type: array - description: >- - The payments used in the order. Available if the relation `payments` - is expanded. + description: The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/Payment' + type: object fulfillments: type: array - description: >- - The fulfillments used in the order. Available if the relation - `fulfillments` is expanded. + description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/Fulfillment' + type: object returns: type: array - description: >- - The returns associated with the order. Available if the relation - `returns` is expanded. + description: The returns associated with the order. Available if the relation `returns` is expanded. items: type: object description: A return object. claims: type: array - description: >- - The claims associated with the order. Available if the relation - `claims` is expanded. + description: The claims associated with the order. Available if the relation `claims` is expanded. items: type: object description: A claim order object. refunds: type: array - description: >- - The refunds associated with the order. Available if the relation - `refunds` is expanded. + description: The refunds associated with the order. Available if the relation `refunds` is expanded. items: type: object description: A refund object. swaps: type: array - description: >- - The swaps associated with the order. Available if the relation - `swaps` is expanded. + description: The swaps associated with the order. Available if the relation `swaps` is expanded. items: type: object description: A swap object. @@ -21650,29 +20958,21 @@ components: description: The ID of the draft order this order is associated with. example: null draft_order: - description: >- - A draft order object. Available if the relation `draft_order` is - expanded. + description: A draft order object. Available if the relation `draft_order` is expanded. type: object items: type: array - description: >- - The line items that belong to the order. Available if the relation - `items` is expanded. + description: The line items that belong to the order. Available if the relation `items` is expanded. items: $ref: '#/components/schemas/LineItem' edits: type: array - description: >- - [EXPERIMENTAL] Order edits done on the order. Available if the - relation `edits` is expanded. + description: '[EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded.' items: - $ref: '#/components/schemas/OrderEdit' + type: object gift_card_transactions: type: array - description: >- - The gift card transactions used in the order. Available if the - relation `gift_card_transactions` is expanded. + description: The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: $ref: '#/components/schemas/GiftCardTransaction' canceled_at: @@ -21680,19 +20980,14 @@ components: description: The date the order was canceled on. format: date-time no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. + description: Flag for describing whether or not notifications related to this should be send. type: boolean example: false idempotency_key: type: string - description: >- - Randomly generated key used to continue the processing of the order - in case of failure. + description: Randomly generated key used to continue the processing of the order in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. external_id: description: The ID of an external order. @@ -21703,9 +20998,7 @@ components: description: The ID of the sales channel this order is associated with. example: null sales_channel: - description: >- - A sales channel object. Available if the relation `sales_channel` is - expanded. + description: A sales channel object. Available if the relation `sales_channel` is expanded. type: object shipping_total: type: integer @@ -21798,7 +21091,7 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. @@ -21845,21 +21138,12 @@ components: type: string example: manual is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean default: true PaymentSession: title: Payment Session - description: >- - Payment Sessions are created when a Customer initilizes the checkout - flow, and can be used to hold the state of a payment flow. Each Payment - Session is controlled by a Payment Provider, who is responsible for the - communication with external payment services. Authorized Payment - Sessions will eventually get promoted to Payments to indicate that they - are authorized for capture/refunds/etc. + description: Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. type: object required: - cart_id @@ -21878,30 +21162,20 @@ components: description: A cart object. Available if the relation `cart` is expanded. type: object provider_id: - description: >- - The id of the Payment Provider that is responsible for the Payment - Session + description: The id of the Payment Provider that is responsible for the Payment Session type: string example: manual is_selected: - description: >- - A flag to indicate if the Payment Session has been selected as the - method that will be used to complete the purchase. + description: A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. type: boolean example: true is_initiated: - description: >- - A flag to indicate if a communication with the third party provider - has been initiated. + description: A flag to indicate if a communication with the third party provider has been initiated. type: boolean example: true default: false status: - description: >- - Indicates the status of the Payment Session. Will default to - `pending`, and will eventually become `authorized`. Payment Sessions - may have the status of `requires_more` to indicate that further - actions are to be completed by the Customer. + description: Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer. type: string enum: - authorized @@ -21911,21 +21185,14 @@ components: - canceled example: pending data: - description: >- - The data required for the Payment Provider to identify, modify and - process the Payment Session. Typically this will be an object that - holds an id to the external payment session, but can be an empty - object if the Payment Provider doesn't hold any state. + description: The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. type: object example: {} idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of a cart in - case of failure. + description: Randomly generated key used to continue the completion of a cart in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -21937,9 +21204,7 @@ components: format: date-time Payment: title: Payment - description: >- - Payments represent an amount authorized with a given payment method, - Payments can be captured, canceled or refunded. + description: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. type: object required: - amount @@ -21979,15 +21244,13 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. $ref: '#/components/schemas/Currency' amount_refunded: - description: >- - The amount of the original Payment amount that has been refunded - back to the Customer. + description: The amount of the original Payment amount that has been refunded back to the Customer. type: integer example: 0 provider_id: @@ -21995,11 +21258,7 @@ components: type: string example: manual data: - description: >- - The data required for the Payment Provider to identify, modify and - process the Payment. Typically this will be an object that holds an - id to the external payment session, but can be an empty object if - the Payment Provider doesn't hold any state. + description: The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. type: object example: {} captured_at: @@ -22012,12 +21271,9 @@ components: format: date-time idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of a payment - in case of failure. + description: Randomly generated key used to continue the completion of a payment in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -22034,9 +21290,7 @@ components: car: white PriceList: title: Price List - description: >- - Price Lists represents a set of prices that overrides the default price - for one or more product variants. + description: Price Lists represents a set of prices that overrides the default price for one or more product variants. type: object required: - name @@ -22055,9 +21309,7 @@ components: description: The price list's description example: Prices for VIP customers type: - description: >- - The type of Price List. This can be one of either `sale` or - `override`. + description: The type of Price List. This can be one of either `sale` or `override`. type: string enum: - sale @@ -22079,17 +21331,13 @@ components: type: string format: date-time customer_groups: - description: >- - The Customer Groups that the Price List applies to. Available if the - relation `customer_groups` is expanded. + description: The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. type: array items: type: object description: A customer group object. prices: - description: >- - The Money Amounts that are associated with the Price List. Available - if the relation `prices` is expanded. + description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. type: array items: oneOf: @@ -22127,16 +21375,12 @@ components: description: The product category's name example: Regular Fit handle: - description: >- - A unique string that identifies the Category - example: slug - structures. + description: 'A unique string that identifies the Category - example: slug structures.' type: string example: regular-fit mpath: type: string - description: >- - A string for Materialized Paths - used for finding ancestors and - descendents + description: A string for Materialized Paths - used for finding ancestors and descendents example: pcat_id1.pcat_id2.pcat_id3 is_internal: type: boolean @@ -22157,10 +21401,14 @@ components: type: string default: null parent_category: - description: >- - A product category object. Available if the relation - `parent_category` is expanded. + description: A product category object. Available if the relation `parent_category` is expanded. type: object + products: + description: products associated with category. Available if the relation `products` is expanded. + type: array + items: + type: object + description: A product object. created_at: type: string description: The date with timezone at which the resource was created. @@ -22189,15 +21437,11 @@ components: type: string example: Summer Collection handle: - description: >- - A unique string that identifies the Product Collection - can for - example be used in slug structures. + description: A unique string that identifies the Product Collection - can for example be used in slug structures. type: string example: summer-collection products: - description: >- - The Products contained in the Product Collection. Available if the - relation `products` is expanded. + description: The Products contained in the Product Collection. Available if the relation `products` is expanded. type: array items: type: object @@ -22221,10 +21465,7 @@ components: car: white ProductOptionValue: title: Product Option Value - description: >- - A value given to a Product Variant's option set. Product Variant have a - Product Option Value for each of the Product Options defined on the - Product. + description: A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. type: object required: - value @@ -22236,25 +21477,18 @@ components: description: The product option value's ID example: optval_01F0YESHR7S6ECD03RF6W12DSJ value: - description: >- - The value that the Product Variant has defined for the specific - Product Option (e.g. if the Product Option is "Size" this value - could be "Small", "Medium" or "Large"). + description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is "Size" this value could be "Small", "Medium" or "Large"). type: string example: large option_id: - description: >- - The ID of the Product Option that the Product Option Value is - defined for. + description: The ID of the Product Option that the Product Option Value is defined for. type: string example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. $ref: '#/components/schemas/ProductOption' variant_id: - description: >- - The ID of the Product Variant that the Product Option Value is - defined for. + description: The ID of the Product Variant that the Product Option Value is defined for. type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: @@ -22279,10 +21513,7 @@ components: car: white ProductOption: title: Product Option - description: >- - Product Options define properties that may vary between different - variants of a Product. Common Product Options are "Size" and "Color", - but Medusa doesn't limit what Product Options that can be defined. + description: Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. type: object required: - title @@ -22297,9 +21528,7 @@ components: type: string example: Size values: - description: >- - The Product Option Values that are defined for the Product Option. - Available if the relation `values` is expanded. + description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. type: array items: $ref: '#/components/schemas/ProductOptionValue' @@ -22361,9 +21590,7 @@ components: car: white ProductTaxRate: title: Product Tax Rate - description: >- - Associates a tax rate with a product to indicate that the product is - taxed in a certain way + description: Associates a tax rate with a product to indicate that the product is taxed in a certain way type: object required: - product_id @@ -22398,9 +21625,7 @@ components: car: white ProductTypeTaxRate: title: Product Type Tax Rate - description: >- - Associates a tax rate with a product type to indicate that the product - type is taxed in a certain way + description: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way type: object required: - product_type_id @@ -22435,9 +21660,7 @@ components: car: white ProductType: title: Product Type - description: >- - Product Type can be added to Products for filtering and reporting - purposes. + description: Product Type can be added to Products for filtering and reporting purposes. type: object required: - value @@ -22469,9 +21692,7 @@ components: car: white ProductVariantInventoryItem: title: Product Variant Inventory Item - description: >- - Product Variant Inventory Items link variants with inventory items and - denote the number of inventory items constituting a variant. + description: Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. type: object properties: id: @@ -22485,9 +21706,7 @@ components: description: The id of the variant. type: string required_quantity: - description: >- - The quantity of an inventory item required for one quantity of the - variant. + description: The quantity of an inventory item required for one quantity of the variant. type: integer default: 1 created_at: @@ -22504,11 +21723,7 @@ components: format: date-time ProductVariant: title: Product Variant - description: >- - Product Variants represent a Product with a specific set of Product - Option configurations. The maximum number of Product Variants that a - Product can have is given by the number of available Product Option - combinations. + description: Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. type: object required: - title @@ -22520,9 +21735,7 @@ components: description: The product variant's ID example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 title: - description: >- - A title that can be displayed for easy identification of the Product - Variant. + description: A title that can be displayed for easy identification of the Product Variant. type: string example: Small product_id: @@ -22533,36 +21746,24 @@ components: description: A product object. Available if the relation `product` is expanded. 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. + description: The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded. type: array items: $ref: '#/components/schemas/MoneyAmount' sku: - description: >- - The unique stock keeping unit used to identify the Product Variant. - This will usually be a unqiue identifer for the item that is to be - shipped, and can be referenced across multiple systems. + description: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. type: string example: shirt-123 barcode: - description: >- - A generic field for a GTIN number that can be used to identify the - Product Variant. + description: A generic field for a GTIN number that can be used to identify the Product Variant. type: string example: null ean: - description: >- - An EAN barcode number that can be used to identify the Product - Variant. + description: An EAN barcode number that can be used to identify the Product Variant. type: string example: null upc: - description: >- - A UPC barcode number that can be used to identify the Product - Variant. + description: A UPC barcode number that can be used to identify the Product Variant. type: string example: null variant_rank: @@ -22574,9 +21775,7 @@ components: type: integer example: 100 allow_backorder: - description: >- - Whether the Product Variant should be purchasable when - `inventory_quantity` is 0. + description: Whether the Product Variant should be purchasable when `inventory_quantity` is 0. type: boolean default: false manage_inventory: @@ -22584,61 +21783,39 @@ components: type: boolean default: true hs_code: - description: >- - The Harmonized System code of the Product Variant. May be used by - Fulfillment Providers to pass customs information to shipping - carriers. + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null origin_country: - description: >- - The country in which the Product Variant was produced. May be used - by Fulfillment Providers to pass customs information to shipping - carriers. + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null mid_code: - description: >- - The Manufacturers Identification code that identifies the - manufacturer of the Product Variant. May be used by Fulfillment - Providers to pass customs information to shipping carriers. + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null material: - description: >- - The material and composition that the Product Variant is made of, - May be used by Fulfillment Providers to pass customs information to - shipping carriers. + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null weight: - description: >- - The weight of the Product Variant. May be used in shipping rate - calculations. + description: The weight of the Product Variant. May be used in shipping rate calculations. type: number example: null height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. + description: The height of the Product Variant. May be used in shipping rate calculations. type: number example: null width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + description: The width of the Product Variant. May be used in shipping rate calculations. type: number example: null length: - description: >- - The length of the Product Variant. May be used in shipping rate - calculations. + description: The length of the Product Variant. May be used in shipping rate calculations. type: number example: null options: - description: >- - The Product Option Values specified for the Product Variant. - Available if the relation `options` is expanded. + description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. type: array items: $ref: '#/components/schemas/ProductOptionValue' @@ -22661,10 +21838,7 @@ components: car: white Product: title: Product - description: >- - Products are a grouping of Product Variants that have common properties - such as images and descriptions. Products can have multiple options - which define the properties that Product Variants differ by. + description: Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. type: object required: - title @@ -22675,15 +21849,11 @@ components: description: The product's ID example: prod_01G1G5V2MBA328390B5AXJ610F title: - description: >- - A title that can be displayed for easy identification of the - Product. + description: A title that can be displayed for easy identification of the Product. type: string example: Medusa Coffee Mug subtitle: - description: >- - An optional subtitle that can be used to further specify the - Product. + description: An optional subtitle that can be used to further specify the Product. type: string description: description: A short description of the Product. @@ -22694,10 +21864,7 @@ components: type: string example: coffee-mug is_giftcard: - description: >- - Whether the Product represents a Gift Card. Products that represent - Gift Cards will automatically generate a redeemable Gift Card code - once they are purchased. + description: Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. type: boolean default: false status: @@ -22710,9 +21877,7 @@ components: - rejected default: draft images: - description: >- - Images of the Product. Available if the relation `images` is - expanded. + description: Images of the Product. Available if the relation `images` is expanded. type: array items: $ref: '#/components/schemas/Image' @@ -22721,81 +21886,52 @@ components: type: string format: uri options: - description: >- - The Product Options that are defined for the Product. Product - Variants of the Product will have a unique combination of Product - Option Values. Available if the relation `options` is expanded. + description: The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded. type: array items: $ref: '#/components/schemas/ProductOption' variants: - description: >- - The Product Variants that belong to the Product. Each will have a - unique combination of Product Option Values. Available if the - relation `variants` is expanded. + description: The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded. type: array items: $ref: '#/components/schemas/ProductVariant' profile_id: - description: >- - The ID of the Shipping Profile that the Product belongs to. Shipping - Profiles have a set of defined Shipping Options that can be used to - Fulfill a given set of Products. + description: The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. type: string example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. $ref: '#/components/schemas/ShippingProfile' weight: - description: >- - The weight of the Product Variant. May be used in shipping rate - calculations. + description: The weight of the Product Variant. May be used in shipping rate calculations. type: number example: null height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. + description: The height of the Product Variant. May be used in shipping rate calculations. type: number example: null width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + description: The width of the Product Variant. May be used in shipping rate calculations. type: number example: null length: - description: >- - The length of the Product Variant. May be used in shipping rate - calculations. + description: The length of the Product Variant. May be used in shipping rate calculations. type: number example: null hs_code: - description: >- - The Harmonized System code of the Product Variant. May be used by - Fulfillment Providers to pass customs information to shipping - carriers. + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null origin_country: - description: >- - The country in which the Product Variant was produced. May be used - by Fulfillment Providers to pass customs information to shipping - carriers. + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null mid_code: - description: >- - The Manufacturers Identification code that identifies the - manufacturer of the Product Variant. May be used by Fulfillment - Providers to pass customs information to shipping carriers. + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null material: - description: >- - The material and composition that the Product Variant is made of, - May be used by Fulfillment Providers to pass customs information to - shipping carriers. + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null collection_id: @@ -22803,9 +21939,7 @@ components: description: The Product Collection that the Product belongs to example: pcol_01F0YESBFAZ0DV6V831JXWH0BG collection: - description: >- - A product collection object. Available if the relation `collection` - is expanded. + description: A product collection object. Available if the relation `collection` is expanded. type: object type_id: type: string @@ -22815,16 +21949,12 @@ components: description: Available if the relation `type` is expanded. $ref: '#/components/schemas/ProductType' tags: - description: >- - The Product Tags assigned to the Product. Available if the relation - `tags` is expanded. + description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: $ref: '#/components/schemas/ProductTag' discountable: - description: >- - Whether the Product can be discounted. Discounts will not apply to - Line Items of this Product when this flag is set to `false`. + description: Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`. type: boolean default: true external_id: @@ -22832,13 +21962,17 @@ components: type: string example: null sales_channels: - description: >- - The sales channels the product is associated with. Available if the - relation `sales_channels` is expanded. + description: The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. type: array items: type: object description: A sales channel object. + categories: + description: The product's associated categories. Available if the relation `categories` is expanded. + type: array + items: + type: object + description: A category object. created_at: type: string description: The date with timezone at which the resource was created. @@ -22871,9 +22005,7 @@ components: example: pak_01G1G5V21KADXNGH29BJMAJ4B4 PublishableApiKey: title: Publishable API key - description: >- - Publishable API key defines scopes (i.e. resources) that are available - within a request. + description: Publishable API key defines scopes (i.e. resources) that are available within a request. type: object properties: id: @@ -22885,9 +22017,7 @@ components: description: The unique identifier of the user that created the key. example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: - description: >- - A user object. Available if the relation `created_by_user` is - expanded. + description: A user object. Available if the relation `created_by_user` is expanded. type: object created_at: type: string @@ -22898,9 +22028,7 @@ components: description: The unique identifier of the user that revoked the key. example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V revoked_by_user: - description: >- - A user object. Available if the relation `revoked_by_user` is - expanded. + description: A user object. Available if the relation `revoked_by_user` is expanded. type: object revoked_at: type: string @@ -22912,10 +22040,7 @@ components: format: date-time Refund: title: Refund - description: >- - Refund represent an amount of money transfered back to the Customer for - a given reason. Refunds may occur in relation to Returns, Swaps and - Claims, but can also be initiated by a store operator. + description: Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. type: object required: - order_id @@ -22938,9 +22063,7 @@ components: type: string example: I didn't like it reason: - description: >- - The reason given for the Refund, will automatically be set when - processed as part of a Swap, Claim or Return. + description: The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return. type: string enum: - discount @@ -22951,12 +22074,9 @@ components: example: return idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the refund - in case of failure. + description: Randomly generated key used to continue the completion of the refund in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -22977,11 +22097,7 @@ components: car: white Region: title: Region - description: >- - Regions hold settings for how Customers in a given geographical location - shop. The is, for example, where currencies and tax rates are defined. A - Region can consist of multiple countries to accomodate common shopping - settings across countries. + description: Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. type: object required: - name @@ -22993,9 +22109,7 @@ components: description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: - description: >- - The name of the region as displayed to the customer. If the Region - only has one country it is recommended to write the country name. + description: The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name. type: string example: EU currency_code: @@ -23003,7 +22117,7 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. @@ -23013,16 +22127,12 @@ components: type: number example: 0 tax_rates: - description: >- - The tax rates that are included in the Region. Available if the - relation `tax_rates` is expanded. + description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. type: array items: $ref: '#/components/schemas/TaxRate' tax_code: - description: >- - The tax code used on purchases in the Region. This may be used by - other systems for accounting purposes. + description: The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. type: string example: null gift_cards_taxable: @@ -23034,9 +22144,7 @@ components: type: boolean default: true countries: - description: >- - The countries that are included in the Region. Available if the - relation `countries` is expanded. + description: The countries that are included in the Region. Available if the relation `countries` is expanded. type: array items: $ref: '#/components/schemas/Country' @@ -23048,16 +22156,12 @@ components: description: Available if the relation `tax_provider` is expanded. $ref: '#/components/schemas/TaxProvider' payment_providers: - description: >- - The Payment Providers that can be used to process Payments in the - Region. Available if the relation `payment_providers` is expanded. + description: The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: - description: >- - The Fulfillment Providers that can be used to fulfill orders in the - Region. Available if the relation `payment_providers` is expanded. + description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: $ref: '#/components/schemas/FulfillmentProvider' @@ -23083,9 +22187,7 @@ components: car: white ReturnItem: title: Return Item - description: >- - Correlates a Line Item with a Return, keeping track of the quantity of - the Line Item that will be returned. + description: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. type: object required: - return_id @@ -23110,9 +22212,7 @@ components: type: integer example: 1 is_requested: - description: >- - Whether the Return Item was requested initially or received - unexpectedly in the warehouse. + description: Whether the Return Item was requested initially or received unexpectedly in the warehouse. type: boolean default: true requested_quantity: @@ -23141,9 +22241,7 @@ components: car: white ReturnReason: title: Return Reason - description: >- - A Reason for why a given product is returned. A Return Reason can be - used on Return Items in order to indicate why a Line Item was returned. + description: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. type: object required: - value @@ -23194,10 +22292,7 @@ components: car: white Return: title: Return - description: >- - Return orders hold information about Line Items that a Customer wishes - to send back, along with how the items will be returned. Returns can be - used as part of a Swap. + description: Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. type: object required: - refund_amount @@ -23216,9 +22311,7 @@ components: - canceled default: requested items: - description: >- - The Return Items that will be shipped back to the warehouse. - Available if the relation `items` is expanded. + description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. type: array items: $ref: '#/components/schemas/ReturnItem' @@ -23241,22 +22334,15 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object shipping_method: - description: >- - The Shipping Method that will be used to send the Return back. Can - be null if the Customer facilitates the return shipment themselves. - Available if the relation `shipping_method` is expanded. + description: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. type: array items: $ref: '#/components/schemas/ShippingMethod' shipping_data: - description: >- - Data about the return shipment as provided by the Fulfilment - Provider that handles the return shipment. + description: Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. type: object example: {} refund_amount: @@ -23264,19 +22350,14 @@ components: type: integer example: 1000 no_notification: - description: >- - When set to true, no notification will be sent related to this - return. + description: When set to true, no notification will be sent related to this return. type: boolean example: false idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the return - in case of failure. + description: Randomly generated key used to continue the completion of the return in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. received_at: description: The date with timezone at which the return was received. @@ -23377,11 +22458,7 @@ components: car: white ShippingMethod: title: Shipping Method - description: >- - Shipping Methods represent a way in which an Order or Return can be - shipped. Shipping Methods are built from a Shipping Option, but may - contain additional details, that can be necessary for the Fulfillment - Provider to handle the shipment. + description: Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. type: object required: - shipping_option_id @@ -23392,9 +22469,7 @@ components: description: The shipping method's ID example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_option_id: - description: >- - The id of the Shipping Option that the Shipping Method is built - from. + description: The id of the Shipping Option that the Shipping Method is built from. type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: @@ -23412,9 +22487,7 @@ components: type: string example: null return_order: - description: >- - A return object. Available if the relation `return_order` is - expanded. + description: A return object. Available if the relation `return_order` is expanded. type: object swap_id: description: The id of the Swap that the Shipping Method is used on. @@ -23435,9 +22508,7 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object tax_lines: type: array @@ -23445,17 +22516,11 @@ components: items: $ref: '#/components/schemas/ShippingMethodTaxLine' price: - description: >- - The amount to charge for the Shipping Method. The currency of the - price is defined by the Region that the Order that the Shipping - Method belongs to is a part of. + description: The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of. type: integer example: 200 data: - description: >- - Additional data that the Fulfillment Provider needs to fulfill the - shipment. This is used in combination with the Shipping Options - data, and may contain information such as a drop point id. + description: Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id. type: object example: {} includes_tax: @@ -23463,9 +22528,7 @@ components: type: boolean ShippingOptionRequirement: title: Shipping Option Requirement - description: >- - A requirement that a Cart must satisfy for the Shipping Option to be - available to the Cart. + description: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. type: object required: - shipping_option_id @@ -23477,21 +22540,14 @@ components: description: The shipping option requirement's ID example: sor_01G1G5V29AB4CTNDRFSRWSRKWD shipping_option_id: - description: >- - The id of the Shipping Option that the hipping option requirement - belongs to + description: The id of the Shipping Option that the hipping option requirement belongs to type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. $ref: '#/components/schemas/ShippingOption' type: - description: >- - The type of the requirement, this defines how the value will be - compared to the Cart's total. `min_subtotal` requirements define the - minimum subtotal that is needed for the Shipping Option to be - available, while the `max_subtotal` defines the maximum subtotal - that the Cart can have for the Shipping Option to be available. + description: The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available. type: string enum: - min_subtotal @@ -23507,13 +22563,7 @@ components: format: date-time ShippingOption: title: Shipping Option - description: >- - Shipping Options represent a way in which an Order or Return can be - shipped. Shipping Options have an associated Fulfillment Provider that - will be used when the fulfillment of an Order is initiated. Shipping - Options themselves cannot be added to Carts, but serve as a template for - Shipping Methods. This distinction makes it possible to customize - individual Shipping Methods with additional information. + description: Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. type: object required: - name @@ -23527,9 +22577,7 @@ components: description: The shipping option's ID example: so_01G1G5V27GYX4QXNARRQCW1N8T name: - description: >- - The name given to the Shipping Option - this may be displayed to the - Customer. + description: The name given to the Shipping Option - this may be displayed to the Customer. type: string example: PostFake Standard region_id: @@ -23540,59 +22588,41 @@ components: description: A region object. Available if the relation `region` is expanded. 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. + description: The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. type: string example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. $ref: '#/components/schemas/ShippingProfile' provider_id: - description: >- - The id of the Fulfillment Provider, that will be used to process - Fulfillments from the Shipping Option. + description: The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. type: string example: manual provider: description: Available if the relation `provider` is expanded. $ref: '#/components/schemas/FulfillmentProvider' price_type: - description: >- - The type of pricing calculation that is used when creatin Shipping - Methods from the Shipping Option. Can be `flat_rate` for fixed - prices or `calculated` if the Fulfillment Provider can provide price - calulations. + description: The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations. type: string enum: - flat_rate - calculated example: flat_rate amount: - description: >- - The amount to charge for shipping when the Shipping Option price - type is `flat_rate`. + description: The amount to charge for shipping when the Shipping Option price type is `flat_rate`. type: integer example: 200 is_return: - description: >- - Flag to indicate if the Shipping Option can be used for Return - shipments. + description: Flag to indicate if the Shipping Option can be used for Return shipments. type: boolean default: false requirements: - description: >- - The requirements that must be satisfied for the Shipping Option to - be available for a Cart. Available if the relation `requirements` is - expanded. + description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. type: array items: $ref: '#/components/schemas/ShippingOptionRequirement' data: - description: >- - The data needed for the Fulfillment Provider to identify the - Shipping Option. + description: The data needed for the Fulfillment Provider to identify the Shipping Option. type: object example: {} includes_tax: @@ -23617,9 +22647,7 @@ components: car: white ShippingProfile: title: Shipping Profile - description: >- - Shipping Profiles have a set of defined Shipping Options that can be - used to fulfill a given set of Products. + description: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. type: object required: - name @@ -23630,15 +22658,11 @@ components: description: The shipping profile's ID example: sp_01G1G5V239ENSZ5MV4JAR737BM name: - description: >- - The name given to the Shipping profile - this may be displayed to - the Customer. + description: The name given to the Shipping profile - this may be displayed to the Customer. type: string example: Default Shipping Profile type: - description: >- - The type of the Shipping Profile, may be `default`, `gift_card` or - `custom`. + description: The type of the Shipping Profile, may be `default`, `gift_card` or `custom`. type: string enum: - default @@ -23646,18 +22670,13 @@ components: - custom example: default products: - description: >- - The Products that the Shipping Profile defines Shipping Options for. - Available if the relation `products` is expanded. + description: The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. type: array items: type: object description: A product object. shipping_options: - description: >- - The Shipping Options that can be used to fulfill the Products in the - Shipping Profile. Available if the relation `shipping_options` is - expanded. + 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' @@ -23680,9 +22699,7 @@ components: car: white ShippingTaxRate: title: Shipping Tax Rate - description: >- - Associates a tax rate with a shipping option to indicate that the - shipping option is taxed in a certain way + description: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way type: object required: - shipping_option_id @@ -23736,7 +22753,7 @@ components: example: {} Store: title: Store - description: 'Holds settings for the Store, such as name, currencies, etc.' + description: Holds settings for the Store, such as name, currencies, etc. type: object properties: id: @@ -23752,28 +22769,22 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. $ref: '#/components/schemas/Currency' currencies: - description: >- - The currencies that are enabled for the Store. Available if the - relation `currencies` is expanded. + description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. type: array items: $ref: '#/components/schemas/Currency' swap_link_template: - description: >- - A template to generate Swap links from. Use {{cart_id}} to include - the Swap's `cart_id` in the link. + description: A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. type: string example: null payment_link_template: - description: >- - A template to generate Payment links from. Use {{cart_id}} to - include the payment's `cart_id` in the link. + description: A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. type: string example: null invite_link_template: @@ -23785,9 +22796,7 @@ components: description: The sales channel ID the cart is associated with. example: null default_sales_channel: - description: >- - A sales channel object. Available if the relation - `default_sales_channel` is expanded. + description: A sales channel object. Available if the relation `default_sales_channel` is expanded. type: object metadata: type: object @@ -23796,14 +22805,7 @@ components: car: white Swap: title: Swap - description: >- - Swaps can be created when a Customer wishes to exchange Products that - they have purchased to different Products. Swaps consist of a Return of - previously purchased Products and a Fulfillment of new Products, the - amount paid for the Products being returned will be used towards payment - for the new Products. In the case where the amount paid for the the - Products being returned exceed the amount to be paid for the new - Products, a Refund will be issued for the difference. + description: Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. type: object required: - fulfillment_status @@ -23825,9 +22827,7 @@ components: - requires_action example: not_fulfilled payment_status: - description: >- - The status of the Payment of the Swap. The payment may either refer - to the refund of an amount or the authorization of a new amount. + description: The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount. type: string enum: - not_paid @@ -23841,59 +22841,41 @@ components: - requires_action example: not_paid order_id: - description: >- - The ID of the Order where the Line Items to be returned where - purchased. + description: The ID of the Order where the Line Items to be returned where purchased. type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. type: object additional_items: - description: >- - The new Line Items to ship to the Customer. Available if the - relation `additional_items` is expanded. + description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. type: array items: $ref: '#/components/schemas/LineItem' return_order: - description: >- - A return order object. The Return that is issued for the return part - of the Swap. Available if the relation `return_order` is expanded. + description: A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. type: object fulfillments: - description: >- - The Fulfillments used to send the new Line Items. Available if the - relation `fulfillments` is expanded. + description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. type: array items: - $ref: '#/components/schemas/Fulfillment' + type: object payment: - description: >- - The Payment authorized when the Swap requires an additional amount - to be charged from the Customer. Available if the relation `payment` - is expanded. - $ref: '#/components/schemas/Payment' + description: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + type: object difference_due: - description: >- - The difference that is paid or refunded as a result of the Swap. May - be negative when the amount paid for the returned items exceed the - total of the new Products. + description: The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. type: integer example: 0 shipping_address_id: - description: >- - The Address to send the new Line Items to - in most cases this will - be the same as the shipping address on the Order. + description: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. $ref: '#/components/schemas/Address' shipping_methods: - description: >- - The Shipping Methods used to fulfill the additional items purchased. - Available if the relation `shipping_methods` is expanded. + description: The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: $ref: '#/components/schemas/ShippingMethod' @@ -23905,22 +22887,17 @@ components: description: A cart object. Available if the relation `cart` is expanded. type: object allow_backorder: - description: 'If true, swaps can be completed with items out of stock' + description: If true, swaps can be completed with items out of stock type: boolean default: false idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the swap - in case of failure. + description: Randomly generated key used to continue the completion of the swap in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. confirmed_at: - description: >- - The date with timezone at which the Swap was confirmed by the - Customer. + description: The date with timezone at which the Swap was confirmed by the Customer. type: string format: date-time canceled_at: @@ -23928,7 +22905,7 @@ components: type: string format: date-time no_notification: - description: 'If set to true, no notification will be sent related to this swap' + description: If set to true, no notification will be sent related to this swap type: boolean example: false created_at: @@ -23995,17 +22972,12 @@ components: type: string example: manual is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean default: true TaxRate: title: Tax Rate - description: >- - A Tax Rate can be used to associate a certain rate to charge on products - within a given Region + description: A Tax Rate can be used to associate a certain rate to charge on products within a given Region type: object required: - name @@ -24036,25 +23008,19 @@ components: type: object products: type: array - description: >- - The products that belong to this tax rate. Available if the relation - `products` is expanded. + description: The products that belong to this tax rate. Available if the relation `products` is expanded. items: type: object description: A product object. product_types: type: array - description: >- - The product types that belong to this tax rate. Available if the - relation `product_types` is expanded. + description: The product types that belong to this tax rate. Available if the relation `product_types` is expanded. items: type: object description: A product type object. shipping_options: type: array - description: >- - The shipping options that belong to this tax rate. Available if the - relation `shipping_options` is expanded. + description: The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. items: type: object description: A shipping option object. @@ -24085,10 +23051,7 @@ components: car: white TrackingLink: title: Tracking Link - description: >- - Tracking Link holds information about tracking numbers for a - Fulfillment. Tracking Links can optionally contain a URL that can be - visited to see the status of the shipment. + description: Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. type: object required: - tracking_number @@ -24115,12 +23078,9 @@ components: $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of a process - in case of failure. + description: Randomly generated key used to continue the completion of a process in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -24183,6 +23143,58 @@ components: description: An optional key-value map with additional details example: car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time ReservationItemDTO: title: Reservation item description: Represents a reservation of an inventory item at a stock location @@ -24222,6 +23234,44 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time PricedVariant: title: Priced Product Variant type: object @@ -24231,9 +23281,7 @@ components: properties: original_price: type: number - description: >- - The original price of the variant without any discounted prices - applied. + description: The original price of the variant without any discounted prices applied. calculated_price: type: number description: The calculated price of the variant. Can be a discounted price. @@ -24292,11 +23340,15 @@ components: address_1: type: string description: Stock location address - example: '35, Jhon Doe Ave' + example: 35, Jhon Doe Ave address_2: type: string description: Stock location address' complement example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa city: type: string description: Stock location address' city @@ -24390,7 +23442,7 @@ components: address_1: type: string description: Stock location address - example: '35, Jhon Doe Ave' + example: 35, Jhon Doe Ave address_2: type: string description: Stock location address' complement @@ -24475,9 +23527,7 @@ components: $ref: '#/components/schemas/Error' message: type: string - default: >- - Provided request body contains errors. Please check the data and - retry the request + default: Provided request body contains errors. Please check the data and retry the request Error: title: Response Error type: object @@ -24550,9 +23600,7 @@ components: example: product-export context: type: object - description: >- - Additional infomration regarding the batch to be used for - processing. + description: Additional infomration regarding the batch to be used for processing. example: shape: prices: @@ -24571,9 +23619,7 @@ components: - images dry_run: type: boolean - description: >- - Set a batch job in dry_run mode to get some information on what will - be done without applying any modifications. + description: Set a batch job in dry_run mode to get some information on what will be done without applying any modifications. default: false AdminBatchJobRes: type: object @@ -24617,9 +23663,7 @@ components: description: The title to identify the Collection by. handle: type: string - description: >- - An optional handle to be used in slugs, if none is provided we will - kebab-case the title. + description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. metadata: description: An optional set of key-value pairs to hold additional information. type: object @@ -24693,9 +23737,7 @@ components: description: The title to identify the Collection by. handle: type: string - description: >- - An optional handle to be used in slugs, if none is provided we will - kebab-case the title. + description: An optional handle to be used in slugs, if none is provided we will kebab-case the title. metadata: description: An optional set of key-value pairs to hold additional information. type: object @@ -24735,12 +23777,24 @@ components: description: The ids of the customers to add type: array items: + type: object required: - id properties: id: description: ID of the customer type: string + AdminPostCustomerGroupsReq: + type: object + required: + - name + properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. AdminDeleteCustomerGroupsGroupCustomerBatchReq: type: object required: @@ -24750,6 +23804,7 @@ components: description: The ids of the customers to remove type: array items: + type: object required: - id properties: @@ -24872,6 +23927,7 @@ components: groups: type: array items: + type: object required: - id properties: @@ -24891,6 +23947,7 @@ components: description: The resources to be added to the discount condition type: array items: + type: object required: - id properties: @@ -24915,16 +23972,12 @@ components: type: string product_types: type: array - description: >- - list of product type IDs if the condition is applied on product - types. + description: list of product type IDs if the condition is applied on product types. items: type: string product_collections: type: array - description: >- - list of product collection IDs if the condition is applied on - product collections. + description: list of product collection IDs if the condition is applied on product collections. items: type: string product_tags: @@ -24934,9 +23987,7 @@ components: type: string customer_groups: type: array - description: >- - list of customer group IDs if the condition is applied on customer - groups. + description: list of customer group IDs if the condition is applied on customer groups. items: type: string AdminPostDiscountsReq: @@ -24951,10 +24002,7 @@ components: description: A unique code that will be used to redeem the Discount is_dynamic: type: boolean - description: >- - Whether the Discount should have multiple instances of itself, each - with a different code. This can be useful for automatically - generated codes that all have to follow a common set of rules. + description: Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules. default: false rule: description: The Discount Rule that defines how Discounts are calculated @@ -24969,19 +24017,14 @@ components: description: A short description of the discount type: type: string - description: >- - The type of the Discount, can be `fixed` for discounts that - reduce the price by a fixed amount, `percentage` for percentage - reductions or `free_shipping` for shipping vouchers. + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. enum: - fixed - percentage - free_shipping value: type: number - description: >- - The value that the discount represents; this will depend on the - type of the discount + description: The value that the discount represents; this will depend on the type of the discount allocation: type: string description: The scope that the discount should apply to. @@ -24990,11 +24033,7 @@ components: - item conditions: type: array - description: >- - A set of conditions that can be used to limit when the discount - can be used. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` - should be provided. + description: A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. items: type: object required: @@ -25008,44 +24047,32 @@ components: - not_in products: type: array - description: >- - list of product IDs if the condition is applied on - products. + description: list of product IDs if the condition is applied on products. items: type: string product_types: type: array - description: >- - list of product type IDs if the condition is applied on - product types. + description: list of product type IDs if the condition is applied on product types. items: type: string product_collections: type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. + description: list of product collection IDs if the condition is applied on product collections. items: type: string product_tags: type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. + description: list of product tag IDs if the condition is applied on product tags. items: type: string customer_groups: type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. + description: list of customer group IDs if the condition is applied on customer groups. items: type: string is_disabled: type: boolean - description: >- - Whether the Discount code is disabled on creation. You will have to - enable it later to make it available to Customers. + description: Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. default: false starts_at: type: string @@ -25060,9 +24087,7 @@ components: description: Duration the discount runs between example: P3Y6M4DT12H30M5S regions: - description: >- - A list of Region ids representing the Regions in which the Discount - can be used. + description: A list of Region ids representing the Regions in which the Discount can be used. type: array items: type: string @@ -25072,6 +24097,21 @@ components: metadata: description: An optional set of key-value pairs to hold additional information. type: object + AdminPostDiscountsDiscountDynamicCodesReq: + type: object + required: + - code + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + usage_limit: + type: number + description: Maximum times the discount can be used + default: 1 + metadata: + type: object + description: An optional set of key-value pairs to hold additional information. AdminDeleteDiscountsDiscountConditionsConditionBatchReq: type: object required: @@ -25081,6 +24121,7 @@ components: description: The resources to be deleted from the discount condition type: array items: + type: object required: - id properties: @@ -25154,16 +24195,12 @@ components: type: string product_types: type: array - description: >- - list of product type IDs if the condition is applied on product - types. + description: list of product type IDs if the condition is applied on product types. items: type: string product_collections: type: array - description: >- - list of product collection IDs if the condition is applied on - product collections. + description: list of product collection IDs if the condition is applied on product collections. items: type: string product_tags: @@ -25173,9 +24210,7 @@ components: type: string customer_groups: type: array - description: >- - list of customer group IDs if the condition is applied on customer - groups. + description: list of customer group IDs if the condition is applied on customer groups. items: type: string AdminPostDiscountsDiscountReq: @@ -25198,9 +24233,7 @@ components: description: A short description of the discount value: type: number - description: >- - The value that the discount represents; this will depend on the - type of the discount + description: The value that the discount represents; this will depend on the type of the discount allocation: type: string description: The scope that the discount should apply to. @@ -25209,11 +24242,7 @@ components: - item conditions: type: array - description: >- - A set of conditions that can be used to limit when the discount - can be used. Only one of `products`, `product_types`, - `product_collections`, `product_tags`, and `customer_groups` - should be provided. + description: A set of conditions that can be used to limit when the discount can be used. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided. items: type: object required: @@ -25230,44 +24259,32 @@ components: - not_in products: type: array - description: >- - list of product IDs if the condition is applied on - products. + description: list of product IDs if the condition is applied on products. items: type: string product_types: type: array - description: >- - list of product type IDs if the condition is applied on - product types. + description: list of product type IDs if the condition is applied on product types. items: type: string product_collections: type: array - description: >- - list of product collection IDs if the condition is applied - on product collections. + description: list of product collection IDs if the condition is applied on product collections. items: type: string product_tags: type: array - description: >- - list of product tag IDs if the condition is applied on - product tags. + description: list of product tag IDs if the condition is applied on product tags. items: type: string customer_groups: type: array - description: >- - list of customer group IDs if the condition is applied on - customer groups. + description: list of customer group IDs if the condition is applied on customer groups. items: type: string is_disabled: type: boolean - description: >- - Whether the Discount code is disabled on creation. You will have to - enable it later to make it available to Customers. + description: Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers. starts_at: type: string format: date-time @@ -25284,9 +24301,7 @@ components: type: number description: Maximum times the discount can be used regions: - description: >- - A list of Region ids representing the Regions in which the Discount - can be used. + description: A list of Region ids representing the Regions in which the Discount can be used. type: array items: type: string @@ -25341,9 +24356,7 @@ components: description: The quantity of the Line Item. type: integer metadata: - description: >- - The optional key-value map with additional details about the - Line Item. + description: The optional key-value map with additional details about the Line Item. type: object region_id: description: The ID of the region for the draft order @@ -25363,9 +24376,7 @@ components: description: The ID of the customer to add on the draft order type: string no_notification_order: - description: >- - An optional flag passed to the resulting order to determine use of - notifications. + description: An optional flag passed to the resulting order to determine use of notifications. type: boolean shipping_methods: description: The shipping methods for the draft order @@ -25385,9 +24396,7 @@ components: description: The potential custom price of the shipping type: integer metadata: - description: >- - The optional key-value map with additional details about the Draft - Order. + description: The optional key-value map with additional details about the Draft Order. type: object AdminPostDraftOrdersDraftOrderLineItemsReq: type: object @@ -25408,9 +24417,7 @@ components: description: The quantity of the Line Item. type: integer metadata: - description: >- - The optional key-value map with additional details about the Line - Item. + description: The optional key-value map with additional details about the Line Item. type: object AdminPostDraftOrdersDraftOrderRegisterPaymentRes: type: object @@ -25462,8 +24469,7 @@ components: type: string description: The 2 character ISO code for the Country. externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. email: type: string @@ -25491,9 +24497,7 @@ components: description: The code that a Discount is identifed by. type: string no_notification_order: - description: >- - An optional flag passed to the resulting order to determine use of - notifications. + description: An optional flag passed to the resulting order to determine use of notifications. type: boolean customer_id: description: The ID of the Customer to associate the Draft Order with. @@ -25511,9 +24515,7 @@ components: description: The quantity of the Line Item. type: integer metadata: - description: >- - The optional key-value map with additional details about the Line - Item. + description: The optional key-value map with additional details about the Line Item. type: object AdminPostGiftCardsReq: type: object @@ -25525,9 +24527,7 @@ components: 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. + 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 @@ -25581,9 +24581,7 @@ components: 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. + 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 @@ -25594,6 +24592,134 @@ components: metadata: description: An optional set of key-value pairs to hold additional information. type: object + AdminPostInventoryItemsItemLocationLevelsReq: + type: object + required: + - location_id + - stocked_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + AdminInventoryItemsRes: + type: object + properties: + inventory_item: + $ref: '#/components/schemas/InventoryItemDTO' + AdminInventoryItemsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Inventory Item. + object: + type: string + description: The type of the object that was deleted. + format: inventory_item + deleted: + type: boolean + description: Whether or not the Inventory Item was deleted. + default: true + AdminInventoryItemsListRes: + type: object + properties: + inventory_items: + type: array + items: + $ref: '#/components/schemas/InventoryItemDTO' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsListWithVariantsAndLocationLevelsRes: + type: object + properties: + inventory_items: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryItemDTO' + - type: object + properties: + location_levels: + type: array + items: + allOf: + - $ref: '#/components/schemas/InventoryLevelDTO' + variants: + type: array + items: + allOf: + - $ref: '#/components/schemas/ProductVariant' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + AdminInventoryItemsLocationLevelsRes: + type: object + properties: + id: + description: The id of the location + location_levels: + description: List of stock levels at a given location + type: array + items: + $ref: '#/components/schemas/InventoryLevelDTO' + AdminPostInventoryItemsInventoryItemReq: + type: object + properties: + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + AdminPostInventoryItemsItemLocationLevelsLevelReq: + type: object + properties: + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number AdminPostInvitesInviteAcceptReq: type: object required: @@ -25734,9 +24860,7 @@ components: type: object properties: to: - description: >- - A new address or user identifier that the Notification should be - sent to + description: A new address or user identifier that the Notification should be sent to type: string AdminPostOrderEditsEditLineItemsReq: type: object @@ -25827,6 +24951,21 @@ components: internal_note: description: An optional note to create or update for the order edit. type: string + AdminPostOrdersOrderShippingMethodsReq: + type: object + required: + - price + - option_id + properties: + price: + type: number + description: The price (excluding VAT) that should be charged for the Shipping Method + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + date: + type: object + description: The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider. AdminPostOrdersOrderClaimsClaimShipmentsReq: type: object required: @@ -25847,11 +24986,7 @@ components: - claim_items properties: type: - description: >- - The type of the Claim. This will determine how the Claim is treated: - `replace` Claims will result in a Fulfillment with new items being - created, while a `refund` Claim will refund the amount paid for the - claimed items. + description: 'The type of the Claim. This will determine how the Claim is treated: `replace` Claims will result in a Fulfillment with new items being created, while a `refund` Claim will refund the amount paid for the claimed items.' type: string enum: - replace @@ -25860,6 +24995,7 @@ components: description: The Claim Items that the Claim will consist of. type: array items: + type: object required: - item_id - quantity @@ -25891,25 +25027,20 @@ components: items: type: string return_shipping: - description: >- - Optional details for the Return Shipping Method, if the items are to - be sent back. + description: Optional details for the Return Shipping Method, if the items are to be sent back. type: object properties: option_id: type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. + description: The ID of the Shipping Option to create the Shipping Method from. price: type: integer description: The price to charge for the Shipping Method. additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. + description: The new items to send to the Customer when the Claim type is Replace. type: array items: + type: object required: - variant_id - quantity @@ -25924,6 +25055,7 @@ components: description: The Shipping Methods to send the additional Line Items with. type: array items: + type: object properties: id: description: The ID of an existing Shipping Method @@ -25934,11 +25066,12 @@ components: price: description: The price to charge for the Shipping Method type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object shipping_address: type: object - description: >- - An optional shipping address to send the claim to. Defaults to the - parent order's shipping address + description: An optional shipping address to send the claim to. Defaults to the parent order's shipping address $ref: '#/components/schemas/Address' refund_amount: description: The amount to refund the Customer when the Claim type is `refund`. @@ -25958,6 +25091,7 @@ components: description: The Line Items to include in the Fulfillment. type: array items: + type: object required: - item_id - quantity @@ -25999,9 +25133,7 @@ components: items: type: string no_notification: - description: >- - If set to true no notification will be send related to this - Shipment. + description: If set to true no notification will be send related to this Shipment. type: boolean AdminPostOrdersOrderSwapsSwapShipmentsReq: type: object @@ -26028,6 +25160,7 @@ components: description: The Line Items to return as part of the Swap. type: array items: + type: object required: - item_id - quantity @@ -26052,9 +25185,7 @@ components: properties: option_id: type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. + description: The ID of the Shipping Option to create the Shipping Method from. price: type: integer description: The price to charge for the Shipping Method. @@ -26062,6 +25193,7 @@ components: description: The new items to send to the Customer. type: array items: + type: object required: - variant_id - quantity @@ -26073,11 +25205,10 @@ components: description: The quantity of the Product Variant to ship. type: integer custom_shipping_options: - description: >- - The custom shipping options to potentially create a Shipping Method - from. + description: The custom shipping options to potentially create a Shipping Method from. type: array items: + type: object required: - option_id - price @@ -26092,7 +25223,7 @@ components: description: If set to true no notification will be send related to this Swap. type: boolean allow_backorder: - description: 'If true, swaps can be completed with items out of stock' + description: If true, swaps can be completed with items out of stock type: boolean default: true AdminPostOrdersOrderClaimsClaimFulfillmentsReq: @@ -26161,6 +25292,7 @@ components: description: The Line Items that will be returned. type: array items: + type: object required: - item_id - quantity @@ -26183,9 +25315,7 @@ components: properties: option_id: type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. + description: The ID of the Shipping Option to create the Shipping Method from. price: type: integer description: The price to charge for the Shipping Method. @@ -26193,15 +25323,11 @@ components: description: An optional note with information about the Return. type: string receive_now: - description: >- - A flag to indicate if the Return should be registerd as received - immediately. + description: A flag to indicate if the Return should be registerd as received immediately. type: boolean default: false no_notification: - description: >- - A flag to indicate if no notifications should be emitted related to - the requested Return. + description: A flag to indicate if no notifications should be emitted related to the requested Return. type: boolean refund: description: The amount to refund. @@ -26213,6 +25339,7 @@ components: description: The Claim Items that the Claim will consist of. type: array items: + type: object required: - id - images @@ -26263,14 +25390,13 @@ components: type: string description: Image URL metadata: - description: >- - An optional set of key-value pairs to hold additional - information. + description: An optional set of key-value pairs to hold additional information. type: object shipping_methods: description: The Shipping Methods to send the additional Line Items with. type: array items: + type: object properties: id: description: The ID of an existing Shipping Method @@ -26281,6 +25407,9 @@ components: price: description: The price to charge for the Shipping Method type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object no_notification: description: If set to true no notification will be send related to this Swap. type: boolean @@ -26349,9 +25478,7 @@ components: $ref: '#/components/schemas/LineItem' description: Items to ship no_notification: - description: >- - A flag to indicate if no notifications should be emitted related to - the updated order. + description: A flag to indicate if no notifications should be emitted related to the updated order. type: boolean AdminPaymentCollectionsRes: type: object @@ -26413,6 +25540,7 @@ components: description: The prices to update or add. type: array items: + type: object required: - amount - variant_id @@ -26421,17 +25549,13 @@ components: description: The ID of the price. type: string region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. type: string currency_code: - description: >- - The 3 character ISO currency code for which the price will be - used. Only required if region_id is not provided. + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. variant_id: description: The ID of the Variant for which the price is used. @@ -26446,9 +25570,7 @@ components: description: The maximum quantity for which the price will be used. type: integer override: - description: >- - If true the prices will replace all existing prices associated with - the Price List. + description: If true the prices will replace all existing prices associated with the Price List. type: boolean AdminPostPriceListsPriceListReq: type: object @@ -26488,22 +25610,19 @@ components: description: The prices of the Price List. type: array items: + type: object required: - amount - variant_id properties: region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. type: string currency_code: - description: >- - The 3 character ISO currency code for which the price will be - used. Only required if region_id is not provided. + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. amount: description: The amount to charge for the Product Variant. @@ -26521,6 +25640,7 @@ components: type: array description: A list of customer groups that the Price List applies to. items: + type: object required: - id properties: @@ -26670,6 +25790,7 @@ components: description: The prices of the Price List. type: array items: + type: object required: - amount - variant_id @@ -26678,17 +25799,13 @@ components: description: The ID of the price. type: string region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currecny_code is not provided. + description: The ID of the Region for which the price is used. Only required if currecny_code is not provided. type: string currency_code: - description: >- - The 3 character ISO currency code for which the price will be - used. Only required if region_id is not provided. + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. variant_id: description: The ID of the Variant for which the price is used. @@ -26706,6 +25823,7 @@ components: type: array description: A list of customer groups that the Price List applies to. items: + type: object required: - id properties: @@ -26715,6 +25833,22 @@ 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: @@ -26725,9 +25859,7 @@ components: 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. + 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 @@ -26737,6 +25869,57 @@ components: 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: @@ -26810,16 +25993,11 @@ components: description: A description of the Product. type: string is_giftcard: - description: >- - A flag to indicate if the Product represents a Gift Card. Purchasing - Products with this flag set to `true` will result in a Gift Card - being created. + description: A flag to indicate if the Product represents a Gift Card. Purchasing Products with this flag set to `true` will result in a Gift Card being created. type: boolean default: false discountable: - description: >- - A flag to indicate if discounts can be applied to the LineItems - generated from this Product + description: A flag to indicate if discounts can be applied to the LineItems generated from this Product type: boolean default: true images: @@ -26861,6 +26039,7 @@ components: description: Tags to associate the Product with. type: array items: + type: object required: - value properties: @@ -26868,24 +26047,34 @@ components: description: The ID of an existing Tag. type: string value: - description: 'The value of the Tag, these will be upserted.' + description: The value of the Tag, these will be upserted. type: string sales_channels: description: '[EXPERIMENTAL] Sales channels to associate the Product with.' type: array items: + type: object required: - id properties: id: description: The ID of an existing Sales channel. type: string - options: - description: >- - The Options that the Product should have. These define on which - properties the Product's Product Variants will differ. + categories: + description: Categories to add the Product to. type: array items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string + options: + description: The Options that the Product should have. These define on which properties the Product's Product Variants will differ. + type: array + items: + type: object required: - title properties: @@ -26896,6 +26085,7 @@ components: description: A list of Product Variants to create with the Product. type: array items: + type: object required: - title properties: @@ -26922,14 +26112,10 @@ components: type: integer default: 0 allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. + description: Whether the Product Variant can be purchased when out of stock. type: boolean manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. + description: Whether Medusa should keep track of the inventory for this Product Variant. type: boolean weight: description: The wieght of the Product Variant. @@ -26953,29 +26139,23 @@ components: description: The material composition of the Product Variant. type: string metadata: - description: >- - An optional set of key-value pairs with additional - information. + description: An optional set of key-value pairs with additional information. type: object prices: type: array items: + type: object required: - amount properties: region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. type: string currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. amount: description: The amount to charge for the Product Variant. @@ -26989,13 +26169,12 @@ components: options: type: array items: + type: object required: - value properties: value: - description: >- - The value to give for the Product Option at the same - index in the Product's `options` field. + description: The value to give for the Product Option at the same index in the Product's `options` field. type: string weight: description: The weight of the Product. @@ -27057,9 +26236,7 @@ components: description: Whether the Product Variant can be purchased when out of stock. type: boolean manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this Product - Variant. + description: Whether Medusa should keep track of the inventory for this Product Variant. type: boolean default: true weight: @@ -27089,6 +26266,7 @@ components: prices: type: array items: + type: object required: - amount properties: @@ -27096,17 +26274,13 @@ components: description: The ID of the price. type: string region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. type: string currency_code: - description: >- - The 3 character ISO currency code for which the price will be - used. Only required if region_id is not provided. + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. amount: description: The amount to charge for the Product Variant. @@ -27120,6 +26294,7 @@ components: options: type: array items: + type: object required: - option_id - value @@ -27223,6 +26398,7 @@ components: tags: type: array items: + type: object properties: id: description: The ID of the tag. @@ -27271,9 +26447,7 @@ components: description: A description of the Product. type: string discountable: - description: >- - A flag to indicate if discounts can be applied to the LineItems - generated from this Product + description: A flag to indicate if discounts can be applied to the LineItems generated from this Product type: boolean images: description: Images of the Product. @@ -27313,6 +26487,7 @@ components: description: Tags to associate the Product with. type: array items: + type: object required: - value properties: @@ -27320,22 +26495,34 @@ components: description: The ID of an existing Tag. type: string value: - description: 'The value of the Tag, these will be upserted.' + description: The value of the Tag, these will be upserted. type: string sales_channels: description: '[EXPERIMENTAL] Sales channels to associate the Product with.' type: array items: + type: object required: - id properties: id: description: The ID of an existing Sales channel. type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string variants: description: A list of Product Variants to create with the Product. type: array items: + type: object properties: id: description: The ID of the Product Variant. @@ -27362,14 +26549,10 @@ components: description: The amount of stock kept for the Product Variant. type: integer allow_backorder: - description: >- - Whether the Product Variant can be purchased when out of - stock. + description: Whether the Product Variant can be purchased when out of stock. type: boolean manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this - Product Variant. + description: Whether Medusa should keep track of the inventory for this Product Variant. type: boolean weight: description: The wieght of the Product Variant. @@ -27393,13 +26576,12 @@ components: description: The material composition of the Product Variant. type: string metadata: - description: >- - An optional set of key-value pairs with additional - information. + description: An optional set of key-value pairs with additional information. type: object prices: type: array items: + type: object required: - amount properties: @@ -27407,18 +26589,13 @@ components: description: The ID of the Price. type: string region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. type: string currency_code: - description: >- - The 3 character ISO currency code for which the price - will be used. Only required if region_id is not - provided. + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. amount: description: The amount to charge for the Product Variant. @@ -27432,6 +26609,7 @@ components: options: type: array items: + type: object required: - option_id - value @@ -27440,9 +26618,7 @@ components: description: The ID of the Option. type: string value: - description: >- - The value to give for the Product Option at the same - index in the Product's `options` field. + description: The value to give for the Product Option at the same index in the Product's `options` field. type: string weight: description: The wieght of the Product. @@ -27498,9 +26674,7 @@ components: description: Whether the Product Variant can be purchased when out of stock. type: boolean manage_inventory: - description: >- - Whether Medusa should keep track of the inventory for this Product - Variant. + description: Whether Medusa should keep track of the inventory for this Product Variant. type: boolean weight: description: The weight of the Product Variant. @@ -27529,6 +26703,7 @@ components: prices: type: array items: + type: object required: - amount properties: @@ -27536,17 +26711,13 @@ components: description: The ID of the price. type: string region_id: - description: >- - The ID of the Region for which the price is used. Only - required if currency_code is not provided. + description: The ID of the Region for which the price is used. Only required if currency_code is not provided. type: string currency_code: - description: >- - The 3 character ISO currency code for which the price will be - used. Only required if region_id is not provided. + description: The 3 character ISO currency code for which the price will be used. Only required if region_id is not provided. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. amount: description: The amount to charge for the Product Variant. @@ -27560,6 +26731,7 @@ components: options: type: array items: + type: object required: - option_id - value @@ -27667,8 +26839,7 @@ components: description: The 2 character ISO code for the Country. type: string externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. AdminPostRegionsRegionFulfillmentProvidersReq: type: object @@ -27703,7 +26874,7 @@ components: description: The 3 character ISO currency code to use for the Region. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. tax_code: description: An optional tax code the Region. @@ -27717,16 +26888,12 @@ components: items: type: string fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled for the - Region + description: A list of Fulfillment Provider IDs that should be enabled for the Region type: array items: type: string countries: - description: >- - A list of countries' 2 ISO Characters that should be included in the - Region. + description: A list of countries' 2 ISO Characters that should be included in the Region. example: - US type: array @@ -27798,22 +26965,16 @@ components: description: The 3 character ISO currency code to use for the Region. type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. automatic_taxes: - description: >- - If true Medusa will automatically calculate taxes for carts in this - region. If false you have to manually call POST /carts/:id/taxes. + description: If true Medusa will automatically calculate taxes for carts in this region. If false you have to manually call POST /carts/:id/taxes. type: boolean gift_cards_taxable: - description: >- - Whether gift cards in this region should be applied sales tax when - purchasing a gift card + description: Whether gift cards in this region should be applied sales tax when purchasing a gift card type: boolean tax_provider_id: - description: >- - The ID of the tax provider to use; if null the system tax provider - is used + description: The ID of the tax provider to use; if null the system tax provider is used type: string tax_code: description: An optional tax code the Region. @@ -27830,16 +26991,12 @@ components: items: type: string fulfillment_providers: - description: >- - A list of Fulfillment Provider IDs that should be enabled for the - Region + description: A list of Fulfillment Provider IDs that should be enabled for the Region type: array items: type: string countries: - description: >- - A list of countries' 2 ISO Characters that should be included in the - Region. + description: A list of countries' 2 ISO Characters that should be included in the Region. type: array items: type: string @@ -27888,9 +27045,7 @@ components: description: The label to display to the Customer. type: string value: - description: >- - The value that the Return Reason will be identified by. Must be - unique. + description: The value that the Return Reason will be identified by. Must be unique. type: string parent_return_reason_id: description: The ID of the parent return reason. @@ -27934,9 +27089,7 @@ components: description: The label to display to the Customer. type: string value: - description: >- - The value that the Return Reason will be identified by. Must be - unique. + description: The value that the Return Reason will be identified by. Must be unique. type: string description: description: An optional description to for the Reason. @@ -27979,6 +27132,7 @@ components: description: The Line Items that have been received. type: array items: + type: object required: - item_id - quantity @@ -28137,9 +27291,7 @@ components: description: The ID of the Shipping Profile to add the Shipping Option to. type: number data: - description: >- - The data needed for the Fulfillment Provider to handle shipping with - this Shipping Option. + description: The data needed for the Fulfillment Provider to handle shipping with this Shipping Option. type: object price_type: description: The type of the Shipping Option price. @@ -28151,11 +27303,10 @@ components: description: The amount to charge for the Shipping Option. type: integer requirements: - description: >- - The requirements that must be satisfied for the Shipping Option to - be available. + description: The requirements that must be satisfied for the Shipping Option to be available. type: array items: + type: object required: - type - amount @@ -28174,7 +27325,7 @@ components: type: boolean default: false admin_only: - description: 'If true, the option can be used for draft orders' + description: If true, the option can be used for draft orders type: boolean default: false metadata: @@ -28224,17 +27375,16 @@ components: description: The amount to charge for the Shipping Option. type: integer admin_only: - description: 'If true, the option can be used for draft orders' + description: If true, the option can be used for draft orders type: boolean metadata: description: An optional set of key-value pairs with additional information. type: object requirements: - description: >- - The requirements that must be satisfied for the Shipping Option to - be available. + description: The requirements that must be satisfied for the Shipping Option to be available. type: array items: + type: object required: - type - amount @@ -28258,10 +27408,18 @@ components: type: object required: - name + - type properties: name: description: The name of the Shipping Profile type: string + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom AdminDeleteShippingProfileRes: type: object properties: @@ -28294,6 +27452,22 @@ components: name: description: The name of the Shipping Profile type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + products: + description: An optional array of product ids to associate with the Shipping Profile + type: array + shipping_options: + description: An optional array of shipping option ids to associate with the Shipping Profile + type: array AdminPostStockLocationsReq: type: object required: @@ -28312,6 +27486,20 @@ components: car: white address: $ref: '#/components/schemas/StockLocationAddressInput' + AdminStockLocationsDeleteRes: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + default: stock_location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true AdminStockLocationsRes: type: object properties: @@ -28375,25 +27563,19 @@ components: 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 + 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 + 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 + 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' + 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. @@ -28530,9 +27712,7 @@ components: properties: product_types: type: array - description: >- - The IDs of the types of products to remove association with this tax - rate + description: The IDs of the types of products to remove association with this tax rate items: type: string AdminDeleteTaxRatesTaxRateProductsReq: @@ -28552,9 +27732,7 @@ components: properties: shipping_options: type: array - description: >- - The IDs of the shipping options to remove association with this tax - rate + description: The IDs of the shipping options to remove association with this tax rate items: type: string AdminPostTaxRatesTaxRateReq: @@ -28736,6 +27914,28 @@ components: metadata: description: An optional set of key-value pairs with additional information. type: object + AdminGetVariantsVariantInventoryRes: + type: object + properties: + id: + description: the id of the variant + type: string + inventory: + description: the stock location address ID + type: string + sales_channel_availability: + type: object + description: An optional key-value map with additional details + properties: + channel_name: + description: Sales channel name + type: string + channel_id: + description: Sales channel id + type: string + available_quantity: + description: Available quantity in sales channel + type: number AdminVariantsListRes: type: object properties: diff --git a/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/admin_draft-orders_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/auth/deleteundefined b/docs/api/admin/code_samples/JavaScript/auth/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/auth/deleteundefined rename to docs/api/admin/code_samples/JavaScript/auth/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/auth/getundefined b/docs/api/admin/code_samples/JavaScript/auth/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/auth/getundefined rename to docs/api/admin/code_samples/JavaScript/auth/get.js diff --git a/docs/api/admin/code_samples/JavaScript/auth/postundefined b/docs/api/admin/code_samples/JavaScript/auth/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/auth/postundefined rename to docs/api/admin/code_samples/JavaScript/auth/post.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs/getundefined b/docs/api/admin/code_samples/JavaScript/batch-jobs/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs/getundefined rename to docs/api/admin/code_samples/JavaScript/batch-jobs/get.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs/postundefined b/docs/api/admin/code_samples/JavaScript/batch-jobs/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs/postundefined rename to docs/api/admin/code_samples/JavaScript/batch-jobs/post.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/batch-jobs_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_confirm/postundefined b/docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_confirm/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_confirm/postundefined rename to docs/api/admin/code_samples/JavaScript/batch-jobs_{id}_confirm/post.js diff --git a/docs/api/admin/code_samples/JavaScript/collections/getundefined b/docs/api/admin/code_samples/JavaScript/collections/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections/getundefined rename to docs/api/admin/code_samples/JavaScript/collections/get.js diff --git a/docs/api/admin/code_samples/JavaScript/collections/postundefined b/docs/api/admin/code_samples/JavaScript/collections/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections/postundefined rename to docs/api/admin/code_samples/JavaScript/collections/post.js diff --git a/docs/api/admin/code_samples/JavaScript/collections_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/collections_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/collections_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/collections_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/collections_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/collections_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/collections_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/collections_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/collections_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/collections_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/currencies/getundefined b/docs/api/admin/code_samples/JavaScript/currencies/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/currencies/getundefined rename to docs/api/admin/code_samples/JavaScript/currencies/get.js diff --git a/docs/api/admin/code_samples/JavaScript/currencies_{code}/postundefined b/docs/api/admin/code_samples/JavaScript/currencies_{code}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/currencies_{code}/postundefined rename to docs/api/admin/code_samples/JavaScript/currencies_{code}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups/getundefined b/docs/api/admin/code_samples/JavaScript/customer-groups/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups/getundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups/postundefined b/docs/api/admin/code_samples/JavaScript/customer-groups/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups/postundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/customer-groups_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers/getundefined b/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers/getundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/postundefined b/docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/customer-groups_{id}_customers_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customers/getundefined b/docs/api/admin/code_samples/JavaScript/customers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers/getundefined rename to docs/api/admin/code_samples/JavaScript/customers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customers/postundefined b/docs/api/admin/code_samples/JavaScript/customers/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers/postundefined rename to docs/api/admin/code_samples/JavaScript/customers/post.js diff --git a/docs/api/admin/code_samples/JavaScript/customers_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/customers_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/customers_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/customers_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/customers_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/customers_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/customers_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts/getundefined b/docs/api/admin/code_samples/JavaScript/discounts/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts/getundefined rename to docs/api/admin/code_samples/JavaScript/discounts/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts/postundefined b/docs/api/admin/code_samples/JavaScript/discounts/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts/postundefined rename to docs/api/admin/code_samples/JavaScript/discounts/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_code_{code}/getundefined b/docs/api/admin/code_samples/JavaScript/discounts_code_{code}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_code_{code}/getundefined rename to docs/api/admin/code_samples/JavaScript/discounts_code_{code}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions/postundefined b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions/postundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/getundefined b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/getundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/postundefined b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/postundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/discounts_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/discounts_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/discounts_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes/postundefined b/docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes/postundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes/post.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/deleteundefined b/docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/postundefined b/docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/postundefined rename to docs/api/admin/code_samples/JavaScript/discounts_{id}_regions_{region_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders/getundefined b/docs/api/admin/code_samples/JavaScript/draft-orders/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders/getundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders/get.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders/postundefined b/docs/api/admin/code_samples/JavaScript/draft-orders/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders/postundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/draft-orders_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/draft-orders_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items/postundefined b/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items/postundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/postundefined b/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/postundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_pay/postundefined b/docs/api/admin/code_samples/JavaScript/draft-orders_{id}_pay/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/draft-orders_{id}_pay/postundefined rename to docs/api/admin/code_samples/JavaScript/draft-orders_{id}_pay/post.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards/getundefined b/docs/api/admin/code_samples/JavaScript/gift-cards/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards/getundefined rename to docs/api/admin/code_samples/JavaScript/gift-cards/get.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards/postundefined b/docs/api/admin/code_samples/JavaScript/gift-cards/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards/postundefined rename to docs/api/admin/code_samples/JavaScript/gift-cards/post.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/gift-cards_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/gift-cards_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/gift-cards_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/gift-cards_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/gift-cards_{id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/product-categories_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/inventory-items/get.js similarity index 59% rename from docs/api/store/code_samples/JavaScript/product-categories_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/inventory-items/get.js index 0e5671230d..d9b7ee9805 100644 --- a/docs/api/store/code_samples/JavaScript/product-categories_{id}/getundefined +++ b/docs/api/admin/code_samples/JavaScript/inventory-items/get.js @@ -1,7 +1,7 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -medusa.productCategories.retrieve("pcat-id") -.then(({ productCategory }) => { - console.log(productCategory.id); +medusa.admin.inventoryItems.list() +.then(({ inventory_items }) => { + console.log(inventory_items.length); }); diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/delete.js new file mode 100644 index 0000000000..ffd9dc0d3a --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/delete.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.delete(inventoryItemId) + .then(({ id, object, deleted }) => { + console.log(id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/get.js b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/get.js new file mode 100644 index 0000000000..8bc8511104 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/get.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.retrieve(inventoryItemId) +.then(({ inventory_item }) => { + console.log(inventory_item.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/post.js b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/post.js new file mode 100644 index 0000000000..3035162092 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}/post.js @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.update(inventoryItemId, { + origin_country: "US", +}) +.then(({ inventory_item }) => { + console.log(inventory_item.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/get.js b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/get.js new file mode 100644 index 0000000000..616eaeb60f --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/get.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.listLocationLevels(inventoryItemId) +.then(({ inventory_item }) => { + console.log(inventory_item.location_levels); +}); diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/post.js b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/post.js new file mode 100644 index 0000000000..4767c9aa6c --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels/post.js @@ -0,0 +1,10 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.createLocationLevel(inventoryItemId, { + location_id: 'sloc', + stocked_quantity: 10, +}) +.then(({ inventory_item }) => { + console.log(inventory_item.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/delete.js b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/delete.js new file mode 100644 index 0000000000..9cc59e3fb7 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/delete.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.deleteLocationLevel(inventoryItemId, locationId) +.then(({ inventory_item }) => { + console.log(inventory_item.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/post.js b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/post.js new file mode 100644 index 0000000000..42977d427c --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/post.js @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.inventoryItems.updateLocationLevel(inventoryItemId, locationId, { + stocked_quantity: 15, +}) +.then(({ inventory_item }) => { + console.log(inventory_item.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/invites/getundefined b/docs/api/admin/code_samples/JavaScript/invites/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites/getundefined rename to docs/api/admin/code_samples/JavaScript/invites/get.js diff --git a/docs/api/admin/code_samples/JavaScript/invites/postundefined b/docs/api/admin/code_samples/JavaScript/invites/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites/postundefined rename to docs/api/admin/code_samples/JavaScript/invites/post.js diff --git a/docs/api/admin/code_samples/JavaScript/invites_accept/postundefined b/docs/api/admin/code_samples/JavaScript/invites_accept/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites_accept/postundefined rename to docs/api/admin/code_samples/JavaScript/invites_accept/post.js diff --git a/docs/api/admin/code_samples/JavaScript/invites_{invite_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/invites_{invite_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites_{invite_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/invites_{invite_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/invites_{invite_id}_resend/postundefined b/docs/api/admin/code_samples/JavaScript/invites_{invite_id}_resend/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/invites_{invite_id}_resend/postundefined rename to docs/api/admin/code_samples/JavaScript/invites_{invite_id}_resend/post.js diff --git a/docs/api/admin/code_samples/JavaScript/notes/getundefined b/docs/api/admin/code_samples/JavaScript/notes/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes/getundefined rename to docs/api/admin/code_samples/JavaScript/notes/get.js diff --git a/docs/api/admin/code_samples/JavaScript/notes/postundefined b/docs/api/admin/code_samples/JavaScript/notes/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes/postundefined rename to docs/api/admin/code_samples/JavaScript/notes/post.js diff --git a/docs/api/admin/code_samples/JavaScript/notes_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/notes_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/notes_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/notes_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/notes_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/notes_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/notes_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/notes_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notes_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/notes_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/notifications/getundefined b/docs/api/admin/code_samples/JavaScript/notifications/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notifications/getundefined rename to docs/api/admin/code_samples/JavaScript/notifications/get.js diff --git a/docs/api/admin/code_samples/JavaScript/notifications_{id}_resend/postundefined b/docs/api/admin/code_samples/JavaScript/notifications_{id}_resend/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/notifications_{id}_resend/postundefined rename to docs/api/admin/code_samples/JavaScript/notifications_{id}_resend/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits/getundefined b/docs/api/admin/code_samples/JavaScript/order-edits/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits/getundefined rename to docs/api/admin/code_samples/JavaScript/order-edits/get.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits/postundefined rename to docs/api/admin/code_samples/JavaScript/order-edits/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_changes_{change_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_changes_{change_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_changes_{change_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}_changes_{change_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/postundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/postundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}_items_{item_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/postundefined rename to docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order_{id}_claims/postundefined b/docs/api/admin/code_samples/JavaScript/order_{id}_claims/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order_{id}_claims/postundefined rename to docs/api/admin/code_samples/JavaScript/order_{id}_claims/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order_{id}_claims_{claim_id}/postundefined b/docs/api/admin/code_samples/JavaScript/order_{id}_claims_{claim_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order_{id}_claims_{claim_id}/postundefined rename to docs/api/admin/code_samples/JavaScript/order_{id}_claims_{claim_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/order_{id}_swaps/postundefined b/docs/api/admin/code_samples/JavaScript/order_{id}_swaps/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/order_{id}_swaps/postundefined rename to docs/api/admin/code_samples/JavaScript/order_{id}_swaps/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders/getundefined b/docs/api/admin/code_samples/JavaScript/orders/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders/getundefined rename to docs/api/admin/code_samples/JavaScript/orders/get.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_archive/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_archive/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_archive/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_archive/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_capture/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_capture/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_capture/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_capture/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_complete/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_complete/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_complete/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_complete/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillment/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillment/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillment/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillment/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_refund/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_refund/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_refund/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_refund/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_reservations/getundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_reservations/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_reservations/getundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_reservations/get.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_return/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_return/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_return/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_return/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_shipment/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_shipment/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_shipment/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_shipment/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_shipping-methods/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_shipping-methods/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_shipping-methods/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_shipping-methods/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/post.js diff --git a/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/postundefined b/docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/postundefined rename to docs/api/admin/code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/payment-collections_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/payment-collections_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/payment-collections_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined b/docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/postundefined rename to docs/api/admin/code_samples/JavaScript/payment-collections_{id}_authorize/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payments_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/payments_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}_capture/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payments_{id}_capture/postundefined rename to docs/api/admin/code_samples/JavaScript/payments_{id}_capture/post.js diff --git a/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined b/docs/api/admin/code_samples/JavaScript/payments_{id}_refund/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/payments_{id}_refund/postundefined rename to docs/api/admin/code_samples/JavaScript/payments_{id}_refund/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists/getundefined b/docs/api/admin/code_samples/JavaScript/price-lists/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists/getundefined rename to docs/api/admin/code_samples/JavaScript/price-lists/get.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists/postundefined b/docs/api/admin/code_samples/JavaScript/price-lists/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists/postundefined rename to docs/api/admin/code_samples/JavaScript/price-lists/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/postundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}_prices_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_products/getundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}_products/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_products/getundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}_products/get.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/deleteundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/deleteundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/deleteundefined b/docs/api/admin/code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/deleteundefined rename to docs/api/admin/code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/product-categories/get.js b/docs/api/admin/code_samples/JavaScript/product-categories/get.js new file mode 100644 index 0000000000..8df496de40 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/product-categories/get.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.productCategories.list() +.then(({ product_categories, limit, offset, count }) => { + console.log(product_categories.length); +}); diff --git a/docs/api/admin/code_samples/JavaScript/product-categories/post.js b/docs/api/admin/code_samples/JavaScript/product-categories/post.js new file mode 100644 index 0000000000..ecda755d7f --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/product-categories/post.js @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.productCategories.create({ + name: "Skinny Jeans", +}) +.then(({ product_category }) => { + console.log(product_category.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/product-categories_{id}/delete.js new file mode 100644 index 0000000000..3f79a9da46 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/product-categories_{id}/delete.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.productCategories.delete(product_category_id) +.then(({ id, object, deleted }) => { + console.log(id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}/get.js b/docs/api/admin/code_samples/JavaScript/product-categories_{id}/get.js new file mode 100644 index 0000000000..bc47b70712 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/product-categories_{id}/get.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.productCategories.retrieve(product_category_id) +.then(({ product_category }) => { + console.log(product_category.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}/post.js b/docs/api/admin/code_samples/JavaScript/product-categories_{id}/post.js new file mode 100644 index 0000000000..29d4d9363f --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/product-categories_{id}/post.js @@ -0,0 +1,9 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.productCategories.update(product_category_id, { + name: "Skinny Jeans" +}) +.then(({ product_category }) => { + console.log(product_category.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/delete.js b/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/delete.js new file mode 100644 index 0000000000..dc9b2d99f1 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/delete.js @@ -0,0 +1,13 @@ +import Medusa from "@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); +}); diff --git a/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/post.js b/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/post.js new file mode 100644 index 0000000000..48204cd6e4 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/product-categories_{id}_products_batch/post.js @@ -0,0 +1,13 @@ +import Medusa from "@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); +}); diff --git a/docs/api/admin/code_samples/JavaScript/product-tags/getundefined b/docs/api/admin/code_samples/JavaScript/product-tags/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-tags/getundefined rename to docs/api/admin/code_samples/JavaScript/product-tags/get.js diff --git a/docs/api/admin/code_samples/JavaScript/product-types/getundefined b/docs/api/admin/code_samples/JavaScript/product-types/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/product-types/getundefined rename to docs/api/admin/code_samples/JavaScript/product-types/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products/getundefined b/docs/api/admin/code_samples/JavaScript/products/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products/getundefined rename to docs/api/admin/code_samples/JavaScript/products/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products/postundefined b/docs/api/admin/code_samples/JavaScript/products/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products/postundefined rename to docs/api/admin/code_samples/JavaScript/products/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_tag-usage/getundefined b/docs/api/admin/code_samples/JavaScript/products_tag-usage/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_tag-usage/getundefined rename to docs/api/admin/code_samples/JavaScript/products_tag-usage/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products_types/getundefined b/docs/api/admin/code_samples/JavaScript/products_types/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_types/getundefined rename to docs/api/admin/code_samples/JavaScript/products_types/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/products_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/products_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/products_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_metadata/postundefined b/docs/api/admin/code_samples/JavaScript/products_{id}_metadata/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_metadata/postundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}_metadata/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_options/postundefined b/docs/api/admin/code_samples/JavaScript/products_{id}_options/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_options/postundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}_options/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/postundefined b/docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/postundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}_options_{option_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_variants/postundefined b/docs/api/admin/code_samples/JavaScript/products_{id}_variants/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_variants/postundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}_variants/post.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/postundefined b/docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/postundefined rename to docs/api/admin/code_samples/JavaScript/products_{id}_variants_{variant_id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-key_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys/getundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys/get.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys/postundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_revoke/post.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/getundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/getundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/get.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined b/docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions/getundefined b/docs/api/admin/code_samples/JavaScript/regions/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions/getundefined rename to docs/api/admin/code_samples/JavaScript/regions/get.js diff --git a/docs/api/admin/code_samples/JavaScript/regions/postundefined b/docs/api/admin/code_samples/JavaScript/regions/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions/postundefined rename to docs/api/admin/code_samples/JavaScript/regions/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_countries/postundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}_countries/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_countries/postundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}_countries/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_countries_{country_code}/deleteundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}_countries_{country_code}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_countries_{country_code}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}_countries_{country_code}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-options/getundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-options/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-options/getundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-options/get.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers/postundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers/postundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers/postundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers/postundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers/post.js diff --git a/docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations/postundefined b/docs/api/admin/code_samples/JavaScript/reservations/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations/postundefined rename to docs/api/admin/code_samples/JavaScript/reservations/post.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/reservations_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/reservations_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/reservations_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/reservations_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/reservations_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/reservations_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/reservations_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/reservations_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons/getundefined b/docs/api/admin/code_samples/JavaScript/return-reasons/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons/getundefined rename to docs/api/admin/code_samples/JavaScript/return-reasons/get.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons/postundefined b/docs/api/admin/code_samples/JavaScript/return-reasons/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons/postundefined rename to docs/api/admin/code_samples/JavaScript/return-reasons/post.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/return-reasons_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/return-reasons_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/return-reasons_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/return-reasons_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/return-reasons_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/returns/getundefined b/docs/api/admin/code_samples/JavaScript/returns/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/returns/getundefined rename to docs/api/admin/code_samples/JavaScript/returns/get.js diff --git a/docs/api/admin/code_samples/JavaScript/returns_{id}_cancel/postundefined b/docs/api/admin/code_samples/JavaScript/returns_{id}_cancel/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/returns_{id}_cancel/postundefined rename to docs/api/admin/code_samples/JavaScript/returns_{id}_cancel/post.js diff --git a/docs/api/admin/code_samples/JavaScript/returns_{id}_receive/postundefined b/docs/api/admin/code_samples/JavaScript/returns_{id}_receive/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/returns_{id}_receive/postundefined rename to docs/api/admin/code_samples/JavaScript/returns_{id}_receive/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels/getundefined b/docs/api/admin/code_samples/JavaScript/sales-channels/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels/getundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels/get.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels/postundefined b/docs/api/admin/code_samples/JavaScript/sales-channels/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels/postundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/sales-channels_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/postundefined b/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels_{id}_products_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/deleteundefined b/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/deleteundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/postundefined b/docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/postundefined rename to docs/api/admin/code_samples/JavaScript/sales-channels_{id}_stock-locations/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options/getundefined b/docs/api/admin/code_samples/JavaScript/shipping-options/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options/getundefined rename to docs/api/admin/code_samples/JavaScript/shipping-options/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options/postundefined b/docs/api/admin/code_samples/JavaScript/shipping-options/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options/postundefined rename to docs/api/admin/code_samples/JavaScript/shipping-options/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/shipping-options_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/shipping-options_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/shipping-options_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-options_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/shipping-options_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles/getundefined b/docs/api/admin/code_samples/JavaScript/shipping-profiles/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles/getundefined rename to docs/api/admin/code_samples/JavaScript/shipping-profiles/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles/postundefined b/docs/api/admin/code_samples/JavaScript/shipping-profiles/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles/postundefined rename to docs/api/admin/code_samples/JavaScript/shipping-profiles/post.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/shipping-profiles_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations/getundefined b/docs/api/admin/code_samples/JavaScript/stock-locations/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations/getundefined rename to docs/api/admin/code_samples/JavaScript/stock-locations/get.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations/postundefined b/docs/api/admin/code_samples/JavaScript/stock-locations/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations/postundefined rename to docs/api/admin/code_samples/JavaScript/stock-locations/post.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/delete.js b/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/delete.js new file mode 100644 index 0000000000..b7e33b5af8 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/delete.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.stockLocations.delete(stock_location_id) + .then(({ id, object, deleted }) => { + console.log(id) + }) diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/stock-locations_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/stock-locations_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/stock-locations_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/stock-locations_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/store/getundefined b/docs/api/admin/code_samples/JavaScript/store/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store/getundefined rename to docs/api/admin/code_samples/JavaScript/store/get.js diff --git a/docs/api/admin/code_samples/JavaScript/store/postundefined b/docs/api/admin/code_samples/JavaScript/store/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store/postundefined rename to docs/api/admin/code_samples/JavaScript/store/post.js diff --git a/docs/api/admin/code_samples/JavaScript/store_currencies_{code}/deleteundefined b/docs/api/admin/code_samples/JavaScript/store_currencies_{code}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_currencies_{code}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/store_currencies_{code}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/store_currencies_{code}/postundefined b/docs/api/admin/code_samples/JavaScript/store_currencies_{code}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_currencies_{code}/postundefined rename to docs/api/admin/code_samples/JavaScript/store_currencies_{code}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/store_payment-providers/getundefined b/docs/api/admin/code_samples/JavaScript/store_payment-providers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_payment-providers/getundefined rename to docs/api/admin/code_samples/JavaScript/store_payment-providers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/store_tax-providers/getundefined b/docs/api/admin/code_samples/JavaScript/store_tax-providers/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/store_tax-providers/getundefined rename to docs/api/admin/code_samples/JavaScript/store_tax-providers/get.js diff --git a/docs/api/admin/code_samples/JavaScript/swaps/getundefined b/docs/api/admin/code_samples/JavaScript/swaps/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/swaps/getundefined rename to docs/api/admin/code_samples/JavaScript/swaps/get.js diff --git a/docs/api/admin/code_samples/JavaScript/swaps_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/swaps_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/swaps_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/swaps_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates/getundefined b/docs/api/admin/code_samples/JavaScript/tax-rates/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates/getundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates/get.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates/postundefined b/docs/api/admin/code_samples/JavaScript/tax-rates/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates/postundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/postundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}_product-types_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/postundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}_products_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/deleteundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/deleteundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/postundefined b/docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/postundefined rename to docs/api/admin/code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/post.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads/deleteundefined b/docs/api/admin/code_samples/JavaScript/uploads/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads/deleteundefined rename to docs/api/admin/code_samples/JavaScript/uploads/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads/postundefined b/docs/api/admin/code_samples/JavaScript/uploads/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads/postundefined rename to docs/api/admin/code_samples/JavaScript/uploads/post.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads_download-url/postundefined b/docs/api/admin/code_samples/JavaScript/uploads_download-url/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads_download-url/postundefined rename to docs/api/admin/code_samples/JavaScript/uploads_download-url/post.js diff --git a/docs/api/admin/code_samples/JavaScript/uploads_protected/postundefined b/docs/api/admin/code_samples/JavaScript/uploads_protected/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/uploads_protected/postundefined rename to docs/api/admin/code_samples/JavaScript/uploads_protected/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users/getundefined b/docs/api/admin/code_samples/JavaScript/users/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users/getundefined rename to docs/api/admin/code_samples/JavaScript/users/get.js diff --git a/docs/api/admin/code_samples/JavaScript/users/postundefined b/docs/api/admin/code_samples/JavaScript/users/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users/postundefined rename to docs/api/admin/code_samples/JavaScript/users/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users_password-token/postundefined b/docs/api/admin/code_samples/JavaScript/users_password-token/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_password-token/postundefined rename to docs/api/admin/code_samples/JavaScript/users_password-token/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users_reset-password/postundefined b/docs/api/admin/code_samples/JavaScript/users_reset-password/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_reset-password/postundefined rename to docs/api/admin/code_samples/JavaScript/users_reset-password/post.js diff --git a/docs/api/admin/code_samples/JavaScript/users_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/users_{id}/delete.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_{id}/deleteundefined rename to docs/api/admin/code_samples/JavaScript/users_{id}/delete.js diff --git a/docs/api/admin/code_samples/JavaScript/users_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/users_{id}/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_{id}/getundefined rename to docs/api/admin/code_samples/JavaScript/users_{id}/get.js diff --git a/docs/api/admin/code_samples/JavaScript/users_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/users_{id}/post.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/users_{id}/postundefined rename to docs/api/admin/code_samples/JavaScript/users_{id}/post.js diff --git a/docs/api/admin/code_samples/JavaScript/variants/getundefined b/docs/api/admin/code_samples/JavaScript/variants/get.js similarity index 100% rename from docs/api/admin/code_samples/JavaScript/variants/getundefined rename to docs/api/admin/code_samples/JavaScript/variants/get.js diff --git a/docs/api/admin/code_samples/JavaScript/variants_{id}_inventory/get.js b/docs/api/admin/code_samples/JavaScript/variants_{id}_inventory/get.js new file mode 100644 index 0000000000..c3d1c7018d --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/variants_{id}_inventory/get.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.admin.variants.list() + .then(({ variants, limit, offset, count }) => { + console.log(variants.length) + }) diff --git a/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/postundefined b/docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/postundefined rename to docs/api/admin/code_samples/Shell/admin_draft-orders_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/apps/getundefined b/docs/api/admin/code_samples/Shell/apps/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/apps/getundefined rename to docs/api/admin/code_samples/Shell/apps/get.sh diff --git a/docs/api/admin/code_samples/Shell/apps_authorizations/postundefined b/docs/api/admin/code_samples/Shell/apps_authorizations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/apps_authorizations/postundefined rename to docs/api/admin/code_samples/Shell/apps_authorizations/post.sh diff --git a/docs/api/admin/code_samples/Shell/auth/deleteundefined b/docs/api/admin/code_samples/Shell/auth/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/auth/deleteundefined rename to docs/api/admin/code_samples/Shell/auth/delete.sh diff --git a/docs/api/admin/code_samples/Shell/auth/getundefined b/docs/api/admin/code_samples/Shell/auth/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/auth/getundefined rename to docs/api/admin/code_samples/Shell/auth/get.sh diff --git a/docs/api/admin/code_samples/Shell/auth/postundefined b/docs/api/admin/code_samples/Shell/auth/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/auth/postundefined rename to docs/api/admin/code_samples/Shell/auth/post.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs/getundefined b/docs/api/admin/code_samples/Shell/batch-jobs/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs/getundefined rename to docs/api/admin/code_samples/Shell/batch-jobs/get.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs/postundefined b/docs/api/admin/code_samples/Shell/batch-jobs/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs/postundefined rename to docs/api/admin/code_samples/Shell/batch-jobs/post.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs_{id}/getundefined b/docs/api/admin/code_samples/Shell/batch-jobs_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs_{id}/getundefined rename to docs/api/admin/code_samples/Shell/batch-jobs_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs_{id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/batch-jobs_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs_{id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/batch-jobs_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/batch-jobs_{id}_confirm/postundefined b/docs/api/admin/code_samples/Shell/batch-jobs_{id}_confirm/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/batch-jobs_{id}_confirm/postundefined rename to docs/api/admin/code_samples/Shell/batch-jobs_{id}_confirm/post.sh diff --git a/docs/api/admin/code_samples/Shell/collections/getundefined b/docs/api/admin/code_samples/Shell/collections/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections/getundefined rename to docs/api/admin/code_samples/Shell/collections/get.sh diff --git a/docs/api/admin/code_samples/Shell/collections/postundefined b/docs/api/admin/code_samples/Shell/collections/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections/postundefined rename to docs/api/admin/code_samples/Shell/collections/post.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/collections_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/collections_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}/getundefined b/docs/api/admin/code_samples/Shell/collections_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}/getundefined rename to docs/api/admin/code_samples/Shell/collections_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}/postundefined b/docs/api/admin/code_samples/Shell/collections_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}/postundefined rename to docs/api/admin/code_samples/Shell/collections_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}_products_batch/deleteundefined b/docs/api/admin/code_samples/Shell/collections_{id}_products_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}_products_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/collections_{id}_products_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/collections_{id}_products_batch/postundefined b/docs/api/admin/code_samples/Shell/collections_{id}_products_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/collections_{id}_products_batch/postundefined rename to docs/api/admin/code_samples/Shell/collections_{id}_products_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/currencies/getundefined b/docs/api/admin/code_samples/Shell/currencies/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/currencies/getundefined rename to docs/api/admin/code_samples/Shell/currencies/get.sh diff --git a/docs/api/admin/code_samples/Shell/currencies_{code}/postundefined b/docs/api/admin/code_samples/Shell/currencies_{code}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/currencies_{code}/postundefined rename to docs/api/admin/code_samples/Shell/currencies_{code}/post.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups/getundefined b/docs/api/admin/code_samples/Shell/customer-groups/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups/getundefined rename to docs/api/admin/code_samples/Shell/customer-groups/get.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups/postundefined b/docs/api/admin/code_samples/Shell/customer-groups/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups/postundefined rename to docs/api/admin/code_samples/Shell/customer-groups/post.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/customer-groups_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/customer-groups_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}/getundefined b/docs/api/admin/code_samples/Shell/customer-groups_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}/getundefined rename to docs/api/admin/code_samples/Shell/customer-groups_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}/postundefined b/docs/api/admin/code_samples/Shell/customer-groups_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}/postundefined rename to docs/api/admin/code_samples/Shell/customer-groups_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers/getundefined b/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}_customers/getundefined rename to docs/api/admin/code_samples/Shell/customer-groups_{id}_customers/get.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/deleteundefined b/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/postundefined b/docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/postundefined rename to docs/api/admin/code_samples/Shell/customer-groups_{id}_customers_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/customers/getundefined b/docs/api/admin/code_samples/Shell/customers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers/getundefined rename to docs/api/admin/code_samples/Shell/customers/get.sh diff --git a/docs/api/admin/code_samples/Shell/customers/postundefined b/docs/api/admin/code_samples/Shell/customers/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers/postundefined rename to docs/api/admin/code_samples/Shell/customers/post.sh diff --git a/docs/api/admin/code_samples/Shell/customers_{id}/getundefined b/docs/api/admin/code_samples/Shell/customers_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers_{id}/getundefined rename to docs/api/admin/code_samples/Shell/customers_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/customers_{id}/postundefined b/docs/api/admin/code_samples/Shell/customers_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/customers_{id}/postundefined rename to docs/api/admin/code_samples/Shell/customers_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts/getundefined b/docs/api/admin/code_samples/Shell/discounts/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts/getundefined rename to docs/api/admin/code_samples/Shell/discounts/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts/postundefined b/docs/api/admin/code_samples/Shell/discounts/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts/postundefined rename to docs/api/admin/code_samples/Shell/discounts/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_code_{code}/getundefined b/docs/api/admin/code_samples/Shell/discounts_code_{code}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_code_{code}/getundefined rename to docs/api/admin/code_samples/Shell/discounts_code_{code}/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions/postundefined b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions/postundefined rename to docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/deleteundefined b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/getundefined b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/getundefined rename to docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/postundefined b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/postundefined rename to docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined rename to docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/discounts_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/discounts_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}/getundefined b/docs/api/admin/code_samples/Shell/discounts_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}/getundefined rename to docs/api/admin/code_samples/Shell/discounts_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}/postundefined b/docs/api/admin/code_samples/Shell/discounts_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}/postundefined rename to docs/api/admin/code_samples/Shell/discounts_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes/postundefined b/docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes/postundefined rename to docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes/post.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes_{code}/deleteundefined b/docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes_{code}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes_{code}/deleteundefined rename to docs/api/admin/code_samples/Shell/discounts_{id}_dynamic-codes_{code}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/deleteundefined b/docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/postundefined b/docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/postundefined rename to docs/api/admin/code_samples/Shell/discounts_{id}_regions_{region_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders/getundefined b/docs/api/admin/code_samples/Shell/draft-orders/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders/getundefined rename to docs/api/admin/code_samples/Shell/draft-orders/get.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders/postundefined b/docs/api/admin/code_samples/Shell/draft-orders/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders/postundefined rename to docs/api/admin/code_samples/Shell/draft-orders/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/draft-orders_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/draft-orders_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}/getundefined b/docs/api/admin/code_samples/Shell/draft-orders_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}/getundefined rename to docs/api/admin/code_samples/Shell/draft-orders_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items/postundefined b/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items/postundefined rename to docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/deleteundefined b/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/postundefined b/docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/postundefined rename to docs/api/admin/code_samples/Shell/draft-orders_{id}_line-items_{line_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/draft-orders_{id}_pay/postundefined b/docs/api/admin/code_samples/Shell/draft-orders_{id}_pay/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/draft-orders_{id}_pay/postundefined rename to docs/api/admin/code_samples/Shell/draft-orders_{id}_pay/post.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards/getundefined b/docs/api/admin/code_samples/Shell/gift-cards/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards/getundefined rename to docs/api/admin/code_samples/Shell/gift-cards/get.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards/postundefined b/docs/api/admin/code_samples/Shell/gift-cards/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards/postundefined rename to docs/api/admin/code_samples/Shell/gift-cards/post.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/gift-cards_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/gift-cards_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards_{id}/getundefined b/docs/api/admin/code_samples/Shell/gift-cards_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards_{id}/getundefined rename to docs/api/admin/code_samples/Shell/gift-cards_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/gift-cards_{id}/postundefined b/docs/api/admin/code_samples/Shell/gift-cards_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/gift-cards_{id}/postundefined rename to docs/api/admin/code_samples/Shell/gift-cards_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/inventory-items/get.sh b/docs/api/admin/code_samples/Shell/inventory-items/get.sh new file mode 100644 index 0000000000..e5f3f47681 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items/get.sh @@ -0,0 +1,3 @@ +curl --location --request GET 'https://medusa-url.com/admin/inventory-items' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}/delete.sh b/docs/api/admin/code_samples/Shell/inventory-items_{id}/delete.sh new file mode 100644 index 0000000000..128d5f43e4 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items_{id}/delete.sh @@ -0,0 +1,2 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}/get.sh b/docs/api/admin/code_samples/Shell/inventory-items_{id}/get.sh new file mode 100644 index 0000000000..04db2a5dca --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items_{id}/get.sh @@ -0,0 +1,3 @@ +curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}/post.sh b/docs/api/admin/code_samples/Shell/inventory-items_{id}/post.sh new file mode 100644 index 0000000000..8d9f64e103 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items_{id}/post.sh @@ -0,0 +1,6 @@ +curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "origin_country": "US" +}' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/get.sh b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/get.sh new file mode 100644 index 0000000000..75b3d173e5 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/get.sh @@ -0,0 +1,3 @@ +curl --location --request GET 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/post.sh b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/post.sh new file mode 100644 index 0000000000..04c6e149ed --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels/post.sh @@ -0,0 +1,7 @@ +curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "location_id": "sloc", + "stocked_quantity": 10 +}' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/delete.sh b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/delete.sh new file mode 100644 index 0000000000..d6334d7d66 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/delete.sh @@ -0,0 +1,3 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' diff --git a/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/post.sh b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/post.sh new file mode 100644 index 0000000000..cf23deffce --- /dev/null +++ b/docs/api/admin/code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/post.sh @@ -0,0 +1,6 @@ +curl --location --request POST 'https://medusa-url.com/admin/inventory-items/{id}/location-levels/{location_id}' \ +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "stocked_quantity": 15 +}' diff --git a/docs/api/admin/code_samples/Shell/invites/getundefined b/docs/api/admin/code_samples/Shell/invites/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites/getundefined rename to docs/api/admin/code_samples/Shell/invites/get.sh diff --git a/docs/api/admin/code_samples/Shell/invites/postundefined b/docs/api/admin/code_samples/Shell/invites/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites/postundefined rename to docs/api/admin/code_samples/Shell/invites/post.sh diff --git a/docs/api/admin/code_samples/Shell/invites_accept/postundefined b/docs/api/admin/code_samples/Shell/invites_accept/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites_accept/postundefined rename to docs/api/admin/code_samples/Shell/invites_accept/post.sh diff --git a/docs/api/admin/code_samples/Shell/invites_{invite_id}/deleteundefined b/docs/api/admin/code_samples/Shell/invites_{invite_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites_{invite_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/invites_{invite_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/invites_{invite_id}_resend/postundefined b/docs/api/admin/code_samples/Shell/invites_{invite_id}_resend/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/invites_{invite_id}_resend/postundefined rename to docs/api/admin/code_samples/Shell/invites_{invite_id}_resend/post.sh diff --git a/docs/api/admin/code_samples/Shell/notes/getundefined b/docs/api/admin/code_samples/Shell/notes/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes/getundefined rename to docs/api/admin/code_samples/Shell/notes/get.sh diff --git a/docs/api/admin/code_samples/Shell/notes/postundefined b/docs/api/admin/code_samples/Shell/notes/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes/postundefined rename to docs/api/admin/code_samples/Shell/notes/post.sh diff --git a/docs/api/admin/code_samples/Shell/notes_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/notes_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/notes_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/notes_{id}/getundefined b/docs/api/admin/code_samples/Shell/notes_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes_{id}/getundefined rename to docs/api/admin/code_samples/Shell/notes_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/notes_{id}/postundefined b/docs/api/admin/code_samples/Shell/notes_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notes_{id}/postundefined rename to docs/api/admin/code_samples/Shell/notes_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/notifications/getundefined b/docs/api/admin/code_samples/Shell/notifications/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notifications/getundefined rename to docs/api/admin/code_samples/Shell/notifications/get.sh diff --git a/docs/api/admin/code_samples/Shell/notifications_{id}_resend/postundefined b/docs/api/admin/code_samples/Shell/notifications_{id}_resend/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/notifications_{id}_resend/postundefined rename to docs/api/admin/code_samples/Shell/notifications_{id}_resend/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits/getundefined b/docs/api/admin/code_samples/Shell/order-edits/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits/getundefined rename to docs/api/admin/code_samples/Shell/order-edits/get.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits/postundefined b/docs/api/admin/code_samples/Shell/order-edits/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits/postundefined rename to docs/api/admin/code_samples/Shell/order-edits/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}/getundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}/getundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}/postundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}/postundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_changes_{change_id}/deleteundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}_changes_{change_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_changes_{change_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}_changes_{change_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/postundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/postundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_items/postundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}_items/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_items/postundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}_items/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/deleteundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/postundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/postundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}_items_{item_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}_request/postundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}_request/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order-edits_{id}_request/postundefined rename to docs/api/admin/code_samples/Shell/order-edits_{id}_request/post.sh diff --git a/docs/api/admin/code_samples/Shell/order_{id}_claims/postundefined b/docs/api/admin/code_samples/Shell/order_{id}_claims/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order_{id}_claims/postundefined rename to docs/api/admin/code_samples/Shell/order_{id}_claims/post.sh diff --git a/docs/api/admin/code_samples/Shell/order_{id}_claims_{claim_id}/postundefined b/docs/api/admin/code_samples/Shell/order_{id}_claims_{claim_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order_{id}_claims_{claim_id}/postundefined rename to docs/api/admin/code_samples/Shell/order_{id}_claims_{claim_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/order_{id}_swaps/postundefined b/docs/api/admin/code_samples/Shell/order_{id}_swaps/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/order_{id}_swaps/postundefined rename to docs/api/admin/code_samples/Shell/order_{id}_swaps/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders/getundefined b/docs/api/admin/code_samples/Shell/orders/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders/getundefined rename to docs/api/admin/code_samples/Shell/orders/get.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}/getundefined b/docs/api/admin/code_samples/Shell/orders_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}/getundefined rename to docs/api/admin/code_samples/Shell/orders_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_archive/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_archive/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_archive/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_archive/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_capture/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_capture/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_capture/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_capture/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_complete/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_complete/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_complete/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_complete/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_fulfillment/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_fulfillment/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_fulfillment/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_fulfillment/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_refund/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_refund/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_refund/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_refund/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_reservations/getundefined b/docs/api/admin/code_samples/Shell/orders_{id}_reservations/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_reservations/getundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_reservations/get.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_return/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_return/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_return/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_return/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_shipment/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_shipment/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_shipment/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_shipment/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_shipping-methods/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_shipping-methods/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_shipping-methods/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_shipping-methods/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/post.sh diff --git a/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/postundefined b/docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/postundefined rename to docs/api/admin/code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/post.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/payment-collections_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}/getundefined rename to docs/api/admin/code_samples/Shell/payment-collections_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}/postundefined rename to docs/api/admin/code_samples/Shell/payment-collections_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined b/docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/postundefined rename to docs/api/admin/code_samples/Shell/payment-collections_{id}_authorize/post.sh diff --git a/docs/api/admin/code_samples/Shell/payments_{id}/getundefined b/docs/api/admin/code_samples/Shell/payments_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payments_{id}/getundefined rename to docs/api/admin/code_samples/Shell/payments_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined b/docs/api/admin/code_samples/Shell/payments_{id}_capture/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payments_{id}_capture/postundefined rename to docs/api/admin/code_samples/Shell/payments_{id}_capture/post.sh diff --git a/docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined b/docs/api/admin/code_samples/Shell/payments_{id}_refund/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/payments_{id}_refund/postundefined rename to docs/api/admin/code_samples/Shell/payments_{id}_refund/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists/getundefined b/docs/api/admin/code_samples/Shell/price-lists/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists/getundefined rename to docs/api/admin/code_samples/Shell/price-lists/get.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists/postundefined b/docs/api/admin/code_samples/Shell/price-lists/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists/postundefined rename to docs/api/admin/code_samples/Shell/price-lists/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}/getundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}/getundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}/postundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}/postundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/deleteundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/postundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/postundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}_prices_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_products/getundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}_products/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_products/getundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}_products/get.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_products_{product_id}_prices/deleteundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}_products_{product_id}_prices/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_products_{product_id}_prices/deleteundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}_products_{product_id}_prices/delete.sh diff --git a/docs/api/admin/code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/deleteundefined b/docs/api/admin/code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/deleteundefined rename to docs/api/admin/code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/delete.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories/getundefined b/docs/api/admin/code_samples/Shell/product-categories/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories/getundefined rename to docs/api/admin/code_samples/Shell/product-categories/get.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories/postundefined b/docs/api/admin/code_samples/Shell/product-categories/post.sh similarity index 87% rename from docs/api/admin/code_samples/Shell/product-categories/postundefined rename to docs/api/admin/code_samples/Shell/product-categories/post.sh index 1c747603c7..712e20f60f 100644 --- a/docs/api/admin/code_samples/Shell/product-categories/postundefined +++ b/docs/api/admin/code_samples/Shell/product-categories/post.sh @@ -2,5 +2,5 @@ curl --location --request POST 'https://medusa-url.com/admin/product-categories' --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ - "name": "Jeans", + "name": "Skinny Jeans", }' diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/product-categories_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/product-categories_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}/getundefined b/docs/api/admin/code_samples/Shell/product-categories_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}/getundefined rename to docs/api/admin/code_samples/Shell/product-categories_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}/postundefined b/docs/api/admin/code_samples/Shell/product-categories_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-categories_{id}/postundefined rename to docs/api/admin/code_samples/Shell/product-categories_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/delete.sh b/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/delete.sh new file mode 100644 index 0000000000..f5cc8b833a --- /dev/null +++ b/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/delete.sh @@ -0,0 +1,10 @@ +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}" + } + ] +}' diff --git a/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/post.sh b/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/post.sh new file mode 100644 index 0000000000..2ddb1ae898 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/product-categories_{id}_products_batch/post.sh @@ -0,0 +1,11 @@ +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}" + } + ] +}' diff --git a/docs/api/admin/code_samples/Shell/product-tags/getundefined b/docs/api/admin/code_samples/Shell/product-tags/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-tags/getundefined rename to docs/api/admin/code_samples/Shell/product-tags/get.sh diff --git a/docs/api/admin/code_samples/Shell/product-types/getundefined b/docs/api/admin/code_samples/Shell/product-types/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/product-types/getundefined rename to docs/api/admin/code_samples/Shell/product-types/get.sh diff --git a/docs/api/admin/code_samples/Shell/products/getundefined b/docs/api/admin/code_samples/Shell/products/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products/getundefined rename to docs/api/admin/code_samples/Shell/products/get.sh diff --git a/docs/api/admin/code_samples/Shell/products/postundefined b/docs/api/admin/code_samples/Shell/products/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products/postundefined rename to docs/api/admin/code_samples/Shell/products/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_tag-usage/getundefined b/docs/api/admin/code_samples/Shell/products_tag-usage/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_tag-usage/getundefined rename to docs/api/admin/code_samples/Shell/products_tag-usage/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_types/getundefined b/docs/api/admin/code_samples/Shell/products_types/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_types/getundefined rename to docs/api/admin/code_samples/Shell/products_types/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/products_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/products_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}/getundefined b/docs/api/admin/code_samples/Shell/products_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}/getundefined rename to docs/api/admin/code_samples/Shell/products_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}/postundefined b/docs/api/admin/code_samples/Shell/products_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}/postundefined rename to docs/api/admin/code_samples/Shell/products_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_metadata/postundefined b/docs/api/admin/code_samples/Shell/products_{id}_metadata/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_metadata/postundefined rename to docs/api/admin/code_samples/Shell/products_{id}_metadata/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_options/postundefined b/docs/api/admin/code_samples/Shell/products_{id}_options/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_options/postundefined rename to docs/api/admin/code_samples/Shell/products_{id}_options/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/deleteundefined b/docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/postundefined b/docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/postundefined rename to docs/api/admin/code_samples/Shell/products_{id}_options_{option_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants/getundefined b/docs/api/admin/code_samples/Shell/products_{id}_variants/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants/getundefined rename to docs/api/admin/code_samples/Shell/products_{id}_variants/get.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants/postundefined b/docs/api/admin/code_samples/Shell/products_{id}_variants/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants/postundefined rename to docs/api/admin/code_samples/Shell/products_{id}_variants/post.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/deleteundefined b/docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/postundefined b/docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/postundefined rename to docs/api/admin/code_samples/Shell/products_{id}_variants_{variant_id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-key_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-key_{id}/postundefined rename to docs/api/admin/code_samples/Shell/publishable-api-key_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys/getundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys/get.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys/postundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/getundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_revoke/post.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/getundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/getundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels/get.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined b/docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined rename to docs/api/admin/code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions/getundefined b/docs/api/admin/code_samples/Shell/regions/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions/getundefined rename to docs/api/admin/code_samples/Shell/regions/get.sh diff --git a/docs/api/admin/code_samples/Shell/regions/postundefined b/docs/api/admin/code_samples/Shell/regions/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions/postundefined rename to docs/api/admin/code_samples/Shell/regions/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/regions_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/regions_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}/getundefined b/docs/api/admin/code_samples/Shell/regions_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}/getundefined rename to docs/api/admin/code_samples/Shell/regions_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}/postundefined b/docs/api/admin/code_samples/Shell/regions_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}/postundefined rename to docs/api/admin/code_samples/Shell/regions_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_countries/postundefined b/docs/api/admin/code_samples/Shell/regions_{id}_countries/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_countries/postundefined rename to docs/api/admin/code_samples/Shell/regions_{id}_countries/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_countries_{country_code}/deleteundefined b/docs/api/admin/code_samples/Shell/regions_{id}_countries_{country_code}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_countries_{country_code}/deleteundefined rename to docs/api/admin/code_samples/Shell/regions_{id}_countries_{country_code}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-options/getundefined b/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-options/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-options/getundefined rename to docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-options/get.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers/postundefined b/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers/postundefined rename to docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/deleteundefined b/docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_payment-providers/postundefined b/docs/api/admin/code_samples/Shell/regions_{id}_payment-providers/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_payment-providers/postundefined rename to docs/api/admin/code_samples/Shell/regions_{id}_payment-providers/post.sh diff --git a/docs/api/admin/code_samples/Shell/regions_{id}_payment-providers_{provider_id}/deleteundefined b/docs/api/admin/code_samples/Shell/regions_{id}_payment-providers_{provider_id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/regions_{id}_payment-providers_{provider_id}/deleteundefined rename to docs/api/admin/code_samples/Shell/regions_{id}_payment-providers_{provider_id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/reservations/getundefined b/docs/api/admin/code_samples/Shell/reservations/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations/getundefined rename to docs/api/admin/code_samples/Shell/reservations/get.sh diff --git a/docs/api/admin/code_samples/Shell/reservations/postundefined b/docs/api/admin/code_samples/Shell/reservations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations/postundefined rename to docs/api/admin/code_samples/Shell/reservations/post.sh diff --git a/docs/api/admin/code_samples/Shell/reservations_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/reservations_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/reservations_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/reservations_{id}/getundefined b/docs/api/admin/code_samples/Shell/reservations_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations_{id}/getundefined rename to docs/api/admin/code_samples/Shell/reservations_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/reservations_{id}/postundefined b/docs/api/admin/code_samples/Shell/reservations_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/reservations_{id}/postundefined rename to docs/api/admin/code_samples/Shell/reservations_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons/getundefined b/docs/api/admin/code_samples/Shell/return-reasons/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons/getundefined rename to docs/api/admin/code_samples/Shell/return-reasons/get.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons/postundefined b/docs/api/admin/code_samples/Shell/return-reasons/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons/postundefined rename to docs/api/admin/code_samples/Shell/return-reasons/post.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/return-reasons_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/return-reasons_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons_{id}/getundefined b/docs/api/admin/code_samples/Shell/return-reasons_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons_{id}/getundefined rename to docs/api/admin/code_samples/Shell/return-reasons_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/return-reasons_{id}/postundefined b/docs/api/admin/code_samples/Shell/return-reasons_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/return-reasons_{id}/postundefined rename to docs/api/admin/code_samples/Shell/return-reasons_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/returns/getundefined b/docs/api/admin/code_samples/Shell/returns/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/returns/getundefined rename to docs/api/admin/code_samples/Shell/returns/get.sh diff --git a/docs/api/admin/code_samples/Shell/returns_{id}_cancel/postundefined b/docs/api/admin/code_samples/Shell/returns_{id}_cancel/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/returns_{id}_cancel/postundefined rename to docs/api/admin/code_samples/Shell/returns_{id}_cancel/post.sh diff --git a/docs/api/admin/code_samples/Shell/returns_{id}_receive/postundefined b/docs/api/admin/code_samples/Shell/returns_{id}_receive/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/returns_{id}_receive/postundefined rename to docs/api/admin/code_samples/Shell/returns_{id}_receive/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels/getundefined b/docs/api/admin/code_samples/Shell/sales-channels/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels/getundefined rename to docs/api/admin/code_samples/Shell/sales-channels/get.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels/postundefined b/docs/api/admin/code_samples/Shell/sales-channels/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels/postundefined rename to docs/api/admin/code_samples/Shell/sales-channels/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/sales-channels_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/sales-channels_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}/getundefined b/docs/api/admin/code_samples/Shell/sales-channels_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}/getundefined rename to docs/api/admin/code_samples/Shell/sales-channels_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}/postundefined b/docs/api/admin/code_samples/Shell/sales-channels_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}/postundefined rename to docs/api/admin/code_samples/Shell/sales-channels_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/deleteundefined b/docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/postundefined b/docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/postundefined rename to docs/api/admin/code_samples/Shell/sales-channels_{id}_products_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/deleteundefined b/docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/deleteundefined rename to docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/delete.sh diff --git a/docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/postundefined b/docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/postundefined rename to docs/api/admin/code_samples/Shell/sales-channels_{id}_stock-locations/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options/getundefined b/docs/api/admin/code_samples/Shell/shipping-options/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options/getundefined rename to docs/api/admin/code_samples/Shell/shipping-options/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options/postundefined b/docs/api/admin/code_samples/Shell/shipping-options/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options/postundefined rename to docs/api/admin/code_samples/Shell/shipping-options/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/shipping-options_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/shipping-options_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options_{id}/getundefined b/docs/api/admin/code_samples/Shell/shipping-options_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options_{id}/getundefined rename to docs/api/admin/code_samples/Shell/shipping-options_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-options_{id}/postundefined b/docs/api/admin/code_samples/Shell/shipping-options_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-options_{id}/postundefined rename to docs/api/admin/code_samples/Shell/shipping-options_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles/getundefined b/docs/api/admin/code_samples/Shell/shipping-profiles/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles/getundefined rename to docs/api/admin/code_samples/Shell/shipping-profiles/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles/postundefined b/docs/api/admin/code_samples/Shell/shipping-profiles/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles/postundefined rename to docs/api/admin/code_samples/Shell/shipping-profiles/post.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/shipping-profiles_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/getundefined b/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles_{id}/getundefined rename to docs/api/admin/code_samples/Shell/shipping-profiles_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/postundefined b/docs/api/admin/code_samples/Shell/shipping-profiles_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/shipping-profiles_{id}/postundefined rename to docs/api/admin/code_samples/Shell/shipping-profiles_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations/getundefined b/docs/api/admin/code_samples/Shell/stock-locations/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations/getundefined rename to docs/api/admin/code_samples/Shell/stock-locations/get.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations/postundefined b/docs/api/admin/code_samples/Shell/stock-locations/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations/postundefined rename to docs/api/admin/code_samples/Shell/stock-locations/post.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations_{id}/delete.sh b/docs/api/admin/code_samples/Shell/stock-locations_{id}/delete.sh new file mode 100644 index 0000000000..7e6622c4fa --- /dev/null +++ b/docs/api/admin/code_samples/Shell/stock-locations_{id}/delete.sh @@ -0,0 +1,2 @@ +curl --location --request DELETE 'https://medusa-url.com/admin/stock-locations/{id}' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/stock-locations_{id}/getundefined b/docs/api/admin/code_samples/Shell/stock-locations_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations_{id}/getundefined rename to docs/api/admin/code_samples/Shell/stock-locations_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/stock-locations_{id}/postundefined b/docs/api/admin/code_samples/Shell/stock-locations_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/stock-locations_{id}/postundefined rename to docs/api/admin/code_samples/Shell/stock-locations_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/store/getundefined b/docs/api/admin/code_samples/Shell/store/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store/getundefined rename to docs/api/admin/code_samples/Shell/store/get.sh diff --git a/docs/api/admin/code_samples/Shell/store/postundefined b/docs/api/admin/code_samples/Shell/store/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store/postundefined rename to docs/api/admin/code_samples/Shell/store/post.sh diff --git a/docs/api/admin/code_samples/Shell/store_currencies_{code}/deleteundefined b/docs/api/admin/code_samples/Shell/store_currencies_{code}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_currencies_{code}/deleteundefined rename to docs/api/admin/code_samples/Shell/store_currencies_{code}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/store_currencies_{code}/postundefined b/docs/api/admin/code_samples/Shell/store_currencies_{code}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_currencies_{code}/postundefined rename to docs/api/admin/code_samples/Shell/store_currencies_{code}/post.sh diff --git a/docs/api/admin/code_samples/Shell/store_payment-providers/getundefined b/docs/api/admin/code_samples/Shell/store_payment-providers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_payment-providers/getundefined rename to docs/api/admin/code_samples/Shell/store_payment-providers/get.sh diff --git a/docs/api/admin/code_samples/Shell/store_tax-providers/getundefined b/docs/api/admin/code_samples/Shell/store_tax-providers/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/store_tax-providers/getundefined rename to docs/api/admin/code_samples/Shell/store_tax-providers/get.sh diff --git a/docs/api/admin/code_samples/Shell/swaps/getundefined b/docs/api/admin/code_samples/Shell/swaps/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/swaps/getundefined rename to docs/api/admin/code_samples/Shell/swaps/get.sh diff --git a/docs/api/admin/code_samples/Shell/swaps_{id}/getundefined b/docs/api/admin/code_samples/Shell/swaps_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/swaps_{id}/getundefined rename to docs/api/admin/code_samples/Shell/swaps_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates/getundefined b/docs/api/admin/code_samples/Shell/tax-rates/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates/getundefined rename to docs/api/admin/code_samples/Shell/tax-rates/get.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates/postundefined b/docs/api/admin/code_samples/Shell/tax-rates/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates/postundefined rename to docs/api/admin/code_samples/Shell/tax-rates/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}/getundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}/getundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}/postundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}/postundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/deleteundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/postundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/postundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}_product-types_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/deleteundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/postundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/postundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}_products_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/deleteundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/deleteundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/delete.sh diff --git a/docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/postundefined b/docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/postundefined rename to docs/api/admin/code_samples/Shell/tax-rates_{id}_shipping-options_batch/post.sh diff --git a/docs/api/admin/code_samples/Shell/uploads/deleteundefined b/docs/api/admin/code_samples/Shell/uploads/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads/deleteundefined rename to docs/api/admin/code_samples/Shell/uploads/delete.sh diff --git a/docs/api/admin/code_samples/Shell/uploads/postundefined b/docs/api/admin/code_samples/Shell/uploads/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads/postundefined rename to docs/api/admin/code_samples/Shell/uploads/post.sh diff --git a/docs/api/admin/code_samples/Shell/uploads_download-url/postundefined b/docs/api/admin/code_samples/Shell/uploads_download-url/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads_download-url/postundefined rename to docs/api/admin/code_samples/Shell/uploads_download-url/post.sh diff --git a/docs/api/admin/code_samples/Shell/uploads_protected/postundefined b/docs/api/admin/code_samples/Shell/uploads_protected/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/uploads_protected/postundefined rename to docs/api/admin/code_samples/Shell/uploads_protected/post.sh diff --git a/docs/api/admin/code_samples/Shell/users/getundefined b/docs/api/admin/code_samples/Shell/users/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users/getundefined rename to docs/api/admin/code_samples/Shell/users/get.sh diff --git a/docs/api/admin/code_samples/Shell/users/postundefined b/docs/api/admin/code_samples/Shell/users/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users/postundefined rename to docs/api/admin/code_samples/Shell/users/post.sh diff --git a/docs/api/admin/code_samples/Shell/users_password-token/postundefined b/docs/api/admin/code_samples/Shell/users_password-token/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_password-token/postundefined rename to docs/api/admin/code_samples/Shell/users_password-token/post.sh diff --git a/docs/api/admin/code_samples/Shell/users_reset-password/postundefined b/docs/api/admin/code_samples/Shell/users_reset-password/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_reset-password/postundefined rename to docs/api/admin/code_samples/Shell/users_reset-password/post.sh diff --git a/docs/api/admin/code_samples/Shell/users_{id}/deleteundefined b/docs/api/admin/code_samples/Shell/users_{id}/delete.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_{id}/deleteundefined rename to docs/api/admin/code_samples/Shell/users_{id}/delete.sh diff --git a/docs/api/admin/code_samples/Shell/users_{id}/getundefined b/docs/api/admin/code_samples/Shell/users_{id}/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_{id}/getundefined rename to docs/api/admin/code_samples/Shell/users_{id}/get.sh diff --git a/docs/api/admin/code_samples/Shell/users_{id}/postundefined b/docs/api/admin/code_samples/Shell/users_{id}/post.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/users_{id}/postundefined rename to docs/api/admin/code_samples/Shell/users_{id}/post.sh diff --git a/docs/api/admin/code_samples/Shell/variants/getundefined b/docs/api/admin/code_samples/Shell/variants/get.sh similarity index 100% rename from docs/api/admin/code_samples/Shell/variants/getundefined rename to docs/api/admin/code_samples/Shell/variants/get.sh diff --git a/docs/api/admin/code_samples/Shell/variants_{id}_inventory/get.sh b/docs/api/admin/code_samples/Shell/variants_{id}_inventory/get.sh new file mode 100644 index 0000000000..15059a495e --- /dev/null +++ b/docs/api/admin/code_samples/Shell/variants_{id}_inventory/get.sh @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/variants' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/components/schemas/Address.yaml b/docs/api/admin/components/schemas/Address.yaml index a69d410311..d2797dc196 100644 --- a/docs/api/admin/components/schemas/Address.yaml +++ b/docs/api/admin/components/schemas/Address.yaml @@ -1,48 +1,71 @@ title: Address description: An address. type: object +required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at properties: id: type: string description: ID of the address example: addr_01G8ZC9VS1XVE149MGH2J7QSSH customer_id: - type: string description: ID of the customer this address belongs to + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: Available if the relation `customer` is expanded. - type: array - items: - type: object - description: A customer object. + nullable: true + type: object company: - type: string description: Company name + nullable: true + type: string example: Acme first_name: - type: string description: First name + nullable: true + type: string example: Arno last_name: - type: string description: Last name + nullable: true + type: string example: Willms address_1: - type: string description: Address line 1 + nullable: true + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + nullable: true + type: string example: Suite 369 city: - type: string description: City + nullable: true + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + nullable: true + type: string externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements @@ -50,18 +73,22 @@ properties: example: st country: description: A country object. Available if the relation `country` is expanded. - type: object + nullable: true + $ref: ./Country.yaml province: - type: string description: Province + nullable: true + type: string example: Kentucky postal_code: - type: string description: Postal Code + nullable: true + type: string example: 72093 phone: - type: string description: Phone Number + nullable: true + type: string example: 16128234334802 created_at: type: string @@ -72,11 +99,13 @@ properties: description: The date with timezone at which the resource was updated. format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml index 1829b6c7cf..f8faad9a4e 100644 --- a/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml +++ b/docs/api/admin/components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml @@ -6,6 +6,7 @@ properties: description: The ids of the customers to remove type: array items: + type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml index 65ab064008..02b1e9b06f 100644 --- a/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml +++ b/docs/api/admin/components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml @@ -6,6 +6,7 @@ properties: description: The resources to be deleted from the discount condition type: array items: + type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq.yaml b/docs/api/admin/components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq.yaml new file mode 100644 index 0000000000..52d2aaa809 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminDeleteProductCategoriesCategoryProductsBatchReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminGetVariantsVariantInventoryRes.yaml b/docs/api/admin/components/schemas/AdminGetVariantsVariantInventoryRes.yaml new file mode 100644 index 0000000000..165c290b71 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminGetVariantsVariantInventoryRes.yaml @@ -0,0 +1,21 @@ +type: object +properties: + id: + description: the id of the variant + type: string + inventory: + description: the stock location address ID + type: string + sales_channel_availability: + type: object + description: An optional key-value map with additional details + properties: + channel_name: + description: Sales channel name + type: string + channel_id: + description: Sales channel id + type: string + available_quantity: + description: Available quantity in sales channel + type: number diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsDeleteRes.yaml new file mode 100644 index 0000000000..e31b73414b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminInventoryItemsDeleteRes.yaml @@ -0,0 +1,13 @@ +type: object +properties: + id: + type: string + description: The ID of the deleted Inventory Item. + object: + type: string + description: The type of the object that was deleted. + format: inventory_item + deleted: + type: boolean + description: Whether or not the Inventory Item was deleted. + default: true diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsListRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsListRes.yaml new file mode 100644 index 0000000000..eec764d4b2 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminInventoryItemsListRes.yaml @@ -0,0 +1,15 @@ +type: object +properties: + inventory_items: + type: array + items: + $ref: ./InventoryItemDTO.yaml + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml new file mode 100644 index 0000000000..d46c1b70ba --- /dev/null +++ b/docs/api/admin/components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml @@ -0,0 +1,28 @@ +type: object +properties: + inventory_items: + type: array + items: + allOf: + - $ref: ./InventoryItemDTO.yaml + - type: object + properties: + location_levels: + type: array + items: + allOf: + - $ref: ./InventoryLevelDTO.yaml + variants: + type: array + items: + allOf: + - $ref: ./ProductVariant.yaml + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsLocationLevelsRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsLocationLevelsRes.yaml new file mode 100644 index 0000000000..4c0077947d --- /dev/null +++ b/docs/api/admin/components/schemas/AdminInventoryItemsLocationLevelsRes.yaml @@ -0,0 +1,9 @@ +type: object +properties: + id: + description: The id of the location + location_levels: + description: List of stock levels at a given location + type: array + items: + $ref: ./InventoryLevelDTO.yaml diff --git a/docs/api/admin/components/schemas/AdminInventoryItemsRes.yaml b/docs/api/admin/components/schemas/AdminInventoryItemsRes.yaml new file mode 100644 index 0000000000..8b0468433e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminInventoryItemsRes.yaml @@ -0,0 +1,4 @@ +type: object +properties: + inventory_item: + $ref: ./InventoryItemDTO.yaml diff --git a/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml index ba460c4c79..f9d2ccacbe 100644 --- a/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml @@ -6,6 +6,7 @@ properties: description: The ids of the customers to add type: array items: + type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/AdminPostCustomerGroupsReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomerGroupsReq.yaml new file mode 100644 index 0000000000..1d5988ff67 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostCustomerGroupsReq.yaml @@ -0,0 +1,10 @@ +type: object +required: + - name +properties: + name: + type: string + description: Name of the customer group + metadata: + type: object + description: Metadata for the customer. diff --git a/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml b/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml index c10421b691..9a4edf247c 100644 --- a/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostCustomersCustomerReq.yaml @@ -20,6 +20,7 @@ properties: groups: type: array items: + type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml index afe209d46e..c19f356129 100644 --- a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml @@ -6,6 +6,7 @@ properties: description: The resources to be added to the discount condition type: array items: + type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq.yaml b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq.yaml new file mode 100644 index 0000000000..3f6a13757c --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostDiscountsDiscountDynamicCodesReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - code +properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + usage_limit: + type: number + description: Maximum times the discount can be used + default: 1 + metadata: + type: object + description: An optional set of key-value pairs to hold additional information. diff --git a/docs/api/admin/components/schemas/AdminPostInventoryItemsInventoryItemReq.yaml b/docs/api/admin/components/schemas/AdminPostInventoryItemsInventoryItemReq.yaml new file mode 100644 index 0000000000..4971d79503 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInventoryItemsInventoryItemReq.yaml @@ -0,0 +1,47 @@ +type: object +properties: + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the manufacturer of + the Inventory Item. May be used by Fulfillment Providers to pass customs + information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May be + used by Fulfillment Providers to pass customs information to shipping + carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq.yaml b/docs/api/admin/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq.yaml new file mode 100644 index 0000000000..27f8b44407 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq.yaml @@ -0,0 +1,8 @@ +type: object +properties: + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number diff --git a/docs/api/admin/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq.yaml b/docs/api/admin/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq.yaml new file mode 100644 index 0000000000..05daa3f720 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostInventoryItemsItemLocationLevelsReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - location_id + - stocked_quantity +properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml index 8ae3a23fe6..c26136a642 100644 --- a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml @@ -4,6 +4,7 @@ properties: description: The Claim Items that the Claim will consist of. type: array items: + type: object required: - id - images @@ -60,6 +61,7 @@ properties: description: The Shipping Methods to send the additional Line Items with. type: array items: + type: object properties: id: description: The ID of an existing Shipping Method @@ -70,6 +72,9 @@ properties: price: description: The price to charge for the Shipping Method type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object no_notification: description: If set to true no notification will be send related to this Swap. type: boolean diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml index cd86c5f9a0..2221e9c16e 100644 --- a/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderClaimsReq.yaml @@ -17,6 +17,7 @@ properties: description: The Claim Items that the Claim will consist of. type: array items: + type: object required: - item_id - quantity @@ -63,6 +64,7 @@ properties: description: The new items to send to the Customer when the Claim type is Replace. type: array items: + type: object required: - variant_id - quantity @@ -77,6 +79,7 @@ properties: description: The Shipping Methods to send the additional Line Items with. type: array items: + type: object properties: id: description: The ID of an existing Shipping Method @@ -87,6 +90,9 @@ properties: price: description: The price to charge for the Shipping Method type: integer + data: + description: An optional set of key-value pairs to hold additional information. + type: object shipping_address: type: object description: >- diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml index c910300406..377b2b8f5f 100644 --- a/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml @@ -6,6 +6,7 @@ properties: description: The Line Items to include in the Fulfillment. type: array items: + type: object required: - item_id - quantity diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml index 938c93c8ef..383a5d143f 100644 --- a/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderReturnsReq.yaml @@ -6,6 +6,7 @@ properties: description: The Line Items that will be returned. type: array items: + type: object required: - item_id - quantity diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderShippingMethodsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderShippingMethodsReq.yaml new file mode 100644 index 0000000000..de74a2f67e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderShippingMethodsReq.yaml @@ -0,0 +1,16 @@ +type: object +required: + - price + - option_id +properties: + price: + type: number + description: The price (excluding VAT) that should be charged for the Shipping Method + option_id: + type: string + description: The ID of the Shipping Option to create the Shipping Method from. + date: + type: object + description: >- + The data required for the Shipping Option to create a Shipping Method. + This will depend on the Fulfillment Provider. diff --git a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml index 45e754b776..42491fcf7b 100644 --- a/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostOrdersOrderSwapsReq.yaml @@ -6,6 +6,7 @@ properties: description: The Line Items to return as part of the Swap. type: array items: + type: object required: - item_id - quantity @@ -38,6 +39,7 @@ properties: description: The new items to send to the Customer. type: array items: + type: object required: - variant_id - quantity @@ -52,6 +54,7 @@ properties: description: The custom shipping options to potentially create a Shipping Method from. type: array items: + type: object required: - option_id - price diff --git a/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml index 28d3868fdb..dc789b1ae4 100644 --- a/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostPriceListPricesPricesReq.yaml @@ -4,6 +4,7 @@ properties: description: The prices to update or add. type: array items: + type: object required: - amount - variant_id diff --git a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml index 09bbab331c..090fb1305b 100644 --- a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml @@ -30,6 +30,7 @@ properties: description: The prices of the Price List. type: array items: + type: object required: - amount - variant_id @@ -66,6 +67,7 @@ properties: type: array description: A list of customer groups that the Price List applies to. items: + type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml index aeb0835071..fce72ccea1 100644 --- a/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostPriceListsPriceListReq.yaml @@ -35,6 +35,7 @@ properties: description: The prices of the Price List. type: array items: + type: object required: - amount - variant_id @@ -68,6 +69,7 @@ properties: type: array description: A list of customer groups that the Price List applies to. items: + type: object required: - id properties: diff --git a/docs/api/admin/components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq.yaml b/docs/api/admin/components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq.yaml new file mode 100644 index 0000000000..5d2772de1b --- /dev/null +++ b/docs/api/admin/components/schemas/AdminPostProductCategoriesCategoryProductsBatchReq.yaml @@ -0,0 +1,15 @@ +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 diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml index 024aaa2c9c..aab995d09a 100644 --- a/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostProductsProductReq.yaml @@ -52,6 +52,7 @@ properties: description: Tags to associate the Product with. type: array items: + type: object required: - value properties: @@ -65,16 +66,28 @@ properties: description: '[EXPERIMENTAL] Sales channels to associate the Product with.' type: array items: + type: object required: - id properties: id: description: The ID of an existing Sales channel. type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string variants: description: A list of Product Variants to create with the Product. type: array items: + type: object properties: id: description: The ID of the Product Variant. @@ -135,6 +148,7 @@ properties: prices: type: array items: + type: object required: - amount properties: @@ -166,6 +180,7 @@ properties: options: type: array items: + type: object required: - option_id - value diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml index d57a04ec20..84f2e0ca37 100644 --- a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsReq.yaml @@ -62,6 +62,7 @@ properties: prices: type: array items: + type: object required: - amount properties: @@ -93,6 +94,7 @@ properties: options: type: array items: + type: object required: - option_id - value diff --git a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml index 9deff44aeb..c124bbb24d 100644 --- a/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostProductsProductVariantsVariantReq.yaml @@ -58,6 +58,7 @@ properties: prices: type: array items: + type: object required: - amount properties: @@ -89,6 +90,7 @@ properties: options: type: array items: + type: object required: - option_id - value diff --git a/docs/api/admin/components/schemas/AdminPostProductsReq.yaml b/docs/api/admin/components/schemas/AdminPostProductsReq.yaml index a779060218..7dcea9ccdc 100644 --- a/docs/api/admin/components/schemas/AdminPostProductsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostProductsReq.yaml @@ -63,6 +63,7 @@ properties: description: Tags to associate the Product with. type: array items: + type: object required: - value properties: @@ -76,18 +77,30 @@ properties: description: '[EXPERIMENTAL] Sales channels to associate the Product with.' type: array items: + type: object required: - id properties: id: description: The ID of an existing Sales channel. type: string + categories: + description: Categories to add the Product to. + type: array + items: + required: + - id + properties: + id: + description: The ID of a Product Category. + type: string options: description: >- The Options that the Product should have. These define on which properties the Product's Product Variants will differ. type: array items: + type: object required: - title properties: @@ -98,6 +111,7 @@ properties: description: A list of Product Variants to create with the Product. type: array items: + type: object required: - title properties: @@ -158,6 +172,7 @@ properties: prices: type: array items: + type: object required: - amount properties: @@ -186,6 +201,7 @@ properties: options: type: array items: + type: object required: - value properties: diff --git a/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml b/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml index 68ee28260e..c04d99907c 100644 --- a/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostReturnsReturnReceiveReq.yaml @@ -6,6 +6,7 @@ properties: description: The Line Items that have been received. type: array items: + type: object required: - item_id - quantity diff --git a/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml index 91f0798ca7..29bb98c358 100644 --- a/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostShippingOptionsOptionReq.yaml @@ -20,6 +20,7 @@ properties: available. type: array items: + type: object required: - type - amount diff --git a/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml index d5088992f1..632348bb8b 100644 --- a/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostShippingOptionsReq.yaml @@ -38,6 +38,7 @@ properties: available. type: array items: + type: object required: - type - amount diff --git a/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml index 5f0da87a1a..17ec3543b0 100644 --- a/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostShippingProfilesProfileReq.yaml @@ -3,3 +3,21 @@ properties: name: description: The name of the Shipping Profile type: string + metadata: + description: An optional set of key-value pairs with additional information. + type: object + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom + products: + description: An optional array of product ids to associate with the Shipping Profile + type: array + shipping_options: + description: >- + An optional array of shipping option ids to associate with the Shipping + Profile + type: array diff --git a/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml b/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml index 790a1e4704..88cbc518be 100644 --- a/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml +++ b/docs/api/admin/components/schemas/AdminPostShippingProfilesReq.yaml @@ -1,7 +1,15 @@ type: object required: - name + - type properties: name: description: The name of the Shipping Profile type: string + type: + description: The type of the Shipping Profile + type: string + enum: + - default + - gift_card + - custom diff --git a/docs/api/admin/components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml b/docs/api/admin/components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml new file mode 100644 index 0000000000..16bdada85e --- /dev/null +++ b/docs/api/admin/components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml @@ -0,0 +1,13 @@ +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 diff --git a/docs/api/store/components/schemas/StoreGetProductCategoryRes.yaml b/docs/api/admin/components/schemas/AdminProductCategoriesCategoryRes.yaml similarity index 100% rename from docs/api/store/components/schemas/StoreGetProductCategoryRes.yaml rename to docs/api/admin/components/schemas/AdminProductCategoriesCategoryRes.yaml diff --git a/docs/api/admin/components/schemas/AdminProductCategoriesListRes.yaml b/docs/api/admin/components/schemas/AdminProductCategoriesListRes.yaml new file mode 100644 index 0000000000..0b6a32c916 --- /dev/null +++ b/docs/api/admin/components/schemas/AdminProductCategoriesListRes.yaml @@ -0,0 +1,15 @@ +type: object +properties: + product_categories: + type: array + items: + $ref: ./ProductCategory.yaml + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml b/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml index b795f110ce..12e422431b 100644 --- a/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml +++ b/docs/api/admin/components/schemas/AdminProductsListTagsRes.yaml @@ -3,6 +3,7 @@ properties: tags: type: array items: + type: object properties: id: description: The ID of the tag. diff --git a/docs/api/admin/components/schemas/AdminStockLocationsDeleteRes.yaml b/docs/api/admin/components/schemas/AdminStockLocationsDeleteRes.yaml new file mode 100644 index 0000000000..fd827299df --- /dev/null +++ b/docs/api/admin/components/schemas/AdminStockLocationsDeleteRes.yaml @@ -0,0 +1,13 @@ +type: object +properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + default: stock_location + deleted: + type: boolean + description: Whether or not the items were deleted. + default: true diff --git a/docs/api/admin/components/schemas/BatchJob.yaml b/docs/api/admin/components/schemas/BatchJob.yaml index 92a81b4576..31782073a7 100644 --- a/docs/api/admin/components/schemas/BatchJob.yaml +++ b/docs/api/admin/components/schemas/BatchJob.yaml @@ -2,21 +2,36 @@ title: Batch Job description: A Batch Job. type: object required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status - type + - updated_at properties: id: - type: string description: The unique identifier for the batch job. + type: string example: batch_01G8T782965PYFG0751G0Z38B4 type: - type: string description: The type of batch job. + type: string enum: - product-import - product-export status: - type: string description: The status of the batch job. + type: string enum: - created - pre_processed @@ -27,17 +42,20 @@ properties: - failed default: created created_by: - type: string description: The unique identifier of the user that created the batch job. + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: description: A user object. Available if the relation `created_by_user` is expanded. - type: object + nullable: true + $ref: ./User.yaml context: - type: object description: >- The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object example: shape: prices: @@ -55,43 +73,47 @@ properties: - variant.prices - images dry_run: - type: boolean description: Specify if the job must apply the modifications or not. + type: boolean default: false result: - type: object description: The result of the batch job. - properties: - count: - type: number - advancement_count: - type: number - progress: - type: number - errors: - type: object + nullable: true + allOf: + - type: object + example: {} + - type: object properties: - message: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: type: string - code: - oneOf: - - type: string - - type: number - err: - type: array - stat_descriptors: - type: object - properties: - key: - type: string - name: - type: string - message: - type: string - file_key: - type: string - file_size: - type: number + file_size: + type: number example: errors: - err: [] @@ -102,38 +124,45 @@ properties: name: Product count to export message: There will be 8 products exported by this action pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true type: string - description: The date from which the job has been pre processed. format: date-time processing_at: - type: string description: The date the job is processing at. + nullable: true + type: string format: date-time confirmed_at: - type: string description: The date when the confirmation has been done. + nullable: true + type: string format: date-time completed_at: - type: string description: The date of the completion. + nullable: true + type: string format: date-time canceled_at: - type: string description: The date of the concellation. + nullable: true + type: string format: date-time failed_at: - type: string description: The date when the job failed. + nullable: true + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was last updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/admin/components/schemas/Cart.yaml b/docs/api/admin/components/schemas/Cart.yaml index aef4b274ff..204dddb8af 100644 --- a/docs/api/admin/components/schemas/Cart.yaml +++ b/docs/api/admin/components/schemas/Cart.yaml @@ -1,28 +1,51 @@ title: Cart description: Represents a user cart type: object +required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The cart's ID + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 email: - type: string description: The email associated with the cart + nullable: true + type: string format: email billing_address_id: - type: string description: The billing address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_address_id: - type: string description: The shipping address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml items: description: Available if the relation `items` is expanded. @@ -30,54 +53,58 @@ properties: items: $ref: ./LineItem.yaml region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml discounts: - type: array description: Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array - description: Available if the relation `gift_cards` is expanded. items: - type: object - description: A gift card object. + $ref: ./Discount.yaml + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: ./GiftCard.yaml customer_id: - type: string description: The customer's ID + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. + nullable: true type: object payment_session: description: The selected payment session in the cart. + nullable: true $ref: ./PaymentSession.yaml payment_sessions: - type: array description: The payment sessions created on the cart. + type: array items: $ref: ./PaymentSession.yaml payment_id: - type: string description: The payment's ID if available + nullable: true + type: string example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: ./Payment.yaml + nullable: true + type: object shipping_methods: - type: array description: The shipping methods added to the cart. + type: array items: $ref: ./ShippingMethod.yaml type: - type: string description: The cart's type. + type: string enum: - default - swap @@ -86,89 +113,105 @@ properties: - claim default: default completed_at: - type: string description: The date with timezone at which the cart was completed. + nullable: true + type: string format: date-time payment_authorized_at: - type: string description: The date with timezone at which the payment was authorized. + nullable: true + type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. context: - type: object description: The context of the cart which can include info like IP or user agent. + nullable: true + type: object example: ip: '::1' user_agent: PostmanRuntime/7.29.2 sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null sales_channel: description: >- A sales channel object. Available if the relation `sales_channel` is expanded. - type: object + nullable: true + $ref: ./SalesChannel.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white shipping_total: - type: integer description: The total of shipping + type: integer example: 1000 discount_total: - type: integer description: The total of discount - example: 800 - tax_total: type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: description: The total of tax + type: integer example: 0 refunded_total: - type: integer description: >- The total amount refunded if the order associated with this cart is returned. + type: integer example: 0 total: - type: integer description: The total amount of the cart + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the cart + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 diff --git a/docs/api/admin/components/schemas/ClaimImage.yaml b/docs/api/admin/components/schemas/ClaimImage.yaml index 721cfcf6a5..5a46013ba3 100644 --- a/docs/api/admin/components/schemas/ClaimImage.yaml +++ b/docs/api/admin/components/schemas/ClaimImage.yaml @@ -3,36 +3,44 @@ description: Represents photo documentation of a claim. type: object required: - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: - type: string description: The claim image's ID + type: string example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 claim_item_id: - type: string description: The ID of the claim item associated with the image + type: string claim_item: description: A claim item object. Available if the relation `claim_item` is expanded. - type: object + nullable: true + $ref: ./ClaimItem.yaml url: - type: string description: The URL of the image + type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ClaimItem.yaml b/docs/api/admin/components/schemas/ClaimItem.yaml index 6fc251960c..84a3b9afe6 100644 --- a/docs/api/admin/components/schemas/ClaimItem.yaml +++ b/docs/api/admin/components/schemas/ClaimItem.yaml @@ -5,18 +5,24 @@ description: >- type: object required: - claim_order_id + - created_at + - deleted_at + - id - item_id - - variant_id - - reason + - metadata + - note - quantity + - reason + - updated_at + - variant_id properties: id: - type: string description: The claim item's ID + type: string example: citm_01G8ZH853Y6TFXWPG5EYE81X63 images: - type: array description: Available if the relation `images` is expanded. + type: array items: $ref: ./ClaimImage.yaml claim_order_id: @@ -24,6 +30,7 @@ properties: type: string claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object item_id: description: The ID of the line item that the claim item refers to. @@ -31,6 +38,7 @@ properties: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. + nullable: true $ref: ./LineItem.yaml variant_id: description: The ID of the product variant that is claimed. @@ -38,7 +46,8 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: A variant object. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: ./ProductVariant.yaml reason: description: The reason for the claim type: string @@ -49,6 +58,7 @@ properties: - other note: description: An optional note about the claim, for additional information + nullable: true type: string example: I don't like it. quantity: @@ -65,19 +75,21 @@ properties: items: $ref: ./ClaimTag.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/ClaimOrder.yaml b/docs/api/admin/components/schemas/ClaimOrder.yaml index 561dbec67d..2bd675041e 100644 --- a/docs/api/admin/components/schemas/ClaimOrder.yaml +++ b/docs/api/admin/components/schemas/ClaimOrder.yaml @@ -5,27 +5,41 @@ description: >- contain additional information about fulfillments and returns. type: object required: - - type + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The claim's ID + type: string example: claim_01G8ZH853Y6TFXWPG5EYE81X63 type: + description: The claim's type type: string enum: - refund - replace payment_status: - type: string description: The status of the claim's payment + type: string enum: - na - not_refunded - refunded default: na fulfillment_status: + description: The claim's fulfillment status type: string enum: - not_fulfilled @@ -56,18 +70,22 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object return_order: description: >- A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true type: object shipping_address_id: description: The ID of the address that the new items should be shipped to + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_methods: description: The shipping methods that the claim order will be shipped with. @@ -78,43 +96,49 @@ properties: description: The fulfillments of the new items to be shipped type: array items: - $ref: ./Fulfillment.yaml + type: object refund_amount: description: The amount that will be refunded in conjunction with the claim + nullable: true type: integer example: 1000 canceled_at: description: The date with timezone at which the claim was canceled. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white no_notification: description: >- Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key diff --git a/docs/api/admin/components/schemas/ClaimTag.yaml b/docs/api/admin/components/schemas/ClaimTag.yaml index bf557fcc6d..fe9a2fd418 100644 --- a/docs/api/admin/components/schemas/ClaimTag.yaml +++ b/docs/api/admin/components/schemas/ClaimTag.yaml @@ -4,30 +4,37 @@ description: >- filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The claim tag's ID + type: string example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 value: description: The value that the claim tag holds type: string example: Damaged created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/Country.yaml b/docs/api/admin/components/schemas/Country.yaml index c28bb31871..188fb5ccae 100644 --- a/docs/api/admin/components/schemas/Country.yaml +++ b/docs/api/admin/components/schemas/Country.yaml @@ -2,27 +2,29 @@ title: Country description: Country details type: object required: + - display_name + - id - iso_2 - iso_3 - - num_code - name - - display_name + - num_code + - region_id properties: id: - type: string description: The country's ID + type: string example: 109 iso_2: - type: string description: The 2 character ISO code of the country in lower case + type: string example: it externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. iso_3: - type: string description: The 2 character ISO code of the country in lower case + type: string example: ita externalDocs: url: >- @@ -45,9 +47,11 @@ properties: type: string example: Italy region_id: - type: string description: The region ID this country is associated with. + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml diff --git a/docs/api/admin/components/schemas/Currency.yaml b/docs/api/admin/components/schemas/Currency.yaml index c553448ec2..a7aef7d3a8 100644 --- a/docs/api/admin/components/schemas/Currency.yaml +++ b/docs/api/admin/components/schemas/Currency.yaml @@ -3,9 +3,9 @@ description: Currency type: object required: - code + - name - symbol - symbol_native - - name properties: code: description: The 3 character ISO code for the currency. @@ -29,3 +29,4 @@ properties: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean + default: false diff --git a/docs/api/admin/components/schemas/CustomShippingOption.yaml b/docs/api/admin/components/schemas/CustomShippingOption.yaml index 619df289c4..e3db8a274e 100644 --- a/docs/api/admin/components/schemas/CustomShippingOption.yaml +++ b/docs/api/admin/components/schemas/CustomShippingOption.yaml @@ -5,12 +5,18 @@ description: >- particular Shipping Option type: object required: + - cart_id + - created_at + - deleted_at + - id + - metadata - price - shipping_option_id + - updated_at properties: id: - type: string description: The custom shipping option's ID + type: string example: cso_01G8X99XNB77DMFBJFWX6DN9V9 price: description: >- @@ -26,31 +32,33 @@ properties: description: >- A shipping option object. Available if the relation `shipping_option` is expanded. - type: object + nullable: true + $ref: ./ShippingOption.yaml cart_id: description: The ID of the Cart that the custom shipping option is attached to + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: ./Cart.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white - includes_tax: - description: '[EXPERIMENTAL] Indicates if the custom shipping option price include tax' - type: boolean diff --git a/docs/api/admin/components/schemas/Customer.yaml b/docs/api/admin/components/schemas/Customer.yaml index 9c91270354..c980de29f0 100644 --- a/docs/api/admin/components/schemas/Customer.yaml +++ b/docs/api/admin/components/schemas/Customer.yaml @@ -2,30 +2,44 @@ title: Customer description: Represents a customer type: object required: + - billing_address_id + - created_at + - deleted_at - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at properties: id: - type: string description: The customer's ID + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 email: - type: string description: The customer's email + type: string format: email first_name: - type: string description: The customer's first name + nullable: true + type: string example: Arno last_name: - type: string description: The customer's last name + nullable: true + type: string example: Willms billing_address_id: - type: string description: The customer's billing address ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. @@ -33,19 +47,19 @@ properties: items: $ref: ./Address.yaml phone: - type: string description: The customer's phone number + nullable: true + type: string example: 16128234334802 has_account: - type: boolean description: Whether the customer has an account or not + type: boolean default: false orders: description: Available if the relation `orders` is expanded. type: array items: type: object - description: An order object. groups: description: >- The customer groups the customer belongs to. Available if the relation @@ -54,19 +68,21 @@ properties: items: $ref: ./CustomerGroup.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/CustomerGroup.yaml b/docs/api/admin/components/schemas/CustomerGroup.yaml index 69e2edfe7c..65e7fb545a 100644 --- a/docs/api/admin/components/schemas/CustomerGroup.yaml +++ b/docs/api/admin/components/schemas/CustomerGroup.yaml @@ -2,45 +2,51 @@ title: Customer Group description: Represents a customer group type: object required: + - created_at + - deleted_at + - id + - metadata - name + - updated_at properties: id: - type: string description: The customer group's ID + type: string example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 name: - type: string description: The name of the customer group + type: string example: VIP customers: - type: array description: >- The customers that belong to the customer group. Available if the relation `customers` is expanded. - items: - type: object - description: A customer object. - price_lists: type: array + items: + $ref: ./Customer.yaml + 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 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/Discount.yaml b/docs/api/admin/components/schemas/Discount.yaml index 72c9365c95..9257a02406 100644 --- a/docs/api/admin/components/schemas/Discount.yaml +++ b/docs/api/admin/components/schemas/Discount.yaml @@ -3,11 +3,24 @@ description: Represents a discount that can be applied to a cart for promotional type: object required: - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration properties: id: - type: string description: The discount's ID + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN code: description: >- @@ -22,11 +35,13 @@ properties: type: boolean example: false rule_id: - type: string description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. + nullable: true $ref: ./DiscountRule.yaml is_disabled: description: >- @@ -35,13 +50,15 @@ properties: type: boolean example: false parent_discount_id: - type: string description: >- The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. + nullable: true $ref: ./Discount.yaml starts_at: description: The time at which the discount can be used. @@ -49,11 +66,13 @@ properties: format: date-time ends_at: description: The time at which the discount can no longer be used. + nullable: true type: string format: date-time valid_duration: - type: string description: Duration the discount runs between + nullable: true + type: string example: P3Y6M4DT12H30M5S regions: description: >- @@ -61,10 +80,10 @@ properties: `regions` is expanded. type: array items: - type: object - description: A region object. + $ref: ./Region.yaml usage_limit: description: The maximum number of times that a discount can be used. + nullable: true type: integer example: 100 usage_count: @@ -73,19 +92,21 @@ properties: example: 50 default: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DiscountCondition.yaml b/docs/api/admin/components/schemas/DiscountCondition.yaml index 40f5247a38..b536b8f05f 100644 --- a/docs/api/admin/components/schemas/DiscountCondition.yaml +++ b/docs/api/admin/components/schemas/DiscountCondition.yaml @@ -2,13 +2,18 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable type: object required: - - type - - operator + - created_at + - deleted_at - discount_rule_id + - id + - metadata + - operator + - type + - updated_at properties: id: - type: string description: The discount condition's ID + type: string example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: The type of the Condition @@ -26,11 +31,12 @@ properties: - in - not_in discount_rule_id: - type: string description: The ID of the discount rule associated with the condition + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. + nullable: true $ref: ./DiscountRule.yaml products: description: >- @@ -38,55 +44,52 @@ properties: the relation `products` is expanded. type: array items: - type: object - description: A product object. + $ref: ./Product.yaml product_types: description: >- - product types associated with this condition if type = product_types. + Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. type: array items: - type: object - description: A product type object. + $ref: ./ProductType.yaml product_tags: description: >- - product tags associated with this condition if type = product_tags. + Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. type: array items: - type: object - description: A product tag object. + $ref: ./ProductTag.yaml product_collections: description: >- - product collections associated with this condition if type = + Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. type: array items: - type: object - description: A product collection object. + $ref: ./ProductCollection.yaml customer_groups: description: >- - customer groups associated with this condition if type = customer_groups. + Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: ./CustomerGroup.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml b/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml index 143c2c2a50..136f2f8472 100644 --- a/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionCustomerGroup.yaml @@ -2,8 +2,11 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group type: object required: - - customer_group_id - condition_id + - created_at + - customer_group_id + - metadata + - updated_at properties: customer_group_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. + nullable: true $ref: ./CustomerGroup.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DiscountConditionProduct.yaml b/docs/api/admin/components/schemas/DiscountConditionProduct.yaml index ca1540fcbb..4ce3691cdf 100644 --- a/docs/api/admin/components/schemas/DiscountConditionProduct.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProduct.yaml @@ -2,8 +2,11 @@ title: Product Discount Condition description: Associates a discount condition with a product type: object required: - - product_id - condition_id + - created_at + - metadata + - product_id + - updated_at properties: product_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. + nullable: true $ref: ./Product.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml b/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml index 49e19e9590..b48d9d6516 100644 --- a/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductCollection.yaml @@ -2,8 +2,11 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection type: object required: - - product_collection_id - condition_id + - created_at + - metadata + - product_collection_id + - updated_at properties: product_collection_id: description: The ID of the Product Collection @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. + nullable: true $ref: ./ProductCollection.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml b/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml index 3b7c0738f0..61c29d1a71 100644 --- a/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductTag.yaml @@ -2,8 +2,11 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag type: object required: - - product_tag_id - condition_id + - created_at + - metadata + - product_tag_id + - updated_at properties: product_tag_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. + nullable: true $ref: ./ProductTag.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DiscountConditionProductType.yaml b/docs/api/admin/components/schemas/DiscountConditionProductType.yaml index 471000a1e7..77a7a5ad8b 100644 --- a/docs/api/admin/components/schemas/DiscountConditionProductType.yaml +++ b/docs/api/admin/components/schemas/DiscountConditionProductType.yaml @@ -2,8 +2,11 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type type: object required: - - product_type_id - condition_id + - created_at + - metadata + - product_type_id + - updated_at properties: product_type_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: ./ProductType.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DiscountRule.yaml b/docs/api/admin/components/schemas/DiscountRule.yaml index 1a6ec45afb..2adf4fb537 100644 --- a/docs/api/admin/components/schemas/DiscountRule.yaml +++ b/docs/api/admin/components/schemas/DiscountRule.yaml @@ -4,12 +4,19 @@ description: >- Cart. type: object required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata - type + - updated_at - value properties: id: - type: string description: The discount rule's ID + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C type: description: >- @@ -24,6 +31,7 @@ properties: example: percentage description: description: A short description of the discount + nullable: true type: string example: 10 Percent value: @@ -34,6 +42,7 @@ properties: example: 10 allocation: description: The scope that the discount should apply to. + nullable: true type: string enum: - total @@ -45,22 +54,23 @@ properties: used. Available if the relation `conditions` is expanded. type: array items: - type: object - description: A discount condition object. + $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/DraftOrder.yaml b/docs/api/admin/components/schemas/DraftOrder.yaml index 5e18ec0f8f..0e82842f04 100644 --- a/docs/api/admin/components/schemas/DraftOrder.yaml +++ b/docs/api/admin/components/schemas/DraftOrder.yaml @@ -1,71 +1,89 @@ title: DraftOrder description: Represents a draft order type: object +required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at properties: id: - type: string description: The draft order's ID + type: string example: dorder_01G8TJFKBG38YYFQ035MSVG03C status: - type: string description: The status of the draft order + type: string enum: - open - completed default: open display_id: - type: string description: The draft order's display ID + type: string example: 2 cart_id: - type: string description: The ID of the cart associated with the draft order. + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: - type: string description: The ID of the order associated with the draft order. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object canceled_at: - type: string description: The date the draft order was canceled at. + nullable: true + type: string format: date-time completed_at: - type: string description: The date the draft order was completed at. + nullable: true + type: string format: date-time no_notification_order: - type: boolean description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/admin/components/schemas/InventoryItemDTO.yaml b/docs/api/admin/components/schemas/InventoryItemDTO.yaml new file mode 100644 index 0000000000..5053d91286 --- /dev/null +++ b/docs/api/admin/components/schemas/InventoryItemDTO.yaml @@ -0,0 +1,69 @@ +type: object +required: + - sku +properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the manufacturer of + the Inventory Item. May be used by Fulfillment Providers to pass customs + information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May be + used by Fulfillment Providers to pass customs information to shipping + carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time diff --git a/docs/api/admin/components/schemas/InventoryLevelDTO.yaml b/docs/api/admin/components/schemas/InventoryLevelDTO.yaml new file mode 100644 index 0000000000..8540f71c95 --- /dev/null +++ b/docs/api/admin/components/schemas/InventoryLevelDTO.yaml @@ -0,0 +1,37 @@ +type: object +required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity +properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time diff --git a/docs/api/admin/components/schemas/Order.yaml b/docs/api/admin/components/schemas/Order.yaml index fbc5185c9b..e503b4fecd 100644 --- a/docs/api/admin/components/schemas/Order.yaml +++ b/docs/api/admin/components/schemas/Order.yaml @@ -133,14 +133,14 @@ properties: The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: ./Payment.yaml + type: object fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: ./Fulfillment.yaml + type: object returns: type: array description: >- @@ -193,7 +193,7 @@ properties: [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: ./OrderEdit.yaml + type: object gift_card_transactions: type: array description: >- diff --git a/docs/api/admin/components/schemas/OrderEdit.yaml b/docs/api/admin/components/schemas/OrderEdit.yaml index ea53ce0b14..01f09e31d0 100644 --- a/docs/api/admin/components/schemas/OrderEdit.yaml +++ b/docs/api/admin/components/schemas/OrderEdit.yaml @@ -17,7 +17,7 @@ properties: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: ./Order.yaml + type: object changes: type: array description: Available if the relation `changes` is expanded. diff --git a/docs/api/admin/components/schemas/Product.yaml b/docs/api/admin/components/schemas/Product.yaml index 5112dc072f..2efc2db8c4 100644 --- a/docs/api/admin/components/schemas/Product.yaml +++ b/docs/api/admin/components/schemas/Product.yaml @@ -169,6 +169,14 @@ properties: items: type: object description: A sales channel object. + categories: + description: >- + The product's associated categories. Available if the relation + `categories` is expanded. + type: array + items: + type: object + description: A category object. created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/ProductCategory.yaml b/docs/api/admin/components/schemas/ProductCategory.yaml index 2a4074e25d..3f9c1eb7e7 100644 --- a/docs/api/admin/components/schemas/ProductCategory.yaml +++ b/docs/api/admin/components/schemas/ProductCategory.yaml @@ -46,6 +46,14 @@ properties: A product category object. Available if the relation `parent_category` is expanded. type: object + products: + description: >- + products associated with category. Available if the relation `products` is + expanded. + type: array + items: + type: object + description: A product object. created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/admin/components/schemas/StockLocationAddressDTO.yaml b/docs/api/admin/components/schemas/StockLocationAddressDTO.yaml index de9461efb2..fa00e2353d 100644 --- a/docs/api/admin/components/schemas/StockLocationAddressDTO.yaml +++ b/docs/api/admin/components/schemas/StockLocationAddressDTO.yaml @@ -19,6 +19,10 @@ properties: type: string description: Stock location address' complement example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa city: type: string description: Stock location address' city diff --git a/docs/api/admin/components/schemas/Swap.yaml b/docs/api/admin/components/schemas/Swap.yaml index d5a43a79d8..97a560fcc8 100644 --- a/docs/api/admin/components/schemas/Swap.yaml +++ b/docs/api/admin/components/schemas/Swap.yaml @@ -68,13 +68,13 @@ properties: relation `fulfillments` is expanded. type: array items: - $ref: ./Fulfillment.yaml + type: object payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: ./Payment.yaml + type: object difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index 4c2251095a..df9e611bb6 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -243,6 +243,14 @@ 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: @@ -351,6 +359,8 @@ 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}: @@ -477,6 +487,8 @@ paths: $ref: paths/users_password-token.yaml /users/reset-password: $ref: paths/users_reset-password.yaml + /variants/{id}/inventory: + $ref: paths/variants_{id}_inventory.yaml /variants: $ref: paths/variants.yaml components: @@ -562,7 +574,7 @@ components: ```tsx diff --git a/docs/api/admin/paths/admin_draft-orders_{id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}.yaml index f8718848dc..207be909e2 100644 --- a/docs/api/admin/paths/admin_draft-orders_{id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostDraftOrdersDraftOrderReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/postundefined + $ref: ../code_samples/JavaScript/admin_draft-orders_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/admin_draft-orders_{id}/postundefined + $ref: ../code_samples/Shell/admin_draft-orders_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/apps.yaml b/docs/api/admin/paths/apps.yaml index 4d0b2d4090..e92bf91ab2 100644 --- a/docs/api/admin/paths/apps.yaml +++ b/docs/api/admin/paths/apps.yaml @@ -3,11 +3,13 @@ get: summary: List Applications description: Retrieve a list of applications. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/apps/getundefined + $ref: ../code_samples/Shell/apps/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/apps_authorizations.yaml b/docs/api/admin/paths/apps_authorizations.yaml index f461bc235b..bea62545f4 100644 --- a/docs/api/admin/paths/apps_authorizations.yaml +++ b/docs/api/admin/paths/apps_authorizations.yaml @@ -8,11 +8,13 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostAppsReq.yaml + x-codegen: + method: authorize x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/apps_authorizations/postundefined + $ref: ../code_samples/Shell/apps_authorizations/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/auth.yaml b/docs/api/admin/paths/auth.yaml index 1a74b737f7..9e69305fc7 100644 --- a/docs/api/admin/paths/auth.yaml +++ b/docs/api/admin/paths/auth.yaml @@ -19,15 +19,17 @@ post: password: type: string description: The User's password. + x-codegen: + method: createSession x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/postundefined + $ref: ../code_samples/JavaScript/auth/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/postundefined + $ref: ../code_samples/Shell/auth/post.sh tags: - Auth responses: @@ -54,15 +56,17 @@ delete: summary: User Logout x-authenticated: true description: Deletes the current session for the logged in user. + x-codegen: + method: deleteSession x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/deleteundefined + $ref: ../code_samples/JavaScript/auth/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/deleteundefined + $ref: ../code_samples/Shell/auth/delete.sh security: - api_token: [] - cookie_auth: [] @@ -88,15 +92,17 @@ get: summary: Get Current User x-authenticated: true description: Gets the currently logged in User. + x-codegen: + method: getSession x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/getundefined + $ref: ../code_samples/JavaScript/auth/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/getundefined + $ref: ../code_samples/Shell/auth/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/batch-jobs.yaml b/docs/api/admin/paths/batch-jobs.yaml index 36207da518..b970ce2cc4 100644 --- a/docs/api/admin/paths/batch-jobs.yaml +++ b/docs/api/admin/paths/batch-jobs.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostBatchesReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs/postundefined + $ref: ../code_samples/JavaScript/batch-jobs/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs/postundefined + $ref: ../code_samples/Shell/batch-jobs/post.sh security: - api_token: [] - cookie_auth: [] @@ -282,15 +284,18 @@ get: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetBatchParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs/getundefined + $ref: ../code_samples/JavaScript/batch-jobs/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs/getundefined + $ref: ../code_samples/Shell/batch-jobs/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/batch-jobs_{id}.yaml b/docs/api/admin/paths/batch-jobs_{id}.yaml index 000772b520..c1c6c734d2 100644 --- a/docs/api/admin/paths/batch-jobs_{id}.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}.yaml @@ -10,15 +10,17 @@ get: description: The ID of the Batch Job schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs_{id}/getundefined + $ref: ../code_samples/JavaScript/batch-jobs_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs_{id}/getundefined + $ref: ../code_samples/Shell/batch-jobs_{id}/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml index bff194f18b..cbd64a2c17 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_cancel.yaml @@ -10,15 +10,17 @@ post: description: The ID of the batch job. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs_{id}_cancel/postundefined + $ref: ../code_samples/JavaScript/batch-jobs_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs_{id}_cancel/postundefined + $ref: ../code_samples/Shell/batch-jobs_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml index 3bc12e8922..96b445516e 100644 --- a/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml +++ b/docs/api/admin/paths/batch-jobs_{id}_confirm.yaml @@ -10,15 +10,17 @@ post: description: The ID of the batch job. schema: type: string + x-codegen: + method: confirm x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/batch-jobs_{id}_confirm/postundefined + $ref: ../code_samples/JavaScript/batch-jobs_{id}_confirm/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/batch-jobs_{id}_confirm/postundefined + $ref: ../code_samples/Shell/batch-jobs_{id}_confirm/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/collections.yaml b/docs/api/admin/paths/collections.yaml index dbd9acf2ef..2e8818121f 100644 --- a/docs/api/admin/paths/collections.yaml +++ b/docs/api/admin/paths/collections.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostCollectionsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections/postundefined + $ref: ../code_samples/JavaScript/collections/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections/postundefined + $ref: ../code_samples/Shell/collections/post.sh security: - api_token: [] - cookie_auth: [] @@ -145,15 +147,18 @@ get: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetCollectionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections/getundefined + $ref: ../code_samples/JavaScript/collections/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections/getundefined + $ref: ../code_samples/Shell/collections/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/collections_{id}.yaml b/docs/api/admin/paths/collections_{id}.yaml index 8247a2566f..b3add7d148 100644 --- a/docs/api/admin/paths/collections_{id}.yaml +++ b/docs/api/admin/paths/collections_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Collection. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections_{id}/deleteundefined + $ref: ../code_samples/JavaScript/collections_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}/deleteundefined + $ref: ../code_samples/Shell/collections_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Product Collection schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections_{id}/getundefined + $ref: ../code_samples/JavaScript/collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}/getundefined + $ref: ../code_samples/Shell/collections_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostCollectionsCollectionReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections_{id}/postundefined + $ref: ../code_samples/JavaScript/collections_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}/postundefined + $ref: ../code_samples/Shell/collections_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/collections_{id}_products_batch.yaml b/docs/api/admin/paths/collections_{id}_products_batch.yaml index 96241493e5..1746b6ccbe 100644 --- a/docs/api/admin/paths/collections_{id}_products_batch.yaml +++ b/docs/api/admin/paths/collections_{id}_products_batch.yaml @@ -15,11 +15,13 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductsToCollectionReq.yaml + x-codegen: + method: addProducts x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}_products_batch/postundefined + $ref: ../code_samples/Shell/collections_{id}_products_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -61,11 +63,13 @@ delete: application/json: schema: $ref: ../components/schemas/AdminDeleteProductsFromCollectionReq.yaml + x-codegen: + method: removeProducts x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}_products_batch/deleteundefined + $ref: ../code_samples/Shell/collections_{id}_products_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/currencies.yaml b/docs/api/admin/paths/currencies.yaml index 5d49d8849f..56afc700eb 100644 --- a/docs/api/admin/paths/currencies.yaml +++ b/docs/api/admin/paths/currencies.yaml @@ -31,15 +31,18 @@ get: schema: type: number default: '20' + x-codegen: + method: list + queryParams: AdminGetCurrenciesParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/currencies/getundefined + $ref: ../code_samples/JavaScript/currencies/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/currencies/getundefined + $ref: ../code_samples/Shell/currencies/get.sh tags: - Currency responses: diff --git a/docs/api/admin/paths/currencies_{code}.yaml b/docs/api/admin/paths/currencies_{code}.yaml index b7194abda1..f059541bae 100644 --- a/docs/api/admin/paths/currencies_{code}.yaml +++ b/docs/api/admin/paths/currencies_{code}.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostCurrenciesCurrencyReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/currencies_{code}/postundefined + $ref: ../code_samples/JavaScript/currencies_{code}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/currencies_{code}/postundefined + $ref: ../code_samples/Shell/currencies_{code}/post.sh tags: - Currency responses: diff --git a/docs/api/admin/paths/customer-groups.yaml b/docs/api/admin/paths/customer-groups.yaml index 81d0a90f85..34919b4e7d 100644 --- a/docs/api/admin/paths/customer-groups.yaml +++ b/docs/api/admin/paths/customer-groups.yaml @@ -3,16 +3,22 @@ post: summary: Create a Customer Group description: Creates a CustomerGroup. x-authenticated: true - parameters: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostCustomerGroupsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups/postundefined + $ref: ../code_samples/JavaScript/customer-groups/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups/postundefined + $ref: ../code_samples/Shell/customer-groups/post.sh security: - api_token: [] - cookie_auth: [] @@ -37,20 +43,6 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - name - properties: - name: - type: string - description: Name of the customer group - metadata: - type: object - description: Metadata for the customer. get: operationId: GetCustomerGroups summary: List Customer Groups @@ -173,15 +165,18 @@ get: groups of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetCustomerGroupsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups/getundefined + $ref: ../code_samples/JavaScript/customer-groups/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups/getundefined + $ref: ../code_samples/Shell/customer-groups/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/customer-groups_{id}.yaml b/docs/api/admin/paths/customer-groups_{id}.yaml index d117c7d0db..3dce0d500f 100644 --- a/docs/api/admin/paths/customer-groups_{id}.yaml +++ b/docs/api/admin/paths/customer-groups_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Customer Group schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups_{id}/deleteundefined + $ref: ../code_samples/JavaScript/customer-groups_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}/deleteundefined + $ref: ../code_samples/Shell/customer-groups_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -65,15 +67,18 @@ get: description: (Comma separated) Which fields should be included in the customer group. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetCustomerGroupsGroupParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups_{id}/getundefined + $ref: ../code_samples/JavaScript/customer-groups_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}/getundefined + $ref: ../code_samples/Shell/customer-groups_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -115,15 +120,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostCustomerGroupsGroupReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups_{id}/postundefined + $ref: ../code_samples/JavaScript/customer-groups_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}/postundefined + $ref: ../code_samples/Shell/customer-groups_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/customer-groups_{id}_customers.yaml b/docs/api/admin/paths/customer-groups_{id}_customers.yaml index 54e9bb3f31..9b6fbb1483 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers.yaml @@ -10,15 +10,40 @@ get: description: The ID of the customer group. schema: type: string + - in: query + name: limit + description: The number of items to return. + schema: + type: integer + default: 50 + - in: query + name: offset + description: The items to skip before result. + schema: + type: integer + default: 0 + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each customer. + schema: + type: string + - in: query + name: q + description: a search term to search email, first_name, and last_name. + schema: + type: string + x-codegen: + method: listCustomers + queryParams: AdminGetGroupsGroupCustomersParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customer-groups_{id}_customers/getundefined + $ref: ../code_samples/JavaScript/customer-groups_{id}_customers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customer-groups_{id}_customers/getundefined + $ref: ../code_samples/Shell/customer-groups_{id}_customers/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml index 3f4849fa2e..2d30363b1e 100644 --- a/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml +++ b/docs/api/admin/paths/customer-groups_{id}_customers_batch.yaml @@ -16,17 +16,18 @@ post: schema: $ref: >- ../components/schemas/AdminPostCustomerGroupsGroupCustomersBatchReq.yaml + x-codegen: + method: addCustomers x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/customer-groups_{id}_customers_batch/postundefined + ../code_samples/JavaScript/customer-groups_{id}_customers_batch/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/customer-groups_{id}_customers_batch/postundefined + $ref: ../code_samples/Shell/customer-groups_{id}_customers_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -69,17 +70,18 @@ delete: schema: $ref: >- ../components/schemas/AdminDeleteCustomerGroupsGroupCustomerBatchReq.yaml + x-codegen: + method: removeCustomers x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/customer-groups_{id}_customers_batch/deleteundefined + ../code_samples/JavaScript/customer-groups_{id}_customers_batch/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/customer-groups_{id}_customers_batch/deleteundefined + $ref: ../code_samples/Shell/customer-groups_{id}_customers_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/customers.yaml b/docs/api/admin/paths/customers.yaml index 3ac2c02628..329b08921d 100644 --- a/docs/api/admin/paths/customers.yaml +++ b/docs/api/admin/paths/customers.yaml @@ -8,20 +8,22 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostCustomersReq.yaml - tags: - - Customer + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers/postundefined + $ref: ../code_samples/JavaScript/customers/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers/postundefined + $ref: ../code_samples/Shell/customers/post.sh security: - api_token: [] - cookie_auth: [] + tags: + - Customer responses: '201': description: OK @@ -69,15 +71,18 @@ get: 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: - $ref: ../code_samples/JavaScript/customers/getundefined + $ref: ../code_samples/JavaScript/customers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers/getundefined + $ref: ../code_samples/Shell/customers/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/customers_{id}.yaml b/docs/api/admin/paths/customers_{id}.yaml index 56e84f9c72..bbd0e2c8a5 100644 --- a/docs/api/admin/paths/customers_{id}.yaml +++ b/docs/api/admin/paths/customers_{id}.yaml @@ -20,15 +20,17 @@ get: 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: - $ref: ../code_samples/JavaScript/customers_{id}/getundefined + $ref: ../code_samples/JavaScript/customers_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_{id}/getundefined + $ref: ../code_samples/Shell/customers_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -80,15 +82,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostCustomersCustomerReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_{id}/postundefined + $ref: ../code_samples/JavaScript/customers_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_{id}/postundefined + $ref: ../code_samples/Shell/customers_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts.yaml b/docs/api/admin/paths/discounts.yaml index 036a2ec584..c9fe101596 100644 --- a/docs/api/admin/paths/discounts.yaml +++ b/docs/api/admin/paths/discounts.yaml @@ -8,12 +8,12 @@ post: parameters: - in: query name: expand - description: (Comma separated) Which fields should be expanded in each customer. + 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 each customer. + description: (Comma separated) Which fields should be retrieved in the results. schema: type: string requestBody: @@ -21,15 +21,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostDiscountsReq.yaml + x-codegen: + method: create + queryParams: AdminPostDiscountsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts/postundefined + $ref: ../code_samples/JavaScript/discounts/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts/postundefined + $ref: ../code_samples/Shell/discounts/post.sh security: - api_token: [] - cookie_auth: [] @@ -116,15 +119,18 @@ get: description: Comma separated list of relations to include in the results. schema: type: string + x-codegen: + method: list + queryParams: AdminGetDiscountsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts/getundefined + $ref: ../code_samples/JavaScript/discounts/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts/getundefined + $ref: ../code_samples/Shell/discounts/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts_code_{code}.yaml b/docs/api/admin/paths/discounts_code_{code}.yaml index 9639a63fc3..ad838dd144 100644 --- a/docs/api/admin/paths/discounts_code_{code}.yaml +++ b/docs/api/admin/paths/discounts_code_{code}.yaml @@ -20,15 +20,18 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieveByCode + queryParams: AdminGetDiscountsDiscountCodeParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_code_{code}/getundefined + $ref: ../code_samples/JavaScript/discounts_code_{code}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_code_{code}/getundefined + $ref: ../code_samples/Shell/discounts_code_{code}/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml index b094f2528a..eda9816633 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml @@ -32,16 +32,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostDiscountsDiscountConditions.yaml + x-codegen: + method: createCondition + queryParams: AdminPostDiscountsDiscountConditionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions/postundefined + $ref: ../code_samples/JavaScript/discounts_{discount_id}_conditions/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{discount_id}_conditions/postundefined + $ref: ../code_samples/Shell/discounts_{discount_id}_conditions/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml index aaddd8c66e..5501701835 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}.yaml @@ -26,17 +26,20 @@ delete: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: deleteCondition + queryParams: AdminDeleteDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/deleteundefined + ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/deleteundefined + ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -89,17 +92,20 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: getCondition + queryParams: AdminGetDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/getundefined + ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/get.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/getundefined + ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -165,17 +171,20 @@ post: schema: $ref: >- ../components/schemas/AdminPostDiscountsDiscountConditionsCondition.yaml + x-codegen: + method: updateCondition + queryParams: AdminPostDiscountsDiscountConditionsConditionParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/postundefined + ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/postundefined + ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml index acfeac0295..0394b766da 100644 --- a/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml @@ -36,17 +36,20 @@ post: schema: $ref: >- ../components/schemas/AdminPostDiscountsDiscountConditionsConditionBatchReq.yaml + x-codegen: + method: addConditionResourceBatch + queryParams: AdminPostDiscountsDiscountConditionsConditionBatchParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined + ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined + ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -109,17 +112,19 @@ delete: schema: $ref: >- ../components/schemas/AdminDeleteDiscountsDiscountConditionsConditionBatchReq.yaml + x-codegen: + method: deleteConditionResourceBatch x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined + ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined + ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts_{id}.yaml b/docs/api/admin/paths/discounts_{id}.yaml index 09266cfeb5..605192c2ab 100644 --- a/docs/api/admin/paths/discounts_{id}.yaml +++ b/docs/api/admin/paths/discounts_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Discount schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}/deleteundefined + $ref: ../code_samples/JavaScript/discounts_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}/deleteundefined + $ref: ../code_samples/Shell/discounts_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -65,15 +67,18 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetDiscountParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}/getundefined + $ref: ../code_samples/JavaScript/discounts_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}/getundefined + $ref: ../code_samples/Shell/discounts_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -131,15 +136,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostDiscountsDiscountReq.yaml + x-codegen: + method: update + queryParams: AdminPostDiscountsDiscountParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}/postundefined + $ref: ../code_samples/JavaScript/discounts_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}/postundefined + $ref: ../code_samples/Shell/discounts_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml index 8228ec0adf..9cee3a1389 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes.yaml @@ -12,15 +12,22 @@ post: description: The ID of the Discount to create the dynamic code from." schema: type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostDiscountsDiscountDynamicCodesReq.yaml + x-codegen: + method: createDynamicCode x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/discounts_{id}_dynamic-codes/postundefined + $ref: ../code_samples/JavaScript/discounts_{id}_dynamic-codes/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}_dynamic-codes/postundefined + $ref: ../code_samples/Shell/discounts_{id}_dynamic-codes/post.sh security: - api_token: [] - cookie_auth: [] @@ -45,23 +52,3 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - code - properties: - code: - type: string - description: The unique code that will be used to redeem the Discount. - usage_limit: - type: number - default: '1' - description: amount of times the discount can be applied. - metadata: - type: object - description: >- - An optional set of key-value paris to hold additional - information. diff --git a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml index 64a02ba04d..00931f18b1 100644 --- a/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml +++ b/docs/api/admin/paths/discounts_{id}_dynamic-codes_{code}.yaml @@ -16,17 +16,18 @@ delete: description: The ID of the Discount schema: type: string + x-codegen: + method: deleteDynamicCode x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/deleteundefined + ../code_samples/JavaScript/discounts_{id}_dynamic-codes_{code}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/discounts_{id}_dynamic-codes_{code}/deleteundefined + $ref: ../code_samples/Shell/discounts_{id}_dynamic-codes_{code}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml index b340b10849..8084d28099 100644 --- a/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml +++ b/docs/api/admin/paths/discounts_{id}_regions_{region_id}.yaml @@ -16,16 +16,17 @@ post: description: The ID of the Region. schema: type: string + x-codegen: + method: addRegion x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/discounts_{id}_regions_{region_id}/postundefined + $ref: ../code_samples/JavaScript/discounts_{id}_regions_{region_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/discounts_{id}_regions_{region_id}/postundefined + $ref: ../code_samples/Shell/discounts_{id}_regions_{region_id}/post.sh security: - api_token: [] - cookie_auth: [] @@ -68,17 +69,18 @@ delete: description: The ID of the Region. schema: type: string + x-codegen: + method: removeRegion x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/discounts_{id}_regions_{region_id}/deleteundefined + ../code_samples/JavaScript/discounts_{id}_regions_{region_id}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/discounts_{id}_regions_{region_id}/deleteundefined + $ref: ../code_samples/Shell/discounts_{id}_regions_{region_id}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/draft-orders.yaml b/docs/api/admin/paths/draft-orders.yaml index 501bcfc24e..0f78a3d87d 100644 --- a/docs/api/admin/paths/draft-orders.yaml +++ b/docs/api/admin/paths/draft-orders.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostDraftOrdersReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders/postundefined + $ref: ../code_samples/JavaScript/draft-orders/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders/postundefined + $ref: ../code_samples/Shell/draft-orders/post.sh security: - api_token: [] - cookie_auth: [] @@ -66,15 +68,18 @@ get: display IDs of draft orders schema: type: string + x-codegen: + method: list + queryParams: AdminGetDraftOrdersParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders/getundefined + $ref: ../code_samples/JavaScript/draft-orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders/getundefined + $ref: ../code_samples/Shell/draft-orders/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/draft-orders_{id}.yaml b/docs/api/admin/paths/draft-orders_{id}.yaml index 91e31ccc0c..3434fcaf90 100644 --- a/docs/api/admin/paths/draft-orders_{id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders_{id}/deleteundefined + $ref: ../code_samples/JavaScript/draft-orders_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders_{id}/deleteundefined + $ref: ../code_samples/Shell/draft-orders_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders_{id}/getundefined + $ref: ../code_samples/JavaScript/draft-orders_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders_{id}/getundefined + $ref: ../code_samples/Shell/draft-orders_{id}/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml index 118863d6e6..ef233bff9b 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items.yaml @@ -16,15 +16,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsReq.yaml + x-codegen: + method: addLineItem x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders_{id}_line-items/postundefined + $ref: ../code_samples/JavaScript/draft-orders_{id}_line-items/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders_{id}_line-items/postundefined + $ref: ../code_samples/Shell/draft-orders_{id}_line-items/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml index 7b12fd27ba..e5a76b1720 100644 --- a/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_line-items_{line_id}.yaml @@ -16,17 +16,18 @@ delete: description: The ID of the Draft Order. schema: type: string + x-codegen: + method: removeLineItem x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/deleteundefined + ../code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/draft-orders_{id}_line-items_{line_id}/deleteundefined + $ref: ../code_samples/Shell/draft-orders_{id}_line-items_{line_id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -75,17 +76,18 @@ post: schema: $ref: >- ../components/schemas/AdminPostDraftOrdersDraftOrderLineItemsItemReq.yaml + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/postundefined + ../code_samples/JavaScript/draft-orders_{id}_line-items_{line_id}/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/draft-orders_{id}_line-items_{line_id}/postundefined + $ref: ../code_samples/Shell/draft-orders_{id}_line-items_{line_id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/draft-orders_{id}_pay.yaml b/docs/api/admin/paths/draft-orders_{id}_pay.yaml index 05b8bda2bb..8b3888acd3 100644 --- a/docs/api/admin/paths/draft-orders_{id}_pay.yaml +++ b/docs/api/admin/paths/draft-orders_{id}_pay.yaml @@ -10,15 +10,17 @@ post: description: The Draft Order id. schema: type: string + x-codegen: + method: markPaid x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/draft-orders_{id}_pay/postundefined + $ref: ../code_samples/JavaScript/draft-orders_{id}_pay/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/draft-orders_{id}_pay/postundefined + $ref: ../code_samples/Shell/draft-orders_{id}_pay/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/gift-cards.yaml b/docs/api/admin/paths/gift-cards.yaml index 40e74a8103..383e39cf94 100644 --- a/docs/api/admin/paths/gift-cards.yaml +++ b/docs/api/admin/paths/gift-cards.yaml @@ -10,15 +10,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostGiftCardsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards/postundefined + $ref: ../code_samples/JavaScript/gift-cards/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards/postundefined + $ref: ../code_samples/Shell/gift-cards/post.sh security: - api_token: [] - cookie_auth: [] @@ -66,15 +68,18 @@ get: 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: - $ref: ../code_samples/JavaScript/gift-cards/getundefined + $ref: ../code_samples/JavaScript/gift-cards/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards/getundefined + $ref: ../code_samples/Shell/gift-cards/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/gift-cards_{id}.yaml b/docs/api/admin/paths/gift-cards_{id}.yaml index cacd875001..624d467e80 100644 --- a/docs/api/admin/paths/gift-cards_{id}.yaml +++ b/docs/api/admin/paths/gift-cards_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Gift Card to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards_{id}/deleteundefined + $ref: ../code_samples/JavaScript/gift-cards_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards_{id}/deleteundefined + $ref: ../code_samples/Shell/gift-cards_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Gift Card. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards_{id}/getundefined + $ref: ../code_samples/JavaScript/gift-cards_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards_{id}/getundefined + $ref: ../code_samples/Shell/gift-cards_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -107,15 +111,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostGiftCardsGiftCardReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards_{id}/postundefined + $ref: ../code_samples/JavaScript/gift-cards_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards_{id}/postundefined + $ref: ../code_samples/Shell/gift-cards_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/inventory-items.yaml b/docs/api/admin/paths/inventory-items.yaml new file mode 100644 index 0000000000..e281ed7024 --- /dev/null +++ b/docs/api/admin/paths/inventory-items.yaml @@ -0,0 +1,131 @@ +get: + operationId: GetInventoryItems + summary: List inventory items. + description: Lists inventory items. + x-authenticated: true + parameters: + - in: query + name: offset + description: How many inventory items to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of inventory items returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + - in: query + name: q + description: Query used for searching product inventory items and their properties. + schema: + type: string + - in: query + name: location_id + style: form + explode: false + description: Locations ids to search for. + schema: + type: array + items: + type: string + - in: query + name: id + description: id to search for. + schema: + type: string + - in: query + name: sku + description: sku to search for. + schema: + type: string + - in: query + name: origin_country + description: origin_country to search for. + schema: + type: string + - in: query + name: mid_code + description: mid_code to search for. + schema: + type: string + - in: query + name: material + description: material to search for. + schema: + type: string + - in: query + name: hs_code + description: hs_code to search for. + schema: + type: string + - in: query + name: weight + description: weight to search for. + schema: + type: string + - in: query + name: length + description: length to search for. + schema: + type: string + - in: query + name: height + description: height to search for. + schema: + type: string + - in: query + name: width + description: width to search for. + schema: + type: string + - in: query + name: requires_shipping + description: requires_shipping to search for. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/inventory-items/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/inventory-items/get.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: >- + ../components/schemas/AdminInventoryItemsListWithVariantsAndLocationLevelsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/inventory-items_{id}.yaml b/docs/api/admin/paths/inventory-items_{id}.yaml new file mode 100644 index 0000000000..c0fa12f028 --- /dev/null +++ b/docs/api/admin/paths/inventory-items_{id}.yaml @@ -0,0 +1,150 @@ +delete: + operationId: DeleteInventoryItemsInventoryItem + summary: Delete an Inventory Item + description: Delete an Inventory Item + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/inventory-items_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/inventory-items_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - InventoryItem + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsDeleteRes.yaml + '400': + $ref: ../components/responses/400_error.yaml +get: + operationId: GetInventoryItemsInventoryItem + summary: Retrive an Inventory Item. + description: Retrives an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/inventory-items_{id}/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/inventory-items_{id}/get.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +post: + operationId: PostInventoryItemsInventoryItem + summary: Update an Inventory Item. + description: Updates an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostInventoryItemsInventoryItemReq.yaml + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/inventory-items_{id}/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/inventory-items_{id}/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/inventory-items_{id}_location-levels.yaml b/docs/api/admin/paths/inventory-items_{id}_location-levels.yaml new file mode 100644 index 0000000000..ae6cdee417 --- /dev/null +++ b/docs/api/admin/paths/inventory-items_{id}_location-levels.yaml @@ -0,0 +1,129 @@ +post: + operationId: PostInventoryItemsInventoryItemLocationLevels + summary: Create an Inventory Location Level for a given Inventory Item. + description: Creates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + ../components/schemas/AdminPostInventoryItemsItemLocationLevelsReq.yaml + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/inventory-items_{id}_location-levels/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/inventory-items_{id}_location-levels/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +get: + operationId: GetInventoryItemsInventoryItemLocationLevels + summary: List stock levels of a given location. + description: Lists stock levels of a given location. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: query + name: offset + description: How many stock locations levels to skip in the result. + schema: + type: integer + default: 0 + - in: query + name: limit + description: Limit the number of stock locations levels returned. + schema: + type: integer + default: 20 + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/inventory-items_{id}_location-levels/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/inventory-items_{id}_location-levels/get.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsLocationLevelsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/inventory-items_{id}_location-levels_{location_id}.yaml b/docs/api/admin/paths/inventory-items_{id}_location-levels_{location_id}.yaml new file mode 100644 index 0000000000..27babb931e --- /dev/null +++ b/docs/api/admin/paths/inventory-items_{id}_location-levels_{location_id}.yaml @@ -0,0 +1,132 @@ +delete: + operationId: DeleteInventoryItemsInventoryIteLocationLevelsLocation + summary: Delete a location level of an Inventory Item. + description: Delete a location level of an Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/delete.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +post: + operationId: PostInventoryItemsInventoryItemLocationLevelsLocationLevel + summary: Update an Inventory Location Level for a given Inventory Item. + description: Updates an Inventory Location Level for a given Inventory Item. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Inventory Item. + schema: + type: string + - in: path + name: location_id + required: true + description: The ID of the Location. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: >- + ../components/schemas/AdminPostInventoryItemsItemLocationLevelsLevelReq.yaml + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/inventory-items_{id}_location-levels_{location_id}/post.js + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/inventory-items_{id}_location-levels_{location_id}/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Inventory Items + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminInventoryItemsRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/invites.yaml b/docs/api/admin/paths/invites.yaml index 1285069b4e..ffb958086f 100644 --- a/docs/api/admin/paths/invites.yaml +++ b/docs/api/admin/paths/invites.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostInvitesReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites/postundefined + $ref: ../code_samples/JavaScript/invites/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites/postundefined + $ref: ../code_samples/Shell/invites/post.sh security: - api_token: [] - cookie_auth: [] @@ -42,15 +44,17 @@ get: summary: Lists Invites description: Lists all Invites x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites/getundefined + $ref: ../code_samples/JavaScript/invites/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites/getundefined + $ref: ../code_samples/Shell/invites/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/invites_accept.yaml b/docs/api/admin/paths/invites_accept.yaml index a6f393d12b..e6ca3b2278 100644 --- a/docs/api/admin/paths/invites_accept.yaml +++ b/docs/api/admin/paths/invites_accept.yaml @@ -7,15 +7,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostInvitesInviteAcceptReq.yaml + x-codegen: + method: accept x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites_accept/postundefined + $ref: ../code_samples/JavaScript/invites_accept/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites_accept/postundefined + $ref: ../code_samples/Shell/invites_accept/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/invites_{invite_id}.yaml b/docs/api/admin/paths/invites_{invite_id}.yaml index fbcb5bed13..aa56da1b65 100644 --- a/docs/api/admin/paths/invites_{invite_id}.yaml +++ b/docs/api/admin/paths/invites_{invite_id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Invite schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites_{invite_id}/deleteundefined + $ref: ../code_samples/JavaScript/invites_{invite_id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites_{invite_id}/deleteundefined + $ref: ../code_samples/Shell/invites_{invite_id}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/invites_{invite_id}_resend.yaml b/docs/api/admin/paths/invites_{invite_id}_resend.yaml index e3faf7e26e..b895f752ae 100644 --- a/docs/api/admin/paths/invites_{invite_id}_resend.yaml +++ b/docs/api/admin/paths/invites_{invite_id}_resend.yaml @@ -10,15 +10,17 @@ post: description: The ID of the Invite schema: type: string + x-codegen: + method: resend x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/invites_{invite_id}_resend/postundefined + $ref: ../code_samples/JavaScript/invites_{invite_id}_resend/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/invites_{invite_id}_resend/postundefined + $ref: ../code_samples/Shell/invites_{invite_id}_resend/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/notes.yaml b/docs/api/admin/paths/notes.yaml index d943c91667..e78f5b9352 100644 --- a/docs/api/admin/paths/notes.yaml +++ b/docs/api/admin/paths/notes.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostNotesReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes/postundefined + $ref: ../code_samples/JavaScript/notes/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes/postundefined + $ref: ../code_samples/Shell/notes/post.sh security: - api_token: [] - cookie_auth: [] @@ -64,15 +66,18 @@ get: description: The ID which the notes belongs to schema: type: string + x-codegen: + method: list + queryParams: AdminGetNotesParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes/getundefined + $ref: ../code_samples/JavaScript/notes/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes/getundefined + $ref: ../code_samples/Shell/notes/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/notes_{id}.yaml b/docs/api/admin/paths/notes_{id}.yaml index 90ef87e655..b0706086a3 100644 --- a/docs/api/admin/paths/notes_{id}.yaml +++ b/docs/api/admin/paths/notes_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Note to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes_{id}/deleteundefined + $ref: ../code_samples/JavaScript/notes_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes_{id}/deleteundefined + $ref: ../code_samples/Shell/notes_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the note to retrieve. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes_{id}/getundefined + $ref: ../code_samples/JavaScript/notes_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes_{id}/getundefined + $ref: ../code_samples/Shell/notes_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostNotesNoteReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notes_{id}/postundefined + $ref: ../code_samples/JavaScript/notes_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notes_{id}/postundefined + $ref: ../code_samples/Shell/notes_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/notifications.yaml b/docs/api/admin/paths/notifications.yaml index 1de38278d4..3030528836 100644 --- a/docs/api/admin/paths/notifications.yaml +++ b/docs/api/admin/paths/notifications.yaml @@ -57,15 +57,18 @@ get: notifications or not schema: type: string + x-codegen: + method: list + queryParams: AdminGetNotificationsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notifications/getundefined + $ref: ../code_samples/JavaScript/notifications/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notifications/getundefined + $ref: ../code_samples/Shell/notifications/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/notifications_{id}_resend.yaml b/docs/api/admin/paths/notifications_{id}_resend.yaml index 9999095382..29311f9a2d 100644 --- a/docs/api/admin/paths/notifications_{id}_resend.yaml +++ b/docs/api/admin/paths/notifications_{id}_resend.yaml @@ -18,15 +18,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostNotificationsNotificationResendReq.yaml + x-codegen: + method: resend x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/notifications_{id}_resend/postundefined + $ref: ../code_samples/JavaScript/notifications_{id}_resend/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/notifications_{id}_resend/postundefined + $ref: ../code_samples/Shell/notifications_{id}_resend/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits.yaml b/docs/api/admin/paths/order-edits.yaml index 81f3bfa72e..3f4a409171 100644 --- a/docs/api/admin/paths/order-edits.yaml +++ b/docs/api/admin/paths/order-edits.yaml @@ -8,15 +8,17 @@ post: schema: $ref: ../components/schemas/AdminPostOrderEditsReq.yaml x-authenticated: true + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits/postundefined + $ref: ../code_samples/JavaScript/order-edits/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits/postundefined + $ref: ../code_samples/Shell/order-edits/post.sh security: - api_token: [] - cookie_auth: [] @@ -79,15 +81,18 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: list + queryParams: GetOrderEditsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits/getundefined + $ref: ../code_samples/JavaScript/order-edits/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits/getundefined + $ref: ../code_samples/Shell/order-edits/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits_{id}.yaml b/docs/api/admin/paths/order-edits_{id}.yaml index 02dd01a081..6ec5af4de5 100644 --- a/docs/api/admin/paths/order-edits_{id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Order Edit to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}/deleteundefined + $ref: ../code_samples/JavaScript/order-edits_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}/deleteundefined + $ref: ../code_samples/Shell/order-edits_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,18 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: GetOrderEditsOrderEditParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}/getundefined + $ref: ../code_samples/JavaScript/order-edits_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}/getundefined + $ref: ../code_samples/Shell/order-edits_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +110,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrderEditsOrderEditReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}/postundefined + $ref: ../code_samples/Shell/order-edits_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits_{id}_cancel.yaml b/docs/api/admin/paths/order-edits_{id}_cancel.yaml index 50300d73e5..f1ef280a37 100644 --- a/docs/api/admin/paths/order-edits_{id}_cancel.yaml +++ b/docs/api/admin/paths/order-edits_{id}_cancel.yaml @@ -10,15 +10,17 @@ post: description: The ID of the OrderEdit. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_cancel/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_cancel/postundefined + $ref: ../code_samples/Shell/order-edits_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml index 80731c4111..492c02d3ed 100644 --- a/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_changes_{change_id}.yaml @@ -16,17 +16,18 @@ delete: description: The ID of the Order Edit Item Change to delete. schema: type: string + x-codegen: + method: deleteItemChange x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/order-edits_{id}_changes_{change_id}/deleteundefined + ../code_samples/JavaScript/order-edits_{id}_changes_{change_id}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/order-edits_{id}_changes_{change_id}/deleteundefined + $ref: ../code_samples/Shell/order-edits_{id}_changes_{change_id}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits_{id}_confirm.yaml b/docs/api/admin/paths/order-edits_{id}_confirm.yaml index 3bee93163e..0d7d0e05e6 100644 --- a/docs/api/admin/paths/order-edits_{id}_confirm.yaml +++ b/docs/api/admin/paths/order-edits_{id}_confirm.yaml @@ -10,15 +10,17 @@ post: description: The ID of the order edit. schema: type: string + x-codegen: + method: confirm x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_confirm/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_confirm/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_confirm/postundefined + $ref: ../code_samples/Shell/order-edits_{id}_confirm/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits_{id}_items.yaml b/docs/api/admin/paths/order-edits_{id}_items.yaml index d1c017ef9a..1dddf39282 100644 --- a/docs/api/admin/paths/order-edits_{id}_items.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items.yaml @@ -15,15 +15,17 @@ post: schema: $ref: ../components/schemas/AdminPostOrderEditsEditLineItemsReq.yaml x-authenticated: true + x-codegen: + method: addLineItem x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_items/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_items/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_items/postundefined + $ref: ../code_samples/Shell/order-edits_{id}_items/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml index abe7fd9543..7d9279065d 100644 --- a/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items_{item_id}.yaml @@ -16,16 +16,17 @@ delete: description: The ID of the order edit item to delete from order. schema: type: string + x-codegen: + method: removeLineItem x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/order-edits_{id}_items_{item_id}/deleteundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_items_{item_id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_items_{item_id}/deleteundefined + $ref: ../code_samples/Shell/order-edits_{id}_items_{item_id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -74,16 +75,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostOrderEditsEditLineItemsLineItemReq.yaml + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/order-edits_{id}_items_{item_id}/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_items_{item_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_items_{item_id}/postundefined + $ref: ../code_samples/Shell/order-edits_{id}_items_{item_id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order-edits_{id}_request.yaml b/docs/api/admin/paths/order-edits_{id}_request.yaml index 1e8f82358b..b73c2cbbdc 100644 --- a/docs/api/admin/paths/order-edits_{id}_request.yaml +++ b/docs/api/admin/paths/order-edits_{id}_request.yaml @@ -10,15 +10,17 @@ post: description: The ID of the Order Edit to request confirmation from. schema: type: string + x-codegen: + method: requestConfirmation x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_request/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_request/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_request/postundefined + $ref: ../code_samples/Shell/order-edits_{id}_request/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order_{id}_claims.yaml b/docs/api/admin/paths/order_{id}_claims.yaml index 2fee281dcf..79b864b18e 100644 --- a/docs/api/admin/paths/order_{id}_claims.yaml +++ b/docs/api/admin/paths/order_{id}_claims.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderClaimsReq.yaml + x-codegen: + method: createClaim x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order_{id}_claims/postundefined + $ref: ../code_samples/JavaScript/order_{id}_claims/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order_{id}_claims/postundefined + $ref: ../code_samples/Shell/order_{id}_claims/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml index db86163b36..f54dfd8f8c 100644 --- a/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml +++ b/docs/api/admin/paths/order_{id}_claims_{claim_id}.yaml @@ -21,15 +21,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderClaimsClaimReq.yaml + x-codegen: + method: updateClaim x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order_{id}_claims_{claim_id}/postundefined + $ref: ../code_samples/JavaScript/order_{id}_claims_{claim_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order_{id}_claims_{claim_id}/postundefined + $ref: ../code_samples/Shell/order_{id}_claims_{claim_id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/order_{id}_swaps.yaml b/docs/api/admin/paths/order_{id}_swaps.yaml index 02801de7ca..7961755f41 100644 --- a/docs/api/admin/paths/order_{id}_swaps.yaml +++ b/docs/api/admin/paths/order_{id}_swaps.yaml @@ -17,15 +17,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderSwapsReq.yaml + x-codegen: + method: createSwap x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order_{id}_swaps/postundefined + $ref: ../code_samples/JavaScript/order_{id}_swaps/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order_{id}_swaps/postundefined + $ref: ../code_samples/Shell/order_{id}_swaps/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders.yaml b/docs/api/admin/paths/orders.yaml index 5b1fbd8dbf..d2eab3db64 100644 --- a/docs/api/admin/paths/orders.yaml +++ b/docs/api/admin/paths/orders.yaml @@ -217,15 +217,18 @@ get: result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetOrdersParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders/getundefined + $ref: ../code_samples/JavaScript/orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders/getundefined + $ref: ../code_samples/Shell/orders/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}.yaml b/docs/api/admin/paths/orders_{id}.yaml index 91da15ffb1..4f13709710 100644 --- a/docs/api/admin/paths/orders_{id}.yaml +++ b/docs/api/admin/paths/orders_{id}.yaml @@ -10,15 +10,28 @@ get: description: The ID of the Order. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codegen: + method: retrieve + queryParams: AdminGetOrdersOrderParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}/getundefined + $ref: ../code_samples/JavaScript/orders_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}/getundefined + $ref: ../code_samples/Shell/orders_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -60,15 +73,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}/postundefined + $ref: ../code_samples/JavaScript/orders_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}/postundefined + $ref: ../code_samples/Shell/orders_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_archive.yaml b/docs/api/admin/paths/orders_{id}_archive.yaml index c3c6576368..887fde4edb 100644 --- a/docs/api/admin/paths/orders_{id}_archive.yaml +++ b/docs/api/admin/paths/orders_{id}_archive.yaml @@ -10,15 +10,17 @@ post: description: The ID of the Order. schema: type: string + x-codegen: + method: archive x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_archive/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_archive/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_archive/postundefined + $ref: ../code_samples/Shell/orders_{id}_archive/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_cancel.yaml index a6ed10c37c..3435f201c3 100644 --- a/docs/api/admin/paths/orders_{id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_cancel.yaml @@ -13,15 +13,17 @@ post: description: The ID of the Order. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_cancel/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_cancel/postundefined + $ref: ../code_samples/Shell/orders_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_capture.yaml b/docs/api/admin/paths/orders_{id}_capture.yaml index c022c5c25f..c123df3c15 100644 --- a/docs/api/admin/paths/orders_{id}_capture.yaml +++ b/docs/api/admin/paths/orders_{id}_capture.yaml @@ -10,15 +10,17 @@ post: description: The ID of the Order. schema: type: string + x-codegen: + method: capturePayment x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_capture/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_capture/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_capture/postundefined + $ref: ../code_samples/Shell/orders_{id}_capture/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml index 98bfa19200..3121aeadd5 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_cancel.yaml @@ -16,17 +16,18 @@ post: description: The ID of the Claim. schema: type: string + x-codegen: + method: cancelClaim x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/postundefined + ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_cancel/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/postundefined + $ref: ../code_samples/Shell/orders_{id}_claims_{claim_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml index 1ad2f311bc..a5765acd2f 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments.yaml @@ -22,17 +22,19 @@ post: schema: $ref: >- ../components/schemas/AdminPostOrdersOrderClaimsClaimFulfillmentsReq.yaml + x-codegen: + method: fulfillClaim x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/postundefined + ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/postundefined + ../code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml index f431edeb09..1b710a2a4d 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -22,17 +22,19 @@ post: description: The ID of the Fulfillment. schema: type: string + x-codegen: + method: cancelClaimFulfillment x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/postundefined + ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/postundefined + ../code_samples/Shell/orders_{id}_claims_{claim_id}_fulfillments_{fulfillment_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml index 8228d5b3b1..4105a6e953 100644 --- a/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_claims_{claim_id}_shipments.yaml @@ -22,17 +22,18 @@ post: schema: $ref: >- ../components/schemas/AdminPostOrdersOrderClaimsClaimShipmentsReq.yaml + x-codegen: + method: createClaimShipment x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/postundefined + ../code_samples/JavaScript/orders_{id}_claims_{claim_id}_shipments/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/postundefined + $ref: ../code_samples/Shell/orders_{id}_claims_{claim_id}_shipments/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_complete.yaml b/docs/api/admin/paths/orders_{id}_complete.yaml index 60137f2529..77a3ccd082 100644 --- a/docs/api/admin/paths/orders_{id}_complete.yaml +++ b/docs/api/admin/paths/orders_{id}_complete.yaml @@ -10,15 +10,17 @@ post: description: The ID of the Order. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_complete/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_complete/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_complete/postundefined + $ref: ../code_samples/Shell/orders_{id}_complete/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_fulfillment.yaml b/docs/api/admin/paths/orders_{id}_fulfillment.yaml index d9c699f6c7..959a9fdbe8 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillment.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillment.yaml @@ -17,15 +17,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderFulfillmentsReq.yaml + x-codegen: + method: createFulfillment x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_fulfillment/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_fulfillment/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_fulfillment/postundefined + $ref: ../code_samples/Shell/orders_{id}_fulfillment/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml index 45d608ef5a..28d300c753 100644 --- a/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -16,17 +16,19 @@ post: description: The ID of the Fulfillment schema: type: string + x-codegen: + method: cancelFulfillment x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/postundefined + ../code_samples/JavaScript/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/postundefined + ../code_samples/Shell/orders_{id}_fulfillments_{fulfillment_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_line-items_{line_item_id}_reserve.yaml b/docs/api/admin/paths/orders_{id}_line-items_{line_item_id}_reserve.yaml index 661d634556..4b7fa823ef 100644 --- a/docs/api/admin/paths/orders_{id}_line-items_{line_item_id}_reserve.yaml +++ b/docs/api/admin/paths/orders_{id}_line-items_{line_item_id}_reserve.yaml @@ -28,12 +28,12 @@ post: label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/postundefined + ../code_samples/JavaScript/orders_{id}_line-items_{line_item_id}_reserve/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/postundefined + ../code_samples/Shell/orders_{id}_line-items_{line_item_id}_reserve/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_refund.yaml b/docs/api/admin/paths/orders_{id}_refund.yaml index f76477a3c9..505319e781 100644 --- a/docs/api/admin/paths/orders_{id}_refund.yaml +++ b/docs/api/admin/paths/orders_{id}_refund.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderRefundsReq.yaml + x-codegen: + method: refundPayment x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_refund/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_refund/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_refund/postundefined + $ref: ../code_samples/Shell/orders_{id}_refund/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_reservations.yaml b/docs/api/admin/paths/orders_{id}_reservations.yaml index def4a369c0..3d45df09ae 100644 --- a/docs/api/admin/paths/orders_{id}_reservations.yaml +++ b/docs/api/admin/paths/orders_{id}_reservations.yaml @@ -26,11 +26,11 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_reservations/getundefined + $ref: ../code_samples/JavaScript/orders_{id}_reservations/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_reservations/getundefined + $ref: ../code_samples/Shell/orders_{id}_reservations/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_return.yaml b/docs/api/admin/paths/orders_{id}_return.yaml index 7f7858c132..209c6b1367 100644 --- a/docs/api/admin/paths/orders_{id}_return.yaml +++ b/docs/api/admin/paths/orders_{id}_return.yaml @@ -17,15 +17,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderReturnsReq.yaml + x-codegen: + method: requestReturn x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_return/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_return/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_return/postundefined + $ref: ../code_samples/Shell/orders_{id}_return/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_shipment.yaml b/docs/api/admin/paths/orders_{id}_shipment.yaml index 7dc1319d5c..e515068d65 100644 --- a/docs/api/admin/paths/orders_{id}_shipment.yaml +++ b/docs/api/admin/paths/orders_{id}_shipment.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderShipmentReq.yaml + x-codegen: + method: createShipment x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_shipment/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_shipment/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_shipment/postundefined + $ref: ../code_samples/Shell/orders_{id}_shipment/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml index 9c59b9a795..33f35845e3 100644 --- a/docs/api/admin/paths/orders_{id}_shipping-methods.yaml +++ b/docs/api/admin/paths/orders_{id}_shipping-methods.yaml @@ -4,7 +4,6 @@ post: description: >- Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced. - x-authenticated: true parameters: - in: path name: id @@ -12,15 +11,23 @@ post: description: The ID of the Order. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminPostOrdersOrderShippingMethodsReq.yaml + x-authenticated: true + x-codegen: + method: addShippingMethod x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_{id}_shipping-methods/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_shipping-methods/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_shipping-methods/postundefined + $ref: ../code_samples/Shell/orders_{id}_shipping-methods/post.sh security: - api_token: [] - cookie_auth: [] @@ -45,27 +52,3 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - price - - option_id - properties: - price: - type: integer - description: >- - The price (excluding VAT) that should be charged for the - Shipping Method - option_id: - type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. - data: - type: object - description: >- - The data required for the Shipping Option to create a Shipping - Method. This will depend on the Fulfillment Provider. diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml index ab6ed2d5ec..14f3e851aa 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_cancel.yaml @@ -16,16 +16,17 @@ post: description: The ID of the Swap. schema: type: string + x-codegen: + method: cancelSwap x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/postundefined + $ref: ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/postundefined + $ref: ../code_samples/Shell/orders_{id}_swaps_{swap_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml index d234c30c3b..930b2c27da 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments.yaml @@ -22,17 +22,18 @@ post: schema: $ref: >- ../components/schemas/AdminPostOrdersOrderSwapsSwapFulfillmentsReq.yaml + x-codegen: + method: fulfillSwap x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/postundefined + ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/postundefined + $ref: ../code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml index 2aab1e34ec..bbb2ee1119 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel.yaml @@ -22,17 +22,19 @@ post: description: The ID of the Fulfillment. schema: type: string + x-codegen: + method: cancelSwapFulfillment x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/postundefined + ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/postundefined + ../code_samples/Shell/orders_{id}_swaps_{swap_id}_fulfillments_{fulfillment_id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml index 5df1ed6d02..0e8e6662af 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_process-payment.yaml @@ -19,17 +19,19 @@ post: description: The ID of the Swap. schema: type: string + x-codegen: + method: processSwapPayment x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/postundefined + ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_process-payment/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/postundefined + ../code_samples/Shell/orders_{id}_swaps_{swap_id}_process-payment/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml index 0c8813d210..da59a0ff0c 100644 --- a/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml +++ b/docs/api/admin/paths/orders_{id}_swaps_{swap_id}_shipments.yaml @@ -21,17 +21,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostOrdersOrderSwapsSwapShipmentsReq.yaml + x-codegen: + method: createSwapShipment x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/postundefined + ../code_samples/JavaScript/orders_{id}_swaps_{swap_id}_shipments/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/postundefined + $ref: ../code_samples/Shell/orders_{id}_swaps_{swap_id}_shipments/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/payment-collections_{id}.yaml b/docs/api/admin/paths/payment-collections_{id}.yaml index 16ac725bf5..164df9dcd2 100644 --- a/docs/api/admin/paths/payment-collections_{id}.yaml +++ b/docs/api/admin/paths/payment-collections_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Payment Collection to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payment-collections_{id}/deleteundefined + $ref: ../code_samples/JavaScript/payment-collections_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}/deleteundefined + $ref: ../code_samples/Shell/payment-collections_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -57,15 +59,18 @@ get: 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: - $ref: ../code_samples/JavaScript/payment-collections_{id}/getundefined + $ref: ../code_samples/JavaScript/payment-collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}/getundefined + $ref: ../code_samples/Shell/payment-collections_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -107,15 +112,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminUpdatePaymentCollectionsReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payment-collections_{id}/postundefined + $ref: ../code_samples/JavaScript/payment-collections_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}/postundefined + $ref: ../code_samples/Shell/payment-collections_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml index ba6ab17043..54779435e2 100644 --- a/docs/api/admin/paths/payment-collections_{id}_authorize.yaml +++ b/docs/api/admin/paths/payment-collections_{id}_authorize.yaml @@ -10,16 +10,17 @@ post: description: The ID of the PaymentCollection. schema: type: string + x-codegen: + method: markAsAuthorized x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_authorize/postundefined + $ref: ../code_samples/JavaScript/payment-collections_{id}_authorize/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}_authorize/postundefined + $ref: ../code_samples/Shell/payment-collections_{id}_authorize/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/payments_{id}.yaml b/docs/api/admin/paths/payments_{id}.yaml index 1dc98ab031..6d17d9769a 100644 --- a/docs/api/admin/paths/payments_{id}.yaml +++ b/docs/api/admin/paths/payments_{id}.yaml @@ -10,15 +10,18 @@ get: description: The ID of the Payment. schema: type: string + x-codegen: + method: retrieve + queryParams: GetPaymentsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payments_{id}/getundefined + $ref: ../code_samples/JavaScript/payments_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payments_{id}/getundefined + $ref: ../code_samples/Shell/payments_{id}/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/payments_{id}_capture.yaml b/docs/api/admin/paths/payments_{id}_capture.yaml index 442ec5c449..accd276fbd 100644 --- a/docs/api/admin/paths/payments_{id}_capture.yaml +++ b/docs/api/admin/paths/payments_{id}_capture.yaml @@ -10,15 +10,17 @@ post: description: The ID of the Payment. schema: type: string + x-codegen: + method: capturePayment x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payments_{id}_capture/postundefined + $ref: ../code_samples/JavaScript/payments_{id}_capture/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payments_{id}_capture/postundefined + $ref: ../code_samples/Shell/payments_{id}_capture/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/payments_{id}_refund.yaml b/docs/api/admin/paths/payments_{id}_refund.yaml index 599d843802..a3bf0f7140 100644 --- a/docs/api/admin/paths/payments_{id}_refund.yaml +++ b/docs/api/admin/paths/payments_{id}_refund.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostPaymentRefundsReq.yaml + x-codegen: + method: refundPayment x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/payments_{id}_refund/postundefined + $ref: ../code_samples/JavaScript/payments_{id}_refund/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payments_{id}_refund/postundefined + $ref: ../code_samples/Shell/payments_{id}_refund/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/price-lists.yaml b/docs/api/admin/paths/price-lists.yaml index e8ef087d4c..002ea6e12e 100644 --- a/docs/api/admin/paths/price-lists.yaml +++ b/docs/api/admin/paths/price-lists.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostPriceListsPriceListReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists/postundefined + $ref: ../code_samples/JavaScript/price-lists/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists/postundefined + $ref: ../code_samples/Shell/price-lists/post.sh security: - api_token: [] - cookie_auth: [] @@ -187,15 +189,18 @@ get: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetPriceListPaginationParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists/getundefined + $ref: ../code_samples/JavaScript/price-lists/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists/getundefined + $ref: ../code_samples/Shell/price-lists/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/price-lists_{id}.yaml b/docs/api/admin/paths/price-lists_{id}.yaml index dd3edd69f6..ac25394799 100644 --- a/docs/api/admin/paths/price-lists_{id}.yaml +++ b/docs/api/admin/paths/price-lists_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Price List to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}/deleteundefined + $ref: ../code_samples/JavaScript/price-lists_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}/deleteundefined + $ref: ../code_samples/Shell/price-lists_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Price List. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}/getundefined + $ref: ../code_samples/JavaScript/price-lists_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}/getundefined + $ref: ../code_samples/Shell/price-lists_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostPriceListsPriceListPriceListReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}/postundefined + $ref: ../code_samples/JavaScript/price-lists_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}/postundefined + $ref: ../code_samples/Shell/price-lists_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml index 95e061eba8..5938b2505a 100644 --- a/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml +++ b/docs/api/admin/paths/price-lists_{id}_prices_batch.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostPriceListPricesPricesReq.yaml + x-codegen: + method: addPrices x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}_prices_batch/postundefined + $ref: ../code_samples/JavaScript/price-lists_{id}_prices_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}_prices_batch/postundefined + $ref: ../code_samples/Shell/price-lists_{id}_prices_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -67,16 +69,17 @@ delete: application/json: schema: $ref: ../components/schemas/AdminDeletePriceListPricesPricesReq.yaml + x-codegen: + method: deletePrices x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/price-lists_{id}_prices_batch/deleteundefined + $ref: ../code_samples/JavaScript/price-lists_{id}_prices_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}_prices_batch/deleteundefined + $ref: ../code_samples/Shell/price-lists_{id}_prices_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/price-lists_{id}_products.yaml b/docs/api/admin/paths/price-lists_{id}_products.yaml index 66fc54fad0..b79f613361 100644 --- a/docs/api/admin/paths/price-lists_{id}_products.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products.yaml @@ -176,15 +176,18 @@ get: result. schema: type: string + x-codegen: + method: listProducts + queryParams: AdminGetPriceListsPriceListProductsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/price-lists_{id}_products/getundefined + $ref: ../code_samples/JavaScript/price-lists_{id}_products/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/price-lists_{id}_products/getundefined + $ref: ../code_samples/Shell/price-lists_{id}_products/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml b/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml index 8adbf0f60c..f2e06239ba 100644 --- a/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml +++ b/docs/api/admin/paths/price-lists_{id}_products_{product_id}_prices.yaml @@ -18,17 +18,19 @@ delete: description: The ID of the product from which the money amount will be deleted. schema: type: string + x-codegen: + method: deleteProductPrices x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/deleteundefined + ../code_samples/JavaScript/price-lists_{id}_products_{product_id}_prices/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/price-lists_{id}_products_{product_id}_prices/deleteundefined + ../code_samples/Shell/price-lists_{id}_products_{product_id}_prices/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml b/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml index 5d18611063..b0f3ba05bc 100644 --- a/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml +++ b/docs/api/admin/paths/price-lists_{id}_variants_{variant_id}_prices.yaml @@ -18,17 +18,19 @@ delete: description: The ID of the variant from which the money amount will be deleted. schema: type: string + x-codegen: + method: deleteVariantPrices x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/deleteundefined + ../code_samples/JavaScript/price-lists_{id}_variants_{variant_id}_prices/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/deleteundefined + ../code_samples/Shell/price-lists_{id}_variants_{variant_id}_prices/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/product-categories.yaml b/docs/api/admin/paths/product-categories.yaml index f009bf5fa1..46547aa740 100644 --- a/docs/api/admin/paths/product-categories.yaml +++ b/docs/api/admin/paths/product-categories.yaml @@ -6,16 +6,12 @@ post: parameters: - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each product - category. + 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 each product - category. + description: (Comma separated) Which fields should be retrieved in the results. schema: type: string requestBody: @@ -23,11 +19,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductCategoriesReq.yaml + x-codegen: + method: create + queryParams: AdminPostProductCategoriesParams x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/product-categories/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories/postundefined + $ref: ../code_samples/Shell/product-categories/post.sh security: - api_token: [] - cookie_auth: [] @@ -39,10 +42,7 @@ post: content: application/json: schema: - type: object - properties: - product_category: - $ref: ../components/schemas/ProductCategory.yaml + $ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -107,11 +107,18 @@ get: category. schema: type: string + x-codegen: + method: list + queryParams: AdminGetProductCategoriesParams x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/product-categories/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories/getundefined + $ref: ../code_samples/Shell/product-categories/get.sh security: - api_token: [] - cookie_auth: [] @@ -123,21 +130,7 @@ get: content: application/json: schema: - type: object - properties: - product_categories: - type: array - items: - $ref: ../components/schemas/ProductCategory.yaml - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + $ref: ../components/schemas/AdminProductCategoriesListRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/product-categories_{id}.yaml b/docs/api/admin/paths/product-categories_{id}.yaml index f1f95d2ec5..21620dc360 100644 --- a/docs/api/admin/paths/product-categories_{id}.yaml +++ b/docs/api/admin/paths/product-categories_{id}.yaml @@ -10,11 +10,17 @@ delete: description: The ID of the Product Category schema: type: string + x-codegen: + method: delete x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/product-categories_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}/deleteundefined + $ref: ../code_samples/Shell/product-categories_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -26,19 +32,7 @@ delete: content: application/json: schema: - 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 the product category was deleted successfully or not. - default: true + $ref: ../components/schemas/AdminProductCategoriesCategoryDeleteRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -63,11 +57,28 @@ get: 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: + $ref: ../code_samples/JavaScript/product-categories_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}/getundefined + $ref: ../code_samples/Shell/product-categories_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -79,10 +90,7 @@ get: content: application/json: schema: - type: object - properties: - product_category: - $ref: ../components/schemas/ProductCategory.yaml + $ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': @@ -126,11 +134,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductCategoriesCategoryReq.yaml + x-codegen: + method: update + queryParams: AdminPostProductCategoriesCategoryParams x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/product-categories_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}/postundefined + $ref: ../code_samples/Shell/product-categories_{id}/post.sh security: - api_token: [] - cookie_auth: [] @@ -142,10 +157,7 @@ post: content: application/json: schema: - type: object - properties: - product_category: - $ref: ../components/schemas/ProductCategory.yaml + $ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/admin/paths/product-categories_{id}_products_batch.yaml b/docs/api/admin/paths/product-categories_{id}_products_batch.yaml new file mode 100644 index 0000000000..ae45b7c7f2 --- /dev/null +++ b/docs/api/admin/paths/product-categories_{id}_products_batch.yaml @@ -0,0 +1,130 @@ +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.yaml + x-codegen: + method: addProducts + queryParams: AdminPostProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/product-categories_{id}_products_batch/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/product-categories_{id}_products_batch/post.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml +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.yaml + x-codegen: + method: removeProducts + queryParams: AdminDeleteProductCategoriesCategoryProductsBatchParams + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/product-categories_{id}_products_batch/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/product-categories_{id}_products_batch/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Category + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminProductCategoriesCategoryRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/product-tags.yaml b/docs/api/admin/paths/product-tags.yaml index a4a7e032e1..f933093037 100644 --- a/docs/api/admin/paths/product-tags.yaml +++ b/docs/api/admin/paths/product-tags.yaml @@ -93,15 +93,18 @@ get: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetProductTagsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-tags/getundefined + $ref: ../code_samples/JavaScript/product-tags/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-tags/getundefined + $ref: ../code_samples/Shell/product-tags/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/product-types.yaml index 018daab908..1077ae9426 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/product-types.yaml @@ -93,15 +93,18 @@ get: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: AdminGetProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-types/getundefined + $ref: ../code_samples/JavaScript/product-types/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-types/getundefined + $ref: ../code_samples/Shell/product-types/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products.yaml b/docs/api/admin/paths/products.yaml index 66b61da211..7b599fb1fa 100644 --- a/docs/api/admin/paths/products.yaml +++ b/docs/api/admin/paths/products.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products/postundefined + $ref: ../code_samples/JavaScript/products/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products/postundefined + $ref: ../code_samples/Shell/products/post.sh security: - api_token: [] - cookie_auth: [] @@ -131,6 +133,20 @@ get: type: array items: type: string + - in: query + name: category_id + style: form + explode: false + description: Category IDs to filter products by + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id + schema: + type: boolean - in: query name: title description: title to search for. @@ -248,15 +264,18 @@ get: description: the field used to order the products. schema: type: string + x-codegen: + method: list + queryParams: AdminGetProductsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products/getundefined + $ref: ../code_samples/JavaScript/products/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products/getundefined + $ref: ../code_samples/Shell/products/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_tag-usage.yaml b/docs/api/admin/paths/products_tag-usage.yaml index c15a0b60e2..31544af7da 100644 --- a/docs/api/admin/paths/products_tag-usage.yaml +++ b/docs/api/admin/paths/products_tag-usage.yaml @@ -3,15 +3,17 @@ get: summary: List Tags Usage Number description: Retrieves a list of Product Tags with how many times each is used. x-authenticated: true + x-codegen: + method: listTags x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_tag-usage/getundefined + $ref: ../code_samples/JavaScript/products_tag-usage/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_tag-usage/getundefined + $ref: ../code_samples/Shell/products_tag-usage/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_types.yaml b/docs/api/admin/paths/products_types.yaml index 791ae38a83..668e7a7609 100644 --- a/docs/api/admin/paths/products_types.yaml +++ b/docs/api/admin/paths/products_types.yaml @@ -4,15 +4,17 @@ get: summary: List Product Types description: Retrieves a list of Product Types. x-authenticated: true + x-codegen: + method: listTypes x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_types/getundefined + $ref: ../code_samples/JavaScript/products_types/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_types/getundefined + $ref: ../code_samples/Shell/products_types/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_{id}.yaml b/docs/api/admin/paths/products_{id}.yaml index 457faa50fb..7ecf980012 100644 --- a/docs/api/admin/paths/products_{id}.yaml +++ b/docs/api/admin/paths/products_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Product. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}/deleteundefined + $ref: ../code_samples/JavaScript/products_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}/deleteundefined + $ref: ../code_samples/Shell/products_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Product. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}/getundefined + $ref: ../code_samples/JavaScript/products_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}/getundefined + $ref: ../code_samples/Shell/products_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductsProductReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}/postundefined + $ref: ../code_samples/JavaScript/products_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}/postundefined + $ref: ../code_samples/Shell/products_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_{id}_metadata.yaml b/docs/api/admin/paths/products_{id}_metadata.yaml index fecb66a47c..3440873c7d 100644 --- a/docs/api/admin/paths/products_{id}_metadata.yaml +++ b/docs/api/admin/paths/products_{id}_metadata.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductsProductMetadataReq.yaml + x-codegen: + method: setMetadata x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}_metadata/postundefined + $ref: ../code_samples/JavaScript/products_{id}_metadata/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_metadata/postundefined + $ref: ../code_samples/Shell/products_{id}_metadata/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_{id}_options.yaml b/docs/api/admin/paths/products_{id}_options.yaml index c8958932c5..3712d6bc71 100644 --- a/docs/api/admin/paths/products_{id}_options.yaml +++ b/docs/api/admin/paths/products_{id}_options.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductsProductOptionsReq.yaml + x-codegen: + method: addOption x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}_options/postundefined + $ref: ../code_samples/JavaScript/products_{id}_options/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_options/postundefined + $ref: ../code_samples/Shell/products_{id}_options/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml index 5c6245fa4d..4250264983 100644 --- a/docs/api/admin/paths/products_{id}_options_{option_id}.yaml +++ b/docs/api/admin/paths/products_{id}_options_{option_id}.yaml @@ -19,17 +19,17 @@ delete: description: The ID of the Product Option. schema: type: string + x-codegen: + method: deleteOption x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/products_{id}_options_{option_id}/deleteundefined + $ref: ../code_samples/JavaScript/products_{id}_options_{option_id}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/products_{id}_options_{option_id}/deleteundefined + $ref: ../code_samples/Shell/products_{id}_options_{option_id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -77,16 +77,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductsProductOptionsOption.yaml + x-codegen: + method: updateOption x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/products_{id}_options_{option_id}/postundefined + $ref: ../code_samples/JavaScript/products_{id}_options_{option_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_options_{option_id}/postundefined + $ref: ../code_samples/Shell/products_{id}_options_{option_id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_{id}_variants.yaml b/docs/api/admin/paths/products_{id}_variants.yaml index 5810d23da2..408793da9a 100644 --- a/docs/api/admin/paths/products_{id}_variants.yaml +++ b/docs/api/admin/paths/products_{id}_variants.yaml @@ -17,15 +17,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostProductsProductVariantsReq.yaml + x-codegen: + method: createVariant x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}_variants/postundefined + $ref: ../code_samples/JavaScript/products_{id}_variants/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_variants/postundefined + $ref: ../code_samples/Shell/products_{id}_variants/post.sh security: - api_token: [] - cookie_auth: [] @@ -84,11 +86,14 @@ get: schema: type: integer default: 100 + x-codegen: + method: listVariants + queryParams: AdminGetProductsVariantsParams x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}_variants/getundefined + $ref: ../code_samples/Shell/products_{id}_variants/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml index 40c8867c26..52cead6eca 100644 --- a/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml +++ b/docs/api/admin/paths/products_{id}_variants_{variant_id}.yaml @@ -16,17 +16,18 @@ delete: description: The ID of the Product Variant. schema: type: string + x-codegen: + method: deleteVariant x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/products_{id}_variants_{variant_id}/deleteundefined + ../code_samples/JavaScript/products_{id}_variants_{variant_id}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/products_{id}_variants_{variant_id}/deleteundefined + $ref: ../code_samples/Shell/products_{id}_variants_{variant_id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -75,17 +76,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostProductsProductVariantsVariantReq.yaml + x-codegen: + method: updateVariant x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/products_{id}_variants_{variant_id}/postundefined + $ref: ../code_samples/JavaScript/products_{id}_variants_{variant_id}/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/products_{id}_variants_{variant_id}/postundefined + $ref: ../code_samples/Shell/products_{id}_variants_{variant_id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/publishable-api-key_{id}.yaml b/docs/api/admin/paths/publishable-api-key_{id}.yaml index 525ebf1b44..18f468adf5 100644 --- a/docs/api/admin/paths/publishable-api-key_{id}.yaml +++ b/docs/api/admin/paths/publishable-api-key_{id}.yaml @@ -16,15 +16,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostPublishableApiKeysPublishableApiKeyReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-key_{id}/postundefined + $ref: ../code_samples/JavaScript/publishable-api-key_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-key_{id}/postundefined + $ref: ../code_samples/Shell/publishable-api-key_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/publishable-api-keys.yaml b/docs/api/admin/paths/publishable-api-keys.yaml index eb29fec0b6..c70d47abb0 100644 --- a/docs/api/admin/paths/publishable-api-keys.yaml +++ b/docs/api/admin/paths/publishable-api-keys.yaml @@ -8,15 +8,17 @@ post: schema: $ref: ../components/schemas/AdminPostPublishableApiKeysReq.yaml x-authenticated: true + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-keys/postundefined + $ref: ../code_samples/JavaScript/publishable-api-keys/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys/postundefined + $ref: ../code_samples/Shell/publishable-api-keys/post.sh security: - api_token: [] - cookie_auth: [] @@ -74,15 +76,18 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: list + queryParams: GetPublishableApiKeysParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-keys/getundefined + $ref: ../code_samples/JavaScript/publishable-api-keys/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys/getundefined + $ref: ../code_samples/Shell/publishable-api-keys/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/publishable-api-keys_{id}.yaml b/docs/api/admin/paths/publishable-api-keys_{id}.yaml index 0175ee2eca..b220a81531 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the PublishableApiKeys to delete. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/deleteundefined + $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys_{id}/deleteundefined + $ref: ../code_samples/Shell/publishable-api-keys_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -45,15 +47,17 @@ get: schema: type: string x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/getundefined + $ref: ../code_samples/JavaScript/publishable-api-keys_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys_{id}/getundefined + $ref: ../code_samples/Shell/publishable-api-keys_{id}/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml index 974f94cc42..357160386e 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_revoke.yaml @@ -10,16 +10,17 @@ post: schema: type: string x-authenticated: true + x-codegen: + method: revoke x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/publishable-api-keys_{id}_revoke/postundefined + $ref: ../code_samples/JavaScript/publishable-api-keys_{id}_revoke/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/publishable-api-keys_{id}_revoke/postundefined + $ref: ../code_samples/Shell/publishable-api-keys_{id}_revoke/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml index b2fa9789ca..549f69c3e5 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels.yaml @@ -15,17 +15,19 @@ get: description: Query used for searching sales channels' names and descriptions. schema: type: string + x-codegen: + method: listSalesChannels + queryParams: GetPublishableApiKeySalesChannelsParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/getundefined + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels/get.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/publishable-api-keys_{id}_sales-channels/getundefined + $ref: ../code_samples/Shell/publishable-api-keys_{id}_sales-channels/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml index 5781079806..7e13a1a0a2 100644 --- a/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml +++ b/docs/api/admin/paths/publishable-api-keys_{id}_sales-channels_batch.yaml @@ -16,17 +16,19 @@ post: schema: $ref: >- ../components/schemas/AdminPostPublishableApiKeySalesChannelsBatchReq.yaml + x-codegen: + method: addSalesChannelsBatch x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/postundefined + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/postundefined + ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -69,17 +71,19 @@ delete: schema: $ref: >- ../components/schemas/AdminDeletePublishableApiKeySalesChannelsBatchReq.yaml + x-codegen: + method: deleteSalesChannelsBatch x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/deleteundefined + ../code_samples/JavaScript/publishable-api-keys_{id}_sales-channels_batch/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/deleteundefined + ../code_samples/Shell/publishable-api-keys_{id}_sales-channels_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions.yaml b/docs/api/admin/paths/regions.yaml index f44ed7f081..62f76fda96 100644 --- a/docs/api/admin/paths/regions.yaml +++ b/docs/api/admin/paths/regions.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostRegionsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions/postundefined + $ref: ../code_samples/JavaScript/regions/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions/postundefined + $ref: ../code_samples/Shell/regions/post.sh security: - api_token: [] - cookie_auth: [] @@ -85,15 +87,18 @@ get: description: >- Date comparison for when resulting region was deleted, i.e. less than, greater than etc. + x-codegen: + method: list + queryParams: AdminGetRegionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions/getundefined + $ref: ../code_samples/JavaScript/regions/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions/getundefined + $ref: ../code_samples/Shell/regions/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}.yaml b/docs/api/admin/paths/regions_{id}.yaml index 92f41aea93..c0077f6a60 100644 --- a/docs/api/admin/paths/regions_{id}.yaml +++ b/docs/api/admin/paths/regions_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Region. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}/deleteundefined + $ref: ../code_samples/JavaScript/regions_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}/deleteundefined + $ref: ../code_samples/Shell/regions_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Region. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}/getundefined + $ref: ../code_samples/JavaScript/regions_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}/getundefined + $ref: ../code_samples/Shell/regions_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostRegionsRegionReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}/postundefined + $ref: ../code_samples/JavaScript/regions_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}/postundefined + $ref: ../code_samples/Shell/regions_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}_countries.yaml b/docs/api/admin/paths/regions_{id}_countries.yaml index 2a3906b302..f95d51fb16 100644 --- a/docs/api/admin/paths/regions_{id}_countries.yaml +++ b/docs/api/admin/paths/regions_{id}_countries.yaml @@ -15,15 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostRegionsRegionCountriesReq.yaml + x-codegen: + method: addCountry x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}_countries/postundefined + $ref: ../code_samples/JavaScript/regions_{id}_countries/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_countries/postundefined + $ref: ../code_samples/Shell/regions_{id}_countries/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml index 27b444cb9d..84c6bcdfa3 100644 --- a/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml +++ b/docs/api/admin/paths/regions_{id}_countries_{country_code}.yaml @@ -19,17 +19,18 @@ delete: externalDocs: url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. + x-codegen: + method: deleteCountry x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/regions_{id}_countries_{country_code}/deleteundefined + ../code_samples/JavaScript/regions_{id}_countries_{country_code}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/regions_{id}_countries_{country_code}/deleteundefined + $ref: ../code_samples/Shell/regions_{id}_countries_{country_code}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml index b58b7838ea..0a585cdd09 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-options.yaml @@ -10,16 +10,17 @@ get: description: The ID of the Region. schema: type: string + x-codegen: + method: retrieveFulfillmentOptions x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/regions_{id}_fulfillment-options/getundefined + $ref: ../code_samples/JavaScript/regions_{id}_fulfillment-options/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_fulfillment-options/getundefined + $ref: ../code_samples/Shell/regions_{id}_fulfillment-options/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml index 38aaef2eb8..0264a95890 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers.yaml @@ -16,16 +16,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostRegionsRegionFulfillmentProvidersReq.yaml + x-codegen: + method: addFulfillmentProvider x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/regions_{id}_fulfillment-providers/postundefined + $ref: ../code_samples/JavaScript/regions_{id}_fulfillment-providers/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_fulfillment-providers/postundefined + $ref: ../code_samples/Shell/regions_{id}_fulfillment-providers/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml index a91bfcaf7d..4a5bb28931 100644 --- a/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_fulfillment-providers_{provider_id}.yaml @@ -16,17 +16,19 @@ delete: description: The ID of the Fulfillment Provider. schema: type: string + x-codegen: + method: deleteFulfillmentProvider x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/deleteundefined + ../code_samples/JavaScript/regions_{id}_fulfillment-providers_{provider_id}/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/deleteundefined + ../code_samples/Shell/regions_{id}_fulfillment-providers_{provider_id}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}_payment-providers.yaml b/docs/api/admin/paths/regions_{id}_payment-providers.yaml index a2e20c16fa..d649d62f1d 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers.yaml @@ -15,16 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostRegionsRegionPaymentProvidersReq.yaml + x-codegen: + method: addPaymentProvider x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/regions_{id}_payment-providers/postundefined + $ref: ../code_samples/JavaScript/regions_{id}_payment-providers/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}_payment-providers/postundefined + $ref: ../code_samples/Shell/regions_{id}_payment-providers/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml index f83f52186d..dc9a42c001 100644 --- a/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml +++ b/docs/api/admin/paths/regions_{id}_payment-providers_{provider_id}.yaml @@ -16,17 +16,19 @@ delete: description: The ID of the Payment Provider. schema: type: string + x-codegen: + method: deletePaymentProvider x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/deleteundefined + ../code_samples/JavaScript/regions_{id}_payment-providers_{provider_id}/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/regions_{id}_payment-providers_{provider_id}/deleteundefined + ../code_samples/Shell/regions_{id}_payment-providers_{provider_id}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/reservations.yaml b/docs/api/admin/paths/reservations.yaml index 934587039e..5ab2b611c6 100644 --- a/docs/api/admin/paths/reservations.yaml +++ b/docs/api/admin/paths/reservations.yaml @@ -12,11 +12,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/reservations/postundefined + $ref: ../code_samples/JavaScript/reservations/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations/postundefined + $ref: ../code_samples/Shell/reservations/post.sh security: - api_token: [] - cookie_auth: [] @@ -124,7 +124,7 @@ get: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations/getundefined + $ref: ../code_samples/Shell/reservations/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/reservations_{id}.yaml b/docs/api/admin/paths/reservations_{id}.yaml index abbc5b4f09..587a62a1d0 100644 --- a/docs/api/admin/paths/reservations_{id}.yaml +++ b/docs/api/admin/paths/reservations_{id}.yaml @@ -14,11 +14,11 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/reservations_{id}/deleteundefined + $ref: ../code_samples/JavaScript/reservations_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations_{id}/deleteundefined + $ref: ../code_samples/Shell/reservations_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -71,11 +71,11 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/reservations_{id}/getundefined + $ref: ../code_samples/JavaScript/reservations_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations_{id}/getundefined + $ref: ../code_samples/Shell/reservations_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -121,11 +121,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/reservations_{id}/postundefined + $ref: ../code_samples/JavaScript/reservations_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/reservations_{id}/postundefined + $ref: ../code_samples/Shell/reservations_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/return-reasons.yaml b/docs/api/admin/paths/return-reasons.yaml index 38a19d8144..5c195c9370 100644 --- a/docs/api/admin/paths/return-reasons.yaml +++ b/docs/api/admin/paths/return-reasons.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostReturnReasonsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons/postundefined + $ref: ../code_samples/JavaScript/return-reasons/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons/postundefined + $ref: ../code_samples/Shell/return-reasons/post.sh security: - api_token: [] - cookie_auth: [] @@ -46,15 +48,17 @@ get: summary: List Return Reasons description: Retrieves a list of Return Reasons. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons/getundefined + $ref: ../code_samples/JavaScript/return-reasons/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons/getundefined + $ref: ../code_samples/Shell/return-reasons/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/return-reasons_{id}.yaml b/docs/api/admin/paths/return-reasons_{id}.yaml index 2071e18767..1de20751f2 100644 --- a/docs/api/admin/paths/return-reasons_{id}.yaml +++ b/docs/api/admin/paths/return-reasons_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the return reason schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/deleteundefined + $ref: ../code_samples/JavaScript/return-reasons_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons_{id}/deleteundefined + $ref: ../code_samples/Shell/return-reasons_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Return Reason. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/getundefined + $ref: ../code_samples/JavaScript/return-reasons_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons_{id}/getundefined + $ref: ../code_samples/Shell/return-reasons_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostReturnReasonsReasonReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/postundefined + $ref: ../code_samples/JavaScript/return-reasons_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons_{id}/postundefined + $ref: ../code_samples/Shell/return-reasons_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/returns.yaml b/docs/api/admin/paths/returns.yaml index 9db369f85b..e7a8aed6de 100644 --- a/docs/api/admin/paths/returns.yaml +++ b/docs/api/admin/paths/returns.yaml @@ -15,15 +15,18 @@ get: schema: type: number default: '0' + x-codegen: + method: list + queryParams: AdminGetReturnsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns/getundefined + $ref: ../code_samples/JavaScript/returns/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns/getundefined + $ref: ../code_samples/Shell/returns/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/returns_{id}_cancel.yaml b/docs/api/admin/paths/returns_{id}_cancel.yaml index e2f6d13915..62932b8110 100644 --- a/docs/api/admin/paths/returns_{id}_cancel.yaml +++ b/docs/api/admin/paths/returns_{id}_cancel.yaml @@ -9,15 +9,17 @@ post: description: The ID of the Return. schema: type: string + x-codegen: + method: cancel x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns_{id}_cancel/postundefined + $ref: ../code_samples/JavaScript/returns_{id}_cancel/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns_{id}_cancel/postundefined + $ref: ../code_samples/Shell/returns_{id}_cancel/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/returns_{id}_receive.yaml b/docs/api/admin/paths/returns_{id}_receive.yaml index f4941020f5..9c253f6378 100644 --- a/docs/api/admin/paths/returns_{id}_receive.yaml +++ b/docs/api/admin/paths/returns_{id}_receive.yaml @@ -16,15 +16,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostReturnsReturnReceiveReq.yaml + x-codegen: + method: receive x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns_{id}_receive/postundefined + $ref: ../code_samples/JavaScript/returns_{id}_receive/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns_{id}_receive/postundefined + $ref: ../code_samples/Shell/returns_{id}_receive/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/sales-channels.yaml b/docs/api/admin/paths/sales-channels.yaml index 19b2b2597a..e895f39b06 100644 --- a/docs/api/admin/paths/sales-channels.yaml +++ b/docs/api/admin/paths/sales-channels.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostSalesChannelsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels/postundefined + $ref: ../code_samples/JavaScript/sales-channels/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels/postundefined + $ref: ../code_samples/Shell/sales-channels/post.sh security: - api_token: [] - cookie_auth: [] @@ -164,15 +166,18 @@ get: of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetSalesChannelsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels/getundefined + $ref: ../code_samples/JavaScript/sales-channels/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels/getundefined + $ref: ../code_samples/Shell/sales-channels/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/sales-channels_{id}.yaml b/docs/api/admin/paths/sales-channels_{id}.yaml index d0cf30ee46..73d5678d53 100644 --- a/docs/api/admin/paths/sales-channels_{id}.yaml +++ b/docs/api/admin/paths/sales-channels_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Sales channel. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels_{id}/deleteundefined + $ref: ../code_samples/JavaScript/sales-channels_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}/deleteundefined + $ref: ../code_samples/Shell/sales-channels_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Sales channel. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels_{id}/getundefined + $ref: ../code_samples/JavaScript/sales-channels_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}/getundefined + $ref: ../code_samples/Shell/sales-channels_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostSalesChannelsSalesChannelReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/sales-channels_{id}/postundefined + $ref: ../code_samples/JavaScript/sales-channels_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}/postundefined + $ref: ../code_samples/Shell/sales-channels_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml index fe479a5dab..459942b185 100644 --- a/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml +++ b/docs/api/admin/paths/sales-channels_{id}_products_batch.yaml @@ -16,16 +16,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostSalesChannelsChannelProductsBatchReq.yaml + x-codegen: + method: addProducts x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/sales-channels_{id}_products_batch/postundefined + $ref: ../code_samples/JavaScript/sales-channels_{id}_products_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/sales-channels_{id}_products_batch/postundefined + $ref: ../code_samples/Shell/sales-channels_{id}_products_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -68,17 +69,18 @@ delete: schema: $ref: >- ../components/schemas/AdminDeleteSalesChannelsChannelProductsBatchReq.yaml + x-codegen: + method: removeProducts x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/sales-channels_{id}_products_batch/deleteundefined + ../code_samples/JavaScript/sales-channels_{id}_products_batch/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/sales-channels_{id}_products_batch/deleteundefined + $ref: ../code_samples/Shell/sales-channels_{id}_products_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/sales-channels_{id}_stock-locations.yaml b/docs/api/admin/paths/sales-channels_{id}_stock-locations.yaml index 54c7e9f435..8aadd7fb3a 100644 --- a/docs/api/admin/paths/sales-channels_{id}_stock-locations.yaml +++ b/docs/api/admin/paths/sales-channels_{id}_stock-locations.yaml @@ -16,17 +16,17 @@ post: schema: $ref: >- ../components/schemas/AdminPostSalesChannelsChannelStockLocationsReq.yaml + x-codegen: + method: addLocation x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/sales-channels_{id}_stock-locations/postundefined + $ref: ../code_samples/JavaScript/sales-channels_{id}_stock-locations/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/sales-channels_{id}_stock-locations/postundefined + $ref: ../code_samples/Shell/sales-channels_{id}_stock-locations/post.sh security: - api_token: [] - cookie_auth: [] @@ -69,17 +69,18 @@ delete: schema: $ref: >- ../components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq.yaml + x-codegen: + method: removeLocation x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/sales-channels_{id}_stock-locations/deleteundefined + ../code_samples/JavaScript/sales-channels_{id}_stock-locations/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/sales-channels_{id}_stock-locations/deleteundefined + $ref: ../code_samples/Shell/sales-channels_{id}_stock-locations/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/shipping-options.yaml b/docs/api/admin/paths/shipping-options.yaml index 26e8d73ece..e2b6222ae7 100644 --- a/docs/api/admin/paths/shipping-options.yaml +++ b/docs/api/admin/paths/shipping-options.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostShippingOptionsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options/postundefined + $ref: ../code_samples/JavaScript/shipping-options/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options/postundefined + $ref: ../code_samples/Shell/shipping-options/post.sh security: - api_token: [] - cookie_auth: [] @@ -62,15 +64,18 @@ get: schema: type: boolean description: Flag for fetching admin specific options + x-codegen: + method: list + queryParams: AdminGetShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options/getundefined + $ref: ../code_samples/JavaScript/shipping-options/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options/getundefined + $ref: ../code_samples/Shell/shipping-options/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/shipping-options_{id}.yaml b/docs/api/admin/paths/shipping-options_{id}.yaml index aafe06cad9..af892d47e0 100644 --- a/docs/api/admin/paths/shipping-options_{id}.yaml +++ b/docs/api/admin/paths/shipping-options_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options_{id}/deleteundefined + $ref: ../code_samples/JavaScript/shipping-options_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options_{id}/deleteundefined + $ref: ../code_samples/Shell/shipping-options_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options_{id}/getundefined + $ref: ../code_samples/JavaScript/shipping-options_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options_{id}/getundefined + $ref: ../code_samples/Shell/shipping-options_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostShippingOptionsOptionReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options_{id}/postundefined + $ref: ../code_samples/JavaScript/shipping-options_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options_{id}/postundefined + $ref: ../code_samples/Shell/shipping-options_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/shipping-profiles.yaml b/docs/api/admin/paths/shipping-profiles.yaml index d3a03a5a0a..14080c61f1 100644 --- a/docs/api/admin/paths/shipping-profiles.yaml +++ b/docs/api/admin/paths/shipping-profiles.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostShippingProfilesReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles/postundefined + $ref: ../code_samples/JavaScript/shipping-profiles/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles/postundefined + $ref: ../code_samples/Shell/shipping-profiles/post.sh security: - api_token: [] - cookie_auth: [] @@ -46,15 +48,17 @@ get: summary: List Shipping Profiles description: Retrieves a list of Shipping Profile. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles/getundefined + $ref: ../code_samples/JavaScript/shipping-profiles/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles/getundefined + $ref: ../code_samples/Shell/shipping-profiles/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/shipping-profiles_{id}.yaml b/docs/api/admin/paths/shipping-profiles_{id}.yaml index 50419aac0f..00ed6dbff3 100644 --- a/docs/api/admin/paths/shipping-profiles_{id}.yaml +++ b/docs/api/admin/paths/shipping-profiles_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Shipping Profile. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles_{id}/deleteundefined + $ref: ../code_samples/JavaScript/shipping-profiles_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles_{id}/deleteundefined + $ref: ../code_samples/Shell/shipping-profiles_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the Shipping Profile. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles_{id}/getundefined + $ref: ../code_samples/JavaScript/shipping-profiles_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles_{id}/getundefined + $ref: ../code_samples/Shell/shipping-profiles_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -104,15 +108,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostShippingProfilesProfileReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-profiles_{id}/postundefined + $ref: ../code_samples/JavaScript/shipping-profiles_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-profiles_{id}/postundefined + $ref: ../code_samples/Shell/shipping-profiles_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/stock-locations.yaml b/docs/api/admin/paths/stock-locations.yaml index 5026f18c23..38f410cf76 100644 --- a/docs/api/admin/paths/stock-locations.yaml +++ b/docs/api/admin/paths/stock-locations.yaml @@ -19,15 +19,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostStockLocationsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/stock-locations/postundefined + $ref: ../code_samples/JavaScript/stock-locations/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/stock-locations/postundefined + $ref: ../code_samples/Shell/stock-locations/post.sh security: - api_token: [] - cookie_auth: [] @@ -165,15 +167,18 @@ get: of the result. schema: type: string + x-codegen: + method: list + queryParams: AdminGetStockLocationsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/stock-locations/getundefined + $ref: ../code_samples/JavaScript/stock-locations/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/stock-locations/getundefined + $ref: ../code_samples/Shell/stock-locations/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/stock-locations_{id}.yaml b/docs/api/admin/paths/stock-locations_{id}.yaml index f3ecb5ae36..f22b4cef3d 100644 --- a/docs/api/admin/paths/stock-locations_{id}.yaml +++ b/docs/api/admin/paths/stock-locations_{id}.yaml @@ -1,3 +1,50 @@ +delete: + operationId: DeleteStockLocationsStockLocation + summary: Delete a Stock Location + description: Delete a Stock Location + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The ID of the Stock Location to delete. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/stock-locations_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/stock-locations_{id}/delete.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - StockLocation + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: The ID of the deleted Stock Location. + object: + type: string + description: The type of the object that was deleted. + format: stock_location + deleted: + type: boolean + description: Whether or not the Stock Location was deleted. + default: true + '400': + $ref: ../components/responses/400_error.yaml get: operationId: GetStockLocationsStockLocation summary: Get a Stock Location @@ -20,15 +67,18 @@ get: description: Comma separated list of fields to include in the results. schema: type: string + x-codegen: + method: retrieve + queryParams: AdminGetStockLocationsLocationParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/stock-locations_{id}/getundefined + $ref: ../code_samples/JavaScript/stock-locations_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/stock-locations_{id}/getundefined + $ref: ../code_samples/Shell/stock-locations_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -68,15 +118,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostStockLocationsLocationReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/stock-locations_{id}/postundefined + $ref: ../code_samples/JavaScript/stock-locations_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/stock-locations_{id}/postundefined + $ref: ../code_samples/Shell/stock-locations_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/store.yaml b/docs/api/admin/paths/store.yaml index 92ad3d600a..e8480eb842 100644 --- a/docs/api/admin/paths/store.yaml +++ b/docs/api/admin/paths/store.yaml @@ -3,15 +3,17 @@ get: summary: Get Store details description: Retrieves the Store details x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store/getundefined + $ref: ../code_samples/JavaScript/store/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store/getundefined + $ref: ../code_samples/Shell/store/get.sh security: - api_token: [] - cookie_auth: [] @@ -46,15 +48,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostStoreReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/store/postundefined + $ref: ../code_samples/JavaScript/store/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store/postundefined + $ref: ../code_samples/Shell/store/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/store_currencies_{code}.yaml b/docs/api/admin/paths/store_currencies_{code}.yaml index 9592667940..3c0d9a656b 100644 --- a/docs/api/admin/paths/store_currencies_{code}.yaml +++ b/docs/api/admin/paths/store_currencies_{code}.yaml @@ -13,15 +13,17 @@ post: 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: - $ref: ../code_samples/JavaScript/store_currencies_{code}/postundefined + $ref: ../code_samples/JavaScript/store_currencies_{code}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_currencies_{code}/postundefined + $ref: ../code_samples/Shell/store_currencies_{code}/post.sh security: - api_token: [] - cookie_auth: [] @@ -61,15 +63,17 @@ delete: 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: - $ref: ../code_samples/JavaScript/store_currencies_{code}/deleteundefined + $ref: ../code_samples/JavaScript/store_currencies_{code}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_currencies_{code}/deleteundefined + $ref: ../code_samples/Shell/store_currencies_{code}/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/store_payment-providers.yaml b/docs/api/admin/paths/store_payment-providers.yaml index bda19f2490..ed54a9d1d7 100644 --- a/docs/api/admin/paths/store_payment-providers.yaml +++ b/docs/api/admin/paths/store_payment-providers.yaml @@ -3,15 +3,17 @@ get: 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: - $ref: ../code_samples/JavaScript/store_payment-providers/getundefined + $ref: ../code_samples/JavaScript/store_payment-providers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_payment-providers/getundefined + $ref: ../code_samples/Shell/store_payment-providers/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/store_tax-providers.yaml b/docs/api/admin/paths/store_tax-providers.yaml index 8d0780e899..34d18c7f42 100644 --- a/docs/api/admin/paths/store_tax-providers.yaml +++ b/docs/api/admin/paths/store_tax-providers.yaml @@ -3,15 +3,17 @@ get: 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: - $ref: ../code_samples/JavaScript/store_tax-providers/getundefined + $ref: ../code_samples/JavaScript/store_tax-providers/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/store_tax-providers/getundefined + $ref: ../code_samples/Shell/store_tax-providers/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/swaps.yaml b/docs/api/admin/paths/swaps.yaml index d9e3f604a4..0ef3dc6b43 100644 --- a/docs/api/admin/paths/swaps.yaml +++ b/docs/api/admin/paths/swaps.yaml @@ -16,15 +16,18 @@ get: type: number default: '0' x-authenticated: true + x-codegen: + method: list + queryParams: AdminGetSwapsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps/getundefined + $ref: ../code_samples/JavaScript/swaps/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps/getundefined + $ref: ../code_samples/Shell/swaps/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/swaps_{id}.yaml b/docs/api/admin/paths/swaps_{id}.yaml index fcd4d58a5e..3e015de067 100644 --- a/docs/api/admin/paths/swaps_{id}.yaml +++ b/docs/api/admin/paths/swaps_{id}.yaml @@ -10,15 +10,17 @@ get: description: The ID of the Swap. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps_{id}/getundefined + $ref: ../code_samples/JavaScript/swaps_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps_{id}/getundefined + $ref: ../code_samples/Shell/swaps_{id}/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/tax-rates.yaml b/docs/api/admin/paths/tax-rates.yaml index 5f1966a1d9..bffe85c655 100644 --- a/docs/api/admin/paths/tax-rates.yaml +++ b/docs/api/admin/paths/tax-rates.yaml @@ -27,15 +27,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostTaxRatesReq.yaml + x-codegen: + method: create + queryParams: AdminPostTaxRatesParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates/postundefined + $ref: ../code_samples/JavaScript/tax-rates/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates/postundefined + $ref: ../code_samples/Shell/tax-rates/post.sh security: - api_token: [] - cookie_auth: [] @@ -139,15 +142,18 @@ get: type: array items: type: string + x-codegen: + method: list + queryParams: AdminGetTaxRatesParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates/getundefined + $ref: ../code_samples/JavaScript/tax-rates/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates/getundefined + $ref: ../code_samples/Shell/tax-rates/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/tax-rates_{id}.yaml b/docs/api/admin/paths/tax-rates_{id}.yaml index 56b44211de..82b5173419 100644 --- a/docs/api/admin/paths/tax-rates_{id}.yaml +++ b/docs/api/admin/paths/tax-rates_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the Shipping Option. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}/deleteundefined + $ref: ../code_samples/JavaScript/tax-rates_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}/deleteundefined + $ref: ../code_samples/Shell/tax-rates_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -73,15 +75,18 @@ get: items: type: string x-authenticated: true + x-codegen: + method: retrieve + queryParams: AdminGetTaxRatesTaxRateParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}/getundefined + $ref: ../code_samples/JavaScript/tax-rates_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}/getundefined + $ref: ../code_samples/Shell/tax-rates_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -141,15 +146,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostTaxRatesTaxRateReq.yaml + x-codegen: + method: update + queryParams: AdminPostTaxRatesTaxRateParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}/postundefined + $ref: ../code_samples/JavaScript/tax-rates_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}/postundefined + $ref: ../code_samples/Shell/tax-rates_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml index c612cb0c90..0b76709b22 100644 --- a/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_product-types_batch.yaml @@ -33,16 +33,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostTaxRatesTaxRateProductTypesReq.yaml + x-codegen: + method: addProductTypes + queryParams: AdminPostTaxRatesTaxRateProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_product-types_batch/postundefined + $ref: ../code_samples/JavaScript/tax-rates_{id}_product-types_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_product-types_batch/postundefined + $ref: ../code_samples/Shell/tax-rates_{id}_product-types_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -102,17 +104,19 @@ delete: application/json: schema: $ref: ../components/schemas/AdminDeleteTaxRatesTaxRateProductTypesReq.yaml + x-codegen: + method: removeProductTypes + queryParams: AdminDeleteTaxRatesTaxRateProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_product-types_batch/deleteundefined + ../code_samples/JavaScript/tax-rates_{id}_product-types_batch/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/tax-rates_{id}_product-types_batch/deleteundefined + $ref: ../code_samples/Shell/tax-rates_{id}_product-types_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml index d06afb4f43..0228525481 100644 --- a/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_products_batch.yaml @@ -33,15 +33,18 @@ post: application/json: schema: $ref: ../components/schemas/AdminPostTaxRatesTaxRateProductsReq.yaml + x-codegen: + method: addProducts + queryParams: AdminPostTaxRatesTaxRateProductsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/tax-rates_{id}_products_batch/postundefined + $ref: ../code_samples/JavaScript/tax-rates_{id}_products_batch/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_products_batch/postundefined + $ref: ../code_samples/Shell/tax-rates_{id}_products_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -101,16 +104,18 @@ delete: application/json: schema: $ref: ../components/schemas/AdminDeleteTaxRatesTaxRateProductsReq.yaml + x-codegen: + method: removeProducts + queryParams: AdminDeleteTaxRatesTaxRateProductsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_products_batch/deleteundefined + $ref: ../code_samples/JavaScript/tax-rates_{id}_products_batch/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/tax-rates_{id}_products_batch/deleteundefined + $ref: ../code_samples/Shell/tax-rates_{id}_products_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml index f8aab48ffe..abaf54d63f 100644 --- a/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml +++ b/docs/api/admin/paths/tax-rates_{id}_shipping-options_batch.yaml @@ -34,17 +34,19 @@ post: schema: $ref: >- ../components/schemas/AdminPostTaxRatesTaxRateShippingOptionsReq.yaml + x-codegen: + method: addShippingOptions + queryParams: AdminPostTaxRatesTaxRateShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/postundefined + ../code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/tax-rates_{id}_shipping-options_batch/postundefined + $ref: ../code_samples/Shell/tax-rates_{id}_shipping-options_batch/post.sh security: - api_token: [] - cookie_auth: [] @@ -105,17 +107,19 @@ delete: schema: $ref: >- ../components/schemas/AdminDeleteTaxRatesTaxRateShippingOptionsReq.yaml + x-codegen: + method: removeShippingOptions + queryParams: AdminDeleteTaxRatesTaxRateShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/deleteundefined + ../code_samples/JavaScript/tax-rates_{id}_shipping-options_batch/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/tax-rates_{id}_shipping-options_batch/deleteundefined + $ref: ../code_samples/Shell/tax-rates_{id}_shipping-options_batch/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/uploads.yaml b/docs/api/admin/paths/uploads.yaml index d2efc7b5b3..3070375714 100644 --- a/docs/api/admin/paths/uploads.yaml +++ b/docs/api/admin/paths/uploads.yaml @@ -18,11 +18,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads/postundefined + $ref: ../code_samples/JavaScript/uploads/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads/postundefined + $ref: ../code_samples/Shell/uploads/post.sh security: - api_token: [] - cookie_auth: [] @@ -61,11 +61,11 @@ delete: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads/deleteundefined + $ref: ../code_samples/JavaScript/uploads/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads/deleteundefined + $ref: ../code_samples/Shell/uploads/delete.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/uploads_download-url.yaml b/docs/api/admin/paths/uploads_download-url.yaml index 716ab2a434..a3a34d3688 100644 --- a/docs/api/admin/paths/uploads_download-url.yaml +++ b/docs/api/admin/paths/uploads_download-url.yaml @@ -12,11 +12,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads_download-url/postundefined + $ref: ../code_samples/JavaScript/uploads_download-url/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads_download-url/postundefined + $ref: ../code_samples/Shell/uploads_download-url/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/uploads_protected.yaml b/docs/api/admin/paths/uploads_protected.yaml index d0429c3886..67e678e526 100644 --- a/docs/api/admin/paths/uploads_protected.yaml +++ b/docs/api/admin/paths/uploads_protected.yaml @@ -18,11 +18,11 @@ post: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/uploads_protected/postundefined + $ref: ../code_samples/JavaScript/uploads_protected/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/uploads_protected/postundefined + $ref: ../code_samples/Shell/uploads_protected/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/users.yaml b/docs/api/admin/paths/users.yaml index b43a7478a4..3403b55103 100644 --- a/docs/api/admin/paths/users.yaml +++ b/docs/api/admin/paths/users.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminCreateUserRequest.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users/postundefined + $ref: ../code_samples/JavaScript/users/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users/postundefined + $ref: ../code_samples/Shell/users/post.sh security: - api_token: [] - cookie_auth: [] @@ -46,15 +48,17 @@ get: summary: List Users description: Retrieves all users. x-authenticated: true + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users/getundefined + $ref: ../code_samples/JavaScript/users/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users/getundefined + $ref: ../code_samples/Shell/users/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/users_password-token.yaml b/docs/api/admin/paths/users_password-token.yaml index 5a3cbff64a..d82fb253ef 100644 --- a/docs/api/admin/paths/users_password-token.yaml +++ b/docs/api/admin/paths/users_password-token.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminResetPasswordTokenRequest.yaml + x-codegen: + method: sendResetPasswordToken x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_password-token/postundefined + $ref: ../code_samples/JavaScript/users_password-token/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_password-token/postundefined + $ref: ../code_samples/Shell/users_password-token/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/users_reset-password.yaml b/docs/api/admin/paths/users_reset-password.yaml index 32edb08c36..24dcae1bda 100644 --- a/docs/api/admin/paths/users_reset-password.yaml +++ b/docs/api/admin/paths/users_reset-password.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminResetPasswordRequest.yaml + x-codegen: + method: resetPassword x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_reset-password/postundefined + $ref: ../code_samples/JavaScript/users_reset-password/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_reset-password/postundefined + $ref: ../code_samples/Shell/users_reset-password/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/users_{id}.yaml b/docs/api/admin/paths/users_{id}.yaml index 3719da14ca..962f3067ee 100644 --- a/docs/api/admin/paths/users_{id}.yaml +++ b/docs/api/admin/paths/users_{id}.yaml @@ -10,15 +10,17 @@ delete: description: The ID of the User. schema: type: string + x-codegen: + method: delete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_{id}/deleteundefined + $ref: ../code_samples/JavaScript/users_{id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_{id}/deleteundefined + $ref: ../code_samples/Shell/users_{id}/delete.sh security: - api_token: [] - cookie_auth: [] @@ -55,15 +57,17 @@ get: description: The ID of the User. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_{id}/getundefined + $ref: ../code_samples/JavaScript/users_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_{id}/getundefined + $ref: ../code_samples/Shell/users_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -105,15 +109,17 @@ post: application/json: schema: $ref: ../components/schemas/AdminUpdateUserRequest.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/users_{id}/postundefined + $ref: ../code_samples/JavaScript/users_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/users_{id}/postundefined + $ref: ../code_samples/Shell/users_{id}/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/variants.yaml b/docs/api/admin/paths/variants.yaml index 176e1393d2..02357455bc 100644 --- a/docs/api/admin/paths/variants.yaml +++ b/docs/api/admin/paths/variants.yaml @@ -93,15 +93,18 @@ get: description: >- filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: AdminGetVariantsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/variants/getundefined + $ref: ../code_samples/JavaScript/variants/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/variants/getundefined + $ref: ../code_samples/Shell/variants/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/admin/paths/variants_{id}_inventory.yaml b/docs/api/admin/paths/variants_{id}_inventory.yaml new file mode 100644 index 0000000000..0504ea75cf --- /dev/null +++ b/docs/api/admin/paths/variants_{id}_inventory.yaml @@ -0,0 +1,51 @@ +get: + operationId: GetVariantsVariantInventory + summary: Get inventory of Variant. + description: Returns the available inventory of a Variant. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The Product Variant id to get inventory for. + schema: + type: string + x-codegen: + method: getInventory + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/variants_{id}_inventory/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/variants_{id}_inventory/get.sh + security: + - api_token: [] + - cookie_auth: [] + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + properties: + variant: + type: object + $ref: ../components/schemas/AdminGetVariantsVariantInventoryRes.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 61259dedfb..69241324af 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -140,7 +140,13 @@ paths: description: >- Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser. - parameters: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostAuthReq' + x-codegen: + method: authenticate x-codeSamples: - lang: JavaScript label: JS Client @@ -188,26 +194,13 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The Customer's email. - password: - type: string - description: The Customer's password. delete: operationId: DeleteAuth summary: Customer Log out description: Destroys a Customer's authenticated session. x-authenticated: true + x-codegen: + method: deleteSession x-codeSamples: - lang: Shell label: cURL @@ -240,6 +233,8 @@ paths: summary: Get Current Customer description: Gets the currently logged in Customer. x-authenticated: true + x-codegen: + method: getSession x-codeSamples: - lang: JavaScript label: JS Client @@ -297,6 +292,8 @@ paths: format: email required: true description: The email to check if exists. + x-codegen: + method: exists x-codeSamples: - lang: JavaScript label: JS Client @@ -345,6 +342,13 @@ paths: description: The cart ID. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartShippingMethodReq' + x-codegen: + method: addShippingMethod x-codeSamples: - lang: JavaScript label: JS Client @@ -391,24 +395,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. '/carts/{id}/taxes': post: summary: Calculate Cart Taxes @@ -423,6 +409,8 @@ paths: description: The Cart ID. schema: type: string + x-codegen: + method: calculateTaxes x-codeSamples: - lang: Shell label: cURL @@ -466,6 +454,8 @@ paths: description: The Cart id. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client @@ -523,6 +513,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCartReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -574,6 +566,8 @@ paths: description: The id of the Cart. schema: type: string + x-codegen: + method: createPaymentSessions x-codeSamples: - lang: JavaScript label: JS Client @@ -630,6 +624,8 @@ paths: description: The unique Discount code. schema: type: string + x-codegen: + method: deleteDiscount x-codeSamples: - lang: JavaScript label: JS Client @@ -686,6 +682,8 @@ paths: description: The id of the Line Item. schema: type: string + x-codegen: + method: deleteLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -741,6 +739,13 @@ paths: description: The id of the Line Item. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsItemReq' + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -787,17 +792,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. '/carts/{id}/payment-sessions/{provider_id}': delete: operationId: DeleteCartsCartPaymentSessionsSession @@ -820,6 +814,8 @@ paths: be deleted. schema: type: string + x-codegen: + method: deletePaymentSession x-codeSamples: - lang: JavaScript label: JS Client @@ -875,6 +871,13 @@ paths: description: The id of the payment provider. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionUpdateReq' + x-codegen: + method: updatePaymentSession x-codeSamples: - lang: JavaScript label: JS Client @@ -922,17 +925,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. '/carts/{id}': get: operationId: GetCartsCart @@ -945,6 +937,8 @@ paths: description: The id of the Cart. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -999,6 +993,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCartsCartReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -1067,6 +1063,8 @@ paths: be refreshed. schema: type: string + x-codegen: + method: refreshPaymentSession x-codeSamples: - lang: JavaScript label: JS Client @@ -1119,6 +1117,13 @@ paths: description: The ID of the Cart. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionReq' + x-codegen: + method: setPaymentSession x-codeSamples: - lang: JavaScript label: JS Client @@ -1165,17 +1170,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. '/collections/{id}': get: operationId: GetCollectionsCollection @@ -1188,6 +1182,8 @@ paths: description: The id of the Product Collection schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -1290,6 +1286,9 @@ paths: 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 @@ -1339,6 +1338,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' + x-codegen: + method: addAddress x-codeSamples: - lang: JavaScript label: JS Client @@ -1422,6 +1423,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -1507,6 +1510,8 @@ paths: description: The id of the Address to remove. schema: type: string + x-codegen: + method: deleteAddress x-codeSamples: - lang: JavaScript label: JS Client @@ -1571,6 +1576,8 @@ paths: schema: $ref: >- #/components/schemas/StorePostCustomersCustomerAddressesAddressReq + x-codegen: + method: updateAddress x-codeSamples: - lang: JavaScript label: JS Client @@ -1633,6 +1640,8 @@ paths: Retrieves a Customer - the Customer must be logged in to retrieve their details. x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -1689,6 +1698,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client @@ -1752,6 +1763,8 @@ paths: are saved with Payment Providers and it is their responsibility to fetch saved methods. x-authenticated: true + x-codegen: + method: listPaymentMethods x-codeSamples: - lang: JavaScript label: JS Client @@ -1969,6 +1982,9 @@ paths: resulting orders. schema: type: string + x-codegen: + method: listOrders + queryParams: StoreGetCustomersCustomerOrdersParams x-codeSamples: - lang: JavaScript label: JS Client @@ -2028,6 +2044,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' + x-codegen: + method: generatePasswordToken x-codeSamples: - lang: JavaScript label: JS Client @@ -2088,6 +2106,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' + x-codegen: + method: resetPassword x-codeSamples: - lang: JavaScript label: JS Client @@ -2144,7 +2164,7 @@ paths: get: operationId: GetGiftCardsCode summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. + description: Retrieves a Gift Card by its associated unique code. parameters: - in: path name: code @@ -2152,6 +2172,8 @@ paths: description: The unique Gift Card code. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -2202,6 +2224,8 @@ paths: description: The ID of the Order Edit. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client @@ -2254,6 +2278,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' + x-codegen: + method: decline x-codeSamples: - lang: JavaScript label: JS Client @@ -2301,6 +2327,8 @@ paths: description: The ID of the OrderEdit. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -2353,6 +2381,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerAcceptClaimReq' + x-codegen: + method: confirmRequest x-codeSamples: - lang: JavaScript label: JS Client @@ -2420,6 +2450,8 @@ paths: description: The ID of Cart. schema: type: string + x-codegen: + method: retrieveByCartId x-codeSamples: - lang: JavaScript label: JS Client @@ -2470,6 +2502,18 @@ paths: 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 @@ -2520,6 +2564,16 @@ paths: 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 @@ -2540,6 +2594,9 @@ paths: 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 @@ -2593,6 +2650,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerOrderClaimReq' + x-codegen: + method: requestCustomerOrders x-codeSamples: - lang: JavaScript label: JS Client @@ -2665,6 +2724,8 @@ paths: schema: $ref: >- #/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq + x-codegen: + method: authorizePaymentSessionsBatch x-codeSamples: - lang: JavaScript label: JS Client @@ -2729,6 +2790,8 @@ paths: description: The ID of the Payment Session. schema: type: string + x-codegen: + method: authorizePaymentSession x-codeSamples: - lang: JavaScript label: JS Client @@ -2797,6 +2860,9 @@ paths: 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 @@ -2859,6 +2925,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' + x-codegen: + method: managePaymentSessionsBatch x-codeSamples: - lang: JavaScript label: JS Client @@ -2949,6 +3017,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' + x-codegen: + method: managePaymentSession x-codeSamples: - lang: JavaScript label: JS Client @@ -3020,6 +3090,8 @@ paths: description: The id of the Payment Session to be refreshed. schema: type: string + x-codegen: + method: refreshPaymentSession x-codeSamples: - lang: JavaScript label: JS Client @@ -3086,6 +3158,9 @@ paths: category. schema: type: string + x-codegen: + method: retrieve + queryParams: StoreGetProductCategoryParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3097,11 +3172,10 @@ paths: // must be previously logged in or use api token - medusa.productCategories.retrieve("pcat-id") - - .then(({ productCategory }) => { - console.log(productCategory.id); - }); + medusa.productCategories.retrieve(product_category_id) + .then(({ product_category }) => { + console.log(product_category.id); + }); - lang: Shell label: cURL source: > @@ -3120,7 +3194,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StoreGetProductCategoryRes' + $ref: '#/components/schemas/StoreGetProductCategoriesCategoryRes' '400': $ref: '#/components/responses/400_error' '401': @@ -3162,7 +3236,23 @@ paths: 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: > @@ -3181,21 +3271,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/StoreProductCategoriesListRes' '400': $ref: '#/components/responses/400_error' '401': @@ -3452,6 +3528,9 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: StoreGetProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3511,6 +3590,11 @@ paths: description: The id of the Product. schema: type: string + - in: query + name: sales_channel_id + description: The sales channel used when fetching the product. + schema: + type: string - in: query name: cart_id description: The ID of the customer's cart. @@ -3523,6 +3607,18 @@ paths: ensure correct prices are retrieved for a region. schema: type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. + schema: + type: string - in: query name: currency_code style: form @@ -3535,6 +3631,9 @@ paths: externalDocs: url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetProductsProductParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3697,6 +3796,20 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + - in: query + name: category_id + style: form + explode: false + description: Category ids to filter by. + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id. + schema: + type: boolean - in: query name: offset description: How many products to skip in the result. @@ -3712,14 +3825,14 @@ paths: - in: query name: expand description: >- - (Comma separated) Which fields should be expanded in each order of + (Comma separated) Which fields should be expanded in each product of the result. schema: type: string - in: query name: fields description: >- - (Comma separated) Which fields should be included in each order of + (Comma separated) Which fields should be included in each product of the result. schema: type: string @@ -3728,6 +3841,24 @@ paths: description: the field used to order the products. schema: type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetProductsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3790,6 +3921,9 @@ paths: description: Limit the number of products returned. schema: type: integer + x-codegen: + method: search + queryParams: StorePostSearchReq x-codeSamples: - lang: JavaScript label: JS Client @@ -3842,6 +3976,8 @@ paths: description: The id of the Region. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -3942,6 +4078,9 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: StoreGetRegionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -3991,6 +4130,8 @@ paths: description: The id of the Return Reason. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client @@ -4034,6 +4175,8 @@ paths: operationId: GetReturnReasons summary: List Return Reasons description: Retrieves a list of Return Reasons. + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client @@ -4082,6 +4225,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostReturnsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -4163,6 +4308,9 @@ paths: description: the Region to retrieve Shipping Options from. schema: type: string + x-codegen: + method: list + queryParams: StoreGetShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client @@ -4213,6 +4361,8 @@ paths: description: The id of the Cart. schema: type: string + x-codegen: + method: listCartOptions x-codeSamples: - lang: JavaScript label: JS Client @@ -4263,6 +4413,8 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostSwapsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client @@ -4345,6 +4497,8 @@ paths: description: The id of the Cart schema: type: string + x-codegen: + method: retrieveByCartId x-codeSamples: - lang: JavaScript label: JS Client @@ -4400,6 +4554,11 @@ paths: description: The id of the Cart to set prices based on. schema: type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string - in: query name: region_id description: The id of the Region to set prices based on. @@ -4415,6 +4574,9 @@ paths: externalDocs: url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetVariantsVariantParams x-codeSamples: - lang: Shell label: cURL @@ -4451,6 +4613,11 @@ paths: description: A comma separated list of Product Variant ids to filter by. schema: type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string - in: query name: expand description: A comma separated list of Product Variant relations to load. @@ -4468,6 +4635,21 @@ paths: schema: type: number default: '100' + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string - in: query name: title style: form @@ -4507,6 +4689,9 @@ paths: description: >- filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: StoreGetVariantsParams x-codeSamples: - lang: Shell label: cURL @@ -4546,6 +4731,13 @@ paths: description: The id of the Cart to add the Line Item to. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsReq' + x-codegen: + method: createLineItem x-codeSamples: - lang: JavaScript label: JS Client @@ -4594,28 +4786,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: >- - The id of the Product Variant to generate the Line Item - from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the - Line Item. components: responses: default_error: @@ -4875,48 +5045,71 @@ components: title: Address description: An address. type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at properties: id: type: string description: ID of the address example: addr_01G8ZC9VS1XVE149MGH2J7QSSH customer_id: - type: string description: ID of the customer this address belongs to + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: Available if the relation `customer` is expanded. - type: array - items: - type: object - description: A customer object. + nullable: true + $ref: '#/components/schemas/Customer' company: - type: string description: Company name + nullable: true + type: string example: Acme first_name: - type: string description: First name + nullable: true + type: string example: Arno last_name: - type: string description: Last name + nullable: true + type: string example: Willms address_1: - type: string description: Address line 1 + nullable: true + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + nullable: true + type: string example: Suite 369 city: - type: string description: City + nullable: true + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + nullable: true + type: string externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements @@ -4924,18 +5117,22 @@ components: example: st country: description: A country object. Available if the relation `country` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Country' province: - type: string description: Province + nullable: true + type: string example: Kentucky postal_code: - type: string description: Postal Code + nullable: true + type: string example: 72093 phone: - type: string description: Phone Number + nullable: true + type: string example: 16128234334802 created_at: type: string @@ -4946,12 +5143,14 @@ components: description: The date with timezone at which the resource was updated. format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white BatchJob: @@ -4959,21 +5158,36 @@ components: description: A Batch Job. type: object required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status - type + - updated_at properties: id: - type: string description: The unique identifier for the batch job. + type: string example: batch_01G8T782965PYFG0751G0Z38B4 type: - type: string description: The type of batch job. + type: string enum: - product-import - product-export status: - type: string description: The status of the batch job. + type: string enum: - created - pre_processed @@ -4984,19 +5198,22 @@ components: - failed default: created created_by: - type: string description: The unique identifier of the user that created the batch job. + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: description: >- A user object. Available if the relation `created_by_user` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/User' context: - type: object description: >- The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object example: shape: prices: @@ -5014,43 +5231,47 @@ components: - variant.prices - images dry_run: - type: boolean description: Specify if the job must apply the modifications or not. + type: boolean default: false result: - type: object description: The result of the batch job. - properties: - count: - type: number - advancement_count: - type: number - progress: - type: number - errors: - type: object + nullable: true + allOf: + - type: object + example: {} + - type: object properties: - message: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: type: string - code: - oneOf: - - type: string - - type: number - err: - type: array - stat_descriptors: - type: object - properties: - key: - type: string - name: - type: string - message: - type: string - file_key: - type: string - file_size: - type: number + file_size: + type: number example: errors: - err: [] @@ -5061,67 +5282,97 @@ components: name: Product count to export message: There will be 8 products exported by this action pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true type: string - description: The date from which the job has been pre processed. format: date-time processing_at: - type: string description: The date the job is processing at. + nullable: true + type: string format: date-time confirmed_at: - type: string description: The date when the confirmation has been done. + nullable: true + type: string format: date-time completed_at: - type: string description: The date of the completion. + nullable: true + type: string format: date-time canceled_at: - type: string description: The date of the concellation. + nullable: true + type: string format: date-time failed_at: - type: string description: The date when the job failed. + nullable: true + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was last updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time Cart: title: Cart description: Represents a user cart type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The cart's ID + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 email: - type: string description: The email associated with the cart + nullable: true + type: string format: email billing_address_id: - type: string description: The billing address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_address_id: - type: string description: The shipping address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. @@ -5129,54 +5380,58 @@ components: items: $ref: '#/components/schemas/LineItem' region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' discounts: - type: array description: Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array - description: Available if the relation `gift_cards` is expanded. items: - type: object - description: A gift card object. + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' customer_id: - type: string description: The customer's ID + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Customer' payment_session: description: The selected payment session in the cart. + nullable: true $ref: '#/components/schemas/PaymentSession' payment_sessions: - type: array description: The payment sessions created on the cart. + type: array items: $ref: '#/components/schemas/PaymentSession' payment_id: - type: string description: The payment's ID if available + nullable: true + type: string example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. + nullable: true $ref: '#/components/schemas/Payment' shipping_methods: - type: array description: The shipping methods added to the cart. + type: array items: $ref: '#/components/schemas/ShippingMethod' type: - type: string description: The cart's type. + type: string enum: - default - swap @@ -5185,93 +5440,109 @@ components: - claim default: default completed_at: - type: string description: The date with timezone at which the cart was completed. + nullable: true + type: string format: date-time payment_authorized_at: - type: string description: The date with timezone at which the payment was authorized. + nullable: true + type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. context: - type: object description: >- The context of the cart which can include info like IP or user agent. + nullable: true + type: object example: ip: '::1' user_agent: PostmanRuntime/7.29.2 sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null sales_channel: description: >- A sales channel object. Available if the relation `sales_channel` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/SalesChannel' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white shipping_total: - type: integer description: The total of shipping + type: integer example: 1000 discount_total: - type: integer description: The total of discount - example: 800 - tax_total: type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: description: The total of tax + type: integer example: 0 refunded_total: - type: integer description: >- The total amount refunded if the order associated with this cart is returned. + type: integer example: 0 total: - type: integer description: The total amount of the cart + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the cart + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 ClaimImage: title: Claim Image @@ -5279,39 +5550,47 @@ components: type: object required: - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: - type: string description: The claim image's ID + type: string example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 claim_item_id: - type: string description: The ID of the claim item associated with the image + type: string claim_item: description: >- A claim item object. Available if the relation `claim_item` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ClaimItem' url: - type: string description: The URL of the image + type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimItem: @@ -5322,18 +5601,24 @@ components: type: object required: - claim_order_id + - created_at + - deleted_at + - id - item_id - - variant_id - - reason + - metadata + - note - quantity + - reason + - updated_at + - variant_id properties: id: - type: string description: The claim item's ID + type: string example: citm_01G8ZH853Y6TFXWPG5EYE81X63 images: - type: array description: Available if the relation `images` is expanded. + type: array items: $ref: '#/components/schemas/ClaimImage' claim_order_id: @@ -5343,13 +5628,15 @@ components: description: >- A claim order object. Available if the relation `claim_order` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ClaimOrder' item_id: description: The ID of the line item that the claim item refers to. type: string example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. + nullable: true $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. @@ -5357,7 +5644,8 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: A variant object. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ProductVariant' reason: description: The reason for the claim type: string @@ -5368,6 +5656,7 @@ components: - other note: description: 'An optional note about the claim, for additional information' + nullable: true type: string example: I don't like it. quantity: @@ -5384,20 +5673,22 @@ components: items: $ref: '#/components/schemas/ClaimTag' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimOrder: @@ -5408,27 +5699,41 @@ components: and can contain additional information about fulfillments and returns. type: object required: - - type + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The claim's ID + type: string example: claim_01G8ZH853Y6TFXWPG5EYE81X63 type: + description: The claim's type type: string enum: - refund - replace payment_status: - type: string description: The status of the claim's payment + type: string enum: - na - not_refunded - refunded default: na fulfillment_status: + description: The claim's fulfillment status type: string enum: - not_fulfilled @@ -5459,18 +5764,22 @@ components: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Order' return_order: description: >- A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded - type: object + nullable: true + $ref: '#/components/schemas/Return' shipping_address_id: description: The ID of the address that the new items should be shipped to + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. @@ -5484,40 +5793,46 @@ components: $ref: '#/components/schemas/Fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim + nullable: true type: integer example: 1000 canceled_at: description: The date with timezone at which the claim was canceled. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white no_notification: description: >- Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key @@ -5529,31 +5844,38 @@ components: easy filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The claim tag's ID + type: string example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 value: description: The value that the claim tag holds type: string example: Damaged created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Country: @@ -5561,27 +5883,29 @@ components: description: Country details type: object required: + - display_name + - id - iso_2 - iso_3 - - num_code - name - - display_name + - num_code + - region_id properties: id: - type: string description: The country's ID + type: string example: 109 iso_2: - type: string description: The 2 character ISO code of the country in lower case + type: string example: it externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. iso_3: - type: string description: The 2 character ISO code of the country in lower case + type: string example: ita externalDocs: url: >- @@ -5604,21 +5928,23 @@ components: type: string example: Italy region_id: - type: string description: The region ID this country is associated with. + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' Currency: title: Currency description: Currency type: object required: - code + - name - symbol - symbol_native - - name properties: code: description: The 3 character ISO code for the currency. @@ -5642,6 +5968,7 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean + default: false CustomShippingOption: title: Custom Shipping Option description: >- @@ -5650,12 +5977,18 @@ components: price for a particular Shipping Option type: object required: + - cart_id + - created_at + - deleted_at + - id + - metadata - price - shipping_option_id + - updated_at properties: id: - type: string description: The custom shipping option's ID + type: string example: cso_01G8X99XNB77DMFBJFWX6DN9V9 price: description: >- @@ -5673,81 +6006,87 @@ components: description: >- A shipping option object. Available if the relation `shipping_option` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ShippingOption' cart_id: description: The ID of the Cart that the custom shipping option is attached to + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Cart' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white - includes_tax: - description: >- - [EXPERIMENTAL] Indicates if the custom shipping option price include - tax - type: boolean CustomerGroup: title: Customer Group description: Represents a customer group type: object required: + - created_at + - deleted_at + - id + - metadata - name + - updated_at properties: id: - type: string description: The customer group's ID + type: string example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 name: - type: string description: The name of the customer group + type: string example: VIP customers: - type: array description: >- The customers that belong to the customer group. Available if the relation `customers` is expanded. - items: - type: object - description: A customer object. - price_lists: type: array + items: + $ref: '#/components/schemas/Customer' + price_lists: description: >- The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. + type: array items: $ref: '#/components/schemas/PriceList' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Customer: @@ -5755,30 +6094,44 @@ components: description: Represents a customer type: object required: + - billing_address_id + - created_at + - deleted_at - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at properties: id: - type: string description: The customer's ID + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 email: - type: string description: The customer's email + type: string format: email first_name: - type: string description: The customer's first name + nullable: true + type: string example: Arno last_name: - type: string description: The customer's last name + nullable: true + type: string example: Willms billing_address_id: - type: string description: The customer's billing address ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. @@ -5786,19 +6139,19 @@ components: items: $ref: '#/components/schemas/Address' phone: - type: string description: The customer's phone number + nullable: true + type: string example: 16128234334802 has_account: - type: boolean description: Whether the customer has an account or not + type: boolean default: false orders: description: Available if the relation `orders` is expanded. type: array items: - type: object - description: An order object. + $ref: '#/components/schemas/Order' groups: description: >- The customer groups the customer belongs to. Available if the @@ -5807,20 +6160,22 @@ components: items: $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionCustomerGroup: @@ -5828,8 +6183,11 @@ components: description: Associates a discount condition with a customer group type: object required: - - customer_group_id - condition_id + - created_at + - customer_group_id + - metadata + - updated_at properties: customer_group_id: description: The ID of the Product Tag @@ -5841,21 +6199,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. + nullable: true $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductCollection: @@ -5863,8 +6224,11 @@ components: description: Associates a discount condition with a product collection type: object required: - - product_collection_id - condition_id + - created_at + - metadata + - product_collection_id + - updated_at properties: product_collection_id: description: The ID of the Product Collection @@ -5876,21 +6240,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. + nullable: true $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductTag: @@ -5898,8 +6265,11 @@ components: description: Associates a discount condition with a product tag type: object required: - - product_tag_id - condition_id + - created_at + - metadata + - product_tag_id + - updated_at properties: product_tag_id: description: The ID of the Product Tag @@ -5911,21 +6281,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. + nullable: true $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductType: @@ -5933,8 +6306,11 @@ components: description: Associates a discount condition with a product type type: object required: - - product_type_id - condition_id + - created_at + - metadata + - product_type_id + - updated_at properties: product_type_id: description: The ID of the Product Tag @@ -5946,21 +6322,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProduct: @@ -5968,8 +6347,11 @@ components: description: Associates a discount condition with a product type: object required: - - product_id - condition_id + - created_at + - metadata + - product_id + - updated_at properties: product_id: description: The ID of the Product Tag @@ -5981,21 +6363,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. + nullable: true $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountCondition: @@ -6003,13 +6388,18 @@ components: description: Holds rule conditions for when a discount is applicable type: object required: - - type - - operator + - created_at + - deleted_at - discount_rule_id + - id + - metadata + - operator + - type + - updated_at properties: id: - type: string description: The discount condition's ID + type: string example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: The type of the Condition @@ -6027,11 +6417,12 @@ components: - in - not_in discount_rule_id: - type: string description: The ID of the discount rule associated with the condition + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' products: description: >- @@ -6039,58 +6430,55 @@ components: Available if the relation `products` is expanded. type: array items: - type: object - description: A product object. + $ref: '#/components/schemas/Product' product_types: description: >- - product types associated with this condition if type = + Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. type: array items: - type: object - description: A product type object. + $ref: '#/components/schemas/ProductType' product_tags: description: >- - product tags associated with this condition if type = product_tags. + Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. type: array items: - type: object - description: A product tag object. + $ref: '#/components/schemas/ProductTag' product_collections: description: >- - product collections associated with this condition if type = + Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. type: array items: - type: object - description: A product collection object. + $ref: '#/components/schemas/ProductCollection' customer_groups: description: >- - customer groups associated with this condition if type = + Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountRule: @@ -6100,12 +6488,19 @@ components: to a Cart. type: object required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata - type + - updated_at - value properties: id: - type: string description: The discount rule's ID + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C type: description: >- @@ -6120,6 +6515,7 @@ components: example: percentage description: description: A short description of the discount + nullable: true type: string example: 10 Percent value: @@ -6130,6 +6526,7 @@ components: example: 10 allocation: description: The scope that the discount should apply to. + nullable: true type: string enum: - total @@ -6141,23 +6538,24 @@ components: be used. Available if the relation `conditions` is expanded. type: array items: - type: object - description: A discount condition object. + $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Discount: @@ -6168,11 +6566,24 @@ components: type: object required: - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration properties: id: - type: string description: The discount's ID + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN code: description: >- @@ -6187,11 +6598,13 @@ components: type: boolean example: false rule_id: - type: string description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' is_disabled: description: >- @@ -6200,13 +6613,15 @@ components: type: boolean example: false parent_discount_id: - type: string description: >- The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. + nullable: true $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. @@ -6214,11 +6629,13 @@ components: format: date-time ends_at: description: The time at which the discount can no longer be used. + nullable: true type: string format: date-time valid_duration: - type: string description: Duration the discount runs between + nullable: true + type: string example: P3Y6M4DT12H30M5S regions: description: >- @@ -6226,10 +6643,10 @@ components: relation `regions` is expanded. type: array items: - type: object - description: A region object. + $ref: '#/components/schemas/Region' usage_limit: description: The maximum number of times that a discount can be used. + nullable: true type: integer example: 100 usage_count: @@ -6238,92 +6655,112 @@ components: example: 50 default: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DraftOrder: title: DraftOrder description: Represents a draft order type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at properties: id: - type: string description: The draft order's ID + type: string example: dorder_01G8TJFKBG38YYFQ035MSVG03C status: - type: string description: The status of the draft order + type: string enum: - open - completed default: open display_id: - type: string description: The draft order's display ID + type: string example: 2 cart_id: - type: string description: The ID of the cart associated with the draft order. + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Cart' order_id: - type: string description: The ID of the order associated with the draft order. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Order' canceled_at: - type: string description: The date the draft order was canceled at. + nullable: true + type: string format: date-time completed_at: - type: string description: The date the draft order was completed at. + nullable: true + type: string format: date-time no_notification_order: - type: boolean description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white FulfillmentItem: @@ -8239,6 +8676,14 @@ components: A product category object. Available if the relation `parent_category` is expanded. type: object + products: + description: >- + products associated with category. Available if the relation + `products` is expanded. + type: array + items: + type: object + description: A product object. created_at: type: string description: The date with timezone at which the resource was created. @@ -8917,6 +9362,14 @@ components: items: type: object description: A sales channel object. + categories: + description: >- + The product's associated categories. Available if the relation + `categories` is expanded. + type: array + items: + type: object + description: A category object. created_at: type: string description: The date with timezone at which the resource was created. @@ -10261,6 +10714,78 @@ components: description: An optional key-value map with additional details example: car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping + carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the + manufacturer of the Inventory Item. May be used by Fulfillment + Providers to pass customs information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May + be used by Fulfillment Providers to pass customs information to + shipping carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time ReservationItemDTO: title: Reservation item description: Represents a reservation of an inventory item at a stock location @@ -10300,6 +10825,50 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: >- + the total stock quantity of an inventory item at the given location + ID + type: number + reserved_quantity: + description: >- + the reserved stock quantity of an inventory item at the given + location ID + type: number + incoming_quantity: + description: >- + the incoming stock quantity of an inventory item at the given + location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time PricedVariant: title: Priced Product Variant type: object @@ -10375,6 +10944,10 @@ components: type: string description: Stock location address' complement example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa city: type: string description: Stock location address' city @@ -10569,6 +11142,18 @@ components: type: type: string description: A slug indicating the type of the error. + StorePostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. StoreAuthRes: type: object properties: @@ -10580,6 +11165,20 @@ components: exists: type: boolean description: Whether email exists or not. + StorePostCartsCartShippingMethodReq: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to process + the fulfillment of the order. Look at the documentation for your + installed fulfillment providers to find out what to send. StorePostCartReq: type: object properties: @@ -10602,6 +11201,7 @@ components: Items from. type: array items: + type: object required: - variant_id - quantity @@ -10657,6 +11257,14 @@ components: When cart is used for a swap and it has been completed successfully. - $ref: '#/components/schemas/Swap' + StorePostCartsCartPaymentSessionReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. StorePostCartsCartReq: type: object properties: @@ -10695,6 +11303,7 @@ components: description: An array of Gift Card codes to add to the Cart. type: array items: + type: object required: - code properties: @@ -10705,6 +11314,7 @@ components: description: An array of Discount codes to add to the Cart. type: array items: + type: object required: - code properties: @@ -10720,6 +11330,22 @@ components: example: ip: '::1' user_agent: Chrome + StorePostCartsCartLineItemsItemReq: + type: object + required: + - quantity + properties: + quantity: + type: number + description: The quantity to set the Line Item to. + StorePostCartsCartPaymentSessionUpdateReq: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. StoreCollectionsListRes: type: object properties: @@ -10951,6 +11577,7 @@ components: be deleted and the provided ones will be created. type: array items: + type: object required: - provider_id - amount @@ -10972,11 +11599,27 @@ components: provider_id: type: string description: The ID of the Payment Provider. - StoreGetProductCategoryRes: + 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: @@ -11059,6 +11702,7 @@ components: description: The items to include in the Return. type: array items: + type: object required: - item_id - quantity @@ -11115,6 +11759,7 @@ components: description: The items to include in the Return. type: array items: + type: object required: - item_id - quantity @@ -11138,6 +11783,7 @@ components: description: The items to exchange the returned items to. type: array items: + type: object required: - variant_id - quantity @@ -11165,3 +11811,20 @@ components: type: array items: $ref: '#/components/schemas/PricedVariant' + StorePostCartsCartLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: The id of the Product Variant to generate the Line Item from. + quantity: + type: number + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: >- + An optional key-value map with additional details about the Line + Item. diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 61259dedfb..81a2fbe62e 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -2,110 +2,60 @@ openapi: 3.0.0 info: version: 1.0.0 title: Medusa Storefront API - description: > - API reference for Medusa's Storefront endpoints. All endpoints are prefixed - with `/store`. - + description: | + API reference for Medusa's Storefront endpoints. All endpoints are prefixed with `/store`. ## Authentication - - To send requests as an authenticated customer, you must use the Cookie - Session ID. - + To send requests as an authenticated customer, you must use the Cookie Session ID. - ## Expanding Fields + In many endpoints you'll find an `expand` query parameter that can be passed to the endpoint. You can use the `expand` query parameter to unpack an entity's relations and return them in the response. - In many endpoints you'll find an `expand` query parameter that can be passed - to the endpoint. You can use the `expand` query parameter to unpack an - entity's relations and return them in the response. + For example, when you list customers you can also retrieve their groups by passing to the `expand` query parameter the value `groups`. + You can expand more than one relation by separating the relations in the `expand` query parameter with a comma. For example, to retrieve both the orders and the groups of a customer, pass to the `expand` query parameter the value `groups,orders`. - For example, when you list customers you can also retrieve their groups by - passing to the `expand` query parameter the value `groups`. - - - You can expand more than one relation by separating the relations in the - `expand` query parameter with a comma. For example, to retrieve both the - orders and the groups of a customer, pass to the `expand` query parameter - the value `groups,orders`. - - - Please note that the parameters you pass to `expand` replace any relations - that are expanded by default. - + Please note that the parameters you pass to `expand` replace any relations that are expanded by default. ## Selecting Fields + In many endpoints you'll find a `fields` query parameter that can be passed to the endpoint. You can use the `fields` query parameter to specify which fields in the entity should be returned in the response. - In many endpoints you'll find a `fields` query parameter that can be passed - to the endpoint. You can use the `fields` query parameter to specify which - fields in the entity should be returned in the response. + You can pass more than one field by seperating the field names in the `fields` query parameter with a comma. + Only the fields you pass to `field` will be retrieved and returned in the response. Any fields that are returned by default will not be returned in this case. This does not affect relations. - You can pass more than one field by seperating the field names in the - `fields` query parameter with a comma. - - - Only the fields you pass to `field` will be retrieved and returned in the - response. Any fields that are returned by default will not be returned in - this case. This does not affect relations. - - - For example, to only select the `title` and `description` fields of a - product, pass to the `fields` query parameter the value `title,description`. - + For example, to only select the `title` and `description` fields of a product, pass to the `fields` query parameter the value `title,description`. ## Pagination - ### Query Parameters + In listing endpoints, such as list customers or list products, you can control the pagination using the query parameters `limit` and `offset`. - In listing endpoints, such as list customers or list products, you can - control the pagination using the query parameters `limit` and `offset`. - - - `limit` is used to specify the maximum number of items that can be return in - the response. `offset` is used to specify how many items to skip before - returning the resulting entities. - - - You can use the `offset` query parameter to change between pages. For - example, if the limit is 50, at page 1 the offset should be 0; at page 2 the - offset should be 50, and so on. + `limit` is used to specify the maximum number of items that can be return in the response. `offset` is used to specify how many items to skip before returning the resulting entities. + You can use the `offset` query parameter to change between pages. For example, if the limit is 50, at page 1 the offset should be 0; at page 2 the offset should be 50, and so on. ### Response Fields + In listing fields, aside from the entities retrieved, there are three pagination-related fields returned: `count`, `limit`, and `offset`. - In listing fields, aside from the entities retrieved, there are three - pagination-related fields returned: `count`, `limit`, and `offset`. + Similarly to the query parameters, `limit` is the maximum number of items that can be returned in the response, and `field` is the number of items that were skipped before the entities in the result. + `count` is the total number of available items of this entity. It can be used to determine how many pages are there. - Similarly to the query parameters, `limit` is the maximum number of items - that can be returned in the response, and `field` is the number of items - that were skipped before the entities in the result. - - - `count` is the total number of available items of this entity. It can be - used to determine how many pages are there. - - - For example, if the `count` is 100 and the `limit` is 50, you can divide the - `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. + For example, if the `count` is 100 and the `limit` is 50, you can divide the `count` by the `limit` to get the number of pages: `100/50 = 2 pages`. license: name: MIT - url: 'https://github.com/medusajs/medusa/blob/master/LICENSE' + url: https://github.com/medusajs/medusa/blob/master/LICENSE tags: - name: Auth - description: >- - Auth endpoints that allow authorization of customers and manages their - sessions. + description: Auth endpoints that allow authorization of customers and manages their sessions. - name: Cart description: Cart endpoints that allow handling carts in Medusa. - name: Collection @@ -131,30 +81,30 @@ tags: - name: Swap description: Swap endpoints that allow handling swaps in Medusa. servers: - - url: 'https://api.medusa-commerce.com/store' + - url: https://api.medusa-commerce.com/store paths: /auth: post: operationId: PostAuth summary: Customer Login - description: >- - Logs a Customer in and authorizes them to view their details. Successful - authentication will set a session cookie in the Customer's browser. - parameters: [] + description: Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser. + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostAuthReq' + x-codegen: + method: authenticate x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.auth.authenticate({ email: 'user@example.com', password: 'user@example.com' }) - .then(({ customer }) => { console.log(customer.id); }); @@ -188,33 +138,18 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The Customer's email. - password: - type: string - description: The Customer's password. delete: operationId: DeleteAuth summary: Customer Log out description: Destroys a Customer's authenticated session. x-authenticated: true + x-codegen: + method: deleteSession x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request DELETE 'https://medusa-url.com/store/auth' - \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/store/auth' \ --header 'Cookie: connect.sid={sid}' security: - cookie_auth: [] @@ -240,19 +175,16 @@ paths: summary: Get Current Customer description: Gets the currently logged in Customer. x-authenticated: true + x-codegen: + method: getSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.auth.getSession() - .then(({ customer }) => { console.log(customer.id); }); @@ -284,7 +216,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/auth/{email}': + /auth/{email}: get: operationId: GetAuthEmail summary: Check if email exists @@ -297,22 +229,19 @@ paths: format: email required: true description: The email to check if exists. + x-codegen: + method: exists x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.auth.exists('user@example.com') - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/auth/user@example.com' \ - + source: | + curl --location --request GET 'https://medusa-url.com/store/auth/user@example.com' \ --header 'Cookie: connect.sid={sid}' tags: - Auth @@ -333,7 +262,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/shipping-methods': + /carts/{id}/shipping-methods: post: operationId: PostCartsCartShippingMethod description: Adds a Shipping Method to the Cart. @@ -345,30 +274,30 @@ paths: description: The cart ID. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartShippingMethodReq' + x-codegen: + method: addShippingMethod x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.addShippingMethod(cart_id, { option_id }) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/shipping-methods' \ --header 'Content-Type: application/json' \ - --data-raw '{ "option_id": "{option_id}", }' @@ -391,31 +320,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. - '/carts/{id}/taxes': + /carts/{id}/taxes: post: summary: Calculate Cart Taxes operationId: PostCartsCartTaxes - description: >- - Calculates taxes for a cart. Depending on the cart's region this may - involve making 3rd party API calls to a Tax Provider service. + description: Calculates taxes for a cart. Depending on the cart's region this may involve making 3rd party API calls to a Tax Provider service. parameters: - in: path name: id @@ -423,12 +332,13 @@ paths: description: The Cart ID. schema: type: string + x-codegen: + method: calculateTaxes x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/taxes' + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/taxes' tags: - Cart responses: @@ -448,17 +358,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/complete': + /carts/{id}/complete: post: summary: Complete a Cart operationId: PostCartsCartComplete - description: >- - Completes a cart. The following steps will be performed. Payment - authorization is attempted and if more work is required, we simply - return the cart for further updates. If payment is authorized and order - is not yet created, we make sure to do so. The completion of a cart can - be performed idempotently with a provided header `Idempotency-Key`. If - not provided, we will generate one for the request. + description: Completes a cart. The following steps will be performed. Payment authorization is attempted and if more work is required, we simply return the cart for further updates. If payment is authorized and order is not yet created, we make sure to do so. The completion of a cart can be performed idempotently with a provided header `Idempotency-Key`. If not provided, we will generate one for the request. parameters: - in: path name: id @@ -466,34 +370,27 @@ paths: description: The Cart id. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.complete(cart_id) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/complete' + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/complete' tags: - Cart responses: '200': - description: >- - If a cart was successfully authorized, but requires further action - from the user the response body will contain the cart with an - updated payment session. If the Cart was successfully completed the - response body will contain the newly created Order. + description: If a cart was successfully authorized, but requires further action from the user the response body will contain the cart with an updated payment session. If the Cart was successfully completed the response body will contain the newly created Order. content: application/json: schema: @@ -512,28 +409,21 @@ paths: post: summary: Create a Cart operationId: PostCart - description: >- - Creates a Cart within the given region and with the initial items. If no - `region_id` is provided the cart will be associated with the first - Region available. If no items are provided the cart will be empty after - creation. If a user is logged in the cart's customer id and email will - be set. + description: Creates a Cart within the given region and with the initial items. If no `region_id` is provided the cart will be associated with the first Region available. If no items are provided the cart will be empty after creation. If a user is logged in the cart's customer id and email will be set. requestBody: content: application/json: schema: $ref: '#/components/schemas/StorePostCartReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.create() - .then(({ cart }) => { console.log(cart.id); }); @@ -560,13 +450,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions': + /carts/{id}/payment-sessions: post: operationId: PostCartsCartPaymentSessions summary: Create Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. + description: Creates Payment Sessions for each of the available Payment Providers in the Cart's Region. parameters: - in: path name: id @@ -574,25 +462,22 @@ paths: description: The id of the Cart. schema: type: string + x-codegen: + method: createPaymentSessions x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.createPaymentSessions(cart_id) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' tags: - Cart responses: @@ -612,7 +497,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/discounts/{code}': + /carts/{id}/discounts/{code}: delete: operationId: DeleteCartsCartDiscountsDiscount description: Removes a Discount from a Cart. @@ -630,25 +515,22 @@ paths: description: The unique Discount code. schema: type: string + x-codegen: + method: deleteDiscount x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.deleteDiscount(cart_id, code) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/discounts/{code}' + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/discounts/{code}' tags: - Cart responses: @@ -668,7 +550,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items/{line_id}': + /carts/{id}/line-items/{line_id}: delete: operationId: DeleteCartsCartLineItemsItem summary: Delete a Line Item @@ -686,25 +568,22 @@ paths: description: The id of the Line Item. schema: type: string + x-codegen: + method: deleteLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.lineItems.delete(cart_id, line_id) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' tags: - Cart responses: @@ -741,30 +620,30 @@ paths: description: The id of the Line Item. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsItemReq' + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.lineItems.update(cart_id, line_id, { quantity: 1 }) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items/{line_id}' \ --header 'Content-Type: application/json' \ - --data-raw '{ "quantity": 1 }' @@ -787,24 +666,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': + /carts/{id}/payment-sessions/{provider_id}: delete: operationId: DeleteCartsCartPaymentSessionsSession summary: Delete a Payment Session - description: >- - Deletes a Payment Session on a Cart. May be useful if a payment has - failed. + description: Deletes a Payment Session on a Cart. May be useful if a payment has failed. parameters: - in: path name: id @@ -815,30 +681,25 @@ paths: - in: path name: provider_id required: true - description: >- - The id of the Payment Provider used to create the Payment Session to - be deleted. + description: The id of the Payment Provider used to create the Payment Session to be deleted. schema: type: string + x-codegen: + method: deletePaymentSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.deletePaymentSession(cart_id, 'manual') - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' + source: | + curl --location --request DELETE 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' tags: - Cart responses: @@ -875,31 +736,31 @@ paths: description: The id of the payment provider. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionUpdateReq' + x-codegen: + method: updatePaymentSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.updatePaymentSession(cart_id, 'manual', { data: { } }) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual' \ --header 'Content-Type: application/json' \ - --data-raw '{ "data": {} }' @@ -922,18 +783,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. - '/carts/{id}': + /carts/{id}: get: operationId: GetCartsCart summary: Get a Cart @@ -945,25 +795,22 @@ paths: description: The id of the Cart. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.retrieve(cart_id) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/carts/{id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/carts/{id}' tags: - Cart responses: @@ -999,30 +846,25 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCartsCartReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.update(cart_id, { email: 'user@example.com' }) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}' \ --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com" }' @@ -1045,13 +887,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-sessions/{provider_id}/refresh': + /carts/{id}/payment-sessions/{provider_id}/refresh: post: operationId: PostCartsCartPaymentSessionsSession summary: Refresh a Payment Session - description: >- - Refreshes a Payment Session to ensure that it is in sync with the Cart - - this is usually not necessary. + description: Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary. parameters: - in: path name: id @@ -1062,30 +902,25 @@ paths: - in: path name: provider_id required: true - description: >- - The id of the Payment Provider that created the Payment Session to - be refreshed. + description: The id of the Payment Provider that created the Payment Session to be refreshed. schema: type: string + x-codegen: + method: refreshPaymentSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.refreshPaymentSession(cart_id, 'manual') - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions/manual/refresh' tags: - Cart responses: @@ -1105,13 +940,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/payment-session': + /carts/{id}/payment-session: post: operationId: PostCartsCartPaymentSession summary: Select a Payment Session - description: >- - Selects a Payment Session as the session intended to be used towards the - completion of the Cart. + description: Selects a Payment Session as the session intended to be used towards the completion of the Cart. parameters: - in: path name: id @@ -1119,30 +952,30 @@ paths: description: The ID of the Cart. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartPaymentSessionReq' + x-codegen: + method: setPaymentSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.setPaymentSession(cart_id, { provider_id: 'manual' }) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/payment-sessions' \ --header 'Content-Type: application/json' \ - --data-raw '{ "provider_id": "manual" }' @@ -1165,18 +998,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. - '/collections/{id}': + /collections/{id}: get: operationId: GetCollectionsCollection summary: Get a Collection @@ -1188,25 +1010,22 @@ paths: description: The id of the Product Collection schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' + source: | + curl --location --request GET 'https://medusa-url.com/store/collections/{id}' tags: - Collection responses: @@ -1234,9 +1053,7 @@ paths: parameters: - in: query name: offset - description: >- - The number of collections to skip before starting to collect the - collections set + description: The number of collections to skip before starting to collect the collections set schema: type: integer default: 0 @@ -1290,25 +1107,23 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' + source: | + curl --location --request GET 'https://medusa-url.com/store/collections' tags: - Collection responses: @@ -1339,17 +1154,15 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerAddressesReq' + x-codegen: + method: addAddress x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.customers.addresses.addAddress({ address: { first_name: 'Celia', @@ -1365,20 +1178,15 @@ paths: metadata: {} } }) - .then(({ customer }) => { console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/me/addresses' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses' \ --header 'Cookie: connect.sid={sid}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "address": { "first_name": "Celia", @@ -1422,33 +1230,28 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.customers.create({ first_name: 'Alec', last_name: 'Reynolds', email: 'user@example.com', password: 'supersecret' }) - .then(({ customer }) => { console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/customers' \ --header 'Content-Type: application/json' \ - --data-raw '{ "first_name": "Alec", "last_name": "Reynolds", @@ -1489,12 +1292,10 @@ paths: example: code: invalid_request_error type: duplicate_error - message: >- - A customer with the given email already has an account. Log in - instead + message: A customer with the given email already has an account. Log in instead '500': $ref: '#/components/responses/500_error' - '/customers/me/addresses/{address_id}': + /customers/me/addresses/{address_id}: delete: operationId: DeleteCustomersCustomerAddressesAddress summary: Delete an Address @@ -1507,28 +1308,23 @@ paths: description: The id of the Address to remove. schema: type: string + x-codegen: + method: deleteAddress x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.customers.addresses.deleteAddress(address_id) - .then(({ customer }) => { console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request DELETE - 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - + source: | + curl --location --request DELETE 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ --header 'Cookie: connect.sid={sid}' security: - cookie_auth: [] @@ -1569,36 +1365,28 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/StorePostCustomersCustomerAddressesAddressReq + $ref: '#/components/schemas/StorePostCustomersCustomerAddressesAddressReq' + x-codegen: + method: updateAddress x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.customers.addresses.updateAddress(address_id, { first_name: 'Gina' }) - .then(({ customer }) => { console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me/addresses/{address_id}' \ --header 'Cookie: connect.sid={sid}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "first_name": "Gina" }' @@ -1629,32 +1417,25 @@ paths: get: operationId: GetCustomersCustomer summary: Get a Customer - description: >- - Retrieves a Customer - the Customer must be logged in to retrieve their - details. + description: Retrieves a Customer - the Customer must be logged in to retrieve their details. x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.customers.retrieve() - .then(({ customer }) => { console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/customers/me' \ - + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me' \ --header 'Cookie: connect.sid={sid}' security: - cookie_auth: [] @@ -1689,34 +1470,27 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerReq' + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.customers.update({ first_name: 'Laury' }) - .then(({ customer }) => { console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/me' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/me' \ --header 'Cookie: connect.sid={sid}' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "first_name": "Laury" }' @@ -1747,33 +1521,25 @@ paths: get: operationId: GetCustomersCustomerPaymentMethods summary: Get Payment Methods - description: >- - Retrieves a list of a Customer's saved payment methods. Payment methods - are saved with Payment Providers and it is their responsibility to fetch - saved methods. + description: Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods. x-authenticated: true + x-codegen: + method: listPaymentMethods x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.customers.paymentMethods.list() - .then(({ payment_methods }) => { console.log(payment_methods.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/customers/me/payment-methods' \ - + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me/payment-methods' \ --header 'Cookie: connect.sid={sid}' security: - cookie_auth: [] @@ -1870,7 +1636,7 @@ paths: schema: type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. - in: query name: tax_rate @@ -1957,40 +1723,32 @@ paths: default: 0 - in: query name: fields - description: >- - (Comma separated string) Which fields should be included in the - resulting orders. + description: (Comma separated string) Which fields should be included in the resulting orders. schema: type: string - in: query name: expand - description: >- - (Comma separated string) Which relations should be expanded in the - resulting orders. + description: (Comma separated string) Which relations should be expanded in the resulting orders. schema: type: string + x-codegen: + method: listOrders + queryParams: StoreGetCustomersCustomerOrdersParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged - medusa.customers.listOrders() - .then(({ orders, limit, offset, count }) => { console.log(orders); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/customers/me/orders' \ - + source: | + curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \ --header 'Cookie: connect.sid={sid}' security: - cookie_auth: [] @@ -2019,43 +1777,34 @@ paths: post: operationId: PostCustomersCustomerPasswordToken summary: Request Password Reset - description: >- - Creates a reset password token to be used in a subsequent - /reset-password request. The password token should be sent out of band - e.g. via email and will not be returned. + description: Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned. requestBody: content: application/json: schema: $ref: '#/components/schemas/StorePostCustomersCustomerPasswordTokenReq' + x-codegen: + method: generatePasswordToken x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.customers.generatePasswordToken({ email: 'user@example.com' }) - .then(() => { // successful }) - .catch(() => { // failed }) - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/password-token' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/password-token' \ --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com" }' @@ -2080,40 +1829,33 @@ paths: post: operationId: PostCustomersResetPassword summary: Reset Password - description: >- - Resets a Customer's password using a password token created by a - previous /password-token request. + description: Resets a Customer's password using a password token created by a previous /password-token request. requestBody: content: application/json: schema: $ref: '#/components/schemas/StorePostCustomersResetPasswordReq' + x-codegen: + method: resetPassword x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.customers.resetPassword({ email: 'user@example.com', password: 'supersecret', token: 'supersecrettoken' }) - .then(({ customer }) => { console.log(customer.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/customers/password-reset' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/customers/password-reset' \ --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com", "password": "supersecret", @@ -2140,11 +1882,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/gift-cards/{code}': + /gift-cards/{code}: get: operationId: GetGiftCardsCode summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. + description: Retrieves a Gift Card by its associated unique code. parameters: - in: path name: code @@ -2152,25 +1894,22 @@ paths: description: The unique Gift Card code. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' + source: | + curl --location --request GET 'https://medusa-url.com/store/gift-cards/{code}' tags: - Gift Card responses: @@ -2190,7 +1929,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/complete': + /order-edits/{id}/complete: post: operationId: PostOrderEditsOrderEditComplete summary: Completes an OrderEdit @@ -2202,24 +1941,22 @@ paths: description: The ID of the Order Edit. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' + source: | + curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/complete' tags: - OrderEdit responses: @@ -2237,7 +1974,7 @@ paths: $ref: '#/components/responses/not_found_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}/decline': + /order-edits/{id}/decline: post: operationId: PostOrderEditsOrderEditDecline summary: Decline an OrderEdit @@ -2254,24 +1991,22 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostOrderEditsOrderEditDecline' + x-codegen: + method: decline x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' + source: | + curl --location --request POST 'https://medusa-url.com/store/order-edits/{id}/decline' tags: - OrderEdit responses: @@ -2289,7 +2024,7 @@ paths: $ref: '#/components/responses/not_found_error' '500': $ref: '#/components/responses/500_error' - '/order-edits/{id}': + /order-edits/{id}: get: operationId: GetOrderEditsOrderEdit summary: Retrieve an OrderEdit @@ -2301,25 +2036,22 @@ paths: description: The ID of the OrderEdit. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' + source: | + curl --location --request GET 'https://medusa-url.com/store/order-edits/{id}' tags: - OrderEdit responses: @@ -2345,44 +2077,35 @@ paths: post: operationId: PostOrdersCustomerOrderClaimsCustomerOrderClaimAccept summary: Verify an Order Claim - description: >- - Verifies the claim order token provided to the customer upon request of - order ownership + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/orders/customer/confirm' \ --header 'Content-Type: application/json' \ - --data-raw '{ "token": "{token}", }' @@ -2406,13 +2129,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/cart/{cart_id}': + /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. + description: Retrieves an Order by the id of the Cart that was used to create the Order. parameters: - in: path name: cart_id @@ -2420,25 +2141,22 @@ paths: description: The ID of Cart. schema: type: string + x-codegen: + method: retrieveByCartId x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' + source: | + curl --location --request GET 'https://medusa-url.com/store/orders/cart/{id}' tags: - Order responses: @@ -2458,7 +2176,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/orders/{id}': + /orders/{id}: get: operationId: GetOrdersOrder summary: Get an Order @@ -2470,25 +2188,32 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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}' + source: | + curl --location --request GET 'https://medusa-url.com/store/orders/{id}' tags: - Order responses: @@ -2520,6 +2245,16 @@ paths: 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 @@ -2540,28 +2275,26 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' + source: | + curl --location --request GET 'https://medusa-url.com/store/orders?display_id=1&email=user@example.com' tags: - Order responses: @@ -2585,44 +2318,35 @@ paths: post: operationId: PostOrdersCustomerOrderClaim summary: Claim an Order - description: >- - Sends an email to emails registered to orders provided with link to - transfer order ownership + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/batch/customer/token' \ --header 'Content-Type: application/json' \ - --data-raw '{ "display_ids": ["id"], }' @@ -2646,7 +2370,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/batch/authorize': + /payment-collections/{id}/sessions/batch/authorize: post: operationId: PostPaymentCollectionsSessionsBatchAuthorize summary: Authorize PaymentSessions @@ -2663,29 +2387,24 @@ paths: content: application/json: schema: - $ref: >- - #/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq + $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq' + x-codegen: + method: authorizePaymentSessionsBatch x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.paymentCollections.authorize(payment_id) - .then(({ payment_collection }) => { console.log(payment_collection.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch/authorize' security: - api_token: [] - cookie_auth: [] @@ -2710,7 +2429,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/{session_id}/authorize': + /payment-collections/{id}/sessions/{session_id}/authorize: post: operationId: PostPaymentCollectionsSessionsSessionAuthorize summary: Authorize Payment Session @@ -2729,27 +2448,23 @@ paths: description: The ID of the Payment Session. schema: type: string + x-codegen: + method: authorizePaymentSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.paymentCollections.authorize(payment_id, session_id) - .then(({ payment_collection }) => { console.log(payment_collection.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}/authorize' security: - api_token: [] - cookie_auth: [] @@ -2774,7 +2489,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}': + /payment-collections/{id}: get: operationId: GetPaymentCollectionsPaymentCollection summary: Get a PaymentCollection @@ -2797,26 +2512,24 @@ paths: 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.paymentCollections.retrieve(paymentCollectionId) .then(({ payment_collection }) => { console.log(payment_collection.id) }) - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/payment-collections/{id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/payment-collections/{id}' security: - api_token: [] - cookie_auth: [] @@ -2841,7 +2554,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/batch': + /payment-collections/{id}/sessions/batch: post: operationId: PostPaymentCollectionsPaymentCollectionSessionsBatch summary: Manage Payment Sessions @@ -2859,21 +2572,17 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostPaymentCollectionsBatchSessionsReq' + x-codegen: + method: managePaymentSessionsBatch x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - // Total amount = 10000 - // Adding two new sessions - medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ { provider_id: "stripe", @@ -2884,13 +2593,10 @@ paths: amount: 5000, }, ]) - .then(({ payment_collection }) => { console.log(payment_collection.id); }); - // Updating one session and removing the other - medusa.paymentCollections.managePaymentSessionsBatch(payment_id, [ { provider_id: "stripe", @@ -2898,15 +2604,13 @@ paths: session_id: "ps_123456" }, ]) - .then(({ payment_collection }) => { console.log(payment_collection.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/batch' security: - api_token: [] - cookie_auth: [] @@ -2931,7 +2635,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions': + /payment-collections/{id}/sessions: post: operationId: PostPaymentCollectionsSessions summary: Manage a Payment Session @@ -2949,32 +2653,25 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePaymentCollectionSessionsReq' + x-codegen: + method: managePaymentSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - // Total amount = 10000 - // Adding a payment session - - medusa.paymentCollections.managePaymentSession(payment_id, { - provider_id: "stripe" }) - + medusa.paymentCollections.managePaymentSession(payment_id, { provider_id: "stripe" }) .then(({ payment_collection }) => { console.log(payment_collection.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions' + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions' security: - api_token: [] - cookie_auth: [] @@ -2999,13 +2696,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/payment-collections/{id}/sessions/{session_id}': + /payment-collections/{id}/sessions/{session_id}: post: operationId: PostPaymentCollectionsPaymentCollectionPaymentSessionsSession summary: Refresh a Payment Session - description: >- - Refreshes a Payment Session to ensure that it is in sync with the - Payment Collection. + description: Refreshes a Payment Session to ensure that it is in sync with the Payment Collection. x-authenticated: false parameters: - in: path @@ -3020,26 +2715,22 @@ paths: description: The id of the Payment Session to be refreshed. schema: type: string + x-codegen: + method: refreshPaymentSession x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - - medusa.paymentCollections.refreshPaymentSession(payment_collection_id, - session_id) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) + medusa.paymentCollections.refreshPaymentSession(payment_collection_id, session_id) .then(({ payment_session }) => { console.log(payment_session.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' + source: | + curl --location --request POST 'https://medusa-url.com/store/payment-collections/{id}/sessions/{session_id}' tags: - PaymentCollection responses: @@ -3059,7 +2750,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/product-categories/{id}': + /product-categories/{id}: get: operationId: GetProductCategoriesCategory summary: Get a Product Category @@ -3074,40 +2765,32 @@ paths: type: string - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each product - category. + 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. + 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: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - - medusa.productCategories.retrieve("pcat-id") - - .then(({ productCategory }) => { - console.log(productCategory.id); - }); + 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}' \ - + source: | + curl --location --request GET 'https://medusa-url.com/store/product-categories/{id}' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3120,7 +2803,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/StoreGetProductCategoryRes' + $ref: '#/components/schemas/StoreGetProductCategoriesCategoryRes' '400': $ref: '#/components/responses/400_error' '401': @@ -3162,13 +2845,23 @@ paths: 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' \ - + source: | + curl --location --request GET 'https://medusa-url.com/store/product-categories' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3181,21 +2874,7 @@ paths: content: application/json: schema: - 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 + $ref: '#/components/schemas/StoreProductCategoriesListRes' '400': $ref: '#/components/responses/400_error' '401': @@ -3307,22 +2986,17 @@ paths: x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + 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' + source: | + curl --location --request GET 'https://medusa-url.com/store/product-tags' tags: - Product Tag responses: @@ -3452,28 +3126,24 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: StoreGetProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token - medusa.productTypes.list() - .then(({ product_types }) => { console.log(product_types.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/product-types' \ - + source: | + curl --location --request GET 'https://medusa-url.com/store/product-types' \ --header 'Authorization: Bearer {api_token}' security: - api_token: [] @@ -3499,7 +3169,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/products/{id}': + /products/{id}: get: operationId: GetProductsProduct summary: Get a Product @@ -3511,6 +3181,11 @@ paths: description: The id of the Product. schema: type: string + - in: query + name: sales_channel_id + description: The sales channel used when fetching the product. + schema: + type: string - in: query name: cart_id description: The ID of the customer's cart. @@ -3518,42 +3193,46 @@ paths: type: string - in: query name: region_id - description: >- - The ID of the region the customer is using. This is helpful to - ensure correct prices are retrieved for a region. + description: The ID of the region the customer is using. This is helpful to ensure correct prices are retrieved for a region. + schema: + type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: (Comma separated) Which fields should be expanded in each product of the result. schema: type: string - in: query name: currency_code style: form explode: false - description: >- - The 3 character ISO currency code to set prices based on. This is - helpful to ensure correct prices are retrieved for a currency. + description: The 3 character ISO currency code to set prices based on. This is helpful to ensure correct prices are retrieved for a currency. schema: type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetProductsProductParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.products.retrieve(product_id) - .then(({ product }) => { console.log(product.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/products/{id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/products/{id}' tags: - Product responses: @@ -3581,9 +3260,7 @@ paths: parameters: - in: query name: q - description: >- - Query used for searching products by title, description, variant's - title, variant's sku, and collection's title + description: Query used for searching products by title, description, variant's title, variant's sku, and collection's title schema: type: string - in: query @@ -3697,6 +3374,20 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + - in: query + name: category_id + style: form + explode: false + description: Category ids to filter by. + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id. + schema: + type: boolean - in: query name: offset description: How many products to skip in the result. @@ -3711,16 +3402,12 @@ paths: default: 100 - in: query name: expand - description: >- - (Comma separated) Which fields should be expanded in each order of - the result. + description: (Comma separated) Which fields should be expanded in each product of the result. schema: type: string - in: query name: fields - description: >- - (Comma separated) Which fields should be included in each order of - the result. + description: (Comma separated) Which fields should be included in each product of the result. schema: type: string - in: query @@ -3728,25 +3415,38 @@ paths: description: the field used to order the products. schema: type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetProductsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.products.list() - .then(({ products, limit, offset, count }) => { console.log(products.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/products' + source: | + curl --location --request GET 'https://medusa-url.com/store/products' tags: - Product responses: @@ -3770,9 +3470,7 @@ paths: post: operationId: PostProductsSearch summary: Search Products - description: >- - Run a search query on products using the search engine installed on - Medusa + description: Run a search query on products using the search engine installed on Medusa parameters: - in: query name: q @@ -3790,27 +3488,25 @@ paths: description: Limit the number of products returned. schema: type: integer + x-codegen: + method: search + queryParams: StorePostSearchReq x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.products.search({ q: 'Shirt' }) - .then(({ hits }) => { console.log(hits.length); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/products/search?q=Shirt' + source: | + curl --location --request POST 'https://medusa-url.com/store/products/search?q=Shirt' tags: - Product responses: @@ -3830,7 +3526,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/regions/{id}': + /regions/{id}: get: operationId: GetRegionsRegion summary: Get a Region @@ -3842,25 +3538,22 @@ paths: description: The id of the Region. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.regions.retrieve(region_id) - .then(({ region }) => { console.log(region.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/regions/{id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/regions/{id}' tags: - Region responses: @@ -3942,17 +3635,16 @@ paths: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: StoreGetRegionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.regions.list() - .then(({ regions }) => { console.log(regions.length); }); @@ -3979,7 +3671,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/return-reasons/{id}': + /return-reasons/{id}: get: operationId: GetReturnReasonsReason summary: Get a Return Reason @@ -3991,25 +3683,22 @@ paths: description: The id of the Return Reason. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.returnReasons.retrieve(reason_id) - .then(({ return_reason }) => { console.log(return_reason.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/return-reasons/{id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/return-reasons/{id}' tags: - Return Reason responses: @@ -4034,25 +3723,22 @@ paths: operationId: GetReturnReasons summary: List Return Reasons description: Retrieves a list of Return Reasons. + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.returnReasons.list() - .then(({ return_reasons }) => { console.log(return_reasons.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/return-reasons' + source: | + curl --location --request GET 'https://medusa-url.com/store/return-reasons' tags: - Return Reason responses: @@ -4082,15 +3768,14 @@ paths: application/json: schema: $ref: '#/components/schemas/StorePostReturnsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.returns.create({ order_id, items: [ @@ -4100,18 +3785,14 @@ paths: } ] }) - .then((data) => { console.log(data.return.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/returns' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/returns' \ --header 'Content-Type: application/json' \ - --data-raw '{ "order_id": "asfasf", "items": [ @@ -4148,9 +3829,7 @@ paths: parameters: - in: query name: is_return - description: >- - Whether return Shipping Options should be included. By default all - Shipping Options are returned. + description: Whether return Shipping Options should be included. By default all Shipping Options are returned. schema: type: boolean - in: query @@ -4163,25 +3842,23 @@ paths: description: the Region to retrieve Shipping Options from. schema: type: string + x-codegen: + method: list + queryParams: StoreGetShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.shippingOptions.list() - .then(({ shipping_options }) => { console.log(shipping_options.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/shipping-options' + source: | + curl --location --request GET 'https://medusa-url.com/store/shipping-options' tags: - Shipping Option responses: @@ -4201,7 +3878,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/shipping-options/{cart_id}': + /shipping-options/{cart_id}: get: operationId: GetShippingOptionsCartId summary: List for Cart @@ -4213,25 +3890,22 @@ paths: description: The id of the Cart. schema: type: string + x-codegen: + method: listCartOptions x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.shippingOptions.listCartOptions(cart_id) - .then(({ shipping_options }) => { console.log(shipping_options.length); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/shipping-options/{cart_id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/shipping-options/{cart_id}' tags: - Shipping Option responses: @@ -4255,23 +3929,20 @@ paths: post: operationId: PostSwaps summary: Create a Swap - description: >- - Creates a Swap on an Order by providing some items to return along with - some items to send back + description: Creates a Swap on an Order by providing some items to return along with some items to send back requestBody: content: application/json: schema: $ref: '#/components/schemas/StorePostSwapsReq' + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.swaps.create({ order_id, return_items: [ @@ -4287,18 +3958,14 @@ paths: } ] }) - .then(({ swap }) => { console.log(swap.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST 'https://medusa-url.com/store/swaps' - \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/swaps' \ --header 'Content-Type: application/json' \ - --data-raw '{ "order_id": "asfasf", "return_items": [ @@ -4333,7 +4000,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/swaps/{cart_id}': + /swaps/{cart_id}: get: operationId: GetSwapsSwapCartId summary: Get by Cart ID @@ -4345,25 +4012,22 @@ paths: description: The id of the Cart schema: type: string + x-codegen: + method: retrieveByCartId x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.swaps.retrieveByCartId(cart_id) - .then(({ swap }) => { console.log(swap.id); }); - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/swaps/{cart_id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/swaps/{cart_id}' tags: - Swap responses: @@ -4383,7 +4047,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/variants/{variant_id}': + /variants/{variant_id}: get: operationId: GetVariantsVariant summary: Get a Product Variant @@ -4400,6 +4064,11 @@ paths: description: The id of the Cart to set prices based on. schema: type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string - in: query name: region_id description: The id of the Region to set prices based on. @@ -4413,14 +4082,16 @@ paths: schema: type: string externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetVariantsVariantParams x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/variants/{id}' + source: | + curl --location --request GET 'https://medusa-url.com/store/variants/{id}' tags: - Product Variant responses: @@ -4451,6 +4122,11 @@ paths: description: A comma separated list of Product Variant ids to filter by. schema: type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string - in: query name: expand description: A comma separated list of Product Variant relations to load. @@ -4468,6 +4144,21 @@ paths: schema: type: number default: '100' + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string - in: query name: title style: form @@ -4499,20 +4190,18 @@ paths: description: filter by inventory quantity greater than this number lte: type: number - description: >- - filter by inventory quantity less than or equal to this - number + description: filter by inventory quantity less than or equal to this number gte: type: number - description: >- - filter by inventory quantity greater than or equal to this - number + description: filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: StoreGetVariantsParams x-codeSamples: - lang: Shell label: cURL - source: > - curl --location --request GET - 'https://medusa-url.com/store/variants' + source: | + curl --location --request GET 'https://medusa-url.com/store/variants' tags: - Product Variant responses: @@ -4532,13 +4221,11 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - '/carts/{id}/line-items': + /carts/{id}/line-items: post: operationId: PostCartsCartLineItems summary: Add a Line Item - description: >- - Generates a Line Item with a given Product Variant and adds it to the - Cart + description: Generates a Line Item with a given Product Variant and adds it to the Cart parameters: - in: path name: id @@ -4546,31 +4233,31 @@ paths: description: The id of the Cart to add the Line Item to. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StorePostCartsCartLineItemsReq' + x-codegen: + method: createLineItem x-codeSamples: - lang: JavaScript label: JS Client - source: > + source: | import Medusa from "@medusajs/medusa-js" - - const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: - 3 }) - + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) medusa.carts.lineItems.create(cart_id, { variant_id, quantity: 1 }) - .then(({ cart }) => { console.log(cart.id); }); - lang: Shell label: cURL - source: > - curl --location --request POST - 'https://medusa-url.com/store/carts/{id}/line-items' \ - + source: | + curl --location --request POST 'https://medusa-url.com/store/carts/{id}/line-items' \ --header 'Content-Type: application/json' \ - --data-raw '{ "variant_id": "{variant_id}", "quantity": 1 @@ -4594,28 +4281,6 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: >- - The id of the Product Variant to generate the Line Item - from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the - Line Item. components: responses: default_error: @@ -4636,9 +4301,7 @@ components: $ref: '#/components/schemas/Error' example: code: unknown_error - message: >- - The request conflicted with another request. You may retry the - request with the provided Idempotency-Key. + message: The request conflicted with another request. You may retry the request with the provided Idempotency-Key. type: QueryRunnerAlreadyReleasedError invalid_request_error: description: Invalid Request Error @@ -4719,9 +4382,7 @@ components: multiple_errors: summary: Multiple Errors value: - message: >- - Provided request body contains errors. Please check the data and retry - the request + message: Provided request body contains errors. Please check the data and retry the request errors: - message: first_name must be a string type: invalid_data @@ -4755,66 +4416,39 @@ components: x-displayName: Cookie Session ID in: cookie name: connect.sid - description: > + description: | Use a cookie session to send authenticated requests. - ### How to Obtain the Cookie Session + If you're sending requests through a browser, using JS Client, or using tools like Postman, the cookie session should be automatically set when the customer is logged in. - If you're sending requests through a browser, using JS Client, or using - tools like Postman, the cookie session should be automatically set when - the customer is logged in. - - - If you're sending requests using cURL, you must set the Session ID in - the cookie manually. - - - To do that, send a request to [authenticate the - customer](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: + If you're sending requests using cURL, you must set the Session ID in the cookie manually. + To do that, send a request to [authenticate the customer](#tag/Auth/operation/PostAuth) and pass the cURL option `-v`: ```bash - curl -v --location --request POST 'https://medusa-url.com/store/auth' \ - --header 'Content-Type: application/json' \ - --data-raw '{ "email": "user@example.com", "password": "supersecret" }' - ``` - - The headers will be logged in the terminal as well as the response. You - should find in the headers a Cookie header similar to this: - + The headers will be logged in the terminal as well as the response. You should find in the headers a Cookie header similar to this: ```bash - - Set-Cookie: - connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; - + Set-Cookie: connect.sid=s%3A2Bu8BkaP9JUfHu9rG59G16Ma0QZf6Gj1.WT549XqX37PN8n0OecqnMCq798eLjZC5IT7yiDCBHPM; ``` - - Copy the value after `connect.sid` (without the `;` at the end) and pass - it as a cookie in subsequent requests as the following: - + Copy the value after `connect.sid` (without the `;` at the end) and pass it as a cookie in subsequent requests as the following: ```bash - - curl --location --request GET - 'https://medusa-url.com/store/customers/me/orders' \ - + curl --location --request GET 'https://medusa-url.com/store/customers/me/orders' \ --header 'Cookie: connect.sid={sid}' - ``` - Where `{sid}` is the value of `connect.sid` that you copied. schemas: AddressFields: @@ -4850,8 +4484,7 @@ components: type: string description: The 2 character ISO code of the country in lower case externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. example: st province: @@ -4875,67 +4508,93 @@ components: title: Address description: An address. type: object + required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at properties: id: type: string description: ID of the address example: addr_01G8ZC9VS1XVE149MGH2J7QSSH customer_id: - type: string description: ID of the customer this address belongs to + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: Available if the relation `customer` is expanded. - type: array - items: - type: object - description: A customer object. + nullable: true + type: object company: - type: string description: Company name + nullable: true + type: string example: Acme first_name: - type: string description: First name + nullable: true + type: string example: Arno last_name: - type: string description: Last name + nullable: true + type: string example: Willms address_1: - type: string description: Address line 1 + nullable: true + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + nullable: true + type: string example: Suite 369 city: - type: string description: City + nullable: true + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + nullable: true + type: string externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. example: st country: description: A country object. Available if the relation `country` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Country' province: - type: string description: Province + nullable: true + type: string example: Kentucky postal_code: - type: string description: Postal Code + nullable: true + type: string example: 72093 phone: - type: string description: Phone Number + nullable: true + type: string example: 16128234334802 created_at: type: string @@ -4946,12 +4605,14 @@ components: description: The date with timezone at which the resource was updated. format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white BatchJob: @@ -4959,21 +4620,36 @@ components: description: A Batch Job. type: object required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status - type + - updated_at properties: id: - type: string description: The unique identifier for the batch job. + type: string example: batch_01G8T782965PYFG0751G0Z38B4 type: - type: string description: The type of batch job. + type: string enum: - product-import - product-export status: - type: string description: The status of the batch job. + type: string enum: - created - pre_processed @@ -4984,19 +4660,18 @@ components: - failed default: created created_by: - type: string description: The unique identifier of the user that created the batch job. + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: - description: >- - A user object. Available if the relation `created_by_user` is - expanded. - type: object + description: A user object. Available if the relation `created_by_user` is expanded. + nullable: true + $ref: '#/components/schemas/User' context: + description: The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true type: object - description: >- - The context of the batch job, the type of the batch job determines - what the context should contain. example: shape: prices: @@ -5014,43 +4689,47 @@ components: - variant.prices - images dry_run: - type: boolean description: Specify if the job must apply the modifications or not. + type: boolean default: false result: - type: object description: The result of the batch job. - properties: - count: - type: number - advancement_count: - type: number - progress: - type: number - errors: - type: object + nullable: true + allOf: + - type: object + example: {} + - type: object properties: - message: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: type: string - code: - oneOf: - - type: string - - type: number - err: - type: array - stat_descriptors: - type: object - properties: - key: - type: string - name: - type: string - message: - type: string - file_key: - type: string - file_size: - type: number + file_size: + type: number example: errors: - err: [] @@ -5061,67 +4740,97 @@ components: name: Product count to export message: There will be 8 products exported by this action pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true type: string - description: The date from which the job has been pre processed. format: date-time processing_at: - type: string description: The date the job is processing at. + nullable: true + type: string format: date-time confirmed_at: - type: string description: The date when the confirmation has been done. + nullable: true + type: string format: date-time completed_at: - type: string description: The date of the completion. + nullable: true + type: string format: date-time canceled_at: - type: string description: The date of the concellation. + nullable: true + type: string format: date-time failed_at: - type: string description: The date when the job failed. + nullable: true + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was last updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time Cart: title: Cart description: Represents a user cart type: object + required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The cart's ID + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 email: - type: string description: The email associated with the cart + nullable: true + type: string format: email billing_address_id: - type: string description: The billing address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_address_id: - type: string description: The shipping address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' items: description: Available if the relation `items` is expanded. @@ -5129,54 +4838,58 @@ components: items: $ref: '#/components/schemas/LineItem' region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' discounts: - type: array description: Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array - description: Available if the relation `gift_cards` is expanded. items: - type: object - description: A gift card object. + $ref: '#/components/schemas/Discount' + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: '#/components/schemas/GiftCard' customer_id: - type: string description: The customer's ID + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. + nullable: true type: object payment_session: description: The selected payment session in the cart. + nullable: true $ref: '#/components/schemas/PaymentSession' payment_sessions: - type: array description: The payment sessions created on the cart. + type: array items: $ref: '#/components/schemas/PaymentSession' payment_id: - type: string description: The payment's ID if available + nullable: true + type: string example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: '#/components/schemas/Payment' + nullable: true + type: object shipping_methods: - type: array description: The shipping methods added to the cart. + type: array items: $ref: '#/components/schemas/ShippingMethod' type: - type: string description: The cart's type. + type: string enum: - default - swap @@ -5185,93 +4898,100 @@ components: - claim default: default completed_at: - type: string description: The date with timezone at which the cart was completed. + nullable: true + type: string format: date-time payment_authorized_at: - type: string description: The date with timezone at which the payment was authorized. + nullable: true + type: string format: date-time idempotency_key: + description: Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true type: string - description: >- - Randomly generated key used to continue the completion of a cart in - case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. context: + description: The context of the cart which can include info like IP or user agent. + nullable: true type: object - description: >- - The context of the cart which can include info like IP or user - agent. example: ip: '::1' user_agent: PostmanRuntime/7.29.2 sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null sales_channel: - description: >- - A sales channel object. Available if the relation `sales_channel` is - expanded. - type: object + description: A sales channel object. Available if the relation `sales_channel` is expanded. + nullable: true + $ref: '#/components/schemas/SalesChannel' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white shipping_total: - type: integer description: The total of shipping + type: integer example: 1000 discount_total: - type: integer description: The total of discount - example: 800 - tax_total: type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: description: The total of tax + type: integer example: 0 refunded_total: + description: The total amount refunded if the order associated with this cart is returned. type: integer - description: >- - The total amount refunded if the order associated with this cart is - returned. example: 0 total: - type: integer description: The total amount of the cart + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the cart + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 ClaimImage: title: Claim Image @@ -5279,70 +4999,79 @@ components: type: object required: - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: - type: string description: The claim image's ID + type: string example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 claim_item_id: - type: string description: The ID of the claim item associated with the image - claim_item: - description: >- - A claim item object. Available if the relation `claim_item` is - expanded. - type: object - url: type: string + claim_item: + description: A claim item object. Available if the relation `claim_item` is expanded. + nullable: true + $ref: '#/components/schemas/ClaimItem' + url: description: The URL of the image + type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimItem: title: Claim Item - description: >- - Represents a claimed item along with information about the reasons for - the claim. + description: Represents a claimed item along with information about the reasons for the claim. type: object required: - claim_order_id + - created_at + - deleted_at + - id - item_id - - variant_id - - reason + - metadata + - note - quantity + - reason + - updated_at + - variant_id properties: id: - type: string description: The claim item's ID + type: string example: citm_01G8ZH853Y6TFXWPG5EYE81X63 images: - type: array description: Available if the relation `images` is expanded. + type: array items: $ref: '#/components/schemas/ClaimImage' claim_order_id: description: The ID of the claim this item is associated with. type: string claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object item_id: description: The ID of the line item that the claim item refers to. @@ -5350,6 +5079,7 @@ components: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. + nullable: true $ref: '#/components/schemas/LineItem' variant_id: description: The ID of the product variant that is claimed. @@ -5357,7 +5087,8 @@ components: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: A variant object. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/ProductVariant' reason: description: The reason for the claim type: string @@ -5367,68 +5098,78 @@ components: - production_failure - other note: - description: 'An optional note about the claim, for additional information' + description: An optional note about the claim, for additional information + nullable: true type: string example: I don't like it. quantity: - description: >- - The quantity of the item that is being claimed; must be less than or - equal to the amount purchased in the original order. + description: The quantity of the item that is being claimed; must be less than or equal to the amount purchased in the original order. type: integer example: 1 tags: - description: >- - User defined tags for easy filtering and grouping. Available if the - relation 'tags' is expanded. + description: User defined tags for easy filtering and grouping. Available if the relation 'tags' is expanded. type: array items: $ref: '#/components/schemas/ClaimTag' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white ClaimOrder: title: Claim Order - description: >- - Claim Orders represent a group of faulty or missing items. Each claim - order consists of a subset of items associated with an original order, - and can contain additional information about fulfillments and returns. + description: Claim Orders represent a group of faulty or missing items. Each claim order consists of a subset of items associated with an original order, and can contain additional information about fulfillments and returns. type: object required: - - type + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The claim's ID + type: string example: claim_01G8ZH853Y6TFXWPG5EYE81X63 type: + description: The claim's type type: string enum: - refund - replace payment_status: - type: string description: The status of the claim's payment + type: string enum: - na - not_refunded - refunded default: na fulfillment_status: + description: The claim's fulfillment status type: string enum: - not_fulfilled @@ -5447,9 +5188,7 @@ components: items: $ref: '#/components/schemas/ClaimItem' additional_items: - description: >- - Refers to the new items to be shipped when the claim order has the - type `replace` + description: Refers to the new items to be shipped when the claim order has the type `replace` type: array items: $ref: '#/components/schemas/LineItem' @@ -5459,18 +5198,20 @@ components: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object return_order: - description: >- - A return object. Holds information about the return if the claim is - to be returned. Available if the relation 'return_order' is expanded + description: A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true type: object shipping_address_id: description: The ID of the address that the new items should be shipped to + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_methods: description: The shipping methods that the claim order will be shipped with. @@ -5481,79 +5222,85 @@ components: description: The fulfillments of the new items to be shipped type: array items: - $ref: '#/components/schemas/Fulfillment' + type: object refund_amount: description: The amount that will be refunded in conjunction with the claim + nullable: true type: integer example: 1000 canceled_at: description: The date with timezone at which the claim was canceled. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. + description: Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true type: string - description: >- - Randomly generated key used to continue the completion of the cart - associated with the claim in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. ClaimTag: title: Claim Tag - description: >- - Claim Tags are user defined tags that can be assigned to claim items for - easy filtering and grouping. + description: Claim Tags are user defined tags that can be assigned to claim items for easy filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The claim tag's ID + type: string example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 value: description: The value that the claim tag holds type: string example: Damaged created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Country: @@ -5561,39 +5308,38 @@ components: description: Country details type: object required: + - display_name + - id - iso_2 - iso_3 - - num_code - name - - display_name + - num_code + - region_id properties: id: - type: string description: The country's ID + type: string example: 109 iso_2: - type: string description: The 2 character ISO code of the country in lower case + type: string example: it externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. iso_3: - type: string description: The 2 character ISO code of the country in lower case + type: string example: ita externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements description: See a list of codes. num_code: description: The numerical ISO code for the country. type: string example: 380 externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_numeric#Officially_assigned_code_elements description: See a list of codes. name: description: The normalized country name in upper case. @@ -5604,28 +5350,30 @@ components: type: string example: Italy region_id: - type: string description: The region ID this country is associated with. + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Region' Currency: title: Currency description: Currency type: object required: - code + - name - symbol - symbol_native - - name properties: code: description: The 3 character ISO code for the currency. type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. symbol: description: The symbol used to indicate the currency. @@ -5642,112 +5390,112 @@ components: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean + default: false CustomShippingOption: title: Custom Shipping Option - description: >- - Custom Shipping Options are 'overriden' Shipping Options. Store managers - can attach a Custom Shipping Option to a cart in order to set a custom - price for a particular Shipping Option + description: Custom Shipping Options are 'overriden' Shipping Options. Store managers can attach a Custom Shipping Option to a cart in order to set a custom price for a particular Shipping Option type: object required: + - cart_id + - created_at + - deleted_at + - id + - metadata - price - shipping_option_id + - updated_at properties: id: - type: string description: The custom shipping option's ID + type: string example: cso_01G8X99XNB77DMFBJFWX6DN9V9 price: - description: >- - The custom price set that will override the shipping option's - original price + description: The custom price set that will override the shipping option's original price type: integer example: 1000 shipping_option_id: - description: >- - The ID of the Shipping Option that the custom shipping option - overrides + description: The ID of the Shipping Option that the custom shipping option overrides type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: - description: >- - A shipping option object. Available if the relation - `shipping_option` is expanded. - type: object + description: A shipping option object. Available if the relation `shipping_option` is expanded. + nullable: true + $ref: '#/components/schemas/ShippingOption' cart_id: description: The ID of the Cart that the custom shipping option is attached to + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: '#/components/schemas/Cart' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white - includes_tax: - description: >- - [EXPERIMENTAL] Indicates if the custom shipping option price include - tax - type: boolean CustomerGroup: title: Customer Group description: Represents a customer group type: object required: + - created_at + - deleted_at + - id + - metadata - name + - updated_at properties: id: - type: string description: The customer group's ID + type: string example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 name: - type: string description: The name of the customer group + type: string example: VIP customers: + description: The customers that belong to the customer group. Available if the relation `customers` is expanded. type: array - description: >- - The customers that belong to the customer group. Available if the - relation `customers` is expanded. items: - type: object - description: A customer object. + $ref: '#/components/schemas/Customer' price_lists: + description: The price lists that are associated with the customer group. Available if the relation `price_lists` is expanded. type: array - description: >- - The price lists that are associated with the customer group. - Available if the relation `price_lists` is expanded. items: $ref: '#/components/schemas/PriceList' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Customer: @@ -5755,30 +5503,44 @@ components: description: Represents a customer type: object required: + - billing_address_id + - created_at + - deleted_at - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at properties: id: - type: string description: The customer's ID + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 email: - type: string description: The customer's email + type: string format: email first_name: - type: string description: The customer's first name + nullable: true + type: string example: Arno last_name: - type: string description: The customer's last name + nullable: true + type: string example: Willms billing_address_id: - type: string description: The customer's billing address ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: '#/components/schemas/Address' shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. @@ -5786,41 +5548,41 @@ components: items: $ref: '#/components/schemas/Address' phone: - type: string description: The customer's phone number + nullable: true + type: string example: 16128234334802 has_account: - type: boolean description: Whether the customer has an account or not + type: boolean default: false orders: description: Available if the relation `orders` is expanded. type: array items: type: object - description: An order object. groups: - description: >- - The customer groups the customer belongs to. Available if the - relation `groups` is expanded. + description: The customer groups the customer belongs to. Available if the relation `groups` is expanded. type: array items: $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionCustomerGroup: @@ -5828,8 +5590,11 @@ components: description: Associates a discount condition with a customer group type: object required: - - customer_group_id - condition_id + - created_at + - customer_group_id + - metadata + - updated_at properties: customer_group_id: description: The ID of the Product Tag @@ -5841,21 +5606,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. + nullable: true $ref: '#/components/schemas/CustomerGroup' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductCollection: @@ -5863,8 +5631,11 @@ components: description: Associates a discount condition with a product collection type: object required: - - product_collection_id - condition_id + - created_at + - metadata + - product_collection_id + - updated_at properties: product_collection_id: description: The ID of the Product Collection @@ -5876,21 +5647,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. + nullable: true $ref: '#/components/schemas/ProductCollection' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductTag: @@ -5898,8 +5672,11 @@ components: description: Associates a discount condition with a product tag type: object required: - - product_tag_id - condition_id + - created_at + - metadata + - product_tag_id + - updated_at properties: product_tag_id: description: The ID of the Product Tag @@ -5911,21 +5688,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. + nullable: true $ref: '#/components/schemas/ProductTag' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProductType: @@ -5933,8 +5713,11 @@ components: description: Associates a discount condition with a product type type: object required: - - product_type_id - condition_id + - created_at + - metadata + - product_type_id + - updated_at properties: product_type_id: description: The ID of the Product Tag @@ -5946,21 +5729,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: '#/components/schemas/ProductType' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountConditionProduct: @@ -5968,8 +5754,11 @@ components: description: Associates a discount condition with a product type: object required: - - product_id - condition_id + - created_at + - metadata + - product_id + - updated_at properties: product_id: description: The ID of the Product Tag @@ -5981,21 +5770,24 @@ components: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. + nullable: true $ref: '#/components/schemas/Product' discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountCondition: @@ -6003,13 +5795,18 @@ components: description: Holds rule conditions for when a discount is applicable type: object required: - - type - - operator + - created_at + - deleted_at - discount_rule_id + - id + - metadata + - operator + - type + - updated_at properties: id: - type: string description: The discount condition's ID + type: string example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: The type of the Condition @@ -6027,91 +5824,78 @@ components: - in - not_in discount_rule_id: - type: string description: The ID of the discount rule associated with the condition + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' products: - description: >- - products associated with this condition if type = products. - Available if the relation `products` is expanded. + description: products associated with this condition if type = products. Available if the relation `products` is expanded. type: array items: - type: object - description: A product object. + $ref: '#/components/schemas/Product' product_types: - description: >- - product types associated with this condition if type = - product_types. Available if the relation `product_types` is - expanded. + description: Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. type: array items: - type: object - description: A product type object. + $ref: '#/components/schemas/ProductType' product_tags: - description: >- - product tags associated with this condition if type = product_tags. - Available if the relation `product_tags` is expanded. + description: Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. type: array items: - type: object - description: A product tag object. + $ref: '#/components/schemas/ProductTag' product_collections: - description: >- - product collections associated with this condition if type = - product_collections. Available if the relation `product_collections` - is expanded. + description: Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. type: array items: - type: object - description: A product collection object. + $ref: '#/components/schemas/ProductCollection' customer_groups: - description: >- - customer groups associated with this condition if type = - customer_groups. Available if the relation `customer_groups` is - expanded. + description: Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: '#/components/schemas/CustomerGroup' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DiscountRule: title: Discount Rule - description: >- - Holds the rules that governs how a Discount is calculated when applied - to a Cart. + description: Holds the rules that governs how a Discount is calculated when applied to a Cart. type: object required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata - type + - updated_at - value properties: id: - type: string description: The discount rule's ID + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C type: - description: >- - The type of the Discount, can be `fixed` for discounts that reduce - the price by a fixed amount, `percentage` for percentage reductions - or `free_shipping` for shipping vouchers. + description: The type of the Discount, can be `fixed` for discounts that reduce the price by a fixed amount, `percentage` for percentage reductions or `free_shipping` for shipping vouchers. type: string enum: - fixed @@ -6120,93 +5904,99 @@ components: example: percentage description: description: A short description of the discount + nullable: true type: string example: 10 Percent value: - description: >- - The value that the discount represents; this will depend on the type - of the discount + description: The value that the discount represents; this will depend on the type of the discount type: integer example: 10 allocation: description: The scope that the discount should apply to. + nullable: true type: string enum: - total - item example: total conditions: - description: >- - A set of conditions that can be used to limit when the discount can - be used. Available if the relation `conditions` is expanded. + description: A set of conditions that can be used to limit when the discount can be used. Available if the relation `conditions` is expanded. type: array items: - type: object - description: A discount condition object. + $ref: '#/components/schemas/DiscountCondition' created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white Discount: title: Discount - description: >- - Represents a discount that can be applied to a cart for promotional - purposes. + description: Represents a discount that can be applied to a cart for promotional purposes. type: object required: - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration properties: id: - type: string description: The discount's ID + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN code: - description: >- - A unique code for the discount - this will be used by the customer - to apply the discount + description: A unique code for the discount - this will be used by the customer to apply the discount type: string example: 10DISC is_dynamic: - description: >- - A flag to indicate if multiple instances of the discount can be - generated. I.e. for newsletter discounts + description: A flag to indicate if multiple instances of the discount can be generated. I.e. for newsletter discounts type: boolean example: false rule_id: - type: string description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. + nullable: true $ref: '#/components/schemas/DiscountRule' is_disabled: - description: >- - Whether the Discount has been disabled. Disabled discounts cannot be - applied to carts + description: Whether the Discount has been disabled. Disabled discounts cannot be applied to carts type: boolean example: false parent_discount_id: + description: The Discount that the discount was created from. This will always be a dynamic discount + nullable: true type: string - description: >- - The Discount that the discount was created from. This will always be - a dynamic discount example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. + nullable: true $ref: '#/components/schemas/Discount' starts_at: description: The time at which the discount can be used. @@ -6214,22 +6004,22 @@ components: format: date-time ends_at: description: The time at which the discount can no longer be used. + nullable: true type: string format: date-time valid_duration: - type: string description: Duration the discount runs between + nullable: true + type: string example: P3Y6M4DT12H30M5S regions: - description: >- - The Regions in which the Discount can be used. Available if the - relation `regions` is expanded. + description: The Regions in which the Discount can be used. Available if the relation `regions` is expanded. type: array items: - type: object - description: A region object. + $ref: '#/components/schemas/Region' usage_limit: description: The maximum number of times that a discount can be used. + nullable: true type: integer example: 100 usage_count: @@ -6238,99 +6028,114 @@ components: example: 50 default: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white DraftOrder: title: DraftOrder description: Represents a draft order type: object + required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at properties: id: - type: string description: The draft order's ID + type: string example: dorder_01G8TJFKBG38YYFQ035MSVG03C status: - type: string description: The status of the draft order + type: string enum: - open - completed default: open display_id: - type: string description: The draft order's display ID + type: string example: 2 cart_id: - type: string description: The ID of the cart associated with the draft order. + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: - type: string description: The ID of the order associated with the draft order. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object canceled_at: - type: string description: The date the draft order was canceled at. + nullable: true + type: string format: date-time completed_at: - type: string description: The date the draft order was completed at. + nullable: true + type: string format: date-time no_notification_order: - type: boolean description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean example: false idempotency_key: + description: Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true type: string - description: >- - Randomly generated key used to continue the completion of the cart - associated with the draft order in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white FulfillmentItem: title: Fulfillment Item - description: >- - Correlates a Line Item with a Fulfillment, keeping track of the quantity - of the Line Item. + description: Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item. type: object required: - fulfillment_id @@ -6346,9 +6151,7 @@ components: type: string example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN fulfillment: - description: >- - A fulfillment object. Available if the relation `fulfillment` is - expanded. + description: A fulfillment object. Available if the relation `fulfillment` is expanded. type: object item: description: Available if the relation `item` is expanded. @@ -6359,9 +6162,7 @@ components: example: 1 FulfillmentProvider: title: Fulfillment Provider - description: >- - Represents a fulfillment provider plugin and holds its installation - status. + description: Represents a fulfillment provider plugin and holds its installation status. type: object properties: id: @@ -6369,22 +6170,12 @@ components: type: string example: manual is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean example: true Fulfillment: title: Fulfillment - description: >- - Fulfillments are created once store operators can prepare the purchased - goods. Fulfillments will eventually be shipped and hold information - about how to track shipments. Fulfillments are created through a - provider, which is typically an external shipping aggregator, shipping - partner og 3PL, most plugins will have asynchronous communications with - these providers through webhooks in order to automatically update and - synchronize the state of Fulfillments. + description: Fulfillments are created once store operators can prepare the purchased goods. Fulfillments will eventually be shipped and hold information about how to track shipments. Fulfillments are created through a provider, which is typically an external shipping aggregator, shipping partner og 3PL, most plugins will have asynchronous communications with these providers through webhooks in order to automatically update and synchronize the state of Fulfillments. type: object required: - provider_id @@ -6398,9 +6189,7 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object swap_id: description: The id of the Swap that the Fulfillment belongs to. @@ -6417,9 +6206,7 @@ components: description: An order object. Available if the relation `order` is expanded. type: object provider_id: - description: >- - The id of the Fulfillment Provider responsible for handling the - fulfillment + description: The id of the Fulfillment Provider responsible for handling the fulfillment type: string example: manual location_id: @@ -6430,33 +6217,23 @@ components: description: Available if the relation `provider` is expanded. $ref: '#/components/schemas/FulfillmentProvider' items: - description: >- - The Fulfillment Items in the Fulfillment - these hold information - about how many of each Line Item has been fulfilled. Available if - the relation `items` is expanded. + description: The Fulfillment Items in the Fulfillment - these hold information about how many of each Line Item has been fulfilled. Available if the relation `items` is expanded. type: array items: $ref: '#/components/schemas/FulfillmentItem' tracking_links: - description: >- - The Tracking Links that can be used to track the status of the - Fulfillment, these will usually be provided by the Fulfillment - Provider. Available if the relation `tracking_links` is expanded. + description: The Tracking Links that can be used to track the status of the Fulfillment, these will usually be provided by the Fulfillment Provider. Available if the relation `tracking_links` is expanded. type: array items: $ref: '#/components/schemas/TrackingLink' tracking_numbers: deprecated: true - description: >- - The tracking numbers that can be used to track the status of the - fulfillment. + description: The tracking numbers that can be used to track the status of the fulfillment. type: array items: type: string data: - description: >- - This contains all the data necessary for the Fulfillment provider to - handle the fulfillment. + description: This contains all the data necessary for the Fulfillment provider to handle the fulfillment. type: object example: {} shipped_at: @@ -6464,9 +6241,7 @@ components: type: string format: date-time no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. + description: Flag for describing whether or not notifications related to this should be send. type: boolean example: false canceled_at: @@ -6475,12 +6250,9 @@ components: format: date-time idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the - fulfillment in case of failure. + description: Randomly generated key used to continue the completion of the fulfillment in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -6501,9 +6273,7 @@ components: car: white GiftCardTransaction: title: Gift Card Transaction - description: >- - Gift Card Transactions are created once a Customer uses a Gift Card to - pay for their Order + description: Gift Card Transactions are created once a Customer uses a Gift Card to pay for their Order type: object required: - gift_card_id @@ -6518,9 +6288,7 @@ components: type: string example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ gift_card: - description: >- - A gift card object. Available if the relation `gift_card` is - expanded. + description: A gift card object. Available if the relation `gift_card` is expanded. type: object order_id: description: The ID of the Order that the Gift Card was used to pay for. @@ -6547,9 +6315,7 @@ components: example: 0 GiftCard: title: Gift Card - description: >- - Gift Cards are redeemable and represent a value that can be used towards - the payment of an Order. + description: Gift Cards are redeemable and represent a value that can be used towards the payment of an Order. type: object required: - code @@ -6562,9 +6328,7 @@ components: description: The cart's ID example: gift_01G8XKBPBQY2R7RBET4J7E0XQZ code: - description: >- - The unique code that identifies the Gift Card. This is used by the - Customer to redeem the value of the Gift Card. + description: The unique code that identifies the Gift Card. This is used by the Customer to redeem the value of the Gift Card. type: string example: 3RFT-MH2C-Y4YZ-XMN4 value: @@ -6590,9 +6354,7 @@ components: description: An order object. Available if the relation `order` is expanded. type: object is_disabled: - description: >- - Whether the Gift Card has been disabled. Disabled Gift Cards cannot - be applied to carts. + description: Whether the Gift Card has been disabled. Disabled Gift Cards cannot be applied to carts. type: boolean example: false ends_at: @@ -6622,9 +6384,7 @@ components: car: white IdempotencyKey: title: Idempotency Key - description: >- - Idempotency Key is used to continue a process in case of any failure - that might occur. + description: Idempotency Key is used to continue a process in case of any failure that might occur. type: object required: - idempotency_key @@ -6634,13 +6394,10 @@ components: description: The idempotency key's ID example: ikey_01G8X9A7ESKAJXG2H0E6F1MW7A idempotency_key: - description: >- - The unique randomly generated key used to determine the state of a - process. + description: The unique randomly generated key used to determine the state of a process. type: string externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: description: Date which the idempotency key was locked. @@ -6846,12 +6603,7 @@ components: car: white LineItem: title: Line Item - description: >- - Line Items represent purchasable units that can be added to a Cart for - checkout. When Line Items are purchased they will get copied to the - resulting order and can eventually be referenced in Fulfillments and - Returns. Line Items may also be created when processing Swaps and - Claims. + description: Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims. type: object required: - title @@ -6888,9 +6640,7 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object tax_lines: description: Available if the relation `tax_lines` is expanded. @@ -6903,9 +6653,7 @@ components: items: $ref: '#/components/schemas/LineItemAdjustment' title: - description: >- - The title of the Line Item, this should be easily identifiable by - the Customer. + description: The title of the Line Item, this should be easily identifiable by the Customer. type: string example: Medusa Coffee Mug description: @@ -6916,8 +6664,7 @@ components: description: A URL string to a small image of the contents of the Line Item. type: string format: uri - example: >- - https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png + example: https://medusa-public-images.s3.eu-west-1.amazonaws.com/coffee-mug.png is_return: description: Is the item being returned type: boolean @@ -6927,28 +6674,19 @@ components: type: boolean example: false should_merge: - description: >- - Flag to indicate if new Line Items with the same variant should be - merged or added as an additional Line Item. + description: Flag to indicate if new Line Items with the same variant should be merged or added as an additional Line Item. type: boolean example: false allow_discounts: - description: >- - Flag to indicate if the Line Item should be included when doing - discount calculations. + description: Flag to indicate if the Line Item should be included when doing discount calculations. type: boolean example: false has_shipping: - description: >- - Flag to indicate if the Line Item has fulfillment associated with - it. + description: Flag to indicate if the Line Item has fulfillment associated with it. type: boolean example: false unit_price: - description: >- - The price of one unit of the content in the Line Item. This should - be in the currency defined by the Cart/Order/Swap/Claim that the - Line Item belongs to. + description: The price of one unit of the content in the Line Item. This should be in the currency defined by the Cart/Order/Swap/Claim that the Line Item belongs to. type: boolean example: 8000 variant_id: @@ -6956,9 +6694,7 @@ components: type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: - description: >- - A product variant object. The Product Variant contained in the Line - Item. Available if the relation `variant` is expanded. + description: A product variant object. The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. type: object quantity: description: The quantity of the content in the Line Item. @@ -6977,9 +6713,7 @@ components: type: integer example: 0 refundable: - description: >- - The amount that can be refunded from the given Line Item. Takes - taxes and discounts into consideration. + description: The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration. type: integer example: 0 subtotal: @@ -7017,9 +6751,7 @@ components: description: '[EXPERIMENTAL] The id of the original line item' type: string order_edit_id: - description: >- - [EXPERIMENTAL] The ID of the order edit to which a cloned item - belongs + description: '[EXPERIMENTAL] The ID of the order edit to which a cloned item belongs' type: string order_edit: description: '[EXPERIMENTAL] The order edit joined' @@ -7039,13 +6771,7 @@ components: car: white MoneyAmount: title: Money Amount - description: >- - Money Amounts represents an amount that a given Product Variant can be - purcased for. Each Money Amount either has a Currency or Region - associated with it to indicate the pricing in a given Currency or, for - fully region-based pricing, the given price in a specific Region. If - region-based pricing is used the amount will be in the currency defined - for the Reigon. + description: Money Amounts represents an amount that a given Product Variant can be purcased for. Each Money Amount either has a Currency or Region associated with it to indicate the pricing in a given Currency or, for fully region-based pricing, the given price in a specific Region. If region-based pricing is used the amount will be in the currency defined for the Reigon. type: object required: - currency_code @@ -7060,27 +6786,21 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. $ref: '#/components/schemas/Currency' amount: - description: >- - The amount in the smallest currecny unit (e.g. cents 100 cents to - charge $1) that the Product Variant will cost. + description: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. type: integer example: 100 min_quantity: - description: >- - The minimum quantity that the Money Amount applies to. If this value - is not set, the Money Amount applies to all quantities. + description: The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. type: integer example: 1 max_quantity: - description: >- - The maximum quantity that the Money Amount applies to. If this value - is not set, the Money Amount applies to all quantities. + description: The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities. type: integer example: 1 price_list_id: @@ -7095,9 +6815,7 @@ components: type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: - description: >- - The Product Variant contained in the Line Item. Available if the - relation `variant` is expanded. + description: The Product Variant contained in the Line Item. Available if the relation `variant` is expanded. type: object region_id: type: string @@ -7125,10 +6843,7 @@ components: car: white Note: title: Note - description: >- - Notes are elements which we can use in association with different - resources to allow users to describe additional information in relation - to these. + description: Notes are elements which we can use in association with different resources to allow users to describe additional information in relation to these. type: object required: - value @@ -7177,9 +6892,7 @@ components: car: white NotificationProvider: title: Notification Provider - description: >- - Represents a notification provider plugin and holds its installation - status. + description: Represents a notification provider plugin and holds its installation status. type: object required: - id @@ -7189,19 +6902,12 @@ components: type: string example: sendgrid is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean default: true Notification: title: Notification - description: >- - Notifications a communications sent via Notification Providers as a - reaction to internal events such as `order.placed`. Notifications can be - used to show a chronological timeline for communications sent to a - Customer regarding an Order, and enables resends. + description: Notifications a communications sent via Notification Providers as a reaction to internal events such as `order.placed`. Notifications can be used to show a chronological timeline for communications sent to a Customer regarding an Order, and enables resends. type: object required: - resource_type @@ -7232,22 +6938,15 @@ components: description: A customer object. Available if the relation `customer` is expanded. type: object to: - description: >- - The address that the Notification was sent to. This will usually be - an email address, but represent other addresses such as a chat bot - user id + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id type: string example: user@example.com data: - description: >- - The data that the Notification was sent with. This contains all the - data necessary for the Notification Provider to initiate a resend. + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. type: object example: {} resends: - description: >- - The resends that have been completed after the original - Notification. + description: The resends that have been completed after the original Notification. type: array items: $ref: '#/components/schemas/NotificationResend' @@ -7295,16 +6994,11 @@ components: description: A customer object. Available if the relation `customer` is expanded. type: object to: - description: >- - The address that the Notification was sent to. This will usually be - an email address, but represent other addresses such as a chat bot - user id + description: The address that the Notification was sent to. This will usually be an email address, but represent other addresses such as a chat bot user id type: string example: user@example.com data: - description: >- - The data that the Notification was sent with. This contains all the - data necessary for the Notification Provider to initiate a resend. + description: The data that the Notification was sent with. This contains all the data necessary for the Notification Provider to initiate a resend. type: object example: {} parent_id: @@ -7382,7 +7076,7 @@ components: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: '#/components/schemas/Order' + type: object changes: type: array description: Available if the relation `changes` is expanded. @@ -7394,32 +7088,24 @@ components: example: Included two more items B to the order. created_by: type: string - description: >- - The unique identifier of the user or customer who created the order - edit. + description: The unique identifier of the user or customer who created the order edit. requested_by: type: string - description: >- - The unique identifier of the user or customer who requested the - order edit. + description: The unique identifier of the user or customer who requested the order edit. requested_at: type: string description: The date with timezone at which the edit was requested. format: date-time confirmed_by: type: string - description: >- - The unique identifier of the user or customer who confirmed the - order edit. + description: The unique identifier of the user or customer who confirmed the order edit. confirmed_at: type: string description: The date with timezone at which the edit was confirmed. format: date-time declined_by: type: string - description: >- - The unique identifier of the user or customer who declined the order - edit. + description: The unique identifier of the user or customer who declined the order edit. declined_at: type: string description: The date with timezone at which the edit was declined. @@ -7457,9 +7143,7 @@ components: example: 8200 difference_due: type: integer - description: >- - The difference between the total amount of the order and total - amount of edited order. + description: The difference between the total amount of the order and total amount of edited order. example: 8200 status: type: string @@ -7645,7 +7329,7 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. @@ -7656,70 +7340,52 @@ components: example: 0 discounts: type: array - description: >- - The discounts used in the order. Available if the relation - `discounts` is expanded. + description: The discounts used in the order. Available if the relation `discounts` is expanded. items: type: object description: A discount object. gift_cards: type: array - description: >- - The gift cards used in the order. Available if the relation - `gift_cards` is expanded. + description: The gift cards used in the order. Available if the relation `gift_cards` is expanded. items: type: object description: A gift card object. shipping_methods: type: array - description: >- - The shipping methods used in the order. Available if the relation - `shipping_methods` is expanded. + description: The shipping methods used in the order. Available if the relation `shipping_methods` is expanded. items: $ref: '#/components/schemas/ShippingMethod' payments: type: array - description: >- - The payments used in the order. Available if the relation `payments` - is expanded. + description: The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: '#/components/schemas/Payment' + type: object fulfillments: type: array - description: >- - The fulfillments used in the order. Available if the relation - `fulfillments` is expanded. + description: The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: '#/components/schemas/Fulfillment' + type: object returns: type: array - description: >- - The returns associated with the order. Available if the relation - `returns` is expanded. + description: The returns associated with the order. Available if the relation `returns` is expanded. items: type: object description: A return object. claims: type: array - description: >- - The claims associated with the order. Available if the relation - `claims` is expanded. + description: The claims associated with the order. Available if the relation `claims` is expanded. items: type: object description: A claim order object. refunds: type: array - description: >- - The refunds associated with the order. Available if the relation - `refunds` is expanded. + description: The refunds associated with the order. Available if the relation `refunds` is expanded. items: type: object description: A refund object. swaps: type: array - description: >- - The swaps associated with the order. Available if the relation - `swaps` is expanded. + description: The swaps associated with the order. Available if the relation `swaps` is expanded. items: type: object description: A swap object. @@ -7728,29 +7394,21 @@ components: description: The ID of the draft order this order is associated with. example: null draft_order: - description: >- - A draft order object. Available if the relation `draft_order` is - expanded. + description: A draft order object. Available if the relation `draft_order` is expanded. type: object items: type: array - description: >- - The line items that belong to the order. Available if the relation - `items` is expanded. + description: The line items that belong to the order. Available if the relation `items` is expanded. items: $ref: '#/components/schemas/LineItem' edits: type: array - description: >- - [EXPERIMENTAL] Order edits done on the order. Available if the - relation `edits` is expanded. + description: '[EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded.' items: - $ref: '#/components/schemas/OrderEdit' + type: object gift_card_transactions: type: array - description: >- - The gift card transactions used in the order. Available if the - relation `gift_card_transactions` is expanded. + description: The gift card transactions used in the order. Available if the relation `gift_card_transactions` is expanded. items: $ref: '#/components/schemas/GiftCardTransaction' canceled_at: @@ -7758,19 +7416,14 @@ components: description: The date the order was canceled on. format: date-time no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. + description: Flag for describing whether or not notifications related to this should be send. type: boolean example: false idempotency_key: type: string - description: >- - Randomly generated key used to continue the processing of the order - in case of failure. + description: Randomly generated key used to continue the processing of the order in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. external_id: description: The ID of an external order. @@ -7781,9 +7434,7 @@ components: description: The ID of the sales channel this order is associated with. example: null sales_channel: - description: >- - A sales channel object. Available if the relation `sales_channel` is - expanded. + description: A sales channel object. Available if the relation `sales_channel` is expanded. type: object shipping_total: type: integer @@ -7876,7 +7527,7 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. @@ -7923,21 +7574,12 @@ components: type: string example: manual is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean default: true PaymentSession: title: Payment Session - description: >- - Payment Sessions are created when a Customer initilizes the checkout - flow, and can be used to hold the state of a payment flow. Each Payment - Session is controlled by a Payment Provider, who is responsible for the - communication with external payment services. Authorized Payment - Sessions will eventually get promoted to Payments to indicate that they - are authorized for capture/refunds/etc. + description: Payment Sessions are created when a Customer initilizes the checkout flow, and can be used to hold the state of a payment flow. Each Payment Session is controlled by a Payment Provider, who is responsible for the communication with external payment services. Authorized Payment Sessions will eventually get promoted to Payments to indicate that they are authorized for capture/refunds/etc. type: object required: - cart_id @@ -7956,30 +7598,20 @@ components: description: A cart object. Available if the relation `cart` is expanded. type: object provider_id: - description: >- - The id of the Payment Provider that is responsible for the Payment - Session + description: The id of the Payment Provider that is responsible for the Payment Session type: string example: manual is_selected: - description: >- - A flag to indicate if the Payment Session has been selected as the - method that will be used to complete the purchase. + description: A flag to indicate if the Payment Session has been selected as the method that will be used to complete the purchase. type: boolean example: true is_initiated: - description: >- - A flag to indicate if a communication with the third party provider - has been initiated. + description: A flag to indicate if a communication with the third party provider has been initiated. type: boolean example: true default: false status: - description: >- - Indicates the status of the Payment Session. Will default to - `pending`, and will eventually become `authorized`. Payment Sessions - may have the status of `requires_more` to indicate that further - actions are to be completed by the Customer. + description: Indicates the status of the Payment Session. Will default to `pending`, and will eventually become `authorized`. Payment Sessions may have the status of `requires_more` to indicate that further actions are to be completed by the Customer. type: string enum: - authorized @@ -7989,21 +7621,14 @@ components: - canceled example: pending data: - description: >- - The data required for the Payment Provider to identify, modify and - process the Payment Session. Typically this will be an object that - holds an id to the external payment session, but can be an empty - object if the Payment Provider doesn't hold any state. + description: The data required for the Payment Provider to identify, modify and process the Payment Session. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. type: object example: {} idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of a cart in - case of failure. + description: Randomly generated key used to continue the completion of a cart in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -8015,9 +7640,7 @@ components: format: date-time Payment: title: Payment - description: >- - Payments represent an amount authorized with a given payment method, - Payments can be captured, canceled or refunded. + description: Payments represent an amount authorized with a given payment method, Payments can be captured, canceled or refunded. type: object required: - amount @@ -8057,15 +7680,13 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. $ref: '#/components/schemas/Currency' amount_refunded: - description: >- - The amount of the original Payment amount that has been refunded - back to the Customer. + description: The amount of the original Payment amount that has been refunded back to the Customer. type: integer example: 0 provider_id: @@ -8073,11 +7694,7 @@ components: type: string example: manual data: - description: >- - The data required for the Payment Provider to identify, modify and - process the Payment. Typically this will be an object that holds an - id to the external payment session, but can be an empty object if - the Payment Provider doesn't hold any state. + description: The data required for the Payment Provider to identify, modify and process the Payment. Typically this will be an object that holds an id to the external payment session, but can be an empty object if the Payment Provider doesn't hold any state. type: object example: {} captured_at: @@ -8090,12 +7707,9 @@ components: format: date-time idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of a payment - in case of failure. + description: Randomly generated key used to continue the completion of a payment in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -8112,9 +7726,7 @@ components: car: white PriceList: title: Price List - description: >- - Price Lists represents a set of prices that overrides the default price - for one or more product variants. + description: Price Lists represents a set of prices that overrides the default price for one or more product variants. type: object required: - name @@ -8133,9 +7745,7 @@ components: description: The price list's description example: Prices for VIP customers type: - description: >- - The type of Price List. This can be one of either `sale` or - `override`. + description: The type of Price List. This can be one of either `sale` or `override`. type: string enum: - sale @@ -8157,17 +7767,13 @@ components: type: string format: date-time customer_groups: - description: >- - The Customer Groups that the Price List applies to. Available if the - relation `customer_groups` is expanded. + description: The Customer Groups that the Price List applies to. Available if the relation `customer_groups` is expanded. type: array items: type: object description: A customer group object. prices: - description: >- - The Money Amounts that are associated with the Price List. Available - if the relation `prices` is expanded. + description: The Money Amounts that are associated with the Price List. Available if the relation `prices` is expanded. type: array items: oneOf: @@ -8205,16 +7811,12 @@ components: description: The product category's name example: Regular Fit handle: - description: >- - A unique string that identifies the Category - example: slug - structures. + description: 'A unique string that identifies the Category - example: slug structures.' type: string example: regular-fit mpath: type: string - description: >- - A string for Materialized Paths - used for finding ancestors and - descendents + description: A string for Materialized Paths - used for finding ancestors and descendents example: pcat_id1.pcat_id2.pcat_id3 is_internal: type: boolean @@ -8235,10 +7837,14 @@ components: type: string default: null parent_category: - description: >- - A product category object. Available if the relation - `parent_category` is expanded. + description: A product category object. Available if the relation `parent_category` is expanded. type: object + products: + description: products associated with category. Available if the relation `products` is expanded. + type: array + items: + type: object + description: A product object. created_at: type: string description: The date with timezone at which the resource was created. @@ -8267,15 +7873,11 @@ components: type: string example: Summer Collection handle: - description: >- - A unique string that identifies the Product Collection - can for - example be used in slug structures. + description: A unique string that identifies the Product Collection - can for example be used in slug structures. type: string example: summer-collection products: - description: >- - The Products contained in the Product Collection. Available if the - relation `products` is expanded. + description: The Products contained in the Product Collection. Available if the relation `products` is expanded. type: array items: type: object @@ -8299,10 +7901,7 @@ components: car: white ProductOptionValue: title: Product Option Value - description: >- - A value given to a Product Variant's option set. Product Variant have a - Product Option Value for each of the Product Options defined on the - Product. + description: A value given to a Product Variant's option set. Product Variant have a Product Option Value for each of the Product Options defined on the Product. type: object required: - value @@ -8314,25 +7913,18 @@ components: description: The product option value's ID example: optval_01F0YESHR7S6ECD03RF6W12DSJ value: - description: >- - The value that the Product Variant has defined for the specific - Product Option (e.g. if the Product Option is "Size" this value - could be "Small", "Medium" or "Large"). + description: The value that the Product Variant has defined for the specific Product Option (e.g. if the Product Option is "Size" this value could be "Small", "Medium" or "Large"). type: string example: large option_id: - description: >- - The ID of the Product Option that the Product Option Value is - defined for. + description: The ID of the Product Option that the Product Option Value is defined for. type: string example: opt_01F0YESHQBZVKCEXJ24BS6PCX3 option: description: Available if the relation `option` is expanded. $ref: '#/components/schemas/ProductOption' variant_id: - description: >- - The ID of the Product Variant that the Product Option Value is - defined for. + description: The ID of the Product Variant that the Product Option Value is defined for. type: string example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: @@ -8357,10 +7949,7 @@ components: car: white ProductOption: title: Product Option - description: >- - Product Options define properties that may vary between different - variants of a Product. Common Product Options are "Size" and "Color", - but Medusa doesn't limit what Product Options that can be defined. + description: Product Options define properties that may vary between different variants of a Product. Common Product Options are "Size" and "Color", but Medusa doesn't limit what Product Options that can be defined. type: object required: - title @@ -8375,9 +7964,7 @@ components: type: string example: Size values: - description: >- - The Product Option Values that are defined for the Product Option. - Available if the relation `values` is expanded. + description: The Product Option Values that are defined for the Product Option. Available if the relation `values` is expanded. type: array items: $ref: '#/components/schemas/ProductOptionValue' @@ -8439,9 +8026,7 @@ components: car: white ProductTaxRate: title: Product Tax Rate - description: >- - Associates a tax rate with a product to indicate that the product is - taxed in a certain way + description: Associates a tax rate with a product to indicate that the product is taxed in a certain way type: object required: - product_id @@ -8476,9 +8061,7 @@ components: car: white ProductTypeTaxRate: title: Product Type Tax Rate - description: >- - Associates a tax rate with a product type to indicate that the product - type is taxed in a certain way + description: Associates a tax rate with a product type to indicate that the product type is taxed in a certain way type: object required: - product_type_id @@ -8513,9 +8096,7 @@ components: car: white ProductType: title: Product Type - description: >- - Product Type can be added to Products for filtering and reporting - purposes. + description: Product Type can be added to Products for filtering and reporting purposes. type: object required: - value @@ -8547,9 +8128,7 @@ components: car: white ProductVariantInventoryItem: title: Product Variant Inventory Item - description: >- - Product Variant Inventory Items link variants with inventory items and - denote the number of inventory items constituting a variant. + description: Product Variant Inventory Items link variants with inventory items and denote the number of inventory items constituting a variant. type: object properties: id: @@ -8563,9 +8142,7 @@ components: description: The id of the variant. type: string required_quantity: - description: >- - The quantity of an inventory item required for one quantity of the - variant. + description: The quantity of an inventory item required for one quantity of the variant. type: integer default: 1 created_at: @@ -8582,11 +8159,7 @@ components: format: date-time ProductVariant: title: Product Variant - description: >- - Product Variants represent a Product with a specific set of Product - Option configurations. The maximum number of Product Variants that a - Product can have is given by the number of available Product Option - combinations. + description: Product Variants represent a Product with a specific set of Product Option configurations. The maximum number of Product Variants that a Product can have is given by the number of available Product Option combinations. type: object required: - title @@ -8598,9 +8171,7 @@ components: description: The product variant's ID example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 title: - description: >- - A title that can be displayed for easy identification of the Product - Variant. + description: A title that can be displayed for easy identification of the Product Variant. type: string example: Small product_id: @@ -8611,36 +8182,24 @@ components: description: A product object. Available if the relation `product` is expanded. 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. + description: The Money Amounts defined for the Product Variant. Each Money Amount represents a price in a given currency or a price in a specific Region. Available if the relation `prices` is expanded. type: array items: $ref: '#/components/schemas/MoneyAmount' sku: - description: >- - The unique stock keeping unit used to identify the Product Variant. - This will usually be a unqiue identifer for the item that is to be - shipped, and can be referenced across multiple systems. + description: The unique stock keeping unit used to identify the Product Variant. This will usually be a unqiue identifer for the item that is to be shipped, and can be referenced across multiple systems. type: string example: shirt-123 barcode: - description: >- - A generic field for a GTIN number that can be used to identify the - Product Variant. + description: A generic field for a GTIN number that can be used to identify the Product Variant. type: string example: null ean: - description: >- - An EAN barcode number that can be used to identify the Product - Variant. + description: An EAN barcode number that can be used to identify the Product Variant. type: string example: null upc: - description: >- - A UPC barcode number that can be used to identify the Product - Variant. + description: A UPC barcode number that can be used to identify the Product Variant. type: string example: null variant_rank: @@ -8652,9 +8211,7 @@ components: type: integer example: 100 allow_backorder: - description: >- - Whether the Product Variant should be purchasable when - `inventory_quantity` is 0. + description: Whether the Product Variant should be purchasable when `inventory_quantity` is 0. type: boolean default: false manage_inventory: @@ -8662,61 +8219,39 @@ components: type: boolean default: true hs_code: - description: >- - The Harmonized System code of the Product Variant. May be used by - Fulfillment Providers to pass customs information to shipping - carriers. + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null origin_country: - description: >- - The country in which the Product Variant was produced. May be used - by Fulfillment Providers to pass customs information to shipping - carriers. + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null mid_code: - description: >- - The Manufacturers Identification code that identifies the - manufacturer of the Product Variant. May be used by Fulfillment - Providers to pass customs information to shipping carriers. + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null material: - description: >- - The material and composition that the Product Variant is made of, - May be used by Fulfillment Providers to pass customs information to - shipping carriers. + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null weight: - description: >- - The weight of the Product Variant. May be used in shipping rate - calculations. + description: The weight of the Product Variant. May be used in shipping rate calculations. type: number example: null height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. + description: The height of the Product Variant. May be used in shipping rate calculations. type: number example: null width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + description: The width of the Product Variant. May be used in shipping rate calculations. type: number example: null length: - description: >- - The length of the Product Variant. May be used in shipping rate - calculations. + description: The length of the Product Variant. May be used in shipping rate calculations. type: number example: null options: - description: >- - The Product Option Values specified for the Product Variant. - Available if the relation `options` is expanded. + description: The Product Option Values specified for the Product Variant. Available if the relation `options` is expanded. type: array items: $ref: '#/components/schemas/ProductOptionValue' @@ -8739,10 +8274,7 @@ components: car: white Product: title: Product - description: >- - Products are a grouping of Product Variants that have common properties - such as images and descriptions. Products can have multiple options - which define the properties that Product Variants differ by. + description: Products are a grouping of Product Variants that have common properties such as images and descriptions. Products can have multiple options which define the properties that Product Variants differ by. type: object required: - title @@ -8753,15 +8285,11 @@ components: description: The product's ID example: prod_01G1G5V2MBA328390B5AXJ610F title: - description: >- - A title that can be displayed for easy identification of the - Product. + description: A title that can be displayed for easy identification of the Product. type: string example: Medusa Coffee Mug subtitle: - description: >- - An optional subtitle that can be used to further specify the - Product. + description: An optional subtitle that can be used to further specify the Product. type: string description: description: A short description of the Product. @@ -8772,10 +8300,7 @@ components: type: string example: coffee-mug is_giftcard: - description: >- - Whether the Product represents a Gift Card. Products that represent - Gift Cards will automatically generate a redeemable Gift Card code - once they are purchased. + description: Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. type: boolean default: false status: @@ -8788,9 +8313,7 @@ components: - rejected default: draft images: - description: >- - Images of the Product. Available if the relation `images` is - expanded. + description: Images of the Product. Available if the relation `images` is expanded. type: array items: $ref: '#/components/schemas/Image' @@ -8799,81 +8322,52 @@ components: type: string format: uri options: - description: >- - The Product Options that are defined for the Product. Product - Variants of the Product will have a unique combination of Product - Option Values. Available if the relation `options` is expanded. + description: The Product Options that are defined for the Product. Product Variants of the Product will have a unique combination of Product Option Values. Available if the relation `options` is expanded. type: array items: $ref: '#/components/schemas/ProductOption' variants: - description: >- - The Product Variants that belong to the Product. Each will have a - unique combination of Product Option Values. Available if the - relation `variants` is expanded. + description: The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. Available if the relation `variants` is expanded. type: array items: $ref: '#/components/schemas/ProductVariant' profile_id: - description: >- - The ID of the Shipping Profile that the Product belongs to. Shipping - Profiles have a set of defined Shipping Options that can be used to - Fulfill a given set of Products. + description: The ID of the Shipping Profile that the Product belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. type: string example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. $ref: '#/components/schemas/ShippingProfile' weight: - description: >- - The weight of the Product Variant. May be used in shipping rate - calculations. + description: The weight of the Product Variant. May be used in shipping rate calculations. type: number example: null height: - description: >- - The height of the Product Variant. May be used in shipping rate - calculations. + description: The height of the Product Variant. May be used in shipping rate calculations. type: number example: null width: - description: >- - The width of the Product Variant. May be used in shipping rate - calculations. + description: The width of the Product Variant. May be used in shipping rate calculations. type: number example: null length: - description: >- - The length of the Product Variant. May be used in shipping rate - calculations. + description: The length of the Product Variant. May be used in shipping rate calculations. type: number example: null hs_code: - description: >- - The Harmonized System code of the Product Variant. May be used by - Fulfillment Providers to pass customs information to shipping - carriers. + description: The Harmonized System code of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null origin_country: - description: >- - The country in which the Product Variant was produced. May be used - by Fulfillment Providers to pass customs information to shipping - carriers. + description: The country in which the Product Variant was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null mid_code: - description: >- - The Manufacturers Identification code that identifies the - manufacturer of the Product Variant. May be used by Fulfillment - Providers to pass customs information to shipping carriers. + description: The Manufacturers Identification code that identifies the manufacturer of the Product Variant. May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null material: - description: >- - The material and composition that the Product Variant is made of, - May be used by Fulfillment Providers to pass customs information to - shipping carriers. + description: The material and composition that the Product Variant is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. type: string example: null collection_id: @@ -8881,9 +8375,7 @@ components: description: The Product Collection that the Product belongs to example: pcol_01F0YESBFAZ0DV6V831JXWH0BG collection: - description: >- - A product collection object. Available if the relation `collection` - is expanded. + description: A product collection object. Available if the relation `collection` is expanded. type: object type_id: type: string @@ -8893,16 +8385,12 @@ components: description: Available if the relation `type` is expanded. $ref: '#/components/schemas/ProductType' tags: - description: >- - The Product Tags assigned to the Product. Available if the relation - `tags` is expanded. + description: The Product Tags assigned to the Product. Available if the relation `tags` is expanded. type: array items: $ref: '#/components/schemas/ProductTag' discountable: - description: >- - Whether the Product can be discounted. Discounts will not apply to - Line Items of this Product when this flag is set to `false`. + description: Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`. type: boolean default: true external_id: @@ -8910,13 +8398,17 @@ components: type: string example: null sales_channels: - description: >- - The sales channels the product is associated with. Available if the - relation `sales_channels` is expanded. + description: The sales channels the product is associated with. Available if the relation `sales_channels` is expanded. type: array items: type: object description: A sales channel object. + categories: + description: The product's associated categories. Available if the relation `categories` is expanded. + type: array + items: + type: object + description: A category object. created_at: type: string description: The date with timezone at which the resource was created. @@ -8949,9 +8441,7 @@ components: example: pak_01G1G5V21KADXNGH29BJMAJ4B4 PublishableApiKey: title: Publishable API key - description: >- - Publishable API key defines scopes (i.e. resources) that are available - within a request. + description: Publishable API key defines scopes (i.e. resources) that are available within a request. type: object properties: id: @@ -8963,9 +8453,7 @@ components: description: The unique identifier of the user that created the key. example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: - description: >- - A user object. Available if the relation `created_by_user` is - expanded. + description: A user object. Available if the relation `created_by_user` is expanded. type: object created_at: type: string @@ -8976,9 +8464,7 @@ components: description: The unique identifier of the user that revoked the key. example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V revoked_by_user: - description: >- - A user object. Available if the relation `revoked_by_user` is - expanded. + description: A user object. Available if the relation `revoked_by_user` is expanded. type: object revoked_at: type: string @@ -8990,10 +8476,7 @@ components: format: date-time Refund: title: Refund - description: >- - Refund represent an amount of money transfered back to the Customer for - a given reason. Refunds may occur in relation to Returns, Swaps and - Claims, but can also be initiated by a store operator. + description: Refund represent an amount of money transfered back to the Customer for a given reason. Refunds may occur in relation to Returns, Swaps and Claims, but can also be initiated by a store operator. type: object required: - order_id @@ -9016,9 +8499,7 @@ components: type: string example: I didn't like it reason: - description: >- - The reason given for the Refund, will automatically be set when - processed as part of a Swap, Claim or Return. + description: The reason given for the Refund, will automatically be set when processed as part of a Swap, Claim or Return. type: string enum: - discount @@ -9029,12 +8510,9 @@ components: example: return idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the refund - in case of failure. + description: Randomly generated key used to continue the completion of the refund in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -9055,11 +8533,7 @@ components: car: white Region: title: Region - description: >- - Regions hold settings for how Customers in a given geographical location - shop. The is, for example, where currencies and tax rates are defined. A - Region can consist of multiple countries to accomodate common shopping - settings across countries. + description: Regions hold settings for how Customers in a given geographical location shop. The is, for example, where currencies and tax rates are defined. A Region can consist of multiple countries to accomodate common shopping settings across countries. type: object required: - name @@ -9071,9 +8545,7 @@ components: description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: - description: >- - The name of the region as displayed to the customer. If the Region - only has one country it is recommended to write the country name. + description: The name of the region as displayed to the customer. If the Region only has one country it is recommended to write the country name. type: string example: EU currency_code: @@ -9081,7 +8553,7 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. currency: description: Available if the relation `currency` is expanded. @@ -9091,16 +8563,12 @@ components: type: number example: 0 tax_rates: - description: >- - The tax rates that are included in the Region. Available if the - relation `tax_rates` is expanded. + description: The tax rates that are included in the Region. Available if the relation `tax_rates` is expanded. type: array items: $ref: '#/components/schemas/TaxRate' tax_code: - description: >- - The tax code used on purchases in the Region. This may be used by - other systems for accounting purposes. + description: The tax code used on purchases in the Region. This may be used by other systems for accounting purposes. type: string example: null gift_cards_taxable: @@ -9112,9 +8580,7 @@ components: type: boolean default: true countries: - description: >- - The countries that are included in the Region. Available if the - relation `countries` is expanded. + description: The countries that are included in the Region. Available if the relation `countries` is expanded. type: array items: $ref: '#/components/schemas/Country' @@ -9126,16 +8592,12 @@ components: description: Available if the relation `tax_provider` is expanded. $ref: '#/components/schemas/TaxProvider' payment_providers: - description: >- - The Payment Providers that can be used to process Payments in the - Region. Available if the relation `payment_providers` is expanded. + description: The Payment Providers that can be used to process Payments in the Region. Available if the relation `payment_providers` is expanded. type: array items: $ref: '#/components/schemas/PaymentProvider' fulfillment_providers: - description: >- - The Fulfillment Providers that can be used to fulfill orders in the - Region. Available if the relation `payment_providers` is expanded. + description: The Fulfillment Providers that can be used to fulfill orders in the Region. Available if the relation `payment_providers` is expanded. type: array items: $ref: '#/components/schemas/FulfillmentProvider' @@ -9161,9 +8623,7 @@ components: car: white ReturnItem: title: Return Item - description: >- - Correlates a Line Item with a Return, keeping track of the quantity of - the Line Item that will be returned. + description: Correlates a Line Item with a Return, keeping track of the quantity of the Line Item that will be returned. type: object required: - return_id @@ -9188,9 +8648,7 @@ components: type: integer example: 1 is_requested: - description: >- - Whether the Return Item was requested initially or received - unexpectedly in the warehouse. + description: Whether the Return Item was requested initially or received unexpectedly in the warehouse. type: boolean default: true requested_quantity: @@ -9219,9 +8677,7 @@ components: car: white ReturnReason: title: Return Reason - description: >- - A Reason for why a given product is returned. A Return Reason can be - used on Return Items in order to indicate why a Line Item was returned. + description: A Reason for why a given product is returned. A Return Reason can be used on Return Items in order to indicate why a Line Item was returned. type: object required: - value @@ -9272,10 +8728,7 @@ components: car: white Return: title: Return - description: >- - Return orders hold information about Line Items that a Customer wishes - to send back, along with how the items will be returned. Returns can be - used as part of a Swap. + description: Return orders hold information about Line Items that a Customer wishes to send back, along with how the items will be returned. Returns can be used as part of a Swap. type: object required: - refund_amount @@ -9294,9 +8747,7 @@ components: - canceled default: requested items: - description: >- - The Return Items that will be shipped back to the warehouse. - Available if the relation `items` is expanded. + description: The Return Items that will be shipped back to the warehouse. Available if the relation `items` is expanded. type: array items: $ref: '#/components/schemas/ReturnItem' @@ -9319,22 +8770,15 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object shipping_method: - description: >- - The Shipping Method that will be used to send the Return back. Can - be null if the Customer facilitates the return shipment themselves. - Available if the relation `shipping_method` is expanded. + description: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. Available if the relation `shipping_method` is expanded. type: array items: $ref: '#/components/schemas/ShippingMethod' shipping_data: - description: >- - Data about the return shipment as provided by the Fulfilment - Provider that handles the return shipment. + description: Data about the return shipment as provided by the Fulfilment Provider that handles the return shipment. type: object example: {} refund_amount: @@ -9342,19 +8786,14 @@ components: type: integer example: 1000 no_notification: - description: >- - When set to true, no notification will be sent related to this - return. + description: When set to true, no notification will be sent related to this return. type: boolean example: false idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the return - in case of failure. + description: Randomly generated key used to continue the completion of the return in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. received_at: description: The date with timezone at which the return was received. @@ -9455,11 +8894,7 @@ components: car: white ShippingMethod: title: Shipping Method - description: >- - Shipping Methods represent a way in which an Order or Return can be - shipped. Shipping Methods are built from a Shipping Option, but may - contain additional details, that can be necessary for the Fulfillment - Provider to handle the shipment. + description: Shipping Methods represent a way in which an Order or Return can be shipped. Shipping Methods are built from a Shipping Option, but may contain additional details, that can be necessary for the Fulfillment Provider to handle the shipment. type: object required: - shipping_option_id @@ -9470,9 +8905,7 @@ components: description: The shipping method's ID example: sm_01F0YET7DR2E7CYVSDHM593QG2 shipping_option_id: - description: >- - The id of the Shipping Option that the Shipping Method is built - from. + description: The id of the Shipping Option that the Shipping Method is built from. type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: @@ -9490,9 +8923,7 @@ components: type: string example: null return_order: - description: >- - A return object. Available if the relation `return_order` is - expanded. + description: A return object. Available if the relation `return_order` is expanded. type: object swap_id: description: The id of the Swap that the Shipping Method is used on. @@ -9513,9 +8944,7 @@ components: type: string example: null claim_order: - description: >- - A claim order object. Available if the relation `claim_order` is - expanded. + description: A claim order object. Available if the relation `claim_order` is expanded. type: object tax_lines: type: array @@ -9523,17 +8952,11 @@ components: items: $ref: '#/components/schemas/ShippingMethodTaxLine' price: - description: >- - The amount to charge for the Shipping Method. The currency of the - price is defined by the Region that the Order that the Shipping - Method belongs to is a part of. + description: The amount to charge for the Shipping Method. The currency of the price is defined by the Region that the Order that the Shipping Method belongs to is a part of. type: integer example: 200 data: - description: >- - Additional data that the Fulfillment Provider needs to fulfill the - shipment. This is used in combination with the Shipping Options - data, and may contain information such as a drop point id. + description: Additional data that the Fulfillment Provider needs to fulfill the shipment. This is used in combination with the Shipping Options data, and may contain information such as a drop point id. type: object example: {} includes_tax: @@ -9541,9 +8964,7 @@ components: type: boolean ShippingOptionRequirement: title: Shipping Option Requirement - description: >- - A requirement that a Cart must satisfy for the Shipping Option to be - available to the Cart. + description: A requirement that a Cart must satisfy for the Shipping Option to be available to the Cart. type: object required: - shipping_option_id @@ -9555,21 +8976,14 @@ components: description: The shipping option requirement's ID example: sor_01G1G5V29AB4CTNDRFSRWSRKWD shipping_option_id: - description: >- - The id of the Shipping Option that the hipping option requirement - belongs to + description: The id of the Shipping Option that the hipping option requirement belongs to type: string example: so_01G1G5V27GYX4QXNARRQCW1N8T shipping_option: description: Available if the relation `shipping_option` is expanded. $ref: '#/components/schemas/ShippingOption' type: - description: >- - The type of the requirement, this defines how the value will be - compared to the Cart's total. `min_subtotal` requirements define the - minimum subtotal that is needed for the Shipping Option to be - available, while the `max_subtotal` defines the maximum subtotal - that the Cart can have for the Shipping Option to be available. + description: The type of the requirement, this defines how the value will be compared to the Cart's total. `min_subtotal` requirements define the minimum subtotal that is needed for the Shipping Option to be available, while the `max_subtotal` defines the maximum subtotal that the Cart can have for the Shipping Option to be available. type: string enum: - min_subtotal @@ -9585,13 +8999,7 @@ components: format: date-time ShippingOption: title: Shipping Option - description: >- - Shipping Options represent a way in which an Order or Return can be - shipped. Shipping Options have an associated Fulfillment Provider that - will be used when the fulfillment of an Order is initiated. Shipping - Options themselves cannot be added to Carts, but serve as a template for - Shipping Methods. This distinction makes it possible to customize - individual Shipping Methods with additional information. + description: Shipping Options represent a way in which an Order or Return can be shipped. Shipping Options have an associated Fulfillment Provider that will be used when the fulfillment of an Order is initiated. Shipping Options themselves cannot be added to Carts, but serve as a template for Shipping Methods. This distinction makes it possible to customize individual Shipping Methods with additional information. type: object required: - name @@ -9605,9 +9013,7 @@ components: description: The shipping option's ID example: so_01G1G5V27GYX4QXNARRQCW1N8T name: - description: >- - The name given to the Shipping Option - this may be displayed to the - Customer. + description: The name given to the Shipping Option - this may be displayed to the Customer. type: string example: PostFake Standard region_id: @@ -9618,59 +9024,41 @@ components: description: A region object. Available if the relation `region` is expanded. 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. + description: The ID of the Shipping Profile that the shipping option belongs to. Shipping Profiles have a set of defined Shipping Options that can be used to Fulfill a given set of Products. type: string example: sp_01G1G5V239ENSZ5MV4JAR737BM profile: description: Available if the relation `profile` is expanded. $ref: '#/components/schemas/ShippingProfile' provider_id: - description: >- - The id of the Fulfillment Provider, that will be used to process - Fulfillments from the Shipping Option. + description: The id of the Fulfillment Provider, that will be used to process Fulfillments from the Shipping Option. type: string example: manual provider: description: Available if the relation `provider` is expanded. $ref: '#/components/schemas/FulfillmentProvider' price_type: - description: >- - The type of pricing calculation that is used when creatin Shipping - Methods from the Shipping Option. Can be `flat_rate` for fixed - prices or `calculated` if the Fulfillment Provider can provide price - calulations. + description: The type of pricing calculation that is used when creatin Shipping Methods from the Shipping Option. Can be `flat_rate` for fixed prices or `calculated` if the Fulfillment Provider can provide price calulations. type: string enum: - flat_rate - calculated example: flat_rate amount: - description: >- - The amount to charge for shipping when the Shipping Option price - type is `flat_rate`. + description: The amount to charge for shipping when the Shipping Option price type is `flat_rate`. type: integer example: 200 is_return: - description: >- - Flag to indicate if the Shipping Option can be used for Return - shipments. + description: Flag to indicate if the Shipping Option can be used for Return shipments. type: boolean default: false requirements: - description: >- - The requirements that must be satisfied for the Shipping Option to - be available for a Cart. Available if the relation `requirements` is - expanded. + description: The requirements that must be satisfied for the Shipping Option to be available for a Cart. Available if the relation `requirements` is expanded. type: array items: $ref: '#/components/schemas/ShippingOptionRequirement' data: - description: >- - The data needed for the Fulfillment Provider to identify the - Shipping Option. + description: The data needed for the Fulfillment Provider to identify the Shipping Option. type: object example: {} includes_tax: @@ -9695,9 +9083,7 @@ components: car: white ShippingProfile: title: Shipping Profile - description: >- - Shipping Profiles have a set of defined Shipping Options that can be - used to fulfill a given set of Products. + description: Shipping Profiles have a set of defined Shipping Options that can be used to fulfill a given set of Products. type: object required: - name @@ -9708,15 +9094,11 @@ components: description: The shipping profile's ID example: sp_01G1G5V239ENSZ5MV4JAR737BM name: - description: >- - The name given to the Shipping profile - this may be displayed to - the Customer. + description: The name given to the Shipping profile - this may be displayed to the Customer. type: string example: Default Shipping Profile type: - description: >- - The type of the Shipping Profile, may be `default`, `gift_card` or - `custom`. + description: The type of the Shipping Profile, may be `default`, `gift_card` or `custom`. type: string enum: - default @@ -9724,18 +9106,13 @@ components: - custom example: default products: - description: >- - The Products that the Shipping Profile defines Shipping Options for. - Available if the relation `products` is expanded. + description: The Products that the Shipping Profile defines Shipping Options for. Available if the relation `products` is expanded. type: array items: type: object description: A product object. shipping_options: - description: >- - The Shipping Options that can be used to fulfill the Products in the - Shipping Profile. Available if the relation `shipping_options` is - expanded. + 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' @@ -9758,9 +9135,7 @@ components: car: white ShippingTaxRate: title: Shipping Tax Rate - description: >- - Associates a tax rate with a shipping option to indicate that the - shipping option is taxed in a certain way + description: Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way type: object required: - shipping_option_id @@ -9814,7 +9189,7 @@ components: example: {} Store: title: Store - description: 'Holds settings for the Store, such as name, currencies, etc.' + description: Holds settings for the Store, such as name, currencies, etc. type: object properties: id: @@ -9830,28 +9205,22 @@ components: type: string example: usd externalDocs: - url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. default_currency: description: Available if the relation `default_currency` is expanded. $ref: '#/components/schemas/Currency' currencies: - description: >- - The currencies that are enabled for the Store. Available if the - relation `currencies` is expanded. + description: The currencies that are enabled for the Store. Available if the relation `currencies` is expanded. type: array items: $ref: '#/components/schemas/Currency' swap_link_template: - description: >- - A template to generate Swap links from. Use {{cart_id}} to include - the Swap's `cart_id` in the link. + description: A template to generate Swap links from. Use {{cart_id}} to include the Swap's `cart_id` in the link. type: string example: null payment_link_template: - description: >- - A template to generate Payment links from. Use {{cart_id}} to - include the payment's `cart_id` in the link. + description: A template to generate Payment links from. Use {{cart_id}} to include the payment's `cart_id` in the link. type: string example: null invite_link_template: @@ -9863,9 +9232,7 @@ components: description: The sales channel ID the cart is associated with. example: null default_sales_channel: - description: >- - A sales channel object. Available if the relation - `default_sales_channel` is expanded. + description: A sales channel object. Available if the relation `default_sales_channel` is expanded. type: object metadata: type: object @@ -9874,14 +9241,7 @@ components: car: white Swap: title: Swap - description: >- - Swaps can be created when a Customer wishes to exchange Products that - they have purchased to different Products. Swaps consist of a Return of - previously purchased Products and a Fulfillment of new Products, the - amount paid for the Products being returned will be used towards payment - for the new Products. In the case where the amount paid for the the - Products being returned exceed the amount to be paid for the new - Products, a Refund will be issued for the difference. + description: Swaps can be created when a Customer wishes to exchange Products that they have purchased to different Products. Swaps consist of a Return of previously purchased Products and a Fulfillment of new Products, the amount paid for the Products being returned will be used towards payment for the new Products. In the case where the amount paid for the the Products being returned exceed the amount to be paid for the new Products, a Refund will be issued for the difference. type: object required: - fulfillment_status @@ -9903,9 +9263,7 @@ components: - requires_action example: not_fulfilled payment_status: - description: >- - The status of the Payment of the Swap. The payment may either refer - to the refund of an amount or the authorization of a new amount. + description: The status of the Payment of the Swap. The payment may either refer to the refund of an amount or the authorization of a new amount. type: string enum: - not_paid @@ -9919,59 +9277,41 @@ components: - requires_action example: not_paid order_id: - description: >- - The ID of the Order where the Line Items to be returned where - purchased. + description: The ID of the Order where the Line Items to be returned where purchased. type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. type: object additional_items: - description: >- - The new Line Items to ship to the Customer. Available if the - relation `additional_items` is expanded. + description: The new Line Items to ship to the Customer. Available if the relation `additional_items` is expanded. type: array items: $ref: '#/components/schemas/LineItem' return_order: - description: >- - A return order object. The Return that is issued for the return part - of the Swap. Available if the relation `return_order` is expanded. + description: A return order object. The Return that is issued for the return part of the Swap. Available if the relation `return_order` is expanded. type: object fulfillments: - description: >- - The Fulfillments used to send the new Line Items. Available if the - relation `fulfillments` is expanded. + description: The Fulfillments used to send the new Line Items. Available if the relation `fulfillments` is expanded. type: array items: - $ref: '#/components/schemas/Fulfillment' + type: object payment: - description: >- - The Payment authorized when the Swap requires an additional amount - to be charged from the Customer. Available if the relation `payment` - is expanded. - $ref: '#/components/schemas/Payment' + description: The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. + type: object difference_due: - description: >- - The difference that is paid or refunded as a result of the Swap. May - be negative when the amount paid for the returned items exceed the - total of the new Products. + description: The difference that is paid or refunded as a result of the Swap. May be negative when the amount paid for the returned items exceed the total of the new Products. type: integer example: 0 shipping_address_id: - description: >- - The Address to send the new Line Items to - in most cases this will - be the same as the shipping address on the Order. + description: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. $ref: '#/components/schemas/Address' shipping_methods: - description: >- - The Shipping Methods used to fulfill the additional items purchased. - Available if the relation `shipping_methods` is expanded. + description: The Shipping Methods used to fulfill the additional items purchased. Available if the relation `shipping_methods` is expanded. type: array items: $ref: '#/components/schemas/ShippingMethod' @@ -9983,22 +9323,17 @@ components: description: A cart object. Available if the relation `cart` is expanded. type: object allow_backorder: - description: 'If true, swaps can be completed with items out of stock' + description: If true, swaps can be completed with items out of stock type: boolean default: false idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of the swap - in case of failure. + description: Randomly generated key used to continue the completion of the swap in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. confirmed_at: - description: >- - The date with timezone at which the Swap was confirmed by the - Customer. + description: The date with timezone at which the Swap was confirmed by the Customer. type: string format: date-time canceled_at: @@ -10006,7 +9341,7 @@ components: type: string format: date-time no_notification: - description: 'If set to true, no notification will be sent related to this swap' + description: If set to true, no notification will be sent related to this swap type: boolean example: false created_at: @@ -10073,17 +9408,12 @@ components: type: string example: manual is_installed: - description: >- - Whether the plugin is installed in the current version. Plugins that - are no longer installed are not deleted by will have this field set - to `false`. + description: Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`. type: boolean default: true TaxRate: title: Tax Rate - description: >- - A Tax Rate can be used to associate a certain rate to charge on products - within a given Region + description: A Tax Rate can be used to associate a certain rate to charge on products within a given Region type: object required: - name @@ -10114,25 +9444,19 @@ components: type: object products: type: array - description: >- - The products that belong to this tax rate. Available if the relation - `products` is expanded. + description: The products that belong to this tax rate. Available if the relation `products` is expanded. items: type: object description: A product object. product_types: type: array - description: >- - The product types that belong to this tax rate. Available if the - relation `product_types` is expanded. + description: The product types that belong to this tax rate. Available if the relation `product_types` is expanded. items: type: object description: A product type object. shipping_options: type: array - description: >- - The shipping options that belong to this tax rate. Available if the - relation `shipping_options` is expanded. + description: The shipping options that belong to this tax rate. Available if the relation `shipping_options` is expanded. items: type: object description: A shipping option object. @@ -10163,10 +9487,7 @@ components: car: white TrackingLink: title: Tracking Link - description: >- - Tracking Link holds information about tracking numbers for a - Fulfillment. Tracking Links can optionally contain a URL that can be - visited to see the status of the shipment. + description: Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment. type: object required: - tracking_number @@ -10193,12 +9514,9 @@ components: $ref: '#/components/schemas/Fulfillment' idempotency_key: type: string - description: >- - Randomly generated key used to continue the completion of a process - in case of failure. + description: Randomly generated key used to continue the completion of a process in case of failure. externalDocs: - url: >- - https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key + url: https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: type: string @@ -10261,6 +9579,58 @@ components: description: An optional key-value map with additional details example: car: white + InventoryItemDTO: + type: object + required: + - sku + properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + material: + description: The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers. + type: string + weight: + description: The weight of the Inventory Item. May be used in shipping rate calculations. + type: number + height: + description: The height of the Inventory Item. May be used in shipping rate calculations. + type: number + width: + description: The width of the Inventory Item. May be used in shipping rate calculations. + type: number + length: + description: The length of the Inventory Item. May be used in shipping rate calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time ReservationItemDTO: title: Reservation item description: Represents a reservation of an inventory item at a stock location @@ -10300,6 +9670,44 @@ components: type: string description: The date with timezone at which the resource was deleted. format: date-time + InventoryLevelDTO: + type: object + required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity + properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time PricedVariant: title: Priced Product Variant type: object @@ -10309,9 +9717,7 @@ components: properties: original_price: type: number - description: >- - The original price of the variant without any discounted prices - applied. + description: The original price of the variant without any discounted prices applied. calculated_price: type: number description: The calculated price of the variant. Can be a discounted price. @@ -10370,11 +9776,15 @@ components: address_1: type: string description: Stock location address - example: '35, Jhon Doe Ave' + example: 35, Jhon Doe Ave address_2: type: string description: Stock location address' complement example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa city: type: string description: Stock location address' city @@ -10468,7 +9878,7 @@ components: address_1: type: string description: Stock location address - example: '35, Jhon Doe Ave' + example: 35, Jhon Doe Ave address_2: type: string description: Stock location address' complement @@ -10553,9 +9963,7 @@ components: $ref: '#/components/schemas/Error' message: type: string - default: >- - Provided request body contains errors. Please check the data and - retry the request + default: Provided request body contains errors. Please check the data and retry the request Error: title: Response Error type: object @@ -10569,6 +9977,18 @@ components: type: type: string description: A slug indicating the type of the error. + StorePostAuthReq: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. StoreAuthRes: type: object properties: @@ -10580,6 +10000,17 @@ components: exists: type: boolean description: Whether email exists or not. + StorePostCartsCartShippingMethodReq: + type: object + required: + - option_id + properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: Used to hold any data that the shipping method may need to process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send. StorePostCartReq: type: object properties: @@ -10593,15 +10024,13 @@ components: type: string description: The 2 character ISO country code to create the Cart in. externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. items: - description: >- - An optional array of `variant_id`, `quantity` pairs to generate Line - Items from. + description: An optional array of `variant_id`, `quantity` pairs to generate Line Items from. type: array items: + type: object required: - variant_id - quantity @@ -10613,9 +10042,7 @@ components: description: The quantity of the Product Variant to add type: integer context: - description: >- - An optional object to provide context to the Cart. The `context` - field is automatically populated with `ip` and `user_agent` + description: An optional object to provide context to the Cart. The `context` field is automatically populated with `ip` and `user_agent` type: object example: ip: '::1' @@ -10641,22 +10068,24 @@ components: oneOf: - type: object allOf: - - description: >- - Cart was successfully authorized and order was placed - successfully. + - description: Cart was successfully authorized and order was placed successfully. - $ref: '#/components/schemas/Order' - type: object allOf: - - description: >- - Cart was successfully authorized but requires further - actions. + - description: Cart was successfully authorized but requires further actions. - $ref: '#/components/schemas/Cart' - type: object allOf: - - description: >- - When cart is used for a swap and it has been completed - successfully. + - description: When cart is used for a swap and it has been completed successfully. - $ref: '#/components/schemas/Swap' + StorePostCartsCartPaymentSessionReq: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The ID of the Payment Provider. StorePostCartsCartReq: type: object properties: @@ -10667,8 +10096,7 @@ components: type: string description: The 2 character ISO country code to create the Cart in. externalDocs: - url: >- - https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + url: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. email: type: string @@ -10695,6 +10123,7 @@ components: description: An array of Gift Card codes to add to the Cart. type: array items: + type: object required: - code properties: @@ -10705,6 +10134,7 @@ components: description: An array of Discount codes to add to the Cart. type: array items: + type: object required: - code properties: @@ -10720,6 +10150,22 @@ components: example: ip: '::1' user_agent: Chrome + StorePostCartsCartLineItemsItemReq: + type: object + required: + - quantity + properties: + quantity: + type: number + description: The quantity to set the Line Item to. + StorePostCartsCartPaymentSessionUpdateReq: + type: object + required: + - data + properties: + data: + type: object + description: The data to update the payment session with. StoreCollectionsListRes: type: object properties: @@ -10814,14 +10260,10 @@ components: properties: provider_id: type: string - description: >- - The id of the Payment Provider where the payment method is - saved. + description: The id of the Payment Provider where the payment method is saved. data: type: object - description: >- - The data needed for the Payment Provider to use the saved - payment method. + description: The data needed for the Payment Provider to use the saved payment method. StorePostCustomersCustomerPasswordTokenReq: type: object required: @@ -10945,12 +10387,10 @@ components: - sessions properties: sessions: - description: >- - An array of payment sessions related to the Payment Collection. If - the session_id is not provided, existing sessions not present will - be deleted and the provided ones will be created. + description: An array of payment sessions related to the Payment Collection. If the session_id is not provided, existing sessions not present will be deleted and the provided ones will be created. type: array items: + type: object required: - provider_id - amount @@ -10972,11 +10412,27 @@ components: provider_id: type: string description: The ID of the Payment Provider. - StoreGetProductCategoryRes: + 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: @@ -11003,9 +10459,7 @@ components: properties: hits: type: array - description: >- - Array of results. The format of the items depends on the search - engine installed on the server. + description: Array of results. The format of the items depends on the search engine installed on the server. StoreProductsListRes: type: object properties: @@ -11059,6 +10513,7 @@ components: description: The items to include in the Return. type: array items: + type: object required: - item_id - quantity @@ -11076,19 +10531,14 @@ components: description: A note to add to the item returned. type: string return_shipping: - description: >- - If the Return is to be handled by the store operator the Customer - can choose a Return Shipping Method. Alternatvely the Customer can - handle the Return themselves. + description: If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves. type: object required: - option_id properties: option_id: type: string - description: >- - The ID of the Shipping Option to create the Shipping Method - from. + description: The ID of the Shipping Option to create the Shipping Method from. StoreReturnsRes: type: object properties: @@ -11115,6 +10565,7 @@ components: description: The items to include in the Return. type: array items: + type: object required: - item_id - quantity @@ -11138,6 +10589,7 @@ components: description: The items to exchange the returned items to. type: array items: + type: object required: - variant_id - quantity @@ -11165,3 +10617,18 @@ components: type: array items: $ref: '#/components/schemas/PricedVariant' + StorePostCartsCartLineItemsReq: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: The id of the Product Variant to generate the Line Item from. + quantity: + type: number + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: An optional key-value map with additional details about the Line Item. diff --git a/docs/api/store/code_samples/JavaScript/auth/getundefined b/docs/api/store/code_samples/JavaScript/auth/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/auth/getundefined rename to docs/api/store/code_samples/JavaScript/auth/get.js diff --git a/docs/api/store/code_samples/JavaScript/auth/postundefined b/docs/api/store/code_samples/JavaScript/auth/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/auth/postundefined rename to docs/api/store/code_samples/JavaScript/auth/post.js diff --git a/docs/api/store/code_samples/JavaScript/auth_{email}/getundefined b/docs/api/store/code_samples/JavaScript/auth_{email}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/auth_{email}/getundefined rename to docs/api/store/code_samples/JavaScript/auth_{email}/get.js diff --git a/docs/api/store/code_samples/JavaScript/carts/postundefined b/docs/api/store/code_samples/JavaScript/carts/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts/postundefined rename to docs/api/store/code_samples/JavaScript/carts/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}/getundefined b/docs/api/store/code_samples/JavaScript/carts_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_complete/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_complete/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_complete/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_complete/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_discounts_{code}/deleteundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_discounts_{code}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_discounts_{code}/deleteundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_discounts_{code}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_line-items/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_line-items/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_line-items/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_line-items/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/deleteundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/deleteundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_line-items_{line_id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-session/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_payment-session/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-session/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_payment-session/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/deleteundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/deleteundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/post.js diff --git a/docs/api/store/code_samples/JavaScript/carts_{id}_shipping-methods/postundefined b/docs/api/store/code_samples/JavaScript/carts_{id}_shipping-methods/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/carts_{id}_shipping-methods/postundefined rename to docs/api/store/code_samples/JavaScript/carts_{id}_shipping-methods/post.js diff --git a/docs/api/store/code_samples/JavaScript/collections/getundefined b/docs/api/store/code_samples/JavaScript/collections/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/collections/getundefined rename to docs/api/store/code_samples/JavaScript/collections/get.js diff --git a/docs/api/store/code_samples/JavaScript/collections_{id}/getundefined b/docs/api/store/code_samples/JavaScript/collections_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/collections_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/collections_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers/postundefined b/docs/api/store/code_samples/JavaScript/customers/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers/postundefined rename to docs/api/store/code_samples/JavaScript/customers/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me/getundefined b/docs/api/store/code_samples/JavaScript/customers_me/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me/getundefined rename to docs/api/store/code_samples/JavaScript/customers_me/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me/postundefined b/docs/api/store/code_samples/JavaScript/customers_me/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me/postundefined rename to docs/api/store/code_samples/JavaScript/customers_me/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_addresses/postundefined b/docs/api/store/code_samples/JavaScript/customers_me_addresses/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_addresses/postundefined rename to docs/api/store/code_samples/JavaScript/customers_me_addresses/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/deleteundefined b/docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/delete.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/deleteundefined rename to docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/delete.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/postundefined b/docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/postundefined rename to docs/api/store/code_samples/JavaScript/customers_me_addresses_{address_id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_orders/getundefined b/docs/api/store/code_samples/JavaScript/customers_me_orders/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_orders/getundefined rename to docs/api/store/code_samples/JavaScript/customers_me_orders/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers_me_payment-methods/getundefined b/docs/api/store/code_samples/JavaScript/customers_me_payment-methods/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_me_payment-methods/getundefined rename to docs/api/store/code_samples/JavaScript/customers_me_payment-methods/get.js diff --git a/docs/api/store/code_samples/JavaScript/customers_password-reset/postundefined b/docs/api/store/code_samples/JavaScript/customers_password-reset/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_password-reset/postundefined rename to docs/api/store/code_samples/JavaScript/customers_password-reset/post.js diff --git a/docs/api/store/code_samples/JavaScript/customers_password-token/postundefined b/docs/api/store/code_samples/JavaScript/customers_password-token/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/customers_password-token/postundefined rename to docs/api/store/code_samples/JavaScript/customers_password-token/post.js diff --git a/docs/api/store/code_samples/JavaScript/gift-cards_{code}/getundefined b/docs/api/store/code_samples/JavaScript/gift-cards_{code}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/gift-cards_{code}/getundefined rename to docs/api/store/code_samples/JavaScript/gift-cards_{code}/get.js diff --git a/docs/api/store/code_samples/JavaScript/order-edits_{id}/getundefined b/docs/api/store/code_samples/JavaScript/order-edits_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/order-edits_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/order-edits_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/postundefined b/docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/postundefined rename to docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/post.js diff --git a/docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/postundefined b/docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/postundefined rename to docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/post.js diff --git a/docs/api/store/code_samples/JavaScript/orders/getundefined b/docs/api/store/code_samples/JavaScript/orders/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders/getundefined rename to docs/api/store/code_samples/JavaScript/orders/get.js diff --git a/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined b/docs/api/store/code_samples/JavaScript/orders_batch_customer_token/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_batch_customer_token/postundefined rename to docs/api/store/code_samples/JavaScript/orders_batch_customer_token/post.js diff --git a/docs/api/store/code_samples/JavaScript/orders_cart_{cart_id}/getundefined b/docs/api/store/code_samples/JavaScript/orders_cart_{cart_id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_cart_{cart_id}/getundefined rename to docs/api/store/code_samples/JavaScript/orders_cart_{cart_id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined b/docs/api/store/code_samples/JavaScript/orders_customer_confirm/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_customer_confirm/postundefined rename to docs/api/store/code_samples/JavaScript/orders_customer_confirm/post.js diff --git a/docs/api/store/code_samples/JavaScript/orders_{id}/getundefined b/docs/api/store/code_samples/JavaScript/orders_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/orders_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/orders_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/payment-collections_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/postundefined rename to docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions/post.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined rename to docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch/post.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined rename to docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/post.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined rename to docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/post.js diff --git a/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined b/docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined rename to docs/api/store/code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/post.js diff --git a/docs/api/store/code_samples/JavaScript/product-categories/get.js b/docs/api/store/code_samples/JavaScript/product-categories/get.js new file mode 100644 index 0000000000..1640c466e4 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/product-categories/get.js @@ -0,0 +1,6 @@ +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); +}); diff --git a/docs/api/store/code_samples/JavaScript/product-categories_{id}/get.js b/docs/api/store/code_samples/JavaScript/product-categories_{id}/get.js new file mode 100644 index 0000000000..62b8663838 --- /dev/null +++ b/docs/api/store/code_samples/JavaScript/product-categories_{id}/get.js @@ -0,0 +1,7 @@ +import Medusa from "@medusajs/medusa-js" +const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) +// must be previously logged in or use api token +medusa.productCategories.retrieve(product_category_id) + .then(({ product_category }) => { + console.log(product_category.id); + }); diff --git a/docs/api/store/code_samples/JavaScript/product-tags/getundefined b/docs/api/store/code_samples/JavaScript/product-tags/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/product-tags/getundefined rename to docs/api/store/code_samples/JavaScript/product-tags/get.js diff --git a/docs/api/store/code_samples/JavaScript/product-types/getundefined b/docs/api/store/code_samples/JavaScript/product-types/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/product-types/getundefined rename to docs/api/store/code_samples/JavaScript/product-types/get.js diff --git a/docs/api/store/code_samples/JavaScript/products/getundefined b/docs/api/store/code_samples/JavaScript/products/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/products/getundefined rename to docs/api/store/code_samples/JavaScript/products/get.js diff --git a/docs/api/store/code_samples/JavaScript/products_search/postundefined b/docs/api/store/code_samples/JavaScript/products_search/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/products_search/postundefined rename to docs/api/store/code_samples/JavaScript/products_search/post.js diff --git a/docs/api/store/code_samples/JavaScript/products_{id}/getundefined b/docs/api/store/code_samples/JavaScript/products_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/products_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/products_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/regions/getundefined b/docs/api/store/code_samples/JavaScript/regions/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/regions/getundefined rename to docs/api/store/code_samples/JavaScript/regions/get.js diff --git a/docs/api/store/code_samples/JavaScript/regions_{id}/getundefined b/docs/api/store/code_samples/JavaScript/regions_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/regions_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/regions_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/return-reasons/getundefined b/docs/api/store/code_samples/JavaScript/return-reasons/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/return-reasons/getundefined rename to docs/api/store/code_samples/JavaScript/return-reasons/get.js diff --git a/docs/api/store/code_samples/JavaScript/return-reasons_{id}/getundefined b/docs/api/store/code_samples/JavaScript/return-reasons_{id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/return-reasons_{id}/getundefined rename to docs/api/store/code_samples/JavaScript/return-reasons_{id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/returns/postundefined b/docs/api/store/code_samples/JavaScript/returns/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/returns/postundefined rename to docs/api/store/code_samples/JavaScript/returns/post.js diff --git a/docs/api/store/code_samples/JavaScript/shipping-options/getundefined b/docs/api/store/code_samples/JavaScript/shipping-options/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/shipping-options/getundefined rename to docs/api/store/code_samples/JavaScript/shipping-options/get.js diff --git a/docs/api/store/code_samples/JavaScript/shipping-options_{cart_id}/getundefined b/docs/api/store/code_samples/JavaScript/shipping-options_{cart_id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/shipping-options_{cart_id}/getundefined rename to docs/api/store/code_samples/JavaScript/shipping-options_{cart_id}/get.js diff --git a/docs/api/store/code_samples/JavaScript/swaps/postundefined b/docs/api/store/code_samples/JavaScript/swaps/post.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/swaps/postundefined rename to docs/api/store/code_samples/JavaScript/swaps/post.js diff --git a/docs/api/store/code_samples/JavaScript/swaps_{cart_id}/getundefined b/docs/api/store/code_samples/JavaScript/swaps_{cart_id}/get.js similarity index 100% rename from docs/api/store/code_samples/JavaScript/swaps_{cart_id}/getundefined rename to docs/api/store/code_samples/JavaScript/swaps_{cart_id}/get.js diff --git a/docs/api/store/code_samples/Shell/auth/deleteundefined b/docs/api/store/code_samples/Shell/auth/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth/deleteundefined rename to docs/api/store/code_samples/Shell/auth/delete.sh diff --git a/docs/api/store/code_samples/Shell/auth/getundefined b/docs/api/store/code_samples/Shell/auth/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth/getundefined rename to docs/api/store/code_samples/Shell/auth/get.sh diff --git a/docs/api/store/code_samples/Shell/auth/postundefined b/docs/api/store/code_samples/Shell/auth/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth/postundefined rename to docs/api/store/code_samples/Shell/auth/post.sh diff --git a/docs/api/store/code_samples/Shell/auth_{email}/getundefined b/docs/api/store/code_samples/Shell/auth_{email}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/auth_{email}/getundefined rename to docs/api/store/code_samples/Shell/auth_{email}/get.sh diff --git a/docs/api/store/code_samples/Shell/carts/postundefined b/docs/api/store/code_samples/Shell/carts/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts/postundefined rename to docs/api/store/code_samples/Shell/carts/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}/getundefined b/docs/api/store/code_samples/Shell/carts_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}/getundefined rename to docs/api/store/code_samples/Shell/carts_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}/postundefined b/docs/api/store/code_samples/Shell/carts_{id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_complete/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_complete/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_complete/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_complete/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_discounts_{code}/deleteundefined b/docs/api/store/code_samples/Shell/carts_{id}_discounts_{code}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_discounts_{code}/deleteundefined rename to docs/api/store/code_samples/Shell/carts_{id}_discounts_{code}/delete.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_line-items/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_line-items/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_line-items/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_line-items/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/deleteundefined b/docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/deleteundefined rename to docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/delete.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_line-items_{line_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-session/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_payment-session/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-session/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_payment-session/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_payment-sessions/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/deleteundefined b/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/deleteundefined rename to docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/delete.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_shipping-methods/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_shipping-methods/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_shipping-methods/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_shipping-methods/post.sh diff --git a/docs/api/store/code_samples/Shell/carts_{id}_taxes/postundefined b/docs/api/store/code_samples/Shell/carts_{id}_taxes/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/carts_{id}_taxes/postundefined rename to docs/api/store/code_samples/Shell/carts_{id}_taxes/post.sh diff --git a/docs/api/store/code_samples/Shell/collections/getundefined b/docs/api/store/code_samples/Shell/collections/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/collections/getundefined rename to docs/api/store/code_samples/Shell/collections/get.sh diff --git a/docs/api/store/code_samples/Shell/collections_{id}/getundefined b/docs/api/store/code_samples/Shell/collections_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/collections_{id}/getundefined rename to docs/api/store/code_samples/Shell/collections_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/customers/postundefined b/docs/api/store/code_samples/Shell/customers/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers/postundefined rename to docs/api/store/code_samples/Shell/customers/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me/getundefined b/docs/api/store/code_samples/Shell/customers_me/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me/getundefined rename to docs/api/store/code_samples/Shell/customers_me/get.sh diff --git a/docs/api/store/code_samples/Shell/customers_me/postundefined b/docs/api/store/code_samples/Shell/customers_me/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me/postundefined rename to docs/api/store/code_samples/Shell/customers_me/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_addresses/postundefined b/docs/api/store/code_samples/Shell/customers_me_addresses/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_addresses/postundefined rename to docs/api/store/code_samples/Shell/customers_me_addresses/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/deleteundefined b/docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/delete.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/deleteundefined rename to docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/delete.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/postundefined b/docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/postundefined rename to docs/api/store/code_samples/Shell/customers_me_addresses_{address_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_orders/getundefined b/docs/api/store/code_samples/Shell/customers_me_orders/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_orders/getundefined rename to docs/api/store/code_samples/Shell/customers_me_orders/get.sh diff --git a/docs/api/store/code_samples/Shell/customers_me_payment-methods/getundefined b/docs/api/store/code_samples/Shell/customers_me_payment-methods/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_me_payment-methods/getundefined rename to docs/api/store/code_samples/Shell/customers_me_payment-methods/get.sh diff --git a/docs/api/store/code_samples/Shell/customers_password-reset/postundefined b/docs/api/store/code_samples/Shell/customers_password-reset/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_password-reset/postundefined rename to docs/api/store/code_samples/Shell/customers_password-reset/post.sh diff --git a/docs/api/store/code_samples/Shell/customers_password-token/postundefined b/docs/api/store/code_samples/Shell/customers_password-token/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/customers_password-token/postundefined rename to docs/api/store/code_samples/Shell/customers_password-token/post.sh diff --git a/docs/api/store/code_samples/Shell/gift-cards_{code}/getundefined b/docs/api/store/code_samples/Shell/gift-cards_{code}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/gift-cards_{code}/getundefined rename to docs/api/store/code_samples/Shell/gift-cards_{code}/get.sh diff --git a/docs/api/store/code_samples/Shell/order-edits_{id}/getundefined b/docs/api/store/code_samples/Shell/order-edits_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/order-edits_{id}/getundefined rename to docs/api/store/code_samples/Shell/order-edits_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/order-edits_{id}_complete/postundefined b/docs/api/store/code_samples/Shell/order-edits_{id}_complete/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/order-edits_{id}_complete/postundefined rename to docs/api/store/code_samples/Shell/order-edits_{id}_complete/post.sh diff --git a/docs/api/store/code_samples/Shell/order-edits_{id}_decline/postundefined b/docs/api/store/code_samples/Shell/order-edits_{id}_decline/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/order-edits_{id}_decline/postundefined rename to docs/api/store/code_samples/Shell/order-edits_{id}_decline/post.sh diff --git a/docs/api/store/code_samples/Shell/orders/getundefined b/docs/api/store/code_samples/Shell/orders/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders/getundefined rename to docs/api/store/code_samples/Shell/orders/get.sh diff --git a/docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined b/docs/api/store/code_samples/Shell/orders_batch_customer_token/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_batch_customer_token/postundefined rename to docs/api/store/code_samples/Shell/orders_batch_customer_token/post.sh diff --git a/docs/api/store/code_samples/Shell/orders_cart_{cart_id}/getundefined b/docs/api/store/code_samples/Shell/orders_cart_{cart_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_cart_{cart_id}/getundefined rename to docs/api/store/code_samples/Shell/orders_cart_{cart_id}/get.sh diff --git a/docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined b/docs/api/store/code_samples/Shell/orders_customer_confirm/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_customer_confirm/postundefined rename to docs/api/store/code_samples/Shell/orders_customer_confirm/post.sh diff --git a/docs/api/store/code_samples/Shell/orders_{id}/getundefined b/docs/api/store/code_samples/Shell/orders_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/orders_{id}/getundefined rename to docs/api/store/code_samples/Shell/orders_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}/getundefined rename to docs/api/store/code_samples/Shell/payment-collections_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/postundefined rename to docs/api/store/code_samples/Shell/payment-collections_{id}_sessions/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined rename to docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined rename to docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined rename to docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}/post.sh diff --git a/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined b/docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined rename to docs/api/store/code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/post.sh diff --git a/docs/api/store/code_samples/Shell/product-categories/getundefined b/docs/api/store/code_samples/Shell/product-categories/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-categories/getundefined rename to docs/api/store/code_samples/Shell/product-categories/get.sh diff --git a/docs/api/store/code_samples/Shell/product-categories_{id}/getundefined b/docs/api/store/code_samples/Shell/product-categories_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-categories_{id}/getundefined rename to docs/api/store/code_samples/Shell/product-categories_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/product-tags/getundefined b/docs/api/store/code_samples/Shell/product-tags/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-tags/getundefined rename to docs/api/store/code_samples/Shell/product-tags/get.sh diff --git a/docs/api/store/code_samples/Shell/product-types/getundefined b/docs/api/store/code_samples/Shell/product-types/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/product-types/getundefined rename to docs/api/store/code_samples/Shell/product-types/get.sh diff --git a/docs/api/store/code_samples/Shell/products/getundefined b/docs/api/store/code_samples/Shell/products/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/products/getundefined rename to docs/api/store/code_samples/Shell/products/get.sh diff --git a/docs/api/store/code_samples/Shell/products_search/postundefined b/docs/api/store/code_samples/Shell/products_search/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/products_search/postundefined rename to docs/api/store/code_samples/Shell/products_search/post.sh diff --git a/docs/api/store/code_samples/Shell/products_{id}/getundefined b/docs/api/store/code_samples/Shell/products_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/products_{id}/getundefined rename to docs/api/store/code_samples/Shell/products_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/regions/getundefined b/docs/api/store/code_samples/Shell/regions/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/regions/getundefined rename to docs/api/store/code_samples/Shell/regions/get.sh diff --git a/docs/api/store/code_samples/Shell/regions_{id}/getundefined b/docs/api/store/code_samples/Shell/regions_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/regions_{id}/getundefined rename to docs/api/store/code_samples/Shell/regions_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/return-reasons/getundefined b/docs/api/store/code_samples/Shell/return-reasons/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/return-reasons/getundefined rename to docs/api/store/code_samples/Shell/return-reasons/get.sh diff --git a/docs/api/store/code_samples/Shell/return-reasons_{id}/getundefined b/docs/api/store/code_samples/Shell/return-reasons_{id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/return-reasons_{id}/getundefined rename to docs/api/store/code_samples/Shell/return-reasons_{id}/get.sh diff --git a/docs/api/store/code_samples/Shell/returns/postundefined b/docs/api/store/code_samples/Shell/returns/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/returns/postundefined rename to docs/api/store/code_samples/Shell/returns/post.sh diff --git a/docs/api/store/code_samples/Shell/shipping-options/getundefined b/docs/api/store/code_samples/Shell/shipping-options/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/shipping-options/getundefined rename to docs/api/store/code_samples/Shell/shipping-options/get.sh diff --git a/docs/api/store/code_samples/Shell/shipping-options_{cart_id}/getundefined b/docs/api/store/code_samples/Shell/shipping-options_{cart_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/shipping-options_{cart_id}/getundefined rename to docs/api/store/code_samples/Shell/shipping-options_{cart_id}/get.sh diff --git a/docs/api/store/code_samples/Shell/swaps/postundefined b/docs/api/store/code_samples/Shell/swaps/post.sh similarity index 100% rename from docs/api/store/code_samples/Shell/swaps/postundefined rename to docs/api/store/code_samples/Shell/swaps/post.sh diff --git a/docs/api/store/code_samples/Shell/swaps_{cart_id}/getundefined b/docs/api/store/code_samples/Shell/swaps_{cart_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/swaps_{cart_id}/getundefined rename to docs/api/store/code_samples/Shell/swaps_{cart_id}/get.sh diff --git a/docs/api/store/code_samples/Shell/variants/getundefined b/docs/api/store/code_samples/Shell/variants/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/variants/getundefined rename to docs/api/store/code_samples/Shell/variants/get.sh diff --git a/docs/api/store/code_samples/Shell/variants_{variant_id}/getundefined b/docs/api/store/code_samples/Shell/variants_{variant_id}/get.sh similarity index 100% rename from docs/api/store/code_samples/Shell/variants_{variant_id}/getundefined rename to docs/api/store/code_samples/Shell/variants_{variant_id}/get.sh diff --git a/docs/api/store/components/schemas/Address.yaml b/docs/api/store/components/schemas/Address.yaml index a69d410311..d2797dc196 100644 --- a/docs/api/store/components/schemas/Address.yaml +++ b/docs/api/store/components/schemas/Address.yaml @@ -1,48 +1,71 @@ title: Address description: An address. type: object +required: + - address_1 + - address_2 + - city + - company + - country_code + - created_at + - customer_id + - deleted_at + - first_name + - id + - last_name + - metadata + - phone + - postal_code + - province + - updated_at properties: id: type: string description: ID of the address example: addr_01G8ZC9VS1XVE149MGH2J7QSSH customer_id: - type: string description: ID of the customer this address belongs to + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: Available if the relation `customer` is expanded. - type: array - items: - type: object - description: A customer object. + nullable: true + type: object company: - type: string description: Company name + nullable: true + type: string example: Acme first_name: - type: string description: First name + nullable: true + type: string example: Arno last_name: - type: string description: Last name + nullable: true + type: string example: Willms address_1: - type: string description: Address line 1 + nullable: true + type: string example: 14433 Kemmer Court address_2: - type: string description: Address line 2 + nullable: true + type: string example: Suite 369 city: - type: string description: City + nullable: true + type: string example: South Geoffreyview country_code: - type: string description: The 2 character ISO code of the country in lower case + nullable: true + type: string externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements @@ -50,18 +73,22 @@ properties: example: st country: description: A country object. Available if the relation `country` is expanded. - type: object + nullable: true + $ref: ./Country.yaml province: - type: string description: Province + nullable: true + type: string example: Kentucky postal_code: - type: string description: Postal Code + nullable: true + type: string example: 72093 phone: - type: string description: Phone Number + nullable: true + type: string example: 16128234334802 created_at: type: string @@ -72,11 +99,13 @@ properties: description: The date with timezone at which the resource was updated. format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/BatchJob.yaml b/docs/api/store/components/schemas/BatchJob.yaml index 92a81b4576..31782073a7 100644 --- a/docs/api/store/components/schemas/BatchJob.yaml +++ b/docs/api/store/components/schemas/BatchJob.yaml @@ -2,21 +2,36 @@ title: Batch Job description: A Batch Job. type: object required: + - canceled_at + - completed_at + - confirmed_at + - context + - created_at + - created_by + - deleted_at + - dry_run + - failed_at + - id + - pre_processed_at + - processing_at + - result + - status - type + - updated_at properties: id: - type: string description: The unique identifier for the batch job. + type: string example: batch_01G8T782965PYFG0751G0Z38B4 type: - type: string description: The type of batch job. + type: string enum: - product-import - product-export status: - type: string description: The status of the batch job. + type: string enum: - created - pre_processed @@ -27,17 +42,20 @@ properties: - failed default: created created_by: - type: string description: The unique identifier of the user that created the batch job. + nullable: true + type: string example: usr_01G1G5V26F5TB3GPAPNJ8X1S3V created_by_user: description: A user object. Available if the relation `created_by_user` is expanded. - type: object + nullable: true + $ref: ./User.yaml context: - type: object description: >- The context of the batch job, the type of the batch job determines what the context should contain. + nullable: true + type: object example: shape: prices: @@ -55,43 +73,47 @@ properties: - variant.prices - images dry_run: - type: boolean description: Specify if the job must apply the modifications or not. + type: boolean default: false result: - type: object description: The result of the batch job. - properties: - count: - type: number - advancement_count: - type: number - progress: - type: number - errors: - type: object + nullable: true + allOf: + - type: object + example: {} + - type: object properties: - message: + count: + type: number + advancement_count: + type: number + progress: + type: number + errors: + type: object + properties: + message: + type: string + code: + oneOf: + - type: string + - type: number + err: + type: array + stat_descriptors: + type: object + properties: + key: + type: string + name: + type: string + message: + type: string + file_key: type: string - code: - oneOf: - - type: string - - type: number - err: - type: array - stat_descriptors: - type: object - properties: - key: - type: string - name: - type: string - message: - type: string - file_key: - type: string - file_size: - type: number + file_size: + type: number example: errors: - err: [] @@ -102,38 +124,45 @@ properties: name: Product count to export message: There will be 8 products exported by this action pre_processed_at: + description: The date from which the job has been pre-processed. + nullable: true type: string - description: The date from which the job has been pre processed. format: date-time processing_at: - type: string description: The date the job is processing at. + nullable: true + type: string format: date-time confirmed_at: - type: string description: The date when the confirmation has been done. + nullable: true + type: string format: date-time completed_at: - type: string description: The date of the completion. + nullable: true + type: string format: date-time canceled_at: - type: string description: The date of the concellation. + nullable: true + type: string format: date-time failed_at: - type: string description: The date when the job failed. + nullable: true + type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was last updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time diff --git a/docs/api/store/components/schemas/Cart.yaml b/docs/api/store/components/schemas/Cart.yaml index aef4b274ff..204dddb8af 100644 --- a/docs/api/store/components/schemas/Cart.yaml +++ b/docs/api/store/components/schemas/Cart.yaml @@ -1,28 +1,51 @@ title: Cart description: Represents a user cart type: object +required: + - billing_address_id + - completed_at + - context + - created_at + - customer_id + - deleted_at + - email + - id + - idempotency_key + - metadata + - payment_authorized_at + - payment_id + - payment_session + - region_id + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The cart's ID + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 email: - type: string description: The email associated with the cart + nullable: true + type: string format: email billing_address_id: - type: string description: The billing address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_address_id: - type: string description: The shipping address's ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml items: description: Available if the relation `items` is expanded. @@ -30,54 +53,58 @@ properties: items: $ref: ./LineItem.yaml region_id: - type: string description: The region's ID + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml discounts: - type: array description: Available if the relation `discounts` is expanded. - items: - type: object - description: A discount object. - gift_cards: type: array - description: Available if the relation `gift_cards` is expanded. items: - type: object - description: A gift card object. + $ref: ./Discount.yaml + gift_cards: + description: Available if the relation `gift_cards` is expanded. + type: array + items: + $ref: ./GiftCard.yaml customer_id: - type: string description: The customer's ID + nullable: true + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 customer: description: A customer object. Available if the relation `customer` is expanded. + nullable: true type: object payment_session: description: The selected payment session in the cart. + nullable: true $ref: ./PaymentSession.yaml payment_sessions: - type: array description: The payment sessions created on the cart. + type: array items: $ref: ./PaymentSession.yaml payment_id: - type: string description: The payment's ID if available + nullable: true + type: string example: pay_01G8ZCC5W42ZNY842124G7P5R9 payment: description: Available if the relation `payment` is expanded. - $ref: ./Payment.yaml + nullable: true + type: object shipping_methods: - type: array description: The shipping methods added to the cart. + type: array items: $ref: ./ShippingMethod.yaml type: - type: string description: The cart's type. + type: string enum: - default - swap @@ -86,89 +113,105 @@ properties: - claim default: default completed_at: - type: string description: The date with timezone at which the cart was completed. + nullable: true + type: string format: date-time payment_authorized_at: - type: string description: The date with timezone at which the payment was authorized. + nullable: true + type: string format: date-time idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of a cart in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. context: - type: object description: The context of the cart which can include info like IP or user agent. + nullable: true + type: object example: ip: '::1' user_agent: PostmanRuntime/7.29.2 sales_channel_id: - type: string description: The sales channel ID the cart is associated with. + nullable: true + type: string example: null sales_channel: description: >- A sales channel object. Available if the relation `sales_channel` is expanded. - type: object + nullable: true + $ref: ./SalesChannel.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white shipping_total: - type: integer description: The total of shipping + type: integer example: 1000 discount_total: - type: integer description: The total of discount - example: 800 - tax_total: type: integer + example: 800 + item_tax_total: + description: The total of items with taxes + type: integer + example: 8000 + shipping_tax_total: + description: The total of shipping with taxes + type: integer + example: 1000 + tax_total: description: The total of tax + type: integer example: 0 refunded_total: - type: integer description: >- The total amount refunded if the order associated with this cart is returned. + type: integer example: 0 total: - type: integer description: The total amount of the cart + type: integer example: 8200 subtotal: - type: integer description: The subtotal of the cart + type: integer example: 8000 refundable_amount: - type: integer description: The amount that can be refunded + type: integer example: 8200 gift_card_total: - type: integer description: The total of gift cards + type: integer example: 0 gift_card_tax_total: - type: integer description: The total of gift cards with taxes + type: integer example: 0 diff --git a/docs/api/store/components/schemas/ClaimImage.yaml b/docs/api/store/components/schemas/ClaimImage.yaml index 721cfcf6a5..5a46013ba3 100644 --- a/docs/api/store/components/schemas/ClaimImage.yaml +++ b/docs/api/store/components/schemas/ClaimImage.yaml @@ -3,36 +3,44 @@ description: Represents photo documentation of a claim. type: object required: - claim_item_id + - created_at + - deleted_at + - id + - metadata + - updated_at - url properties: id: - type: string description: The claim image's ID + type: string example: cimg_01G8ZH853Y6TFXWPG5EYE81X63 claim_item_id: - type: string description: The ID of the claim item associated with the image + type: string claim_item: description: A claim item object. Available if the relation `claim_item` is expanded. - type: object + nullable: true + $ref: ./ClaimItem.yaml url: - type: string description: The URL of the image + type: string format: uri created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ClaimItem.yaml b/docs/api/store/components/schemas/ClaimItem.yaml index 6fc251960c..84a3b9afe6 100644 --- a/docs/api/store/components/schemas/ClaimItem.yaml +++ b/docs/api/store/components/schemas/ClaimItem.yaml @@ -5,18 +5,24 @@ description: >- type: object required: - claim_order_id + - created_at + - deleted_at + - id - item_id - - variant_id - - reason + - metadata + - note - quantity + - reason + - updated_at + - variant_id properties: id: - type: string description: The claim item's ID + type: string example: citm_01G8ZH853Y6TFXWPG5EYE81X63 images: - type: array description: Available if the relation `images` is expanded. + type: array items: $ref: ./ClaimImage.yaml claim_order_id: @@ -24,6 +30,7 @@ properties: type: string claim_order: description: A claim order object. Available if the relation `claim_order` is expanded. + nullable: true type: object item_id: description: The ID of the line item that the claim item refers to. @@ -31,6 +38,7 @@ properties: example: item_01G8ZM25TN49YV9EQBE2NC27KC item: description: Available if the relation `item` is expanded. + nullable: true $ref: ./LineItem.yaml variant_id: description: The ID of the product variant that is claimed. @@ -38,7 +46,8 @@ properties: example: variant_01G1G5V2MRX2V3PVSR2WXYPFB6 variant: description: A variant object. Available if the relation `variant` is expanded. - type: object + nullable: true + $ref: ./ProductVariant.yaml reason: description: The reason for the claim type: string @@ -49,6 +58,7 @@ properties: - other note: description: An optional note about the claim, for additional information + nullable: true type: string example: I don't like it. quantity: @@ -65,19 +75,21 @@ properties: items: $ref: ./ClaimTag.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/ClaimOrder.yaml b/docs/api/store/components/schemas/ClaimOrder.yaml index 561dbec67d..2bd675041e 100644 --- a/docs/api/store/components/schemas/ClaimOrder.yaml +++ b/docs/api/store/components/schemas/ClaimOrder.yaml @@ -5,27 +5,41 @@ description: >- contain additional information about fulfillments and returns. type: object required: - - type + - canceled_at + - created_at + - deleted_at + - fulfillment_status + - id + - idempotency_key + - metadata + - no_notification - order_id + - payment_status + - refund_amount + - shipping_address_id + - type + - updated_at properties: id: - type: string description: The claim's ID + type: string example: claim_01G8ZH853Y6TFXWPG5EYE81X63 type: + description: The claim's type type: string enum: - refund - replace payment_status: - type: string description: The status of the claim's payment + type: string enum: - na - not_refunded - refunded default: na fulfillment_status: + description: The claim's fulfillment status type: string enum: - not_fulfilled @@ -56,18 +70,22 @@ properties: example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object return_order: description: >- A return object. Holds information about the return if the claim is to be returned. Available if the relation 'return_order' is expanded + nullable: true type: object shipping_address_id: description: The ID of the address that the new items should be shipped to + nullable: true type: string example: addr_01G8ZH853YPY9B94857DY91YGW shipping_address: description: Available if the relation `shipping_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_methods: description: The shipping methods that the claim order will be shipped with. @@ -78,43 +96,49 @@ properties: description: The fulfillments of the new items to be shipped type: array items: - $ref: ./Fulfillment.yaml + type: object refund_amount: description: The amount that will be refunded in conjunction with the claim + nullable: true type: integer example: 1000 canceled_at: description: The date with timezone at which the claim was canceled. + nullable: true type: string format: date-time created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white no_notification: description: >- Flag for describing whether or not notifications related to this should be send. + nullable: true type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the claim in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key diff --git a/docs/api/store/components/schemas/ClaimTag.yaml b/docs/api/store/components/schemas/ClaimTag.yaml index bf557fcc6d..fe9a2fd418 100644 --- a/docs/api/store/components/schemas/ClaimTag.yaml +++ b/docs/api/store/components/schemas/ClaimTag.yaml @@ -4,30 +4,37 @@ description: >- filtering and grouping. type: object required: + - created_at + - deleted_at + - id + - metadata + - updated_at - value properties: id: - type: string description: The claim tag's ID + type: string example: ctag_01G8ZCC5Y63B95V6B5SHBZ91S4 value: description: The value that the claim tag holds type: string example: Damaged created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/Country.yaml b/docs/api/store/components/schemas/Country.yaml index c28bb31871..188fb5ccae 100644 --- a/docs/api/store/components/schemas/Country.yaml +++ b/docs/api/store/components/schemas/Country.yaml @@ -2,27 +2,29 @@ title: Country description: Country details type: object required: + - display_name + - id - iso_2 - iso_3 - - num_code - name - - display_name + - num_code + - region_id properties: id: - type: string description: The country's ID + type: string example: 109 iso_2: - type: string description: The 2 character ISO code of the country in lower case + type: string example: it externalDocs: url: >- https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements description: See a list of codes. iso_3: - type: string description: The 2 character ISO code of the country in lower case + type: string example: ita externalDocs: url: >- @@ -45,9 +47,11 @@ properties: type: string example: Italy region_id: - type: string description: The region ID this country is associated with. + nullable: true + type: string example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G region: description: A region object. Available if the relation `region` is expanded. - type: object + nullable: true + $ref: ./Region.yaml diff --git a/docs/api/store/components/schemas/Currency.yaml b/docs/api/store/components/schemas/Currency.yaml index c553448ec2..a7aef7d3a8 100644 --- a/docs/api/store/components/schemas/Currency.yaml +++ b/docs/api/store/components/schemas/Currency.yaml @@ -3,9 +3,9 @@ description: Currency type: object required: - code + - name - symbol - symbol_native - - name properties: code: description: The 3 character ISO code for the currency. @@ -29,3 +29,4 @@ properties: includes_tax: description: '[EXPERIMENTAL] Does the currency prices include tax' type: boolean + default: false diff --git a/docs/api/store/components/schemas/CustomShippingOption.yaml b/docs/api/store/components/schemas/CustomShippingOption.yaml index 619df289c4..e3db8a274e 100644 --- a/docs/api/store/components/schemas/CustomShippingOption.yaml +++ b/docs/api/store/components/schemas/CustomShippingOption.yaml @@ -5,12 +5,18 @@ description: >- particular Shipping Option type: object required: + - cart_id + - created_at + - deleted_at + - id + - metadata - price - shipping_option_id + - updated_at properties: id: - type: string description: The custom shipping option's ID + type: string example: cso_01G8X99XNB77DMFBJFWX6DN9V9 price: description: >- @@ -26,31 +32,33 @@ properties: description: >- A shipping option object. Available if the relation `shipping_option` is expanded. - type: object + nullable: true + $ref: ./ShippingOption.yaml cart_id: description: The ID of the Cart that the custom shipping option is attached to + nullable: true type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. - type: object + nullable: true + $ref: ./Cart.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white - includes_tax: - description: '[EXPERIMENTAL] Indicates if the custom shipping option price include tax' - type: boolean diff --git a/docs/api/store/components/schemas/Customer.yaml b/docs/api/store/components/schemas/Customer.yaml index 9c91270354..c980de29f0 100644 --- a/docs/api/store/components/schemas/Customer.yaml +++ b/docs/api/store/components/schemas/Customer.yaml @@ -2,30 +2,44 @@ title: Customer description: Represents a customer type: object required: + - billing_address_id + - created_at + - deleted_at - email + - first_name + - has_account + - id + - last_name + - metadata + - phone + - updated_at properties: id: - type: string description: The customer's ID + type: string example: cus_01G2SG30J8C85S4A5CHM2S1NS2 email: - type: string description: The customer's email + type: string format: email first_name: - type: string description: The customer's first name + nullable: true + type: string example: Arno last_name: - type: string description: The customer's last name + nullable: true + type: string example: Willms billing_address_id: - type: string description: The customer's billing address ID + nullable: true + type: string example: addr_01G8ZH853YPY9B94857DY91YGW billing_address: description: Available if the relation `billing_address` is expanded. + nullable: true $ref: ./Address.yaml shipping_addresses: description: Available if the relation `shipping_addresses` is expanded. @@ -33,19 +47,19 @@ properties: items: $ref: ./Address.yaml phone: - type: string description: The customer's phone number + nullable: true + type: string example: 16128234334802 has_account: - type: boolean description: Whether the customer has an account or not + type: boolean default: false orders: description: Available if the relation `orders` is expanded. type: array items: type: object - description: An order object. groups: description: >- The customer groups the customer belongs to. Available if the relation @@ -54,19 +68,21 @@ properties: items: $ref: ./CustomerGroup.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/CustomerGroup.yaml b/docs/api/store/components/schemas/CustomerGroup.yaml index 69e2edfe7c..65e7fb545a 100644 --- a/docs/api/store/components/schemas/CustomerGroup.yaml +++ b/docs/api/store/components/schemas/CustomerGroup.yaml @@ -2,45 +2,51 @@ title: Customer Group description: Represents a customer group type: object required: + - created_at + - deleted_at + - id + - metadata - name + - updated_at properties: id: - type: string description: The customer group's ID + type: string example: cgrp_01G8ZH853Y6TFXWPG5EYE81X63 name: - type: string description: The name of the customer group + type: string example: VIP customers: - type: array description: >- The customers that belong to the customer group. Available if the relation `customers` is expanded. - items: - type: object - description: A customer object. - price_lists: type: array + items: + $ref: ./Customer.yaml + 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 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/Discount.yaml b/docs/api/store/components/schemas/Discount.yaml index 72c9365c95..9257a02406 100644 --- a/docs/api/store/components/schemas/Discount.yaml +++ b/docs/api/store/components/schemas/Discount.yaml @@ -3,11 +3,24 @@ description: Represents a discount that can be applied to a cart for promotional type: object required: - code + - created_at + - deleted_at + - ends_at + - id + - is_disabled - is_dynamic + - metadata + - parent_discount_id + - rule_id + - starts_at + - updated_at + - usage_count + - usage_limit + - valid_duration properties: id: - type: string description: The discount's ID + type: string example: disc_01F0YESMW10MGHWJKZSDDMN0VN code: description: >- @@ -22,11 +35,13 @@ properties: type: boolean example: false rule_id: - type: string description: The Discount Rule that governs the behaviour of the Discount + nullable: true + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C rule: description: Available if the relation `rule` is expanded. + nullable: true $ref: ./DiscountRule.yaml is_disabled: description: >- @@ -35,13 +50,15 @@ properties: type: boolean example: false parent_discount_id: - type: string description: >- The Discount that the discount was created from. This will always be a dynamic discount + nullable: true + type: string example: disc_01G8ZH853YPY9B94857DY91YGW parent_discount: description: Available if the relation `parent_discount` is expanded. + nullable: true $ref: ./Discount.yaml starts_at: description: The time at which the discount can be used. @@ -49,11 +66,13 @@ properties: format: date-time ends_at: description: The time at which the discount can no longer be used. + nullable: true type: string format: date-time valid_duration: - type: string description: Duration the discount runs between + nullable: true + type: string example: P3Y6M4DT12H30M5S regions: description: >- @@ -61,10 +80,10 @@ properties: `regions` is expanded. type: array items: - type: object - description: A region object. + $ref: ./Region.yaml usage_limit: description: The maximum number of times that a discount can be used. + nullable: true type: integer example: 100 usage_count: @@ -73,19 +92,21 @@ properties: example: 50 default: 0 created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DiscountCondition.yaml b/docs/api/store/components/schemas/DiscountCondition.yaml index 40f5247a38..b536b8f05f 100644 --- a/docs/api/store/components/schemas/DiscountCondition.yaml +++ b/docs/api/store/components/schemas/DiscountCondition.yaml @@ -2,13 +2,18 @@ title: Discount Condition description: Holds rule conditions for when a discount is applicable type: object required: - - type - - operator + - created_at + - deleted_at - discount_rule_id + - id + - metadata + - operator + - type + - updated_at properties: id: - type: string description: The discount condition's ID + type: string example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A type: description: The type of the Condition @@ -26,11 +31,12 @@ properties: - in - not_in discount_rule_id: - type: string description: The ID of the discount rule associated with the condition + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C discount_rule: description: Available if the relation `discount_rule` is expanded. + nullable: true $ref: ./DiscountRule.yaml products: description: >- @@ -38,55 +44,52 @@ properties: the relation `products` is expanded. type: array items: - type: object - description: A product object. + $ref: ./Product.yaml product_types: description: >- - product types associated with this condition if type = product_types. + Product types associated with this condition if type = product_types. Available if the relation `product_types` is expanded. type: array items: - type: object - description: A product type object. + $ref: ./ProductType.yaml product_tags: description: >- - product tags associated with this condition if type = product_tags. + Product tags associated with this condition if type = product_tags. Available if the relation `product_tags` is expanded. type: array items: - type: object - description: A product tag object. + $ref: ./ProductTag.yaml product_collections: description: >- - product collections associated with this condition if type = + Product collections associated with this condition if type = product_collections. Available if the relation `product_collections` is expanded. type: array items: - type: object - description: A product collection object. + $ref: ./ProductCollection.yaml customer_groups: description: >- - customer groups associated with this condition if type = customer_groups. + Customer groups associated with this condition if type = customer_groups. Available if the relation `customer_groups` is expanded. type: array items: - type: object - description: A customer group object. + $ref: ./CustomerGroup.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml b/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml index 143c2c2a50..136f2f8472 100644 --- a/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml +++ b/docs/api/store/components/schemas/DiscountConditionCustomerGroup.yaml @@ -2,8 +2,11 @@ title: Product Tag Discount Condition description: Associates a discount condition with a customer group type: object required: - - customer_group_id - condition_id + - created_at + - customer_group_id + - metadata + - updated_at properties: customer_group_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A customer_group: description: Available if the relation `customer_group` is expanded. + nullable: true $ref: ./CustomerGroup.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DiscountConditionProduct.yaml b/docs/api/store/components/schemas/DiscountConditionProduct.yaml index ca1540fcbb..4ce3691cdf 100644 --- a/docs/api/store/components/schemas/DiscountConditionProduct.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProduct.yaml @@ -2,8 +2,11 @@ title: Product Discount Condition description: Associates a discount condition with a product type: object required: - - product_id - condition_id + - created_at + - metadata + - product_id + - updated_at properties: product_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product: description: Available if the relation `product` is expanded. + nullable: true $ref: ./Product.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml b/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml index 49e19e9590..b48d9d6516 100644 --- a/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductCollection.yaml @@ -2,8 +2,11 @@ title: Product Collection Discount Condition description: Associates a discount condition with a product collection type: object required: - - product_collection_id - condition_id + - created_at + - metadata + - product_collection_id + - updated_at properties: product_collection_id: description: The ID of the Product Collection @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_collection: description: Available if the relation `product_collection` is expanded. + nullable: true $ref: ./ProductCollection.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DiscountConditionProductTag.yaml b/docs/api/store/components/schemas/DiscountConditionProductTag.yaml index 3b7c0738f0..61c29d1a71 100644 --- a/docs/api/store/components/schemas/DiscountConditionProductTag.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductTag.yaml @@ -2,8 +2,11 @@ title: Product Tag Discount Condition description: Associates a discount condition with a product tag type: object required: - - product_tag_id - condition_id + - created_at + - metadata + - product_tag_id + - updated_at properties: product_tag_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_tag: description: Available if the relation `product_tag` is expanded. + nullable: true $ref: ./ProductTag.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DiscountConditionProductType.yaml b/docs/api/store/components/schemas/DiscountConditionProductType.yaml index 471000a1e7..77a7a5ad8b 100644 --- a/docs/api/store/components/schemas/DiscountConditionProductType.yaml +++ b/docs/api/store/components/schemas/DiscountConditionProductType.yaml @@ -2,8 +2,11 @@ title: Product Type Discount Condition description: Associates a discount condition with a product type type: object required: - - product_type_id - condition_id + - created_at + - metadata + - product_type_id + - updated_at properties: product_type_id: description: The ID of the Product Tag @@ -15,20 +18,23 @@ properties: example: discon_01G8X9A7ESKAJXG2H0E6F1MW7A product_type: description: Available if the relation `product_type` is expanded. + nullable: true $ref: ./ProductType.yaml discount_condition: description: Available if the relation `discount_condition` is expanded. + nullable: true $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DiscountRule.yaml b/docs/api/store/components/schemas/DiscountRule.yaml index 1a6ec45afb..2adf4fb537 100644 --- a/docs/api/store/components/schemas/DiscountRule.yaml +++ b/docs/api/store/components/schemas/DiscountRule.yaml @@ -4,12 +4,19 @@ description: >- Cart. type: object required: + - allocation + - created_at + - deleted_at + - description + - id + - metadata - type + - updated_at - value properties: id: - type: string description: The discount rule's ID + type: string example: dru_01F0YESMVK96HVX7N419E3CJ7C type: description: >- @@ -24,6 +31,7 @@ properties: example: percentage description: description: A short description of the discount + nullable: true type: string example: 10 Percent value: @@ -34,6 +42,7 @@ properties: example: 10 allocation: description: The scope that the discount should apply to. + nullable: true type: string enum: - total @@ -45,22 +54,23 @@ properties: used. Available if the relation `conditions` is expanded. type: array items: - type: object - description: A discount condition object. + $ref: ./DiscountCondition.yaml created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. + type: string format: date-time deleted_at: - type: string description: The date with timezone at which the resource was deleted. + nullable: true + type: string format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/DraftOrder.yaml b/docs/api/store/components/schemas/DraftOrder.yaml index 5e18ec0f8f..0e82842f04 100644 --- a/docs/api/store/components/schemas/DraftOrder.yaml +++ b/docs/api/store/components/schemas/DraftOrder.yaml @@ -1,71 +1,89 @@ title: DraftOrder description: Represents a draft order type: object +required: + - canceled_at + - cart_id + - completed_at + - created_at + - display_id + - id + - idempotency_key + - metadata + - no_notification_order + - order_id + - status + - updated_at properties: id: - type: string description: The draft order's ID + type: string example: dorder_01G8TJFKBG38YYFQ035MSVG03C status: - type: string description: The status of the draft order + type: string enum: - open - completed default: open display_id: - type: string description: The draft order's display ID + type: string example: 2 cart_id: - type: string description: The ID of the cart associated with the draft order. + nullable: true + type: string example: cart_01G8ZH853Y6TFXWPG5EYE81X63 cart: description: A cart object. Available if the relation `cart` is expanded. + nullable: true type: object order_id: - type: string description: The ID of the order associated with the draft order. + nullable: true + type: string example: order_01G8TJSYT9M6AVS5N4EMNFS1EK order: description: An order object. Available if the relation `order` is expanded. + nullable: true type: object canceled_at: - type: string description: The date the draft order was canceled at. + nullable: true + type: string format: date-time completed_at: - type: string description: The date the draft order was completed at. + nullable: true + type: string format: date-time no_notification_order: - type: boolean description: Whether to send the customer notifications regarding order updates. + nullable: true + type: boolean example: false idempotency_key: - type: string description: >- Randomly generated key used to continue the completion of the cart associated with the draft order in case of failure. + nullable: true + type: string externalDocs: url: >- https://docs.medusajs.com/advanced/backend/payment/overview#idempotency-key description: Learn more how to use the idempotency key. created_at: - type: string description: The date with timezone at which the resource was created. + type: string format: date-time updated_at: - type: string description: The date with timezone at which the resource was updated. - format: date-time - deleted_at: type: string - description: The date with timezone at which the resource was deleted. format: date-time metadata: - type: object description: An optional key-value map with additional details + nullable: true + type: object example: car: white diff --git a/docs/api/store/components/schemas/InventoryItemDTO.yaml b/docs/api/store/components/schemas/InventoryItemDTO.yaml new file mode 100644 index 0000000000..5053d91286 --- /dev/null +++ b/docs/api/store/components/schemas/InventoryItemDTO.yaml @@ -0,0 +1,69 @@ +type: object +required: + - sku +properties: + sku: + description: The Stock Keeping Unit (SKU) code of the Inventory Item. + type: string + hs_code: + description: >- + The Harmonized System code of the Inventory Item. May be used by + Fulfillment Providers to pass customs information to shipping carriers. + type: string + origin_country: + description: >- + The country in which the Inventory Item was produced. May be used by + Fulfillment Providers to pass customs information to shipping carriers. + type: string + mid_code: + description: >- + The Manufacturers Identification code that identifies the manufacturer of + the Inventory Item. May be used by Fulfillment Providers to pass customs + information to shipping carriers. + type: string + material: + description: >- + The material and composition that the Inventory Item is made of, May be + used by Fulfillment Providers to pass customs information to shipping + carriers. + type: string + weight: + description: >- + The weight of the Inventory Item. May be used in shipping rate + calculations. + type: number + height: + description: >- + The height of the Inventory Item. May be used in shipping rate + calculations. + type: number + width: + description: >- + The width of the Inventory Item. May be used in shipping rate + calculations. + type: number + length: + description: >- + The length of the Inventory Item. May be used in shipping rate + calculations. + type: number + requires_shipping: + description: Whether the item requires shipping. + type: boolean + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time diff --git a/docs/api/store/components/schemas/InventoryLevelDTO.yaml b/docs/api/store/components/schemas/InventoryLevelDTO.yaml new file mode 100644 index 0000000000..8540f71c95 --- /dev/null +++ b/docs/api/store/components/schemas/InventoryLevelDTO.yaml @@ -0,0 +1,37 @@ +type: object +required: + - inventory_item_id + - location_id + - stocked_quantity + - reserved_quantity + - incoming_quantity +properties: + location_id: + description: the item location ID + type: string + stocked_quantity: + description: the total stock quantity of an inventory item at the given location ID + type: number + reserved_quantity: + description: the reserved stock quantity of an inventory item at the given location ID + type: number + incoming_quantity: + description: the incoming stock quantity of an inventory item at the given location ID + type: number + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time diff --git a/docs/api/store/components/schemas/Order.yaml b/docs/api/store/components/schemas/Order.yaml index fbc5185c9b..e503b4fecd 100644 --- a/docs/api/store/components/schemas/Order.yaml +++ b/docs/api/store/components/schemas/Order.yaml @@ -133,14 +133,14 @@ properties: The payments used in the order. Available if the relation `payments` is expanded. items: - $ref: ./Payment.yaml + type: object fulfillments: type: array description: >- The fulfillments used in the order. Available if the relation `fulfillments` is expanded. items: - $ref: ./Fulfillment.yaml + type: object returns: type: array description: >- @@ -193,7 +193,7 @@ properties: [EXPERIMENTAL] Order edits done on the order. Available if the relation `edits` is expanded. items: - $ref: ./OrderEdit.yaml + type: object gift_card_transactions: type: array description: >- diff --git a/docs/api/store/components/schemas/OrderEdit.yaml b/docs/api/store/components/schemas/OrderEdit.yaml index ea53ce0b14..01f09e31d0 100644 --- a/docs/api/store/components/schemas/OrderEdit.yaml +++ b/docs/api/store/components/schemas/OrderEdit.yaml @@ -17,7 +17,7 @@ properties: example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: description: Available if the relation `order` is expanded. - $ref: ./Order.yaml + type: object changes: type: array description: Available if the relation `changes` is expanded. diff --git a/docs/api/store/components/schemas/Product.yaml b/docs/api/store/components/schemas/Product.yaml index 5112dc072f..2efc2db8c4 100644 --- a/docs/api/store/components/schemas/Product.yaml +++ b/docs/api/store/components/schemas/Product.yaml @@ -169,6 +169,14 @@ properties: items: type: object description: A sales channel object. + categories: + description: >- + The product's associated categories. Available if the relation + `categories` is expanded. + type: array + items: + type: object + description: A category object. created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/ProductCategory.yaml b/docs/api/store/components/schemas/ProductCategory.yaml index 2a4074e25d..3f9c1eb7e7 100644 --- a/docs/api/store/components/schemas/ProductCategory.yaml +++ b/docs/api/store/components/schemas/ProductCategory.yaml @@ -46,6 +46,14 @@ properties: A product category object. Available if the relation `parent_category` is expanded. type: object + products: + description: >- + products associated with category. Available if the relation `products` is + expanded. + type: array + items: + type: object + description: A product object. created_at: type: string description: The date with timezone at which the resource was created. diff --git a/docs/api/store/components/schemas/StockLocationAddressDTO.yaml b/docs/api/store/components/schemas/StockLocationAddressDTO.yaml index de9461efb2..fa00e2353d 100644 --- a/docs/api/store/components/schemas/StockLocationAddressDTO.yaml +++ b/docs/api/store/components/schemas/StockLocationAddressDTO.yaml @@ -19,6 +19,10 @@ properties: type: string description: Stock location address' complement example: apartment 4432 + company: + type: string + description: Stock location company' name + example: Medusa city: type: string description: Stock location address' city diff --git a/docs/api/store/components/schemas/StoreGetProductCategoriesCategoryRes.yaml b/docs/api/store/components/schemas/StoreGetProductCategoriesCategoryRes.yaml new file mode 100644 index 0000000000..d343bc439f --- /dev/null +++ b/docs/api/store/components/schemas/StoreGetProductCategoriesCategoryRes.yaml @@ -0,0 +1,4 @@ +type: object +properties: + product_category: + $ref: ./ProductCategory.yaml diff --git a/docs/api/store/components/schemas/StorePostAuthReq.yaml b/docs/api/store/components/schemas/StorePostAuthReq.yaml new file mode 100644 index 0000000000..6c547a53ba --- /dev/null +++ b/docs/api/store/components/schemas/StorePostAuthReq.yaml @@ -0,0 +1,11 @@ +type: object +required: + - email + - password +properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. diff --git a/docs/api/store/components/schemas/StorePostCartReq.yaml b/docs/api/store/components/schemas/StorePostCartReq.yaml index e403744a2b..836a28a8b9 100644 --- a/docs/api/store/components/schemas/StorePostCartReq.yaml +++ b/docs/api/store/components/schemas/StorePostCartReq.yaml @@ -19,6 +19,7 @@ properties: from. type: array items: + type: object required: - variant_id - quantity diff --git a/docs/api/store/components/schemas/StorePostCartsCartLineItemsItemReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartLineItemsItemReq.yaml new file mode 100644 index 0000000000..b2a49083e7 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartsCartLineItemsItemReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - quantity +properties: + quantity: + type: number + description: The quantity to set the Line Item to. diff --git a/docs/api/store/components/schemas/StorePostCartsCartLineItemsReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartLineItemsReq.yaml new file mode 100644 index 0000000000..39e4f1b97a --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartsCartLineItemsReq.yaml @@ -0,0 +1,14 @@ +type: object +required: + - variant_id + - quantity +properties: + variant_id: + type: string + description: The id of the Product Variant to generate the Line Item from. + quantity: + type: number + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: An optional key-value map with additional details about the Line Item. diff --git a/docs/api/store/components/schemas/StorePostCartsCartPaymentSessionReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartPaymentSessionReq.yaml new file mode 100644 index 0000000000..121bde5095 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartsCartPaymentSessionReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - provider_id +properties: + provider_id: + type: string + description: The ID of the Payment Provider. diff --git a/docs/api/store/components/schemas/StorePostCartsCartPaymentSessionUpdateReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartPaymentSessionUpdateReq.yaml new file mode 100644 index 0000000000..bd4d70742b --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartsCartPaymentSessionUpdateReq.yaml @@ -0,0 +1,7 @@ +type: object +required: + - data +properties: + data: + type: object + description: The data to update the payment session with. diff --git a/docs/api/store/components/schemas/StorePostCartsCartReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml index 1a3f876ecd..86402c2bd1 100644 --- a/docs/api/store/components/schemas/StorePostCartsCartReq.yaml +++ b/docs/api/store/components/schemas/StorePostCartsCartReq.yaml @@ -35,6 +35,7 @@ properties: description: An array of Gift Card codes to add to the Cart. type: array items: + type: object required: - code properties: @@ -45,6 +46,7 @@ properties: description: An array of Discount codes to add to the Cart. type: array items: + type: object required: - code properties: diff --git a/docs/api/store/components/schemas/StorePostCartsCartShippingMethodReq.yaml b/docs/api/store/components/schemas/StorePostCartsCartShippingMethodReq.yaml new file mode 100644 index 0000000000..de546145c2 --- /dev/null +++ b/docs/api/store/components/schemas/StorePostCartsCartShippingMethodReq.yaml @@ -0,0 +1,13 @@ +type: object +required: + - option_id +properties: + option_id: + type: string + description: ID of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to process the + fulfillment of the order. Look at the documentation for your installed + fulfillment providers to find out what to send. diff --git a/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml index b7db27a304..38b13cf93c 100644 --- a/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml +++ b/docs/api/store/components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml @@ -9,6 +9,7 @@ properties: and the provided ones will be created. type: array items: + type: object required: - provider_id - amount diff --git a/docs/api/store/components/schemas/StorePostReturnsReq.yaml b/docs/api/store/components/schemas/StorePostReturnsReq.yaml index fe17ff6931..28a7393f57 100644 --- a/docs/api/store/components/schemas/StorePostReturnsReq.yaml +++ b/docs/api/store/components/schemas/StorePostReturnsReq.yaml @@ -10,6 +10,7 @@ properties: description: The items to include in the Return. type: array items: + type: object required: - item_id - quantity diff --git a/docs/api/store/components/schemas/StorePostSwapsReq.yaml b/docs/api/store/components/schemas/StorePostSwapsReq.yaml index 3a246b86e2..fd08d4a05a 100644 --- a/docs/api/store/components/schemas/StorePostSwapsReq.yaml +++ b/docs/api/store/components/schemas/StorePostSwapsReq.yaml @@ -11,6 +11,7 @@ properties: description: The items to include in the Return. type: array items: + type: object required: - item_id - quantity @@ -34,6 +35,7 @@ properties: description: The items to exchange the returned items to. type: array items: + type: object required: - variant_id - quantity diff --git a/docs/api/store/components/schemas/StoreProductCategoriesListRes.yaml b/docs/api/store/components/schemas/StoreProductCategoriesListRes.yaml new file mode 100644 index 0000000000..0b6a32c916 --- /dev/null +++ b/docs/api/store/components/schemas/StoreProductCategoriesListRes.yaml @@ -0,0 +1,15 @@ +type: object +properties: + product_categories: + type: array + items: + $ref: ./ProductCategory.yaml + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page diff --git a/docs/api/store/components/schemas/Swap.yaml b/docs/api/store/components/schemas/Swap.yaml index d5a43a79d8..97a560fcc8 100644 --- a/docs/api/store/components/schemas/Swap.yaml +++ b/docs/api/store/components/schemas/Swap.yaml @@ -68,13 +68,13 @@ properties: relation `fulfillments` is expanded. type: array items: - $ref: ./Fulfillment.yaml + type: object payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. Available if the relation `payment` is expanded. - $ref: ./Payment.yaml + type: object difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May be diff --git a/docs/api/store/paths/auth.yaml b/docs/api/store/paths/auth.yaml index fec81cbe6b..e6b8bdfa0f 100644 --- a/docs/api/store/paths/auth.yaml +++ b/docs/api/store/paths/auth.yaml @@ -4,16 +4,22 @@ post: description: >- Logs a Customer in and authorizes them to view their details. Successful authentication will set a session cookie in the Customer's browser. - parameters: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StorePostAuthReq.yaml + x-codegen: + method: authenticate x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/postundefined + $ref: ../code_samples/JavaScript/auth/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/postundefined + $ref: ../code_samples/Shell/auth/post.sh tags: - Auth responses: @@ -35,31 +41,18 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The Customer's email. - password: - type: string - description: The Customer's password. delete: operationId: DeleteAuth summary: Customer Log out description: Destroys a Customer's authenticated session. x-authenticated: true + x-codegen: + method: deleteSession x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/deleteundefined + $ref: ../code_samples/Shell/auth/delete.sh security: - cookie_auth: [] tags: @@ -84,15 +77,17 @@ get: summary: Get Current Customer description: Gets the currently logged in Customer. x-authenticated: true + x-codegen: + method: getSession x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth/getundefined + $ref: ../code_samples/JavaScript/auth/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth/getundefined + $ref: ../code_samples/Shell/auth/get.sh security: - cookie_auth: [] tags: diff --git a/docs/api/store/paths/auth_{email}.yaml b/docs/api/store/paths/auth_{email}.yaml index 46f2c1f27c..fb414e798e 100644 --- a/docs/api/store/paths/auth_{email}.yaml +++ b/docs/api/store/paths/auth_{email}.yaml @@ -10,15 +10,17 @@ get: format: email required: true description: The email to check if exists. + x-codegen: + method: exists x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/auth_{email}/getundefined + $ref: ../code_samples/JavaScript/auth_{email}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/auth_{email}/getundefined + $ref: ../code_samples/Shell/auth_{email}/get.sh tags: - Auth responses: diff --git a/docs/api/store/paths/carts.yaml b/docs/api/store/paths/carts.yaml index 604faace10..abce30a7cb 100644 --- a/docs/api/store/paths/carts.yaml +++ b/docs/api/store/paths/carts.yaml @@ -11,15 +11,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCartReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts/postundefined + $ref: ../code_samples/JavaScript/carts/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts/postundefined + $ref: ../code_samples/Shell/carts/post.sh tags: - Cart responses: diff --git a/docs/api/store/paths/carts_{id}.yaml b/docs/api/store/paths/carts_{id}.yaml index 2c303abefe..6b2602f54e 100644 --- a/docs/api/store/paths/carts_{id}.yaml +++ b/docs/api/store/paths/carts_{id}.yaml @@ -9,15 +9,17 @@ get: description: The id of the Cart. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}/getundefined + $ref: ../code_samples/JavaScript/carts_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}/getundefined + $ref: ../code_samples/Shell/carts_{id}/get.sh tags: - Cart responses: @@ -53,15 +55,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCartsCartReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}/postundefined + $ref: ../code_samples/JavaScript/carts_{id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}/postundefined + $ref: ../code_samples/Shell/carts_{id}/post.sh tags: - Cart responses: diff --git a/docs/api/store/paths/carts_{id}_complete.yaml b/docs/api/store/paths/carts_{id}_complete.yaml index 164f736f13..ce23f42808 100644 --- a/docs/api/store/paths/carts_{id}_complete.yaml +++ b/docs/api/store/paths/carts_{id}_complete.yaml @@ -15,15 +15,17 @@ post: description: The Cart id. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_complete/postundefined + $ref: ../code_samples/JavaScript/carts_{id}_complete/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_complete/postundefined + $ref: ../code_samples/Shell/carts_{id}_complete/post.sh tags: - Cart responses: diff --git a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml index 9d2e0edc7c..56b4494909 100644 --- a/docs/api/store/paths/carts_{id}_discounts_{code}.yaml +++ b/docs/api/store/paths/carts_{id}_discounts_{code}.yaml @@ -15,15 +15,17 @@ delete: description: The unique Discount code. schema: type: string + x-codegen: + method: deleteDiscount x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_discounts_{code}/deleteundefined + $ref: ../code_samples/JavaScript/carts_{id}_discounts_{code}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_discounts_{code}/deleteundefined + $ref: ../code_samples/Shell/carts_{id}_discounts_{code}/delete.sh tags: - Cart responses: diff --git a/docs/api/store/paths/carts_{id}_line-items.yaml b/docs/api/store/paths/carts_{id}_line-items.yaml index 5927ca5004..268a70bac2 100644 --- a/docs/api/store/paths/carts_{id}_line-items.yaml +++ b/docs/api/store/paths/carts_{id}_line-items.yaml @@ -9,15 +9,22 @@ post: description: The id of the Cart to add the Line Item to. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StorePostCartsCartLineItemsReq.yaml + x-codegen: + method: createLineItem x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_line-items/postundefined + $ref: ../code_samples/JavaScript/carts_{id}_line-items/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_line-items/postundefined + $ref: ../code_samples/Shell/carts_{id}_line-items/post.sh tags: - Cart responses: @@ -37,23 +44,3 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: The id of the Product Variant to generate the Line Item from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the Line - Item. diff --git a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml index f956aa931d..b2e1b8c367 100644 --- a/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml +++ b/docs/api/store/paths/carts_{id}_line-items_{line_id}.yaml @@ -15,16 +15,17 @@ delete: description: The id of the Line Item. schema: type: string + x-codegen: + method: deleteLineItem x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/carts_{id}_line-items_{line_id}/deleteundefined + $ref: ../code_samples/JavaScript/carts_{id}_line-items_{line_id}/delete.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_line-items_{line_id}/deleteundefined + $ref: ../code_samples/Shell/carts_{id}_line-items_{line_id}/delete.sh tags: - Cart responses: @@ -61,16 +62,22 @@ post: description: The id of the Line Item. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StorePostCartsCartLineItemsItemReq.yaml + x-codegen: + method: updateLineItem x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/carts_{id}_line-items_{line_id}/postundefined + $ref: ../code_samples/JavaScript/carts_{id}_line-items_{line_id}/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_line-items_{line_id}/postundefined + $ref: ../code_samples/Shell/carts_{id}_line-items_{line_id}/post.sh tags: - Cart responses: @@ -90,14 +97,3 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. diff --git a/docs/api/store/paths/carts_{id}_payment-session.yaml b/docs/api/store/paths/carts_{id}_payment-session.yaml index 7a7f0903f5..f6a044fb97 100644 --- a/docs/api/store/paths/carts_{id}_payment-session.yaml +++ b/docs/api/store/paths/carts_{id}_payment-session.yaml @@ -11,15 +11,22 @@ post: description: The ID of the Cart. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StorePostCartsCartPaymentSessionReq.yaml + x-codegen: + method: setPaymentSession x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_payment-session/postundefined + $ref: ../code_samples/JavaScript/carts_{id}_payment-session/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_payment-session/postundefined + $ref: ../code_samples/Shell/carts_{id}_payment-session/post.sh tags: - Cart responses: @@ -39,14 +46,3 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The ID of the Payment Provider. diff --git a/docs/api/store/paths/carts_{id}_payment-sessions.yaml b/docs/api/store/paths/carts_{id}_payment-sessions.yaml index 7421bf65d3..92f77fa1d9 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions.yaml @@ -11,15 +11,17 @@ post: description: The id of the Cart. schema: type: string + x-codegen: + method: createPaymentSessions x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_payment-sessions/postundefined + $ref: ../code_samples/JavaScript/carts_{id}_payment-sessions/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_payment-sessions/postundefined + $ref: ../code_samples/Shell/carts_{id}_payment-sessions/post.sh tags: - Cart responses: diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml index 40549de1a9..03220c3c5f 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}.yaml @@ -17,17 +17,19 @@ delete: deleted. schema: type: string + x-codegen: + method: deletePaymentSession x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/deleteundefined + ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/delete.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/deleteundefined + ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/delete.sh tags: - Cart responses: @@ -64,17 +66,24 @@ post: description: The id of the payment provider. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StorePostCartsCartPaymentSessionUpdateReq.yaml + x-codegen: + method: updatePaymentSession x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/postundefined + ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/postundefined + ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}/post.sh tags: - Cart responses: @@ -94,14 +103,3 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - data - properties: - data: - type: object - description: The data to update the payment session with. diff --git a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml index 7c3a88b622..1d054b5d08 100644 --- a/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml +++ b/docs/api/store/paths/carts_{id}_payment-sessions_{provider_id}_refresh.yaml @@ -19,17 +19,19 @@ post: refreshed. schema: type: string + x-codegen: + method: refreshPaymentSession x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/postundefined + ../code_samples/JavaScript/carts_{id}_payment-sessions_{provider_id}_refresh/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/postundefined + ../code_samples/Shell/carts_{id}_payment-sessions_{provider_id}_refresh/post.sh tags: - Cart responses: diff --git a/docs/api/store/paths/carts_{id}_shipping-methods.yaml b/docs/api/store/paths/carts_{id}_shipping-methods.yaml index d9d73d0b1f..9151a80e1a 100644 --- a/docs/api/store/paths/carts_{id}_shipping-methods.yaml +++ b/docs/api/store/paths/carts_{id}_shipping-methods.yaml @@ -9,15 +9,22 @@ post: description: The cart ID. schema: type: string + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StorePostCartsCartShippingMethodReq.yaml + x-codegen: + method: addShippingMethod x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/carts_{id}_shipping-methods/postundefined + $ref: ../code_samples/JavaScript/carts_{id}_shipping-methods/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_shipping-methods/postundefined + $ref: ../code_samples/Shell/carts_{id}_shipping-methods/post.sh tags: - Cart responses: @@ -37,21 +44,3 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: ID of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the documentation - for your installed fulfillment providers to find out what to - send. diff --git a/docs/api/store/paths/carts_{id}_taxes.yaml b/docs/api/store/paths/carts_{id}_taxes.yaml index 3b2fca7d62..21591b1d43 100644 --- a/docs/api/store/paths/carts_{id}_taxes.yaml +++ b/docs/api/store/paths/carts_{id}_taxes.yaml @@ -11,11 +11,13 @@ post: description: The Cart ID. schema: type: string + x-codegen: + method: calculateTaxes x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/carts_{id}_taxes/postundefined + $ref: ../code_samples/Shell/carts_{id}_taxes/post.sh tags: - Cart responses: diff --git a/docs/api/store/paths/collections.yaml b/docs/api/store/paths/collections.yaml index 7a5decca88..22d770bca8 100644 --- a/docs/api/store/paths/collections.yaml +++ b/docs/api/store/paths/collections.yaml @@ -61,15 +61,18 @@ get: 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: - $ref: ../code_samples/JavaScript/collections/getundefined + $ref: ../code_samples/JavaScript/collections/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections/getundefined + $ref: ../code_samples/Shell/collections/get.sh tags: - Collection responses: diff --git a/docs/api/store/paths/collections_{id}.yaml b/docs/api/store/paths/collections_{id}.yaml index 0e6a630320..0ea79a1461 100644 --- a/docs/api/store/paths/collections_{id}.yaml +++ b/docs/api/store/paths/collections_{id}.yaml @@ -9,15 +9,17 @@ get: description: The id of the Product Collection schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/collections_{id}/getundefined + $ref: ../code_samples/JavaScript/collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/collections_{id}/getundefined + $ref: ../code_samples/Shell/collections_{id}/get.sh tags: - Collection responses: diff --git a/docs/api/store/paths/customers.yaml b/docs/api/store/paths/customers.yaml index 9cfa46ca1e..68378b419c 100644 --- a/docs/api/store/paths/customers.yaml +++ b/docs/api/store/paths/customers.yaml @@ -7,15 +7,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCustomersReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers/postundefined + $ref: ../code_samples/JavaScript/customers/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers/postundefined + $ref: ../code_samples/Shell/customers/post.sh tags: - Customer responses: diff --git a/docs/api/store/paths/customers_me.yaml b/docs/api/store/paths/customers_me.yaml index dadcea98c1..ac589e5ce1 100644 --- a/docs/api/store/paths/customers_me.yaml +++ b/docs/api/store/paths/customers_me.yaml @@ -5,15 +5,17 @@ get: Retrieves a Customer - the Customer must be logged in to retrieve their details. x-authenticated: true + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me/getundefined + $ref: ../code_samples/JavaScript/customers_me/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me/getundefined + $ref: ../code_samples/Shell/customers_me/get.sh security: - cookie_auth: [] tags: @@ -47,15 +49,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCustomersCustomerReq.yaml + x-codegen: + method: update x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me/postundefined + $ref: ../code_samples/JavaScript/customers_me/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me/postundefined + $ref: ../code_samples/Shell/customers_me/post.sh security: - cookie_auth: [] tags: diff --git a/docs/api/store/paths/customers_me_addresses.yaml b/docs/api/store/paths/customers_me_addresses.yaml index 3dad4c8077..ba83e00c9b 100644 --- a/docs/api/store/paths/customers_me_addresses.yaml +++ b/docs/api/store/paths/customers_me_addresses.yaml @@ -8,15 +8,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCustomersCustomerAddressesReq.yaml + x-codegen: + method: addAddress x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me_addresses/postundefined + $ref: ../code_samples/JavaScript/customers_me_addresses/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me_addresses/postundefined + $ref: ../code_samples/Shell/customers_me_addresses/post.sh security: - cookie_auth: [] tags: diff --git a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml index 40b17f73c7..9b0b70531a 100644 --- a/docs/api/store/paths/customers_me_addresses_{address_id}.yaml +++ b/docs/api/store/paths/customers_me_addresses_{address_id}.yaml @@ -10,17 +10,18 @@ delete: description: The id of the Address to remove. schema: type: string + x-codegen: + method: deleteAddress x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/customers_me_addresses_{address_id}/deleteundefined + ../code_samples/JavaScript/customers_me_addresses_{address_id}/delete.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/customers_me_addresses_{address_id}/deleteundefined + $ref: ../code_samples/Shell/customers_me_addresses_{address_id}/delete.sh security: - cookie_auth: [] tags: @@ -62,17 +63,17 @@ post: schema: $ref: >- ../components/schemas/StorePostCustomersCustomerAddressesAddressReq.yaml + x-codegen: + method: updateAddress x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/customers_me_addresses_{address_id}/postundefined + $ref: ../code_samples/JavaScript/customers_me_addresses_{address_id}/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/customers_me_addresses_{address_id}/postundefined + $ref: ../code_samples/Shell/customers_me_addresses_{address_id}/post.sh security: - cookie_auth: [] tags: diff --git a/docs/api/store/paths/customers_me_orders.yaml b/docs/api/store/paths/customers_me_orders.yaml index 108b908784..b58425bcb1 100644 --- a/docs/api/store/paths/customers_me_orders.yaml +++ b/docs/api/store/paths/customers_me_orders.yaml @@ -168,15 +168,18 @@ get: resulting orders. schema: type: string + x-codegen: + method: listOrders + queryParams: StoreGetCustomersCustomerOrdersParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me_orders/getundefined + $ref: ../code_samples/JavaScript/customers_me_orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me_orders/getundefined + $ref: ../code_samples/Shell/customers_me_orders/get.sh security: - cookie_auth: [] tags: diff --git a/docs/api/store/paths/customers_me_payment-methods.yaml b/docs/api/store/paths/customers_me_payment-methods.yaml index 3b642ba318..96f715aad0 100644 --- a/docs/api/store/paths/customers_me_payment-methods.yaml +++ b/docs/api/store/paths/customers_me_payment-methods.yaml @@ -6,15 +6,17 @@ get: saved with Payment Providers and it is their responsibility to fetch saved methods. x-authenticated: true + x-codegen: + method: listPaymentMethods x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_me_payment-methods/getundefined + $ref: ../code_samples/JavaScript/customers_me_payment-methods/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_me_payment-methods/getundefined + $ref: ../code_samples/Shell/customers_me_payment-methods/get.sh security: - cookie_auth: [] tags: diff --git a/docs/api/store/paths/customers_password-reset.yaml b/docs/api/store/paths/customers_password-reset.yaml index c20e06e414..8ae3b378c6 100644 --- a/docs/api/store/paths/customers_password-reset.yaml +++ b/docs/api/store/paths/customers_password-reset.yaml @@ -9,15 +9,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCustomersResetPasswordReq.yaml + x-codegen: + method: resetPassword x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_password-reset/postundefined + $ref: ../code_samples/JavaScript/customers_password-reset/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_password-reset/postundefined + $ref: ../code_samples/Shell/customers_password-reset/post.sh tags: - Customer responses: diff --git a/docs/api/store/paths/customers_password-token.yaml b/docs/api/store/paths/customers_password-token.yaml index 46bb9dce0d..f010c0f30d 100644 --- a/docs/api/store/paths/customers_password-token.yaml +++ b/docs/api/store/paths/customers_password-token.yaml @@ -11,15 +11,17 @@ post: schema: $ref: >- ../components/schemas/StorePostCustomersCustomerPasswordTokenReq.yaml + x-codegen: + method: generatePasswordToken x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/customers_password-token/postundefined + $ref: ../code_samples/JavaScript/customers_password-token/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/customers_password-token/postundefined + $ref: ../code_samples/Shell/customers_password-token/post.sh tags: - Customer responses: diff --git a/docs/api/store/paths/gift-cards_{code}.yaml b/docs/api/store/paths/gift-cards_{code}.yaml index 9c7dfe5d26..61acd5b360 100644 --- a/docs/api/store/paths/gift-cards_{code}.yaml +++ b/docs/api/store/paths/gift-cards_{code}.yaml @@ -1,7 +1,7 @@ get: operationId: GetGiftCardsCode summary: Get Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. + description: Retrieves a Gift Card by its associated unique code. parameters: - in: path name: code @@ -9,15 +9,17 @@ get: description: The unique Gift Card code. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/gift-cards_{code}/getundefined + $ref: ../code_samples/JavaScript/gift-cards_{code}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/gift-cards_{code}/getundefined + $ref: ../code_samples/Shell/gift-cards_{code}/get.sh tags: - Gift Card responses: diff --git a/docs/api/store/paths/order-edits_{id}.yaml b/docs/api/store/paths/order-edits_{id}.yaml index edf25d0e6b..971517ac96 100644 --- a/docs/api/store/paths/order-edits_{id}.yaml +++ b/docs/api/store/paths/order-edits_{id}.yaml @@ -9,15 +9,17 @@ get: description: The ID of the OrderEdit. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}/getundefined + $ref: ../code_samples/JavaScript/order-edits_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}/getundefined + $ref: ../code_samples/Shell/order-edits_{id}/get.sh tags: - OrderEdit responses: diff --git a/docs/api/store/paths/order-edits_{id}_complete.yaml b/docs/api/store/paths/order-edits_{id}_complete.yaml index 3ff5331fa1..97cff00d7b 100644 --- a/docs/api/store/paths/order-edits_{id}_complete.yaml +++ b/docs/api/store/paths/order-edits_{id}_complete.yaml @@ -9,15 +9,17 @@ post: description: The ID of the Order Edit. schema: type: string + x-codegen: + method: complete x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_complete/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_complete/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_complete/postundefined + $ref: ../code_samples/Shell/order-edits_{id}_complete/post.sh tags: - OrderEdit responses: diff --git a/docs/api/store/paths/order-edits_{id}_decline.yaml b/docs/api/store/paths/order-edits_{id}_decline.yaml index 53cfeceb02..47292e7f17 100644 --- a/docs/api/store/paths/order-edits_{id}_decline.yaml +++ b/docs/api/store/paths/order-edits_{id}_decline.yaml @@ -14,15 +14,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostOrderEditsOrderEditDecline.yaml + x-codegen: + method: decline x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/order-edits_{id}_decline/postundefined + $ref: ../code_samples/JavaScript/order-edits_{id}_decline/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/order-edits_{id}_decline/postundefined + $ref: ../code_samples/Shell/order-edits_{id}_decline/post.sh tags: - OrderEdit responses: diff --git a/docs/api/store/paths/orders.yaml b/docs/api/store/paths/orders.yaml index 7ebd4b871d..bcf397aff9 100644 --- a/docs/api/store/paths/orders.yaml +++ b/docs/api/store/paths/orders.yaml @@ -9,6 +9,16 @@ get: 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 @@ -29,15 +39,18 @@ get: 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: - $ref: ../code_samples/JavaScript/orders/getundefined + $ref: ../code_samples/JavaScript/orders/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders/getundefined + $ref: ../code_samples/Shell/orders/get.sh tags: - Order responses: diff --git a/docs/api/store/paths/orders_batch_customer_token.yaml b/docs/api/store/paths/orders_batch_customer_token.yaml index 39899babbf..71f6cfb30e 100644 --- a/docs/api/store/paths/orders_batch_customer_token.yaml +++ b/docs/api/store/paths/orders_batch_customer_token.yaml @@ -9,15 +9,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCustomersCustomerOrderClaimReq.yaml + x-codegen: + method: requestCustomerOrders x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_batch_customer_token/postundefined + $ref: ../code_samples/JavaScript/orders_batch_customer_token/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_batch_customer_token/postundefined + $ref: ../code_samples/Shell/orders_batch_customer_token/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/orders_cart_{cart_id}.yaml b/docs/api/store/paths/orders_cart_{cart_id}.yaml index 6ef812f754..296e93bc86 100644 --- a/docs/api/store/paths/orders_cart_{cart_id}.yaml +++ b/docs/api/store/paths/orders_cart_{cart_id}.yaml @@ -9,15 +9,17 @@ get: description: The ID of Cart. schema: type: string + x-codegen: + method: retrieveByCartId x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_cart_{cart_id}/getundefined + $ref: ../code_samples/JavaScript/orders_cart_{cart_id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_cart_{cart_id}/getundefined + $ref: ../code_samples/Shell/orders_cart_{cart_id}/get.sh tags: - Order responses: diff --git a/docs/api/store/paths/orders_customer_confirm.yaml b/docs/api/store/paths/orders_customer_confirm.yaml index c9b6092f2f..9fba54cfd5 100644 --- a/docs/api/store/paths/orders_customer_confirm.yaml +++ b/docs/api/store/paths/orders_customer_confirm.yaml @@ -9,15 +9,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostCustomersCustomerAcceptClaimReq.yaml + x-codegen: + method: confirmRequest x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/orders_customer_confirm/postundefined + $ref: ../code_samples/JavaScript/orders_customer_confirm/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_customer_confirm/postundefined + $ref: ../code_samples/Shell/orders_customer_confirm/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/orders_{id}.yaml b/docs/api/store/paths/orders_{id}.yaml index f2317c0d64..d511afd673 100644 --- a/docs/api/store/paths/orders_{id}.yaml +++ b/docs/api/store/paths/orders_{id}.yaml @@ -9,15 +9,27 @@ get: 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: - $ref: ../code_samples/JavaScript/orders_{id}/getundefined + $ref: ../code_samples/JavaScript/orders_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/orders_{id}/getundefined + $ref: ../code_samples/Shell/orders_{id}/get.sh tags: - Order responses: diff --git a/docs/api/store/paths/payment-collections_{id}.yaml b/docs/api/store/paths/payment-collections_{id}.yaml index 7085b9d3ff..8c6cf5f81c 100644 --- a/docs/api/store/paths/payment-collections_{id}.yaml +++ b/docs/api/store/paths/payment-collections_{id}.yaml @@ -20,15 +20,18 @@ get: 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: - $ref: ../code_samples/JavaScript/payment-collections_{id}/getundefined + $ref: ../code_samples/JavaScript/payment-collections_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}/getundefined + $ref: ../code_samples/Shell/payment-collections_{id}/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/payment-collections_{id}_sessions.yaml b/docs/api/store/paths/payment-collections_{id}_sessions.yaml index 20af179e08..ad8cf6c210 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions.yaml @@ -15,16 +15,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePaymentCollectionSessionsReq.yaml + x-codegen: + method: managePaymentSession x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions/postundefined + $ref: ../code_samples/JavaScript/payment-collections_{id}_sessions/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/payment-collections_{id}_sessions/postundefined + $ref: ../code_samples/Shell/payment-collections_{id}_sessions/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml index d562ea0661..15c827e38f 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch.yaml @@ -16,17 +16,18 @@ post: schema: $ref: >- ../components/schemas/StorePostPaymentCollectionsBatchSessionsReq.yaml + x-codegen: + method: managePaymentSessionsBatch x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_batch/postundefined + ../code_samples/JavaScript/payment-collections_{id}_sessions_batch/post.js - lang: Shell label: cURL source: - $ref: >- - ../code_samples/Shell/payment-collections_{id}_sessions_batch/postundefined + $ref: ../code_samples/Shell/payment-collections_{id}_sessions_batch/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml index 38d93b3324..14eaf4a628 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_batch_authorize.yaml @@ -16,17 +16,19 @@ post: schema: $ref: >- ../components/schemas/StorePostPaymentCollectionsBatchSessionsAuthorizeReq.yaml + x-codegen: + method: authorizePaymentSessionsBatch x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/postundefined + ../code_samples/JavaScript/payment-collections_{id}_sessions_batch_authorize/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/postundefined + ../code_samples/Shell/payment-collections_{id}_sessions_batch_authorize/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml index 79157301e0..fb1fb511c5 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}.yaml @@ -18,17 +18,19 @@ post: description: The id of the Payment Session to be refreshed. schema: type: string + x-codegen: + method: refreshPaymentSession x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/postundefined + ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}/postundefined + ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}/post.sh tags: - PaymentCollection responses: diff --git a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml index 0edd575da8..70064e284b 100644 --- a/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml +++ b/docs/api/store/paths/payment-collections_{id}_sessions_{session_id}_authorize.yaml @@ -16,17 +16,19 @@ post: description: The ID of the Payment Session. schema: type: string + x-codegen: + method: authorizePaymentSession x-codeSamples: - lang: JavaScript label: JS Client source: $ref: >- - ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/postundefined + ../code_samples/JavaScript/payment-collections_{id}_sessions_{session_id}_authorize/post.js - lang: Shell label: cURL source: $ref: >- - ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/postundefined + ../code_samples/Shell/payment-collections_{id}_sessions_{session_id}_authorize/post.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/product-categories.yaml b/docs/api/store/paths/product-categories.yaml index 5f00b425d9..2cc95446f2 100644 --- a/docs/api/store/paths/product-categories.yaml +++ b/docs/api/store/paths/product-categories.yaml @@ -26,11 +26,18 @@ get: schema: type: integer default: 100 + x-codegen: + method: list + queryParams: StoreGetProductCategoriesParams x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/product-categories/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories/getundefined + $ref: ../code_samples/Shell/product-categories/get.sh security: - api_token: [] - cookie_auth: [] @@ -42,21 +49,7 @@ get: content: application/json: schema: - type: object - properties: - product_categories: - type: array - items: - $ref: ../components/schemas/ProductCategory.yaml - count: - type: integer - description: The total number of items available - offset: - type: integer - description: The number of items skipped before these items - limit: - type: integer - description: The number of items per page + $ref: ../components/schemas/StoreProductCategoriesListRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/product-categories_{id}.yaml b/docs/api/store/paths/product-categories_{id}.yaml index 9b9ba9082a..62fcb28473 100644 --- a/docs/api/store/paths/product-categories_{id}.yaml +++ b/docs/api/store/paths/product-categories_{id}.yaml @@ -24,15 +24,18 @@ get: category. schema: type: string + x-codegen: + method: retrieve + queryParams: StoreGetProductCategoryParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-categories_{id}/getundefined + $ref: ../code_samples/JavaScript/product-categories_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-categories_{id}/getundefined + $ref: ../code_samples/Shell/product-categories_{id}/get.sh security: - api_token: [] - cookie_auth: [] @@ -44,7 +47,7 @@ get: content: application/json: schema: - $ref: ../components/schemas/StoreGetProductCategoryRes.yaml + $ref: ../components/schemas/StoreGetProductCategoriesCategoryRes.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/docs/api/store/paths/product-tags.yaml b/docs/api/store/paths/product-tags.yaml index 6134c2a185..b4a8e99fca 100644 --- a/docs/api/store/paths/product-tags.yaml +++ b/docs/api/store/paths/product-tags.yaml @@ -97,11 +97,11 @@ get: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-tags/getundefined + $ref: ../code_samples/JavaScript/product-tags/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-tags/getundefined + $ref: ../code_samples/Shell/product-tags/get.sh tags: - Product Tag responses: diff --git a/docs/api/store/paths/product-types.yaml b/docs/api/store/paths/product-types.yaml index b5e34ef9ee..38eb9d78ca 100644 --- a/docs/api/store/paths/product-types.yaml +++ b/docs/api/store/paths/product-types.yaml @@ -93,15 +93,18 @@ get: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: StoreGetProductTypesParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/product-types/getundefined + $ref: ../code_samples/JavaScript/product-types/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/product-types/getundefined + $ref: ../code_samples/Shell/product-types/get.sh security: - api_token: [] - cookie_auth: [] diff --git a/docs/api/store/paths/products.yaml b/docs/api/store/paths/products.yaml index 78a6955b68..ccddde8462 100644 --- a/docs/api/store/paths/products.yaml +++ b/docs/api/store/paths/products.yaml @@ -121,6 +121,20 @@ get: type: string description: filter by dates greater than or equal to this date format: date + - in: query + name: category_id + style: form + explode: false + description: Category ids to filter by. + schema: + type: array + items: + type: string + - in: query + name: include_category_children + description: Include category children when filtering by category_id. + schema: + type: boolean - in: query name: offset description: How many products to skip in the result. @@ -136,14 +150,14 @@ get: - in: query name: expand description: >- - (Comma separated) Which fields should be expanded in each order of the + (Comma separated) Which fields should be expanded in each product of the result. schema: type: string - in: query name: fields description: >- - (Comma separated) Which fields should be included in each order of the + (Comma separated) Which fields should be included in each product of the result. schema: type: string @@ -152,15 +166,33 @@ get: description: the field used to order the products. schema: type: string + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + x-codegen: + method: list + queryParams: StoreGetProductsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products/getundefined + $ref: ../code_samples/JavaScript/products/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products/getundefined + $ref: ../code_samples/Shell/products/get.sh tags: - Product responses: diff --git a/docs/api/store/paths/products_search.yaml b/docs/api/store/paths/products_search.yaml index 07c6919b8c..8600b8ac69 100644 --- a/docs/api/store/paths/products_search.yaml +++ b/docs/api/store/paths/products_search.yaml @@ -19,15 +19,18 @@ post: description: Limit the number of products returned. schema: type: integer + x-codegen: + method: search + queryParams: StorePostSearchReq x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_search/postundefined + $ref: ../code_samples/JavaScript/products_search/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_search/postundefined + $ref: ../code_samples/Shell/products_search/post.sh tags: - Product responses: diff --git a/docs/api/store/paths/products_{id}.yaml b/docs/api/store/paths/products_{id}.yaml index 30458c8dd5..6ad685401a 100644 --- a/docs/api/store/paths/products_{id}.yaml +++ b/docs/api/store/paths/products_{id}.yaml @@ -9,6 +9,11 @@ get: description: The id of the Product. schema: type: string + - in: query + name: sales_channel_id + description: The sales channel used when fetching the product. + schema: + type: string - in: query name: cart_id description: The ID of the customer's cart. @@ -21,6 +26,18 @@ get: correct prices are retrieved for a region. schema: type: string + - in: query + name: fields + description: (Comma separated) Which fields should be included in the result. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of the + result. + schema: + type: string - in: query name: currency_code style: form @@ -33,15 +50,18 @@ get: externalDocs: url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetProductsProductParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/products_{id}/getundefined + $ref: ../code_samples/JavaScript/products_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/products_{id}/getundefined + $ref: ../code_samples/Shell/products_{id}/get.sh tags: - Product responses: diff --git a/docs/api/store/paths/regions.yaml b/docs/api/store/paths/regions.yaml index 422623b8b6..f8b0d9b9da 100644 --- a/docs/api/store/paths/regions.yaml +++ b/docs/api/store/paths/regions.yaml @@ -59,15 +59,18 @@ get: type: string description: filter by dates greater than or equal to this date format: date + x-codegen: + method: list + queryParams: StoreGetRegionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions/getundefined + $ref: ../code_samples/JavaScript/regions/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions/getundefined + $ref: ../code_samples/Shell/regions/get.sh tags: - Region responses: diff --git a/docs/api/store/paths/regions_{id}.yaml b/docs/api/store/paths/regions_{id}.yaml index c8158b5b4b..63026d4adb 100644 --- a/docs/api/store/paths/regions_{id}.yaml +++ b/docs/api/store/paths/regions_{id}.yaml @@ -9,15 +9,17 @@ get: description: The id of the Region. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/regions_{id}/getundefined + $ref: ../code_samples/JavaScript/regions_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/regions_{id}/getundefined + $ref: ../code_samples/Shell/regions_{id}/get.sh tags: - Region responses: diff --git a/docs/api/store/paths/return-reasons.yaml b/docs/api/store/paths/return-reasons.yaml index 2d3cecc1ad..56d00ff79b 100644 --- a/docs/api/store/paths/return-reasons.yaml +++ b/docs/api/store/paths/return-reasons.yaml @@ -2,15 +2,17 @@ get: operationId: GetReturnReasons summary: List Return Reasons description: Retrieves a list of Return Reasons. + x-codegen: + method: list x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons/getundefined + $ref: ../code_samples/JavaScript/return-reasons/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons/getundefined + $ref: ../code_samples/Shell/return-reasons/get.sh tags: - Return Reason responses: diff --git a/docs/api/store/paths/return-reasons_{id}.yaml b/docs/api/store/paths/return-reasons_{id}.yaml index cf90f2858d..ba1cc066b1 100644 --- a/docs/api/store/paths/return-reasons_{id}.yaml +++ b/docs/api/store/paths/return-reasons_{id}.yaml @@ -9,15 +9,17 @@ get: description: The id of the Return Reason. schema: type: string + x-codegen: + method: retrieve x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/return-reasons_{id}/getundefined + $ref: ../code_samples/JavaScript/return-reasons_{id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/return-reasons_{id}/getundefined + $ref: ../code_samples/Shell/return-reasons_{id}/get.sh tags: - Return Reason responses: diff --git a/docs/api/store/paths/returns.yaml b/docs/api/store/paths/returns.yaml index f1297642dd..ee04bb1ff5 100644 --- a/docs/api/store/paths/returns.yaml +++ b/docs/api/store/paths/returns.yaml @@ -7,15 +7,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostReturnsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/returns/postundefined + $ref: ../code_samples/JavaScript/returns/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/returns/postundefined + $ref: ../code_samples/Shell/returns/post.sh tags: - Return responses: diff --git a/docs/api/store/paths/shipping-options.yaml b/docs/api/store/paths/shipping-options.yaml index 7fdea9e6ff..790c76832a 100644 --- a/docs/api/store/paths/shipping-options.yaml +++ b/docs/api/store/paths/shipping-options.yaml @@ -20,15 +20,18 @@ get: description: the Region to retrieve Shipping Options from. schema: type: string + x-codegen: + method: list + queryParams: StoreGetShippingOptionsParams x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options/getundefined + $ref: ../code_samples/JavaScript/shipping-options/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options/getundefined + $ref: ../code_samples/Shell/shipping-options/get.sh tags: - Shipping Option responses: diff --git a/docs/api/store/paths/shipping-options_{cart_id}.yaml b/docs/api/store/paths/shipping-options_{cart_id}.yaml index 1e8797574d..159495603b 100644 --- a/docs/api/store/paths/shipping-options_{cart_id}.yaml +++ b/docs/api/store/paths/shipping-options_{cart_id}.yaml @@ -9,15 +9,17 @@ get: description: The id of the Cart. schema: type: string + x-codegen: + method: listCartOptions x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/shipping-options_{cart_id}/getundefined + $ref: ../code_samples/JavaScript/shipping-options_{cart_id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/shipping-options_{cart_id}/getundefined + $ref: ../code_samples/Shell/shipping-options_{cart_id}/get.sh tags: - Shipping Option responses: diff --git a/docs/api/store/paths/swaps.yaml b/docs/api/store/paths/swaps.yaml index 8548c772a6..9ae0d63cf0 100644 --- a/docs/api/store/paths/swaps.yaml +++ b/docs/api/store/paths/swaps.yaml @@ -9,15 +9,17 @@ post: application/json: schema: $ref: ../components/schemas/StorePostSwapsReq.yaml + x-codegen: + method: create x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps/postundefined + $ref: ../code_samples/JavaScript/swaps/post.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps/postundefined + $ref: ../code_samples/Shell/swaps/post.sh tags: - Swap responses: diff --git a/docs/api/store/paths/swaps_{cart_id}.yaml b/docs/api/store/paths/swaps_{cart_id}.yaml index 332153ec09..d50e68638d 100644 --- a/docs/api/store/paths/swaps_{cart_id}.yaml +++ b/docs/api/store/paths/swaps_{cart_id}.yaml @@ -9,15 +9,17 @@ get: description: The id of the Cart schema: type: string + x-codegen: + method: retrieveByCartId x-codeSamples: - lang: JavaScript label: JS Client source: - $ref: ../code_samples/JavaScript/swaps_{cart_id}/getundefined + $ref: ../code_samples/JavaScript/swaps_{cart_id}/get.js - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/swaps_{cart_id}/getundefined + $ref: ../code_samples/Shell/swaps_{cart_id}/get.sh tags: - Swap responses: diff --git a/docs/api/store/paths/variants.yaml b/docs/api/store/paths/variants.yaml index 3369c1722b..90562879e6 100644 --- a/docs/api/store/paths/variants.yaml +++ b/docs/api/store/paths/variants.yaml @@ -8,6 +8,11 @@ get: description: A comma separated list of Product Variant ids to filter by. schema: type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string - in: query name: expand description: A comma separated list of Product Variant relations to load. @@ -25,6 +30,21 @@ get: schema: type: number default: '100' + - in: query + name: cart_id + description: The id of the Cart to set prices based on. + schema: + type: string + - in: query + name: region_id + description: The id of the Region to set prices based on. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string - in: query name: title style: form @@ -62,11 +82,14 @@ get: description: >- filter by inventory quantity greater than or equal to this number + x-codegen: + method: list + queryParams: StoreGetVariantsParams x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/variants/getundefined + $ref: ../code_samples/Shell/variants/get.sh tags: - Product Variant responses: diff --git a/docs/api/store/paths/variants_{variant_id}.yaml b/docs/api/store/paths/variants_{variant_id}.yaml index c551b6ce0d..59eaa551bb 100644 --- a/docs/api/store/paths/variants_{variant_id}.yaml +++ b/docs/api/store/paths/variants_{variant_id}.yaml @@ -14,6 +14,11 @@ get: description: The id of the Cart to set prices based on. schema: type: string + - in: query + name: sales_channel_id + description: A sales channel id for result configuration. + schema: + type: string - in: query name: region_id description: The id of the Region to set prices based on. @@ -29,11 +34,14 @@ get: externalDocs: url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes description: See a list of codes. + x-codegen: + method: retrieve + queryParams: StoreGetVariantsVariantParams x-codeSamples: - lang: Shell label: cURL source: - $ref: ../code_samples/Shell/variants_{variant_id}/getundefined + $ref: ../code_samples/Shell/variants_{variant_id}/get.sh tags: - Product Variant responses: