diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 44dd9c87f5..f76a6777ec 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -1327,6 +1327,13 @@ paths: description: a search term to search titles and handles. schema: type: string + - in: query + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. + schema: + type: string - in: query name: created_at description: Date comparison for when resulting collections were created. @@ -1691,19 +1698,44 @@ paths: type: boolean - in: query name: order - description: to retrieve products in. + description: order to retrieve products in. schema: type: string - in: query name: offset description: How many products to skip in the result. schema: - type: string + type: number + default: '0' - in: query name: limit description: Limit the number of products returned. schema: - type: string + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' tags: - Currency responses: @@ -1713,19 +1745,19 @@ paths: application/json: schema: properties: - count: - description: The number of Currency. - type: integer - offset: - description: The offset of the Currency query. - type: integer - limit: - description: The limit of the currency query. - type: integer currencies: type: array items: $ref: '#/components/schemas/currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '/currencies/{code}': post: operationId: PostCurrenciesCurrency @@ -1747,6 +1779,37 @@ paths: includes_tax: type: boolean description: '[EXPERIMENTAL] Tax included in prices of currency.' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' tags: - Currency responses: @@ -2049,6 +2112,11 @@ paths: description: the field used to order the customer groups. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string - in: query name: id style: form @@ -3019,6 +3087,223 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/discounts/{discount_id}/conditions/{condition_id}/batch': + post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add a batch of resources to a discount condition + description: Add a batch of resources to a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.addConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete a batch of resources from a discount condition + description: Delete a batch of resources from a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' '/discounts/{discount_id}/conditions': post: operationId: PostDiscountsDiscountConditions @@ -4421,10 +4706,14 @@ paths: format: email billing_address: description: The Address to be used for billing purposes. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string shipping_address: description: The Address to be used for shipping. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string items: description: The Line Items that have been received. type: array @@ -5151,10 +5440,14 @@ paths: format: email billing_address: description: The Address to be used for billing purposes. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string shipping_address: description: The Address to be used for shipping. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string discounts: description: An array of Discount codes to add to the Draft Order. type: array @@ -6585,6 +6878,25 @@ paths: description: The ID of the Order Edit. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-authenticated: true x-codeSamples: - lang: JavaScript @@ -6597,20 +6909,26 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.addLineItem(order_edit_id, { variant_id, - quantity }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity + }) + + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ - -d '{ "variant_id": "some_variant_id", "quantity": 3 }' + --header 'Content-Type: application/json' \ + + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", + "quantity": 3 }' security: - api_token: [] - cookie_auth: [] @@ -6661,7 +6979,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.cancel(orderEditId) + medusa.admin.orderEdits.cancel(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -6669,7 +6987,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/:id/cancel' \ + 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: @@ -6718,7 +7036,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.confirm(orderEditId) + medusa.admin.orderEdits.confirm(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -6726,7 +7044,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/:id/confirm' \ + 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ --header 'Authorization: Bearer {api_token}' security: @@ -6756,6 +7074,19 @@ paths: operationId: PostOrderEdits summary: Create an OrderEdit description: Creates an OrderEdit. + requestBody: + content: + application/json: + schema: + required: + - order_id + properties: + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string x-authenticated: true x-codeSamples: - lang: JavaScript @@ -6768,7 +7099,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.create({ order_id, internal_note }) + medusa.admin.orderEdits.create({ order_id }) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -6778,10 +7109,12 @@ paths: curl --location --request POST 'https://medusa-url.com/admin/order-edits' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ - -d '{ "order_id": "my_order_id", "internal_note": "my_optional_note" - }' + --header 'Content-Type: application/json' \ + + --data-raw '{ "order_id": "my_order_id", "internal_note": + "my_optional_note" }' security: - api_token: [] - cookie_auth: [] @@ -6808,6 +7141,102 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + get: + operationId: GetOrderEdits + summary: List an OrderEdit + description: List a OrderEdit. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order_edits: + type: array + $ref: '#/components/schemas/order_edit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' '/order-edits/{id}/items/{item_id}': delete: operationId: DeleteOrderEditsOrderEditLineItemsLineItem @@ -6893,6 +7322,16 @@ paths: description: The ID of the order edit item to update. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -6904,7 +7343,10 @@ paths: // 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 }) => { console.log(order_edit.id) }) @@ -6914,9 +7356,11 @@ paths: curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ - -d '{ "quantity": 5 }' + --header 'Content-Type: application/json' \ + + --data-raw '{ "quantity": 5 }' security: - api_token: [] - cookie_auth: [] @@ -6973,8 +7417,8 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.deleteItemChange(item_change_id, - order_edit_id) + medusa.admin.orderEdits.deleteItemChange(order_edit_id, + item_change_id) .then(({ id, object, deleted }) => { console.log(id) }) @@ -7035,7 +7479,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.delete(edit_id) + medusa.admin.orderEdits.delete(order_edit_id) .then(({ id, object, deleted }) => { console.log(id) }) @@ -7083,6 +7527,16 @@ paths: description: The ID of the OrderEdit. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -7094,7 +7548,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.retrieve(orderEditId) + medusa.admin.orderEdits.retrieve(orderEditId) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -7143,6 +7597,14 @@ paths: description: The ID of the OrderEdit. schema: type: string + requestBody: + content: + application/json: + schema: + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -7154,9 +7616,9 @@ paths: // must be previously logged in or use api token - const params = {internal_note: "internal reason XY"} - - medusa.admin.orderEdit.update(orderEditId, params) + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" + }) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -7166,7 +7628,7 @@ paths: curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ @@ -7223,7 +7685,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.requestConfirmation(edit_id) + medusa.admin.orderEdits.requestConfirmation(order_edit_id) .then({ order_edit }) => { console.log(order_edit.id) }) @@ -11162,6 +11624,11 @@ paths: description: The field to sort items by. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string - in: query name: value style: form @@ -11311,6 +11778,11 @@ paths: description: The field to sort items by. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string - in: query name: value style: form @@ -11837,6 +12309,11 @@ paths: title and sku, and collection title. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. + schema: + type: string - in: query name: id style: form @@ -11900,6 +12377,15 @@ paths: type: array items: type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to filter products by + schema: + type: array + items: + type: string - in: query name: title description: title to search for. @@ -11920,11 +12406,6 @@ paths: description: Search for giftcards using is_giftcard=true. schema: type: boolean - - in: query - name: type - description: type ID to search for. - schema: - type: string - in: query name: created_at description: Date comparison for when resulting products were created. @@ -15050,8 +15531,8 @@ paths: ] }) - .then(({ return }) => { - console.log(return.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL @@ -18294,6 +18775,85 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /uploads/protected: + post: + operationId: PostUploadsProtected + summary: Upload files with acl or in a non-public bucket + description: >- + Uploads at least one file to the specific fileservice that is installed + in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.createProtected(file) + + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/uploads/protected' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: image/jpeg' \ + + --form 'files=@""' \ + + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + uploads: + type: array + items: + type: object + properties: + url: + type: string + description: The URL of the uploaded file. + format: uri + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /uploads: post: operationId: PostUploads @@ -18912,22 +19472,96 @@ paths: x-authenticated: true parameters: - in: query - name: q - description: Query used for searching variants. + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. schema: type: string - in: query name: offset - description: How many variants to skip in the result. + description: How many product variants to skip in the result. schema: - type: integer - default: 0 + type: number + default: '0' - in: query name: limit - description: Limit the number of variants returned. + description: Maximum number of Product Variants to return. schema: - type: integer - default: 20 + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: >- + filter by inventory quantity less than or equal to this + number + gte: + type: number + description: >- + filter by inventory quantity greater than or equal to this + number x-codeSamples: - lang: JavaScript label: JS Client @@ -21818,11 +22452,11 @@ components: description: The ID of the order that is edited example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: - description: Order object + description: Available if the relation `order` is expanded. $ref: '#/components/schemas/order' changes: type: array - description: Line item changes array. + description: Available if the relation `changes` is expanded. items: $ref: '#/components/schemas/order_item_change' internal_note: @@ -21898,11 +22532,35 @@ components: The difference between the total amount of the order and total amount of edited order. example: 8200 + status: + type: string + description: The status of the order edit. + enum: + - confirmed + - declined + - requested + - created + - canceled items: type: array - description: Computed line items from the changes. + description: Available if the relation `items` is expanded. items: $ref: '#/components/schemas/line_item' + payment_collection_id: + type: string + description: The ID of the payment collection + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + $ref: '#/components/schemas/payment_collection' + 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 order_item_change: title: Order Item Change description: Represents an order edit item change @@ -21917,7 +22575,7 @@ components: example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: type: string - description: The order's status + description: The order item change's status enum: - item_add - item_remove @@ -21927,22 +22585,39 @@ components: description: The ID of the order edit example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: - description: Order edit object + description: Available if the relation `order_edit` is expanded. $ref: '#/components/schemas/order_edit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: - description: Original line item object. + description: Available if the relation `original_line_item` is expanded. $ref: '#/components/schemas/line_item' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: - description: Line item object. + description: Available if the relation `line_item` is expanded. $ref: '#/components/schemas/line_item' + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white order: title: Order description: Represents an order @@ -22221,6 +22896,103 @@ components: type: integer description: The total of gift cards with taxes example: 0 + payment_collection: + title: Payment Collection + description: Payment Collection + x-resourceId: payment_collection + required: + - type + - status + - amount + - region_id + - currency_code + - created_by + properties: + id: + type: string + description: The payment collection's ID + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + type: string + description: The type of the payment collection + enum: + - order_edit + status: + type: string + description: The type of the payment collection + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - refunded + - partially_refunded + - canceled + - requires_action + description: + type: string + description: Description of the payment collection + amount: + type: number + description: Amount of the payment collection. + authorized_amount: + type: number + description: Authorized amount of the payment collection. + captured_amount: + type: number + description: Captured amount of the payment collection. + refunded_amount: + type: number + description: Refunded amount of the payment collection. + region_id: + type: string + description: The region's ID + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + $ref: '#/components/schemas/region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + $ref: '#/components/schemas/currency' + payment_sessions: + type: array + description: Available if the relation `payment_sessions` is expanded. + items: + $ref: '#/components/schemas/payment_session' + payments: + type: array + description: Available if the relation `payments` is expanded. + items: + $ref: '#/components/schemas/payment' + created_by: + type: string + description: The ID of the user that created the payment collection. + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -23259,7 +24031,7 @@ components: properties: id: type: string - description: The cart's ID + description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 44dd9c87f5..f76a6777ec 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -1327,6 +1327,13 @@ paths: description: a search term to search titles and handles. schema: type: string + - in: query + name: discount_condition_id + description: >- + The discount condition id on which to filter the product + collections. + schema: + type: string - in: query name: created_at description: Date comparison for when resulting collections were created. @@ -1691,19 +1698,44 @@ paths: type: boolean - in: query name: order - description: to retrieve products in. + description: order to retrieve products in. schema: type: string - in: query name: offset description: How many products to skip in the result. schema: - type: string + type: number + default: '0' - in: query name: limit description: Limit the number of products returned. schema: - type: string + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.list() + + .then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies' \ + + --header 'Authorization: Bearer {api_token}' tags: - Currency responses: @@ -1713,19 +1745,19 @@ paths: application/json: schema: properties: - count: - description: The number of Currency. - type: integer - offset: - description: The offset of the Currency query. - type: integer - limit: - description: The limit of the currency query. - type: integer currencies: type: array items: $ref: '#/components/schemas/currency' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page '/currencies/{code}': post: operationId: PostCurrenciesCurrency @@ -1747,6 +1779,37 @@ paths: includes_tax: type: boolean description: '[EXPERIMENTAL] Tax included in prices of currency.' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.currencies.update(code, { + includes_tax: true + }) + + .then(({ currency }) => { + console.log(currency.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/currencies/{code}' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "includes_tax": true + }' tags: - Currency responses: @@ -2049,6 +2112,11 @@ paths: description: the field used to order the customer groups. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string - in: query name: id style: form @@ -3019,6 +3087,223 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + '/discounts/{discount_id}/conditions/{condition_id}/batch': + post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add a batch of resources to a discount condition + description: Add a batch of resources to a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.addConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + delete: + operationId: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete a batch of resources from a discount condition + description: Delete a batch of resources from a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each + discount of the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount + of the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.discounts.deleteConditionResourceBatch(discount_id, + condition_id, { + resources: [{ id: item_id }] + }) + + .then(({ discount }) => { + console.log(discount.id); + }); + - lang: Shell + label: cURL + source: > + curl --location --request DELETE + 'https://medusa-url.com/admin/discounts/{id}/conditions/{condition_id}/batch' + \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: application/json' \ + + --data-raw '{ + "resources": [{ "id": "item_id" }] + }' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' '/discounts/{discount_id}/conditions': post: operationId: PostDiscountsDiscountConditions @@ -4421,10 +4706,14 @@ paths: format: email billing_address: description: The Address to be used for billing purposes. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string shipping_address: description: The Address to be used for shipping. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string items: description: The Line Items that have been received. type: array @@ -5151,10 +5440,14 @@ paths: format: email billing_address: description: The Address to be used for billing purposes. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string shipping_address: description: The Address to be used for shipping. - $ref: '#/components/schemas/address_fields' + anyOf: + - $ref: '#/components/schemas/address_fields' + - type: string discounts: description: An array of Discount codes to add to the Draft Order. type: array @@ -6585,6 +6878,25 @@ paths: description: The ID of the Order Edit. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-authenticated: true x-codeSamples: - lang: JavaScript @@ -6597,20 +6909,26 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.addLineItem(order_edit_id, { variant_id, - quantity }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) + medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity + }) + + .then(({ order_edit }) => { + console.log(order_edit.id) + }) - lang: Shell label: cURL source: > curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ - -d '{ "variant_id": "some_variant_id", "quantity": 3 }' + --header 'Content-Type: application/json' \ + + --data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", + "quantity": 3 }' security: - api_token: [] - cookie_auth: [] @@ -6661,7 +6979,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.cancel(orderEditId) + medusa.admin.orderEdits.cancel(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -6669,7 +6987,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/:id/cancel' \ + 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' security: @@ -6718,7 +7036,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.confirm(orderEditId) + medusa.admin.orderEdits.confirm(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -6726,7 +7044,7 @@ paths: label: cURL source: > curl --location --request POST - 'https://medusa-url.com/admin/order-edits/:id/confirm' \ + 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ --header 'Authorization: Bearer {api_token}' security: @@ -6756,6 +7074,19 @@ paths: operationId: PostOrderEdits summary: Create an OrderEdit description: Creates an OrderEdit. + requestBody: + content: + application/json: + schema: + required: + - order_id + properties: + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string x-authenticated: true x-codeSamples: - lang: JavaScript @@ -6768,7 +7099,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.create({ order_id, internal_note }) + medusa.admin.orderEdits.create({ order_id }) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -6778,10 +7109,12 @@ paths: curl --location --request POST 'https://medusa-url.com/admin/order-edits' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ - -d '{ "order_id": "my_order_id", "internal_note": "my_optional_note" - }' + --header 'Content-Type: application/json' \ + + --data-raw '{ "order_id": "my_order_id", "internal_note": + "my_optional_note" }' security: - api_token: [] - cookie_auth: [] @@ -6808,6 +7141,102 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + get: + operationId: GetOrderEdits + summary: List an OrderEdit + description: List a OrderEdit. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) + - lang: Shell + label: cURL + source: > + curl --location --request GET + 'https://medusa-url.com/admin/order-edits' \ + + --header 'Authorization: Bearer {api_token}' + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order_edits: + type: array + $ref: '#/components/schemas/order_edit' + count: + type: integer + description: The total number of items available + offset: + type: integer + description: The number of items skipped before these items + limit: + type: integer + description: The number of items per page + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' '/order-edits/{id}/items/{item_id}': delete: operationId: DeleteOrderEditsOrderEditLineItemsLineItem @@ -6893,6 +7322,16 @@ paths: description: The ID of the order edit item to update. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number x-codeSamples: - lang: JavaScript label: JS Client @@ -6904,7 +7343,10 @@ paths: // 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 }) => { console.log(order_edit.id) }) @@ -6914,9 +7356,11 @@ paths: curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ - -d '{ "quantity": 5 }' + --header 'Content-Type: application/json' \ + + --data-raw '{ "quantity": 5 }' security: - api_token: [] - cookie_auth: [] @@ -6973,8 +7417,8 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.deleteItemChange(item_change_id, - order_edit_id) + medusa.admin.orderEdits.deleteItemChange(order_edit_id, + item_change_id) .then(({ id, object, deleted }) => { console.log(id) }) @@ -7035,7 +7479,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.delete(edit_id) + medusa.admin.orderEdits.delete(order_edit_id) .then(({ id, object, deleted }) => { console.log(id) }) @@ -7083,6 +7527,16 @@ paths: description: The ID of the OrderEdit. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -7094,7 +7548,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdit.retrieve(orderEditId) + medusa.admin.orderEdits.retrieve(orderEditId) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -7143,6 +7597,14 @@ paths: description: The ID of the OrderEdit. schema: type: string + requestBody: + content: + application/json: + schema: + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -7154,9 +7616,9 @@ paths: // must be previously logged in or use api token - const params = {internal_note: "internal reason XY"} - - medusa.admin.orderEdit.update(orderEditId, params) + medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" + }) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -7166,7 +7628,7 @@ paths: curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \ - --header 'Authorization: Bearer {api_token}' + --header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ @@ -7223,7 +7685,7 @@ paths: // must be previously logged in or use api token - medusa.admin.orderEdits.requestConfirmation(edit_id) + medusa.admin.orderEdits.requestConfirmation(order_edit_id) .then({ order_edit }) => { console.log(order_edit.id) }) @@ -11162,6 +11624,11 @@ paths: description: The field to sort items by. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string - in: query name: value style: form @@ -11311,6 +11778,11 @@ paths: description: The field to sort items by. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string - in: query name: value style: form @@ -11837,6 +12309,11 @@ paths: title and sku, and collection title. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. + schema: + type: string - in: query name: id style: form @@ -11900,6 +12377,15 @@ paths: type: array items: type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to filter products by + schema: + type: array + items: + type: string - in: query name: title description: title to search for. @@ -11920,11 +12406,6 @@ paths: description: Search for giftcards using is_giftcard=true. schema: type: boolean - - in: query - name: type - description: type ID to search for. - schema: - type: string - in: query name: created_at description: Date comparison for when resulting products were created. @@ -15050,8 +15531,8 @@ paths: ] }) - .then(({ return }) => { - console.log(return.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL @@ -18294,6 +18775,85 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /uploads/protected: + post: + operationId: PostUploadsProtected + summary: Upload files with acl or in a non-public bucket + description: >- + Uploads at least one file to the specific fileservice that is installed + in Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: > + import Medusa from "@medusajs/medusa-js" + + const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: + 3 }) + + // must be previously logged in or use api token + + medusa.admin.uploads.createProtected(file) + + .then(({ uploads }) => { + console.log(uploads.length); + }); + - lang: Shell + label: cURL + source: > + curl --location --request POST + 'https://medusa-url.com/admin/uploads/protected' \ + + --header 'Authorization: Bearer {api_token}' \ + + --header 'Content-Type: image/jpeg' \ + + --form 'files=@""' \ + + --form 'files=@""' + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + uploads: + type: array + items: + type: object + properties: + url: + type: string + description: The URL of the uploaded file. + format: uri + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' /uploads: post: operationId: PostUploads @@ -18912,22 +19472,96 @@ paths: x-authenticated: true parameters: - in: query - name: q - description: Query used for searching variants. + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. schema: type: string - in: query name: offset - description: How many variants to skip in the result. + description: How many product variants to skip in the result. schema: - type: integer - default: 0 + type: number + default: '0' - in: query name: limit - description: Limit the number of variants returned. + description: Maximum number of Product Variants to return. schema: - type: integer - default: 20 + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: >- + filter by inventory quantity less than or equal to this + number + gte: + type: number + description: >- + filter by inventory quantity greater than or equal to this + number x-codeSamples: - lang: JavaScript label: JS Client @@ -21818,11 +22452,11 @@ components: description: The ID of the order that is edited example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: - description: Order object + description: Available if the relation `order` is expanded. $ref: '#/components/schemas/order' changes: type: array - description: Line item changes array. + description: Available if the relation `changes` is expanded. items: $ref: '#/components/schemas/order_item_change' internal_note: @@ -21898,11 +22532,35 @@ components: The difference between the total amount of the order and total amount of edited order. example: 8200 + status: + type: string + description: The status of the order edit. + enum: + - confirmed + - declined + - requested + - created + - canceled items: type: array - description: Computed line items from the changes. + description: Available if the relation `items` is expanded. items: $ref: '#/components/schemas/line_item' + payment_collection_id: + type: string + description: The ID of the payment collection + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + $ref: '#/components/schemas/payment_collection' + 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 order_item_change: title: Order Item Change description: Represents an order edit item change @@ -21917,7 +22575,7 @@ components: example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: type: string - description: The order's status + description: The order item change's status enum: - item_add - item_remove @@ -21927,22 +22585,39 @@ components: description: The ID of the order edit example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: - description: Order edit object + description: Available if the relation `order_edit` is expanded. $ref: '#/components/schemas/order_edit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: - description: Original line item object. + description: Available if the relation `original_line_item` is expanded. $ref: '#/components/schemas/line_item' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: - description: Line item object. + description: Available if the relation `line_item` is expanded. $ref: '#/components/schemas/line_item' + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white order: title: Order description: Represents an order @@ -22221,6 +22896,103 @@ components: type: integer description: The total of gift cards with taxes example: 0 + payment_collection: + title: Payment Collection + description: Payment Collection + x-resourceId: payment_collection + required: + - type + - status + - amount + - region_id + - currency_code + - created_by + properties: + id: + type: string + description: The payment collection's ID + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + type: string + description: The type of the payment collection + enum: + - order_edit + status: + type: string + description: The type of the payment collection + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - refunded + - partially_refunded + - canceled + - requires_action + description: + type: string + description: Description of the payment collection + amount: + type: number + description: Amount of the payment collection. + authorized_amount: + type: number + description: Authorized amount of the payment collection. + captured_amount: + type: number + description: Captured amount of the payment collection. + refunded_amount: + type: number + description: Refunded amount of the payment collection. + region_id: + type: string + description: The region's ID + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + $ref: '#/components/schemas/region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + $ref: '#/components/schemas/currency' + payment_sessions: + type: array + description: Available if the relation `payment_sessions` is expanded. + items: + $ref: '#/components/schemas/payment_session' + payments: + type: array + description: Available if the relation `payments` is expanded. + items: + $ref: '#/components/schemas/payment' + created_by: + type: string + description: The ID of the user that created the payment collection. + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -23259,7 +24031,7 @@ components: properties: id: type: string - description: The cart's ID + description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- diff --git a/docs/api/admin/code_samples/JavaScript/currencies/getundefined b/docs/api/admin/code_samples/JavaScript/currencies/getundefined new file mode 100644 index 0000000000..73a384b02c --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/currencies/getundefined @@ -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.currencies.list() +.then(({ currencies, count, offset, limit }) => { + console.log(currencies.length); +}); diff --git a/docs/api/admin/code_samples/JavaScript/currencies_{code}/postundefined b/docs/api/admin/code_samples/JavaScript/currencies_{code}/postundefined new file mode 100644 index 0000000000..f50291cf75 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/currencies_{code}/postundefined @@ -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.currencies.update(code, { + includes_tax: true +}) +.then(({ currency }) => { + console.log(currency.id); +}); 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/deleteundefined new file mode 100644 index 0000000000..e2426d3522 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined @@ -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.discounts.deleteConditionResourceBatch(discount_id, condition_id, { + resources: [{ id: item_id }] +}) +.then(({ discount }) => { + console.log(discount.id); +}); 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/postundefined new file mode 100644 index 0000000000..573fdcb402 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined @@ -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.discounts.addConditionResourceBatch(discount_id, condition_id, { + resources: [{ id: item_id }] +}) +.then(({ discount }) => { + console.log(discount.id); +}); diff --git a/docs/api/admin/code_samples/JavaScript/order-edits/getundefined b/docs/api/admin/code_samples/JavaScript/order-edits/getundefined new file mode 100644 index 0000000000..3f73c739e5 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/order-edits/getundefined @@ -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.orderEdits.list() + .then(({ order_edits, count, limit, offset }) => { + console.log(order_edits.length) + }) diff --git a/docs/api/admin/code_samples/JavaScript/order-edits/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits/postundefined index 71e4b18f00..acbbf8896a 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits/postundefined @@ -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.admin.orderEdit.create({ order_id, internal_note }) +medusa.admin.orderEdits.create({ order_id }) .then(({ order_edit }) => { console.log(order_edit.id) }) diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/deleteundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/deleteundefined index 46359c7fae..32998e028c 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/deleteundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/deleteundefined @@ -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.admin.orderEdits.delete(edit_id) +medusa.admin.orderEdits.delete(order_edit_id) .then(({ id, object, deleted }) => { console.log(id) }) diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/getundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/getundefined index 4ce9358905..9b7ef7ed33 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/getundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/getundefined @@ -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.admin.orderEdit.retrieve(orderEditId) +medusa.admin.orderEdits.retrieve(orderEditId) .then(({ order_edit }) => { console.log(order_edit.id) }) diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/postundefined index 2440c42378..e7d202f12d 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}/postundefined @@ -1,8 +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 -const params = {internal_note: "internal reason XY"} -medusa.admin.orderEdit.update(orderEditId, params) +medusa.admin.orderEdits.update(order_edit_id, { + internal_note: "internal reason XY" +}) .then(({ order_edit }) => { console.log(order_edit.id) }) 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/postundefined index 7c6b834206..780aa48167 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_cancel/postundefined @@ -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.admin.orderEdit.cancel(orderEditId) +medusa.admin.orderEdits.cancel(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) 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}/deleteundefined index c1ef05c2f9..f0f9145218 100644 --- 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}/deleteundefined @@ -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.admin.orderEdits.deleteItemChange(item_change_id, order_edit_id) +medusa.admin.orderEdits.deleteItemChange(order_edit_id, item_change_id) .then(({ id, object, deleted }) => { console.log(id) }) 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/postundefined index ab9fc4f042..ec39a07a6c 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_confirm/postundefined @@ -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.admin.orderEdit.confirm(orderEditId) +medusa.admin.orderEdits.confirm(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) diff --git a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined index d6569f3b5f..4ae4ed80a7 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_items/postundefined @@ -1,7 +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.orderEdit.addLineItem(order_edit_id, { variant_id, quantity }) - .then(({ order_edit }) => { - console.log(order_edit.id) - }) +medusa.admin.orderEdits.addLineItem(order_edit_id, { + variant_id, + quantity +}) +.then(({ order_edit }) => { + console.log(order_edit.id) +}) 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}/postundefined index fc95e5299a..f4ba4375d8 100644 --- 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}/postundefined @@ -1,7 +1,9 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token -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 }) => { console.log(order_edit.id) }) 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/postundefined index 37e5c1796a..0922f8c850 100644 --- a/docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/postundefined +++ b/docs/api/admin/code_samples/JavaScript/order-edits_{id}_request/postundefined @@ -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.admin.orderEdits.requestConfirmation(edit_id) +medusa.admin.orderEdits.requestConfirmation(order_edit_id) .then({ order_edit }) => { console.log(order_edit.id) }) diff --git a/docs/api/admin/code_samples/JavaScript/returns_{id}_receive/postundefined b/docs/api/admin/code_samples/JavaScript/returns_{id}_receive/postundefined index d77c23d252..8d05dfee10 100644 --- a/docs/api/admin/code_samples/JavaScript/returns_{id}_receive/postundefined +++ b/docs/api/admin/code_samples/JavaScript/returns_{id}_receive/postundefined @@ -9,6 +9,6 @@ medusa.admin.returns.receive(return_id, { } ] }) -.then(({ return }) => { - console.log(return.id); +.then((data) => { + console.log(data.return.id); }); diff --git a/docs/api/admin/code_samples/JavaScript/uploads_protected/postundefined b/docs/api/admin/code_samples/JavaScript/uploads_protected/postundefined new file mode 100644 index 0000000000..ddd65037e5 --- /dev/null +++ b/docs/api/admin/code_samples/JavaScript/uploads_protected/postundefined @@ -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.uploads.createProtected(file) +.then(({ uploads }) => { + console.log(uploads.length); +}); diff --git a/docs/api/admin/code_samples/Shell/currencies/getundefined b/docs/api/admin/code_samples/Shell/currencies/getundefined new file mode 100644 index 0000000000..67225eb265 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/currencies/getundefined @@ -0,0 +1,2 @@ +curl --location --request POST 'https://medusa-url.com/admin/currencies' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/currencies_{code}/postundefined b/docs/api/admin/code_samples/Shell/currencies_{code}/postundefined new file mode 100644 index 0000000000..bde3b929de --- /dev/null +++ b/docs/api/admin/code_samples/Shell/currencies_{code}/postundefined @@ -0,0 +1,6 @@ +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 +}' 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/deleteundefined new file mode 100644 index 0000000000..609609e46b --- /dev/null +++ b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined @@ -0,0 +1,6 @@ +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" }] +}' 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/postundefined new file mode 100644 index 0000000000..b64695b1f9 --- /dev/null +++ b/docs/api/admin/code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined @@ -0,0 +1,6 @@ +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" }] +}' diff --git a/docs/api/admin/code_samples/Shell/order-edits/getundefined b/docs/api/admin/code_samples/Shell/order-edits/getundefined new file mode 100644 index 0000000000..3a83fdf7cc --- /dev/null +++ b/docs/api/admin/code_samples/Shell/order-edits/getundefined @@ -0,0 +1,2 @@ +curl --location --request GET 'https://medusa-url.com/admin/order-edits' \ +--header 'Authorization: Bearer {api_token}' diff --git a/docs/api/admin/code_samples/Shell/order-edits/postundefined b/docs/api/admin/code_samples/Shell/order-edits/postundefined index 29b1870d9c..65fb80274b 100644 --- a/docs/api/admin/code_samples/Shell/order-edits/postundefined +++ b/docs/api/admin/code_samples/Shell/order-edits/postundefined @@ -1,3 +1,4 @@ curl --location --request POST 'https://medusa-url.com/admin/order-edits' \ ---header 'Authorization: Bearer {api_token}' --d '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }' +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ "order_id": "my_order_id", "internal_note": "my_optional_note" }' diff --git a/docs/api/admin/code_samples/Shell/order-edits_{id}/postundefined b/docs/api/admin/code_samples/Shell/order-edits_{id}/postundefined index 3fba5b2aa2..916c9d8a2f 100644 --- a/docs/api/admin/code_samples/Shell/order-edits_{id}/postundefined +++ b/docs/api/admin/code_samples/Shell/order-edits_{id}/postundefined @@ -1,5 +1,5 @@ curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}' \ ---header 'Authorization: Bearer {api_token}' +--header 'Authorization: Bearer {api_token}' \ --header 'Content-Type: application/json' \ --data-raw '{ "internal_note": "internal reason XY" 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/postundefined index fdda792726..827b3eee6c 100644 --- a/docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/postundefined +++ b/docs/api/admin/code_samples/Shell/order-edits_{id}_cancel/postundefined @@ -1,2 +1,2 @@ -curl --location --request POST 'https://medusa-url.com/admin/order-edits/:id/cancel' \ +curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/cancel' \ --header 'Authorization: Bearer {api_token}' 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/postundefined index 82c18df5dd..eeac43d05a 100644 --- a/docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/postundefined +++ b/docs/api/admin/code_samples/Shell/order-edits_{id}_confirm/postundefined @@ -1,2 +1,2 @@ -curl --location --request POST 'https://medusa-url.com/admin/order-edits/:id/confirm' \ +curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/confirm' \ --header 'Authorization: Bearer {api_token}' 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/postundefined index 115265370d..50b46233e4 100644 --- a/docs/api/admin/code_samples/Shell/order-edits_{id}_items/postundefined +++ b/docs/api/admin/code_samples/Shell/order-edits_{id}_items/postundefined @@ -1,3 +1,4 @@ curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items' \ ---header 'Authorization: Bearer {api_token}' --d '{ "variant_id": "some_variant_id", "quantity": 3 }' +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ "variant_id": "variant_01G1G5V2MRX2V3PVSR2WXYPFB6", "quantity": 3 }' 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}/postundefined index 0c72b1352f..1aaad546b9 100644 --- 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}/postundefined @@ -1,3 +1,4 @@ curl --location --request POST 'https://medusa-url.com/admin/order-edits/{id}/items/{item_id}' \ ---header 'Authorization: Bearer {api_token}' --d '{ "quantity": 5 }' +--header 'Authorization: Bearer {api_token}' \ +--header 'Content-Type: application/json' \ +--data-raw '{ "quantity": 5 }' diff --git a/docs/api/admin/code_samples/Shell/uploads_protected/postundefined b/docs/api/admin/code_samples/Shell/uploads_protected/postundefined new file mode 100644 index 0000000000..e3f5e6524e --- /dev/null +++ b/docs/api/admin/code_samples/Shell/uploads_protected/postundefined @@ -0,0 +1,5 @@ +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=@""' diff --git a/docs/api/admin/components/schemas/order_edit.yaml b/docs/api/admin/components/schemas/order_edit.yaml index fdcb17fccd..44e4a3f779 100644 --- a/docs/api/admin/components/schemas/order_edit.yaml +++ b/docs/api/admin/components/schemas/order_edit.yaml @@ -16,11 +16,11 @@ properties: description: The ID of the order that is edited example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: - description: Order object + description: Available if the relation `order` is expanded. $ref: ./order.yaml changes: type: array - description: Line item changes array. + description: Available if the relation `changes` is expanded. items: $ref: ./order_item_change.yaml internal_note: @@ -92,8 +92,32 @@ properties: The difference between the total amount of the order and total amount of edited order. example: 8200 + status: + type: string + description: The status of the order edit. + enum: + - confirmed + - declined + - requested + - created + - canceled items: type: array - description: Computed line items from the changes. + description: Available if the relation `items` is expanded. items: $ref: ./line_item.yaml + payment_collection_id: + type: string + description: The ID of the payment collection + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + $ref: ./payment_collection.yaml + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time diff --git a/docs/api/admin/components/schemas/order_item_change.yaml b/docs/api/admin/components/schemas/order_item_change.yaml index 74cb2ed7ec..70d61c83c3 100644 --- a/docs/api/admin/components/schemas/order_item_change.yaml +++ b/docs/api/admin/components/schemas/order_item_change.yaml @@ -11,7 +11,7 @@ properties: example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: type: string - description: The order's status + description: The order item change's status enum: - item_add - item_remove @@ -21,19 +21,36 @@ properties: description: The ID of the order edit example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: - description: Order edit object + description: Available if the relation `order_edit` is expanded. $ref: ./order_edit.yaml original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: - description: Original line item object. + description: Available if the relation `original_line_item` is expanded. $ref: ./line_item.yaml line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: - description: Line item object. + description: Available if the relation `line_item` is expanded. $ref: ./line_item.yaml + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white diff --git a/docs/api/admin/components/schemas/payment_collection.yaml b/docs/api/admin/components/schemas/payment_collection.yaml new file mode 100644 index 0000000000..315c62b475 --- /dev/null +++ b/docs/api/admin/components/schemas/payment_collection.yaml @@ -0,0 +1,96 @@ +title: Payment Collection +description: Payment Collection +x-resourceId: payment_collection +required: + - type + - status + - amount + - region_id + - currency_code + - created_by +properties: + id: + type: string + description: The payment collection's ID + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + type: string + description: The type of the payment collection + enum: + - order_edit + status: + type: string + description: The type of the payment collection + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - refunded + - partially_refunded + - canceled + - requires_action + description: + type: string + description: Description of the payment collection + amount: + type: number + description: Amount of the payment collection. + authorized_amount: + type: number + description: Authorized amount of the payment collection. + captured_amount: + type: number + description: Captured amount of the payment collection. + refunded_amount: + type: number + description: Refunded amount of the payment collection. + region_id: + type: string + description: The region's ID + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + $ref: ./region.yaml + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + $ref: ./currency.yaml + payment_sessions: + type: array + description: Available if the relation `payment_sessions` is expanded. + items: + $ref: ./payment_session.yaml + payments: + type: array + description: Available if the relation `payments` is expanded. + items: + $ref: ./payment.yaml + created_by: + type: string + description: The ID of the user that created the payment collection. + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white diff --git a/docs/api/admin/components/schemas/region.yaml b/docs/api/admin/components/schemas/region.yaml index 1ca5d40e77..a2561dc892 100644 --- a/docs/api/admin/components/schemas/region.yaml +++ b/docs/api/admin/components/schemas/region.yaml @@ -12,7 +12,7 @@ required: properties: id: type: string - description: The cart's ID + description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- diff --git a/docs/api/admin/openapi.yaml b/docs/api/admin/openapi.yaml index 0f15dafd46..380a1c21d2 100644 --- a/docs/api/admin/openapi.yaml +++ b/docs/api/admin/openapi.yaml @@ -240,6 +240,8 @@ paths: $ref: paths/customers_{id}.yaml /discounts/{id}/regions/{region_id}: $ref: paths/discounts_{id}_regions_{region_id}.yaml + /discounts/{discount_id}/conditions/{condition_id}/batch: + $ref: paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml /discounts/{discount_id}/conditions: $ref: paths/discounts_{discount_id}_conditions.yaml /discounts: @@ -450,6 +452,8 @@ paths: $ref: paths/tax-rates.yaml /tax-rates/{id}: $ref: paths/tax-rates_{id}.yaml + /uploads/protected: + $ref: paths/uploads_protected.yaml /uploads: $ref: paths/uploads.yaml /users: diff --git a/docs/api/admin/paths/admin_draft-orders_{id}.yaml b/docs/api/admin/paths/admin_draft-orders_{id}.yaml index 86de7f8599..fdf0874807 100644 --- a/docs/api/admin/paths/admin_draft-orders_{id}.yaml +++ b/docs/api/admin/paths/admin_draft-orders_{id}.yaml @@ -31,10 +31,14 @@ post: format: email billing_address: description: The Address to be used for billing purposes. - $ref: ../components/schemas/address_fields.yaml + anyOf: + - $ref: ../components/schemas/address_fields.yaml + - type: string shipping_address: description: The Address to be used for shipping. - $ref: ../components/schemas/address_fields.yaml + anyOf: + - $ref: ../components/schemas/address_fields.yaml + - type: string discounts: description: An array of Discount codes to add to the Draft Order. type: array diff --git a/docs/api/admin/paths/collections.yaml b/docs/api/admin/paths/collections.yaml index 5aff716e10..fea044f02c 100644 --- a/docs/api/admin/paths/collections.yaml +++ b/docs/api/admin/paths/collections.yaml @@ -91,6 +91,11 @@ get: description: a search term to search titles and handles. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product collections. + schema: + type: string - in: query name: created_at description: Date comparison for when resulting collections were created. diff --git a/docs/api/admin/paths/currencies.yaml b/docs/api/admin/paths/currencies.yaml index 216a872515..340ac8d423 100644 --- a/docs/api/admin/paths/currencies.yaml +++ b/docs/api/admin/paths/currencies.yaml @@ -16,19 +16,30 @@ get: type: boolean - in: query name: order - description: to retrieve products in. + description: order to retrieve products in. schema: type: string - in: query name: offset description: How many products to skip in the result. schema: - type: string + type: number + default: '0' - in: query name: limit description: Limit the number of products returned. schema: - type: string + type: number + default: '20' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/currencies/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/currencies/getundefined tags: - Currency responses: @@ -38,16 +49,16 @@ get: application/json: schema: properties: - count: - description: The number of Currency. - type: integer - offset: - description: The offset of the Currency query. - type: integer - limit: - description: The limit of the currency query. - type: integer currencies: type: array items: $ref: ../components/schemas/currency.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/paths/currencies_{code}.yaml b/docs/api/admin/paths/currencies_{code}.yaml index b2ddbc5749..73e2a1c5ef 100644 --- a/docs/api/admin/paths/currencies_{code}.yaml +++ b/docs/api/admin/paths/currencies_{code}.yaml @@ -18,6 +18,15 @@ post: includes_tax: type: boolean description: '[EXPERIMENTAL] Tax included in prices of currency.' + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/currencies_{code}/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/currencies_{code}/postundefined tags: - Currency responses: diff --git a/docs/api/admin/paths/customer-groups.yaml b/docs/api/admin/paths/customer-groups.yaml index 7e88f48f0a..decf0c12e7 100644 --- a/docs/api/admin/paths/customer-groups.yaml +++ b/docs/api/admin/paths/customer-groups.yaml @@ -75,6 +75,11 @@ get: description: the field used to order the customer groups. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the customer groups. + schema: + type: string - in: query name: id style: form 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 new file mode 100644 index 0000000000..a59cec2e06 --- /dev/null +++ b/docs/api/admin/paths/discounts_{discount_id}_conditions_{condition_id}_batch.yaml @@ -0,0 +1,172 @@ +post: + operationId: PostDiscountsDiscountConditionsConditionBatch + summary: Add a batch of resources to a discount condition + description: Add a batch of resources to a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each discount of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount of + the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - resources + properties: + resources: + description: The resources to be added to the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: ../components/schemas/discount.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: DeleteDiscountsDiscountConditionsConditionBatch + summary: Delete a batch of resources from a discount condition + description: Delete a batch of resources from a discount condition. + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The ID of the Product. + schema: + type: string + - in: path + name: condition_id + required: true + description: The ID of the condition on which to add the item. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which relations should be expanded in each discount of + the result. + schema: + type: string + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each discount of + the result. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - resources + properties: + resources: + description: The resources to be deleted from the discount condition + type: array + items: + required: + - id + properties: + id: + description: The id of the item + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: >- + ../code_samples/JavaScript/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined + - lang: Shell + label: cURL + source: + $ref: >- + ../code_samples/Shell/discounts_{discount_id}_conditions_{condition_id}_batch/deleteundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Discount Condition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: ../components/schemas/discount.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/draft-orders.yaml b/docs/api/admin/paths/draft-orders.yaml index a1ce3947a7..cc40a8a99f 100644 --- a/docs/api/admin/paths/draft-orders.yaml +++ b/docs/api/admin/paths/draft-orders.yaml @@ -25,10 +25,14 @@ post: format: email billing_address: description: The Address to be used for billing purposes. - $ref: ../components/schemas/address_fields.yaml + anyOf: + - $ref: ../components/schemas/address_fields.yaml + - type: string shipping_address: description: The Address to be used for shipping. - $ref: ../components/schemas/address_fields.yaml + anyOf: + - $ref: ../components/schemas/address_fields.yaml + - type: string items: description: The Line Items that have been received. type: array diff --git a/docs/api/admin/paths/order-edits.yaml b/docs/api/admin/paths/order-edits.yaml index f8034c1443..f4d402d052 100644 --- a/docs/api/admin/paths/order-edits.yaml +++ b/docs/api/admin/paths/order-edits.yaml @@ -2,6 +2,19 @@ post: operationId: PostOrderEdits summary: Create an OrderEdit description: Creates an OrderEdit. + requestBody: + content: + application/json: + schema: + required: + - order_id + properties: + order_id: + description: The ID of the order to create the edit for. + type: string + internal_note: + description: An optional note to create for the order edit. + type: string x-authenticated: true x-codeSamples: - lang: JavaScript @@ -38,3 +51,86 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml +get: + operationId: GetOrderEdits + summary: List an OrderEdit + description: List a OrderEdit. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching order edit internal note. + schema: + type: string + - in: query + name: order_id + description: List order edits by order id. + schema: + type: string + - in: query + name: limit + description: The number of items in the response + schema: + type: number + default: '20' + - in: query + name: offset + description: The offset of items in response + schema: + type: number + default: '0' + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/order-edits/getundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/order-edits/getundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - OrderEdit + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order_edits: + type: array + $ref: ../components/schemas/order_edit.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 + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/order-edits_{id}.yaml b/docs/api/admin/paths/order-edits_{id}.yaml index 86c87ffe26..9c2972214b 100644 --- a/docs/api/admin/paths/order-edits_{id}.yaml +++ b/docs/api/admin/paths/order-edits_{id}.yaml @@ -56,6 +56,16 @@ get: description: The ID of the OrderEdit. schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string x-codeSamples: - lang: JavaScript label: JS Client @@ -103,6 +113,14 @@ post: description: The ID of the OrderEdit. schema: type: string + requestBody: + content: + application/json: + schema: + properties: + internal_note: + description: An optional note to create or update for the order edit. + type: string x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/order-edits_{id}_items.yaml b/docs/api/admin/paths/order-edits_{id}_items.yaml index 5588a9570a..a97910d3ce 100644 --- a/docs/api/admin/paths/order-edits_{id}_items.yaml +++ b/docs/api/admin/paths/order-edits_{id}_items.yaml @@ -9,6 +9,25 @@ post: description: The ID of the Order Edit. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - variant_id + - quantity + properties: + variant_id: + description: The ID of the variant ID to add + type: string + quantity: + description: The quantity to add + type: number + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object x-authenticated: true x-codeSamples: - lang: JavaScript 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 95634fe383..41ec464d8e 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 @@ -70,6 +70,16 @@ post: description: The ID of the order edit item to update. schema: type: string + requestBody: + content: + application/json: + schema: + required: + - quantity + properties: + quantity: + description: The quantity to update + type: number x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/admin/paths/product-tags.yaml b/docs/api/admin/paths/product-tags.yaml index 8b68dfdc37..fcc8bcad35 100644 --- a/docs/api/admin/paths/product-tags.yaml +++ b/docs/api/admin/paths/product-tags.yaml @@ -21,6 +21,11 @@ get: description: The field to sort items by. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the tags. + schema: + type: string - in: query name: value style: form diff --git a/docs/api/admin/paths/product-types.yaml b/docs/api/admin/paths/product-types.yaml index 965fcf34e0..00e7e2f1c4 100644 --- a/docs/api/admin/paths/product-types.yaml +++ b/docs/api/admin/paths/product-types.yaml @@ -21,6 +21,11 @@ get: description: The field to sort items by. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product types. + schema: + type: string - in: query name: value style: form diff --git a/docs/api/admin/paths/products.yaml b/docs/api/admin/paths/products.yaml index f1f18c1a40..cc2ad51a46 100644 --- a/docs/api/admin/paths/products.yaml +++ b/docs/api/admin/paths/products.yaml @@ -289,6 +289,11 @@ get: and sku, and collection title. schema: type: string + - in: query + name: discount_condition_id + description: The discount condition id on which to filter the product. + schema: + type: string - in: query name: id style: form @@ -352,6 +357,15 @@ get: type: array items: type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to filter products by + schema: + type: array + items: + type: string - in: query name: title description: title to search for. @@ -372,11 +386,6 @@ get: description: Search for giftcards using is_giftcard=true. schema: type: boolean - - in: query - name: type - description: type ID to search for. - schema: - type: string - in: query name: created_at description: Date comparison for when resulting products were created. diff --git a/docs/api/admin/paths/uploads_protected.yaml b/docs/api/admin/paths/uploads_protected.yaml new file mode 100644 index 0000000000..5099c3e215 --- /dev/null +++ b/docs/api/admin/paths/uploads_protected.yaml @@ -0,0 +1,58 @@ +post: + operationId: PostUploadsProtected + summary: Upload files with acl or in a non-public bucket + description: >- + Uploads at least one file to the specific fileservice that is installed in + Medusa. + x-authenticated: true + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: string + format: binary + x-codeSamples: + - lang: JavaScript + label: JS Client + source: + $ref: ../code_samples/JavaScript/uploads_protected/postundefined + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/uploads_protected/postundefined + security: + - api_token: [] + - cookie_auth: [] + tags: + - Upload + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + uploads: + type: array + items: + type: object + properties: + url: + type: string + description: The URL of the uploaded file. + format: uri + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml diff --git a/docs/api/admin/paths/variants.yaml b/docs/api/admin/paths/variants.yaml index a10c15ee54..0eb69611a8 100644 --- a/docs/api/admin/paths/variants.yaml +++ b/docs/api/admin/paths/variants.yaml @@ -5,22 +5,94 @@ get: x-authenticated: true parameters: - in: query - name: q - description: Query used for searching variants. + name: id + description: A Product Variant id to filter by. + schema: + type: string + - in: query + name: ids + description: A comma separated list of Product Variant ids to filter by. + schema: + type: string + - in: query + name: expand + description: A comma separated list of Product Variant relations to load. + schema: + type: string + - in: query + name: fields + description: A comma separated list of Product Variant fields to include. schema: type: string - in: query name: offset - description: How many variants to skip in the result. + description: How many product variants to skip in the result. schema: - type: integer - default: 0 + type: number + default: '0' - in: query name: limit - description: Limit the number of variants returned. + description: Maximum number of Product Variants to return. schema: - type: integer - default: 20 + type: number + default: '100' + - in: query + name: cart_id + description: The id of the cart to use for price selection. + schema: + type: string + - in: query + name: region_id + description: The id of the region to use for price selection. + schema: + type: string + - in: query + name: currency_code + description: The currency code to use for price selection. + schema: + type: string + - in: query + name: customer_id + description: The id of the customer to use for price selection. + schema: + type: string + - in: query + name: title + style: form + explode: false + description: product variant title to search for. + schema: + oneOf: + - type: string + description: a single title to search by + - type: array + description: multiple titles to search by + items: + type: string + - in: query + name: inventory_quantity + description: Filter by available inventory quantity + schema: + oneOf: + - type: number + description: a specific number to search by. + - type: object + description: search using less and greater than comparisons. + properties: + lt: + type: number + description: filter by inventory quantity less than this number + gt: + type: number + description: filter by inventory quantity greater than this number + lte: + type: number + description: filter by inventory quantity less than or equal to this number + gte: + type: number + description: >- + filter by inventory quantity greater than or equal to this + number x-codeSamples: - lang: JavaScript label: JS Client diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 2c871d4971..099ae6e9ff 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -2617,7 +2617,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdit.complete(orderEditId) + medusa.orderEdits.complete(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -2674,7 +2674,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdit.decline(orderEditId) + medusa.orderEdits.decline(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id); }) @@ -2723,7 +2723,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdit.retrieve(orderEditId) + medusa.orderEdits.retrieve(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id); @@ -3047,6 +3047,15 @@ paths: - type: array items: type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: an array of sales channel IDs to filter the retrieved products by. + schema: + type: array + items: + type: string - in: query name: collection_id style: form @@ -3056,6 +3065,15 @@ paths: type: array items: type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to search for + schema: + type: array + items: + type: string - in: query name: tags style: form @@ -3085,11 +3103,6 @@ paths: description: Search for giftcards using is_giftcard=true. schema: type: boolean - - in: query - name: type - description: type to search for. - schema: - type: string - in: query name: created_at description: Date comparison for when resulting products were created. @@ -3613,8 +3626,8 @@ paths: ] }) - .then(({ return }) => { - console.log(return.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL @@ -6871,11 +6884,11 @@ components: description: The ID of the order that is edited example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: - description: Order object + description: Available if the relation `order` is expanded. $ref: '#/components/schemas/order' changes: type: array - description: Line item changes array. + description: Available if the relation `changes` is expanded. items: $ref: '#/components/schemas/order_item_change' internal_note: @@ -6951,11 +6964,35 @@ components: The difference between the total amount of the order and total amount of edited order. example: 8200 + status: + type: string + description: The status of the order edit. + enum: + - confirmed + - declined + - requested + - created + - canceled items: type: array - description: Computed line items from the changes. + description: Available if the relation `items` is expanded. items: $ref: '#/components/schemas/line_item' + payment_collection_id: + type: string + description: The ID of the payment collection + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + $ref: '#/components/schemas/payment_collection' + 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 order_item_change: title: Order Item Change description: Represents an order edit item change @@ -6970,7 +7007,7 @@ components: example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: type: string - description: The order's status + description: The order item change's status enum: - item_add - item_remove @@ -6980,22 +7017,39 @@ components: description: The ID of the order edit example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: - description: Order edit object + description: Available if the relation `order_edit` is expanded. $ref: '#/components/schemas/order_edit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: - description: Original line item object. + description: Available if the relation `original_line_item` is expanded. $ref: '#/components/schemas/line_item' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: - description: Line item object. + description: Available if the relation `line_item` is expanded. $ref: '#/components/schemas/line_item' + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white order: title: Order description: Represents an order @@ -7274,6 +7328,103 @@ components: type: integer description: The total of gift cards with taxes example: 0 + payment_collection: + title: Payment Collection + description: Payment Collection + x-resourceId: payment_collection + required: + - type + - status + - amount + - region_id + - currency_code + - created_by + properties: + id: + type: string + description: The payment collection's ID + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + type: string + description: The type of the payment collection + enum: + - order_edit + status: + type: string + description: The type of the payment collection + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - refunded + - partially_refunded + - canceled + - requires_action + description: + type: string + description: Description of the payment collection + amount: + type: number + description: Amount of the payment collection. + authorized_amount: + type: number + description: Authorized amount of the payment collection. + captured_amount: + type: number + description: Captured amount of the payment collection. + refunded_amount: + type: number + description: Refunded amount of the payment collection. + region_id: + type: string + description: The region's ID + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + $ref: '#/components/schemas/region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + $ref: '#/components/schemas/currency' + payment_sessions: + type: array + description: Available if the relation `payment_sessions` is expanded. + items: + $ref: '#/components/schemas/payment_session' + payments: + type: array + description: Available if the relation `payments` is expanded. + items: + $ref: '#/components/schemas/payment' + created_by: + type: string + description: The ID of the user that created the payment collection. + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -8312,7 +8463,7 @@ components: properties: id: type: string - description: The cart's ID + description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 2c871d4971..099ae6e9ff 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -2617,7 +2617,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdit.complete(orderEditId) + medusa.orderEdits.complete(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) @@ -2674,7 +2674,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdit.decline(orderEditId) + medusa.orderEdits.decline(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id); }) @@ -2723,7 +2723,7 @@ paths: const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) - medusa.orderEdit.retrieve(orderEditId) + medusa.orderEdits.retrieve(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id); @@ -3047,6 +3047,15 @@ paths: - type: array items: type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: an array of sales channel IDs to filter the retrieved products by. + schema: + type: array + items: + type: string - in: query name: collection_id style: form @@ -3056,6 +3065,15 @@ paths: type: array items: type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to search for + schema: + type: array + items: + type: string - in: query name: tags style: form @@ -3085,11 +3103,6 @@ paths: description: Search for giftcards using is_giftcard=true. schema: type: boolean - - in: query - name: type - description: type to search for. - schema: - type: string - in: query name: created_at description: Date comparison for when resulting products were created. @@ -3613,8 +3626,8 @@ paths: ] }) - .then(({ return }) => { - console.log(return.id); + .then((data) => { + console.log(data.return.id); }); - lang: Shell label: cURL @@ -6871,11 +6884,11 @@ components: description: The ID of the order that is edited example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: - description: Order object + description: Available if the relation `order` is expanded. $ref: '#/components/schemas/order' changes: type: array - description: Line item changes array. + description: Available if the relation `changes` is expanded. items: $ref: '#/components/schemas/order_item_change' internal_note: @@ -6951,11 +6964,35 @@ components: The difference between the total amount of the order and total amount of edited order. example: 8200 + status: + type: string + description: The status of the order edit. + enum: + - confirmed + - declined + - requested + - created + - canceled items: type: array - description: Computed line items from the changes. + description: Available if the relation `items` is expanded. items: $ref: '#/components/schemas/line_item' + payment_collection_id: + type: string + description: The ID of the payment collection + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + $ref: '#/components/schemas/payment_collection' + 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 order_item_change: title: Order Item Change description: Represents an order edit item change @@ -6970,7 +7007,7 @@ components: example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: type: string - description: The order's status + description: The order item change's status enum: - item_add - item_remove @@ -6980,22 +7017,39 @@ components: description: The ID of the order edit example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: - description: Order edit object + description: Available if the relation `order_edit` is expanded. $ref: '#/components/schemas/order_edit' original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: - description: Original line item object. + description: Available if the relation `original_line_item` is expanded. $ref: '#/components/schemas/line_item' line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: - description: Line item object. + description: Available if the relation `line_item` is expanded. $ref: '#/components/schemas/line_item' + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white order: title: Order description: Represents an order @@ -7274,6 +7328,103 @@ components: type: integer description: The total of gift cards with taxes example: 0 + payment_collection: + title: Payment Collection + description: Payment Collection + x-resourceId: payment_collection + required: + - type + - status + - amount + - region_id + - currency_code + - created_by + properties: + id: + type: string + description: The payment collection's ID + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + type: string + description: The type of the payment collection + enum: + - order_edit + status: + type: string + description: The type of the payment collection + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - refunded + - partially_refunded + - canceled + - requires_action + description: + type: string + description: Description of the payment collection + amount: + type: number + description: Amount of the payment collection. + authorized_amount: + type: number + description: Authorized amount of the payment collection. + captured_amount: + type: number + description: Captured amount of the payment collection. + refunded_amount: + type: number + description: Refunded amount of the payment collection. + region_id: + type: string + description: The region's ID + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + $ref: '#/components/schemas/region' + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: 'https://en.wikipedia.org/wiki/ISO_4217#Active_codes' + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + $ref: '#/components/schemas/currency' + payment_sessions: + type: array + description: Available if the relation `payment_sessions` is expanded. + items: + $ref: '#/components/schemas/payment_session' + payments: + type: array + description: Available if the relation `payments` is expanded. + items: + $ref: '#/components/schemas/payment' + created_by: + type: string + description: The ID of the user that created the payment collection. + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -8312,7 +8463,7 @@ components: properties: id: type: string - description: The cart's ID + description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- diff --git a/docs/api/store/code_samples/JavaScript/order-edits_{id}/getundefined b/docs/api/store/code_samples/JavaScript/order-edits_{id}/getundefined index f77c2b0a27..08e3f53272 100644 --- a/docs/api/store/code_samples/JavaScript/order-edits_{id}/getundefined +++ b/docs/api/store/code_samples/JavaScript/order-edits_{id}/getundefined @@ -1,6 +1,6 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) -medusa.orderEdit.retrieve(orderEditId) +medusa.orderEdits.retrieve(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id); }); 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/postundefined index ee0fa54b93..f1e6affb37 100644 --- a/docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/postundefined +++ b/docs/api/store/code_samples/JavaScript/order-edits_{id}_complete/postundefined @@ -1,6 +1,6 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) -medusa.orderEdit.complete(orderEditId) +medusa.orderEdits.complete(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id) }) 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/postundefined index f3edf50fc7..d5d9c6c5d4 100644 --- a/docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/postundefined +++ b/docs/api/store/code_samples/JavaScript/order-edits_{id}_decline/postundefined @@ -1,6 +1,6 @@ import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) -medusa.orderEdit.decline(orderEditId) +medusa.orderEdits.decline(order_edit_id) .then(({ order_edit }) => { console.log(order_edit.id); }) diff --git a/docs/api/store/code_samples/JavaScript/returns/postundefined b/docs/api/store/code_samples/JavaScript/returns/postundefined index 412b0fff65..3f88229f0d 100644 --- a/docs/api/store/code_samples/JavaScript/returns/postundefined +++ b/docs/api/store/code_samples/JavaScript/returns/postundefined @@ -9,6 +9,6 @@ medusa.returns.create({ } ] }) -.then(({ return }) => { - console.log(return.id); +.then((data) => { + console.log(data.return.id); }); diff --git a/docs/api/store/components/schemas/order_edit.yaml b/docs/api/store/components/schemas/order_edit.yaml index fdcb17fccd..44e4a3f779 100644 --- a/docs/api/store/components/schemas/order_edit.yaml +++ b/docs/api/store/components/schemas/order_edit.yaml @@ -16,11 +16,11 @@ properties: description: The ID of the order that is edited example: order_01G2SG30J8C85S4A5CHM2S1NS2 order: - description: Order object + description: Available if the relation `order` is expanded. $ref: ./order.yaml changes: type: array - description: Line item changes array. + description: Available if the relation `changes` is expanded. items: $ref: ./order_item_change.yaml internal_note: @@ -92,8 +92,32 @@ properties: The difference between the total amount of the order and total amount of edited order. example: 8200 + status: + type: string + description: The status of the order edit. + enum: + - confirmed + - declined + - requested + - created + - canceled items: type: array - description: Computed line items from the changes. + description: Available if the relation `items` is expanded. items: $ref: ./line_item.yaml + payment_collection_id: + type: string + description: The ID of the payment collection + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + payment_collection: + description: Available if the relation `payment_collection` is expanded. + $ref: ./payment_collection.yaml + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time diff --git a/docs/api/store/components/schemas/order_item_change.yaml b/docs/api/store/components/schemas/order_item_change.yaml index 74cb2ed7ec..70d61c83c3 100644 --- a/docs/api/store/components/schemas/order_item_change.yaml +++ b/docs/api/store/components/schemas/order_item_change.yaml @@ -11,7 +11,7 @@ properties: example: oic_01G8TJSYT9M6AVS5N4EMNFS1EK type: type: string - description: The order's status + description: The order item change's status enum: - item_add - item_remove @@ -21,19 +21,36 @@ properties: description: The ID of the order edit example: oe_01G2SG30J8C85S4A5CHM2S1NS2 order_edit: - description: Order edit object + description: Available if the relation `order_edit` is expanded. $ref: ./order_edit.yaml original_line_item_id: type: string description: The ID of the original line item in the order example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN original_line_item: - description: Original line item object. + description: Available if the relation `original_line_item` is expanded. $ref: ./line_item.yaml line_item_id: type: string description: The ID of the cloned line item. example: item_01G8ZC9GWT6B2GP5FSXRXNFNGN line_item: - description: Line item object. + description: Available if the relation `line_item` is expanded. $ref: ./line_item.yaml + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white diff --git a/docs/api/store/components/schemas/payment_collection.yaml b/docs/api/store/components/schemas/payment_collection.yaml new file mode 100644 index 0000000000..315c62b475 --- /dev/null +++ b/docs/api/store/components/schemas/payment_collection.yaml @@ -0,0 +1,96 @@ +title: Payment Collection +description: Payment Collection +x-resourceId: payment_collection +required: + - type + - status + - amount + - region_id + - currency_code + - created_by +properties: + id: + type: string + description: The payment collection's ID + example: paycol_01G8TJSYT9M6AVS5N4EMNFS1EK + type: + type: string + description: The type of the payment collection + enum: + - order_edit + status: + type: string + description: The type of the payment collection + enum: + - not_paid + - awaiting + - authorized + - partially_authorized + - captured + - partially_captured + - refunded + - partially_refunded + - canceled + - requires_action + description: + type: string + description: Description of the payment collection + amount: + type: number + description: Amount of the payment collection. + authorized_amount: + type: number + description: Authorized amount of the payment collection. + captured_amount: + type: number + description: Captured amount of the payment collection. + refunded_amount: + type: number + description: Refunded amount of the payment collection. + region_id: + type: string + description: The region's ID + example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G + region: + description: Available if the relation `region` is expanded. + $ref: ./region.yaml + currency_code: + description: The 3 character ISO code for the currency. + type: string + example: usd + externalDocs: + url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes + description: See a list of codes. + currency: + description: Available if the relation `currency` is expanded. + $ref: ./currency.yaml + payment_sessions: + type: array + description: Available if the relation `payment_sessions` is expanded. + items: + $ref: ./payment_session.yaml + payments: + type: array + description: Available if the relation `payments` is expanded. + items: + $ref: ./payment.yaml + created_by: + type: string + description: The ID of the user that created the payment collection. + created_at: + type: string + description: The date with timezone at which the resource was created. + format: date-time + updated_at: + type: string + description: The date with timezone at which the resource was updated. + format: date-time + deleted_at: + type: string + description: The date with timezone at which the resource was deleted. + format: date-time + metadata: + type: object + description: An optional key-value map with additional details + example: + car: white diff --git a/docs/api/store/components/schemas/region.yaml b/docs/api/store/components/schemas/region.yaml index 1ca5d40e77..a2561dc892 100644 --- a/docs/api/store/components/schemas/region.yaml +++ b/docs/api/store/components/schemas/region.yaml @@ -12,7 +12,7 @@ required: properties: id: type: string - description: The cart's ID + description: The region's ID example: reg_01G1G5V26T9H8Y0M4JNE3YGA4G name: description: >- diff --git a/docs/api/store/paths/products.yaml b/docs/api/store/paths/products.yaml index f347b4f4c0..9ee4789003 100644 --- a/docs/api/store/paths/products.yaml +++ b/docs/api/store/paths/products.yaml @@ -21,6 +21,15 @@ get: - type: array items: type: string + - in: query + name: sales_channel_id + style: form + explode: false + description: an array of sales channel IDs to filter the retrieved products by. + schema: + type: array + items: + type: string - in: query name: collection_id style: form @@ -30,6 +39,15 @@ get: type: array items: type: string + - in: query + name: type_id + style: form + explode: false + description: Type IDs to search for + schema: + type: array + items: + type: string - in: query name: tags style: form @@ -59,11 +77,6 @@ get: description: Search for giftcards using is_giftcard=true. schema: type: boolean - - in: query - name: type - description: type to search for. - schema: - type: string - in: query name: created_at description: Date comparison for when resulting products were created.