From 3d0f4086b4c1e44d9f23122a7ea3b963b5a412aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 09:14:39 +0000 Subject: [PATCH] chore(docs): Updated API Reference (automated) (#13794) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com> --- .../JavaScript/admin_refund-reasons/post.js | 17 + .../admin_refund-reasons_{id}/delete.js | 14 + .../admin_refund-reasons_{id}/get.js | 14 + .../admin_refund-reasons_{id}/post.js | 17 + .../components/schemas/AdminCampaign.yaml | 8 + .../AdminCreateCalculatedShippingOption.yaml | 55 ++ ...=> AdminCreateFlatRateShippingOption.yaml} | 83 +- .../schemas/AdminCreateRefundReason.yaml | 8 + .../admin/components/schemas/AdminRefund.yaml | 2 +- .../components/schemas/AdminRefundReason.yaml | 6 +- .../AdminRefundReasonDeleteResponse.yaml | 21 + .../AdminUpdatePaymentRefundReason.yaml | 4 + .../components/schemas/BaseCartLineItem.yaml | 11 - .../schemas/BaseCartShippingMethod.yaml | 8 - .../admin/components/schemas/BaseRefund.yaml | 2 +- ...efundReason.yaml => BaseRefundReason.yaml} | 8 +- .../StoreShippingOptionListResponse.yaml | 132 ++- .../specs/admin/openapi.full.yaml | 782 ++++++++++++++---- .../admin/paths/admin_product-categories.yaml | 43 + .../paths/admin_product-categories_{id}.yaml | 86 ++ .../admin/paths/admin_refund-reasons.yaml | 4 + .../paths/admin_refund-reasons_{id}.yaml | 33 +- .../admin/paths/admin_shipping-options.yaml | 5 +- .../components/schemas/AdminCampaign.yaml | 8 + .../AdminCreateCalculatedShippingOption.yaml | 55 ++ ...=> AdminCreateFlatRateShippingOption.yaml} | 83 +- .../schemas/AdminCreateRefundReason.yaml | 8 + .../store/components/schemas/AdminRefund.yaml | 2 +- .../components/schemas/AdminRefundReason.yaml | 6 +- .../AdminRefundReasonDeleteResponse.yaml | 21 + .../AdminUpdatePaymentRefundReason.yaml | 4 + .../components/schemas/BaseCartLineItem.yaml | 11 - .../schemas/BaseCartShippingMethod.yaml | 8 - .../store/components/schemas/BaseRefund.yaml | 2 +- ...efundReason.yaml => BaseRefundReason.yaml} | 8 +- .../StoreShippingOptionListResponse.yaml | 132 ++- .../specs/store/openapi.full.yaml | 608 ++++++++++---- .../paths/store_carts_{id}_customer.yaml | 32 +- .../specs/store/paths/store_collections.yaml | 14 + .../admin/delete_admin_refund-reasons_[id].ts | 38 +- .../get_admin_product-categories_[id].ts | 38 + .../admin/get_admin_refund-reasons_[id].ts | 17 + ...get_admin_views_[entity]_configurations.ts | 3 +- ...in_views_[entity]_configurations_active.ts | 3 +- .../admin/post_admin_product-categories.ts | 38 + .../post_admin_product-categories_[id].ts | 38 + .../admin/post_admin_refund-reasons.ts | 20 + .../admin/post_admin_refund-reasons_[id].ts | 20 + .../admin/post_admin_shipping-options.ts | 5 +- ...ost_admin_views_[entity]_configurations.ts | 3 +- ...in_views_[entity]_configurations_active.ts | 4 +- .../operations/store/get_store_collections.ts | 14 + .../store/post_store_carts_[id]_customer.ts | 28 +- .../oas-output/schemas/AdminCampaign.ts | 7 + .../AdminCreateCalculatedShippingOption.ts | 57 ++ ...s => AdminCreateFlatRateShippingOption.ts} | 83 +- .../schemas/AdminCreateRefundReason.ts | 8 + .../oas-output/schemas/AdminRefund.ts | 2 +- .../oas-output/schemas/AdminRefundReason.ts | 6 +- .../AdminRefundReasonDeleteResponse.ts | 26 + .../schemas/AdminUpdatePaymentRefundReason.ts | 4 + .../oas-output/schemas/BaseCartLineItem.ts | 11 - .../schemas/BaseCartShippingMethod.ts | 8 - .../oas-output/schemas/BaseRefund.ts | 2 +- .../{RefundReason.ts => BaseRefundReason.ts} | 10 +- .../StoreShippingOptionListResponse.ts | 130 ++- .../route-examples-output/route-examples.json | 12 + 67 files changed, 2475 insertions(+), 525 deletions(-) create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/post.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/delete.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/get.js create mode 100644 www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/post.js create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminCreateCalculatedShippingOption.yaml rename www/apps/api-reference/specs/admin/components/schemas/{AdminCreateShippingOption.yaml => AdminCreateFlatRateShippingOption.yaml} (52%) create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminRefundReasonDeleteResponse.yaml rename www/apps/api-reference/specs/admin/components/schemas/{RefundReason.yaml => BaseRefundReason.yaml} (87%) create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminCreateCalculatedShippingOption.yaml rename www/apps/api-reference/specs/store/components/schemas/{AdminCreateShippingOption.yaml => AdminCreateFlatRateShippingOption.yaml} (52%) create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminRefundReasonDeleteResponse.yaml rename www/apps/api-reference/specs/store/components/schemas/{RefundReason.yaml => BaseRefundReason.yaml} (87%) create mode 100644 www/utils/generated/oas-output/schemas/AdminCreateCalculatedShippingOption.ts rename www/utils/generated/oas-output/schemas/{AdminCreateShippingOption.ts => AdminCreateFlatRateShippingOption.ts} (52%) create mode 100644 www/utils/generated/oas-output/schemas/AdminRefundReasonDeleteResponse.ts rename www/utils/generated/oas-output/schemas/{RefundReason.ts => BaseRefundReason.ts} (85%) diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/post.js new file mode 100644 index 0000000000..14d904906c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.refundReason.create({ + value: "refund", + label: "Refund", +}) +.then(({ refund_reason }) => { + console.log(refund_reason) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/delete.js new file mode 100644 index 0000000000..ccab597501 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/delete.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.refundReason.delete("ret_123") +.then(({ deleted }) => { + console.log(deleted) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/get.js new file mode 100644 index 0000000000..a5e8774d7a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/get.js @@ -0,0 +1,14 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.refundReason.retrieve("refr_123") +.then(({ refund_reason }) => { + console.log(refund_reason) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/post.js new file mode 100644 index 0000000000..c643527e9a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_refund-reasons_{id}/post.js @@ -0,0 +1,17 @@ +import Medusa from "@medusajs/js-sdk" + +export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, +}) + +sdk.admin.refundReason.update("ret_123", { + value: "refund", + label: "Refund", +}) +.then(({ refund_reason }) => { + console.log(refund_reason) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCampaign.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCampaign.yaml index d77f5dbb8d..e1bb18e655 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminCampaign.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCampaign.yaml @@ -51,6 +51,7 @@ properties: - currency_code - limit - used + - attribute properties: id: type: string @@ -82,6 +83,13 @@ properties: property holds the total amount discounted so far. If the limit is `usage`, it holds the number of times the campaign's promotions have been used so far. + attribute: + type: string + title: attribute + description: The cart attribute to limit the budget by. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/promotion/campaign#attribute-based-budgets created_at: type: string format: date-time diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateCalculatedShippingOption.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateCalculatedShippingOption.yaml new file mode 100644 index 0000000000..0fd1b33fa8 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateCalculatedShippingOption.yaml @@ -0,0 +1,55 @@ +type: object +description: The calculated shipping option's details. +x-schemaName: AdminCreateCalculatedShippingOption +required: + - price_type + - name + - service_zone_id + - shipping_profile_id + - provider_id +properties: + price_type: + type: string + title: price_type + description: The calculated shipping option's price type. + enum: + - calculated + - flat + name: + type: string + title: name + description: The calculated shipping option's name. + service_zone_id: + type: string + title: service_zone_id + description: The ID of the associated service zone. + shipping_profile_id: + type: string + title: shipping_profile_id + description: The ID of the associated shipping profile. + data: + type: object + description: The calculated shipping option's data. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property + provider_id: + type: string + title: provider_id + description: >- + The ID of the fulfillment provider handling this calculated shipping + option. + type: + $ref: ./AdminCreateShippingOptionType.yaml + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. + rules: + type: array + description: The calculated shipping option's rules. + items: + $ref: ./AdminCreateShippingOptionRule.yaml + metadata: + type: object + description: The shipping option's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFlatRateShippingOption.yaml similarity index 52% rename from www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml rename to www/apps/api-reference/specs/admin/components/schemas/AdminCreateFlatRateShippingOption.yaml index f433c655a0..da47b8740e 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateFlatRateShippingOption.yaml @@ -1,18 +1,18 @@ type: object -description: The shipping option's details. -x-schemaName: AdminCreateShippingOption +description: The flat rate shipping option's details. +x-schemaName: AdminCreateFlatRateShippingOption required: + - price_type + - prices - name - service_zone_id - shipping_profile_id - - price_type - provider_id - - prices properties: name: type: string title: name - description: The shipping option's name. + description: The flat-rate shipping option's name. service_zone_id: type: string title: service_zone_id @@ -24,8 +24,8 @@ properties: data: type: object description: >- - The shipping option's data, useful for the fulfillment provider handling - its processing. + The flat-rate shipping option's data, useful for the fulfillment provider + handling its processing. externalDocs: url: >- https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property @@ -65,6 +65,35 @@ properties: type: number title: amount description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. - type: object description: The price's details. x-schemaName: AdminCreateShippingOptionPriceWithRegion @@ -80,12 +109,44 @@ properties: type: number title: amount description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. rules: type: array description: The shipping option's rules. items: $ref: ./AdminCreateShippingOptionRule.yaml - type_id: - type: string - title: type_id - description: The ID of the shipping option type that this shipping option belongs to. + metadata: + type: object + description: The shipping option's metadata. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateRefundReason.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateRefundReason.yaml index a94aba8a11..ef7534dda6 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateRefundReason.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateRefundReason.yaml @@ -3,6 +3,7 @@ description: The refund reason's details. x-schemaName: AdminCreateRefundReason required: - label + - code properties: label: type: string @@ -12,3 +13,10 @@ properties: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. + metadata: + type: object + description: The refund reason's metadata. Can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminRefund.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminRefund.yaml index 229fb7729c..ee936d0dbf 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminRefund.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminRefund.yaml @@ -35,4 +35,4 @@ properties: payment: $ref: ./BasePayment.yaml refund_reason: - $ref: ./RefundReason.yaml + $ref: ./BaseRefundReason.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminRefundReason.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminRefundReason.yaml index a1f49a55fa..955aebe55f 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminRefundReason.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminRefundReason.yaml @@ -4,7 +4,7 @@ x-schemaName: AdminRefundReason required: - id - label - - metadata + - code - created_at - updated_at properties: @@ -36,3 +36,7 @@ properties: format: date-time title: updated_at description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminRefundReasonDeleteResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminRefundReasonDeleteResponse.yaml new file mode 100644 index 0000000000..394f1cb036 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminRefundReasonDeleteResponse.yaml @@ -0,0 +1,21 @@ +type: object +description: The deletion's details. +required: + - id + - object + - deleted +properties: + id: + type: string + title: id + description: The refund reason's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: refund_reason + deleted: + type: boolean + title: deleted + description: Whether the refund reason was deleted. +x-schemaName: AdminRefundReasonDeleteResponse diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdatePaymentRefundReason.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdatePaymentRefundReason.yaml index 1573aa64b7..132b0827dc 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminUpdatePaymentRefundReason.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminUpdatePaymentRefundReason.yaml @@ -9,4 +9,8 @@ properties: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. x-schemaName: AdminUpdatePaymentRefundReason diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseCartLineItem.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseCartLineItem.yaml index eca6c74f23..84bfd74ab8 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseCartLineItem.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseCartLineItem.yaml @@ -11,17 +11,6 @@ required: - unit_price - cart - cart_id - - original_total - - original_subtotal - - original_tax_total - - item_total - - item_subtotal - - item_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml index 2601c6fffd..172ddd7a93 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml @@ -9,14 +9,6 @@ required: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseRefund.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseRefund.yaml index 9a8cf91839..edd77dce4d 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseRefund.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseRefund.yaml @@ -35,4 +35,4 @@ properties: payment: type: object refund_reason: - $ref: ./RefundReason.yaml + $ref: ./BaseRefundReason.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/RefundReason.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseRefundReason.yaml similarity index 87% rename from www/apps/api-reference/specs/admin/components/schemas/RefundReason.yaml rename to www/apps/api-reference/specs/admin/components/schemas/BaseRefundReason.yaml index fad95d0cde..230330348e 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/RefundReason.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseRefundReason.yaml @@ -1,10 +1,10 @@ type: object description: The refund reason's details. -x-schemaName: RefundReason +x-schemaName: BaseRefundReason required: - id - label - - metadata + - code - created_at - updated_at properties: @@ -36,3 +36,7 @@ properties: format: date-time title: updated_at description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreShippingOptionListResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreShippingOptionListResponse.yaml index d41c99958f..25974fee50 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreShippingOptionListResponse.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreShippingOptionListResponse.yaml @@ -1,11 +1,137 @@ type: object -description: The shipping option's details. +description: The list of shipping options. x-schemaName: StoreShippingOptionListResponse required: - shipping_options properties: shipping_options: type: array - description: The shipping option's shipping options. + description: The list of shipping options. items: - $ref: ./StoreCartShippingOption.yaml + allOf: + - $ref: ./StoreCartShippingOption.yaml + - type: object + description: The shipping option's details. + required: + - service_zone + properties: + service_zone: + type: object + description: The shipping option's service zone. + required: + - id + - fulfillment_set_id + - fulfillment_set + properties: + id: + type: string + title: id + description: The service zone's ID. + fulfillment_set_id: + type: string + title: fulfillment_set_id + description: The ID of the service zone's fulfillment set. + fulfillment_set: + type: object + description: The service zone's fulfillment set. + required: + - id + - type + - location + properties: + id: + type: string + title: id + description: The fulfillment set's ID. + type: + type: string + title: type + description: The fulfillment set's type. + location: + type: object + description: The fulfillment set's location details. + required: + - id + - address + properties: + id: + type: string + title: id + description: The location's ID. + address: + type: object + description: The location's address. + x-schemaName: StoreFulfillmentAddress + required: + - id + - company + - address_1 + - address_2 + - city + - country_code + - province + - postal_code + - phone + - metadata + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The address's ID. + company: + type: string + title: company + description: The address's company. + address_1: + type: string + title: address_1 + description: The first line of the address. + address_2: + type: string + title: address_2 + description: The second line of the address. + city: + type: string + title: city + description: The address's city. + country_code: + type: string + title: country_code + description: The address's country code. + example: us + province: + type: string + title: province + description: The address's province. + postal_code: + type: string + title: postal_code + description: The address's postal code. + phone: + type: string + title: phone + description: The address's phone. + metadata: + type: object + description: >- + The address's metadata. Can hold custom + key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the address was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the address was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the address was deleted. + description: The shipping option's details. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index f34ad75de0..b5480b48d6 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -29064,6 +29064,44 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted records in the result. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted records in the result. security: - api_token: [] - cookie_auth: [] @@ -29175,6 +29213,44 @@ paths: type: boolean title: include_descendants_tree description: Whether to retrieve a list of child categories. If you enable this, add to the `fields` query parameter `category_children` to set the children of a category in this field. You can either pass `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, `fields=category_children.id,category_children.name`. + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted records in the result. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted records in the result. security: - api_token: [] - cookie_auth: [] @@ -29245,6 +29321,44 @@ paths: description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. This API route restricts the fields that can be selected. Learn how to override the retrievable fields in the [Retrieve Custom Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. externalDocs: url: '#select-fields-and-relations' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted records in the result. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted records in the result. security: - api_token: [] - cookie_auth: [] @@ -38108,6 +38222,26 @@ paths: schema: $ref: '#/components/schemas/AdminCreateRefundReason' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.refundReason.create({ + value: "refund", + label: "Refund", + }) + .then(({ refund_reason }) => { + console.log(refund_reason) + }) - lang: Shell label: cURL source: |- @@ -38169,6 +38303,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.refundReason.retrieve("refr_123") + .then(({ refund_reason }) => { + console.log(refund_reason) + }) - lang: Shell label: cURL source: |- @@ -38227,6 +38378,26 @@ paths: schema: $ref: '#/components/schemas/AdminUpdatePaymentRefundReason' x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.refundReason.update("ret_123", { + value: "refund", + label: "Refund", + }) + .then(({ refund_reason }) => { + console.log(refund_reason) + }) - lang: Shell label: cURL source: |- @@ -38276,6 +38447,23 @@ paths: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: |- + import Medusa from "@medusajs/js-sdk" + + export const sdk = new Medusa({ + baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + debug: import.meta.env.DEV, + auth: { + type: "session", + }, + }) + + sdk.admin.refundReason.delete("ret_123") + .then(({ deleted }) => { + console.log(deleted) + }) - lang: Shell label: cURL source: |- @@ -38289,26 +38477,7 @@ paths: content: application/json: schema: - type: object - description: The deletion's details. - required: - - id - - object - - deleted - properties: - id: - type: string - title: id - description: The refund reason's ID. - object: - type: string - title: object - description: The name of the deleted object. - default: refund_reason - deleted: - type: boolean - title: deleted - description: Whether the refund reason was deleted. + $ref: '#/components/schemas/AdminRefundReasonDeleteResponse' '400': $ref: '#/components/responses/400_error' '401': @@ -45955,7 +46124,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AdminCreateShippingOption' + oneOf: + - $ref: '#/components/schemas/AdminCreateFlatRateShippingOption' + - $ref: '#/components/schemas/AdminCreateCalculatedShippingOption' + description: The shipping option's details. x-codeSamples: - lang: JavaScript label: JS SDK @@ -57020,6 +57192,7 @@ components: - currency_code - limit - used + - attribute properties: id: type: string @@ -57045,6 +57218,12 @@ components: title: used description: | How much of the budget has been used. If the limit is `spend`, this property holds the total amount discounted so far. If the limit is `usage`, it holds the number of times the campaign's promotions have been used so far. + attribute: + type: string + title: attribute + description: The cart attribute to limit the budget by. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/promotion/campaign#attribute-based-budgets created_at: type: string format: date-time @@ -57539,6 +57718,59 @@ components: enum: - publishable - secret + AdminCreateCalculatedShippingOption: + type: object + description: The calculated shipping option's details. + x-schemaName: AdminCreateCalculatedShippingOption + required: + - price_type + - name + - service_zone_id + - shipping_profile_id + - provider_id + properties: + price_type: + type: string + title: price_type + description: The calculated shipping option's price type. + enum: + - calculated + - flat + name: + type: string + title: name + description: The calculated shipping option's name. + service_zone_id: + type: string + title: service_zone_id + description: The ID of the associated service zone. + shipping_profile_id: + type: string + title: shipping_profile_id + description: The ID of the associated shipping profile. + data: + type: object + description: The calculated shipping option's data. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property + provider_id: + type: string + title: provider_id + description: The ID of the fulfillment provider handling this calculated shipping option. + type: + $ref: '#/components/schemas/AdminCreateShippingOptionType' + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. + rules: + type: array + description: The calculated shipping option's rules. + items: + $ref: '#/components/schemas/AdminCreateShippingOptionRule' + metadata: + type: object + description: The shipping option's metadata, can hold custom key-value pairs. AdminCreateCustomerGroup: type: object description: The customer group's details. @@ -57556,6 +57788,153 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + AdminCreateFlatRateShippingOption: + type: object + description: The flat rate shipping option's details. + x-schemaName: AdminCreateFlatRateShippingOption + required: + - price_type + - prices + - name + - service_zone_id + - shipping_profile_id + - provider_id + properties: + name: + type: string + title: name + description: The flat-rate shipping option's name. + service_zone_id: + type: string + title: service_zone_id + description: The ID of the associated service zone. + shipping_profile_id: + type: string + title: shipping_profile_id + description: The ID of the associated shipping profile. + data: + type: object + description: The flat-rate shipping option's data, useful for the fulfillment provider handling its processing. + externalDocs: + url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property + price_type: + type: string + description: The shipping option's price type. If `flat`, the shipping option has a fixed price set in `prices`. Otherwise, the shipping option's price is calculated by the fulfillment provider. + enum: + - flat + - calculated + provider_id: + type: string + title: provider_id + description: The ID of the fulfillment provider handling this shipping option. + type: + $ref: '#/components/schemas/AdminCreateShippingOptionType' + prices: + type: array + description: The shipping option's prices. + items: + oneOf: + - type: object + description: The price's details. + x-schemaName: AdminCreateShippingOptionPriceWithCurrency + required: + - currency_code + - amount + properties: + currency_code: + type: string + title: currency_code + description: The price's currency code. + example: usd + amount: + type: number + title: amount + description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. + - type: object + description: The price's details. + x-schemaName: AdminCreateShippingOptionPriceWithRegion + required: + - region_id + - amount + properties: + region_id: + type: string + title: region_id + description: The ID of the region this price is used in. + amount: + type: number + title: amount + description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. + rules: + type: array + description: The shipping option's rules. + items: + $ref: '#/components/schemas/AdminCreateShippingOptionRule' + metadata: + type: object + description: The shipping option's metadata. AdminCreateFulfillment: type: object description: The filfillment's details. @@ -58629,6 +59008,7 @@ components: x-schemaName: AdminCreateRefundReason required: - label + - code properties: label: type: string @@ -58638,6 +59018,13 @@ components: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. + metadata: + type: object + description: The refund reason's metadata. Can hold custom key-value pairs. AdminCreateRegion: type: object description: The region's details. @@ -58805,92 +59192,6 @@ components: type: string title: label_url description: The label's URL. - AdminCreateShippingOption: - type: object - description: The shipping option's details. - x-schemaName: AdminCreateShippingOption - required: - - name - - service_zone_id - - shipping_profile_id - - price_type - - provider_id - - prices - properties: - name: - type: string - title: name - description: The shipping option's name. - service_zone_id: - type: string - title: service_zone_id - description: The ID of the associated service zone. - shipping_profile_id: - type: string - title: shipping_profile_id - description: The ID of the associated shipping profile. - data: - type: object - description: The shipping option's data, useful for the fulfillment provider handling its processing. - externalDocs: - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property - price_type: - type: string - description: The shipping option's price type. If `flat`, the shipping option has a fixed price set in `prices`. Otherwise, the shipping option's price is calculated by the fulfillment provider. - enum: - - flat - - calculated - provider_id: - type: string - title: provider_id - description: The ID of the fulfillment provider handling this shipping option. - type: - $ref: '#/components/schemas/AdminCreateShippingOptionType' - prices: - type: array - description: The shipping option's prices. - items: - oneOf: - - type: object - description: The price's details. - x-schemaName: AdminCreateShippingOptionPriceWithCurrency - required: - - currency_code - - amount - properties: - currency_code: - type: string - title: currency_code - description: The price's currency code. - example: usd - amount: - type: number - title: amount - description: The price's amount. - - type: object - description: The price's details. - x-schemaName: AdminCreateShippingOptionPriceWithRegion - required: - - region_id - - amount - properties: - region_id: - type: string - title: region_id - description: The ID of the region this price is used in. - amount: - type: number - title: amount - description: The price's amount. - rules: - type: array - description: The shipping option's rules. - items: - $ref: '#/components/schemas/AdminCreateShippingOptionRule' - type_id: - type: string - title: type_id - description: The ID of the shipping option type that this shipping option belongs to. AdminCreateShippingOptionRule: type: object description: The details of the shipping option rule. @@ -67052,7 +67353,7 @@ components: payment: $ref: '#/components/schemas/BasePayment' refund_reason: - $ref: '#/components/schemas/RefundReason' + $ref: '#/components/schemas/BaseRefundReason' AdminRefundReason: type: object description: The refund reason's details. @@ -67060,7 +67361,7 @@ components: required: - id - label - - metadata + - code - created_at - updated_at properties: @@ -67092,6 +67393,32 @@ components: format: date-time title: updated_at description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. + AdminRefundReasonDeleteResponse: + type: object + description: The deletion's details. + required: + - id + - object + - deleted + properties: + id: + type: string + title: id + description: The refund reason's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: refund_reason + deleted: + type: boolean + title: deleted + description: Whether the refund reason was deleted. + x-schemaName: AdminRefundReasonDeleteResponse AdminRegion: type: object description: The region's details. @@ -69791,6 +70118,10 @@ components: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. x-schemaName: AdminUpdatePaymentRefundReason AdminUpdatePriceList: type: object @@ -71651,17 +71982,6 @@ components: - unit_price - cart - cart_id - - original_total - - original_subtotal - - original_tax_total - - item_total - - item_subtotal - - item_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -71847,14 +72167,6 @@ components: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -74342,7 +74654,50 @@ components: payment: type: object refund_reason: - $ref: '#/components/schemas/RefundReason' + $ref: '#/components/schemas/BaseRefundReason' + BaseRefundReason: + type: object + description: The refund reason's details. + x-schemaName: BaseRefundReason + required: + - id + - label + - code + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The refund reason's ID. + label: + type: string + title: label + description: The refund reason's label. + description: + type: string + title: description + description: The refund reason's description. + metadata: + type: object + description: The refund reason's metadata, can hold custom key-value pairs. + externalDocs: + url: https://docs.medusajs.com/api/store#manage-metadata + description: Learn how to manage metadata + created_at: + type: string + format: date-time + title: created_at + description: The date the refund reason was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. BaseRegion: type: object description: The region's details. @@ -76847,45 +77202,6 @@ components: type: number title: version description: The order version that the transaction belongs to. - RefundReason: - type: object - description: The refund reason's details. - x-schemaName: RefundReason - required: - - id - - label - - metadata - - created_at - - updated_at - properties: - id: - type: string - title: id - description: The refund reason's ID. - label: - type: string - title: label - description: The refund reason's label. - description: - type: string - title: description - description: The refund reason's description. - metadata: - type: object - description: The refund reason's metadata, can hold custom key-value pairs. - externalDocs: - url: https://docs.medusajs.com/api/store#manage-metadata - description: Learn how to manage metadata - created_at: - type: string - format: date-time - title: created_at - description: The date the refund reason was created. - updated_at: - type: string - format: date-time - title: updated_at - description: The date the refund reason was updated. RefundReasonResponse: type: object description: The refund reason's details. @@ -86456,16 +86772,140 @@ components: description: Learn how to manage metadata StoreShippingOptionListResponse: type: object - description: The shipping option's details. + description: The list of shipping options. x-schemaName: StoreShippingOptionListResponse required: - shipping_options properties: shipping_options: type: array - description: The shipping option's shipping options. + description: The list of shipping options. items: - $ref: '#/components/schemas/StoreCartShippingOption' + allOf: + - $ref: '#/components/schemas/StoreCartShippingOption' + - type: object + description: The shipping option's details. + required: + - service_zone + properties: + service_zone: + type: object + description: The shipping option's service zone. + required: + - id + - fulfillment_set_id + - fulfillment_set + properties: + id: + type: string + title: id + description: The service zone's ID. + fulfillment_set_id: + type: string + title: fulfillment_set_id + description: The ID of the service zone's fulfillment set. + fulfillment_set: + type: object + description: The service zone's fulfillment set. + required: + - id + - type + - location + properties: + id: + type: string + title: id + description: The fulfillment set's ID. + type: + type: string + title: type + description: The fulfillment set's type. + location: + type: object + description: The fulfillment set's location details. + required: + - id + - address + properties: + id: + type: string + title: id + description: The location's ID. + address: + type: object + description: The location's address. + x-schemaName: StoreFulfillmentAddress + required: + - id + - company + - address_1 + - address_2 + - city + - country_code + - province + - postal_code + - phone + - metadata + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The address's ID. + company: + type: string + title: company + description: The address's company. + address_1: + type: string + title: address_1 + description: The first line of the address. + address_2: + type: string + title: address_2 + description: The second line of the address. + city: + type: string + title: city + description: The address's city. + country_code: + type: string + title: country_code + description: The address's country code. + example: us + province: + type: string + title: province + description: The address's province. + postal_code: + type: string + title: postal_code + description: The address's postal code. + phone: + type: string + title: phone + description: The address's phone. + metadata: + type: object + description: The address's metadata. Can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the address was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the address was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the address was deleted. + description: The shipping option's details. StoreShippingOptionResponse: type: object description: The shipping option's details. diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml index 0221078fbb..e94d04f7ca 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-categories.yaml @@ -717,6 +717,49 @@ post: documentation. externalDocs: url: '#select-fields-and-relations' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: >- + The field to sort the data by. By default, the sort order is ascending. + To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: >- + The field to sort the data by. By default, the sort order is + ascending. To change the order to descending, prefix the field name + with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted records in the result. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted records in the result. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml index bc54617716..a5e1e23ed5 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_product-categories_{id}.yaml @@ -78,6 +78,49 @@ get: `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, `fields=category_children.id,category_children.name`. + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: >- + The field to sort the data by. By default, the sort order is ascending. + To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: >- + The field to sort the data by. By default, the sort order is + ascending. To change the order to descending, prefix the field name + with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted records in the result. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted records in the result. security: - api_token: [] - cookie_auth: [] @@ -150,6 +193,49 @@ post: documentation. externalDocs: url: '#select-fields-and-relations' + - name: offset + in: query + description: The number of items to skip when retrieving a list. + required: false + schema: + type: number + title: offset + description: The number of items to skip when retrieving a list. + externalDocs: + url: '#pagination' + - name: limit + in: query + description: Limit the number of items returned in the list. + required: false + schema: + type: number + title: limit + description: Limit the number of items returned in the list. + externalDocs: + url: '#pagination' + - name: order + in: query + description: >- + The field to sort the data by. By default, the sort order is ascending. + To change the order to descending, prefix the field name with `-`. + required: false + schema: + type: string + title: order + description: >- + The field to sort the data by. By default, the sort order is + ascending. To change the order to descending, prefix the field name + with `-`. + externalDocs: + url: '#pagination' + - name: with_deleted + in: query + description: Whether to include deleted records in the result. + required: false + schema: + type: boolean + title: with_deleted + description: Whether to include deleted records in the result. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml index d9beba083a..27c71df1a0 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons.yaml @@ -214,6 +214,10 @@ post: schema: $ref: ../components/schemas/AdminCreateRefundReason.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_refund-reasons/post.js - lang: Shell label: cURL source: diff --git a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml index 8b6034cd94..5db69be643 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_refund-reasons_{id}.yaml @@ -35,6 +35,10 @@ get: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_refund-reasons_{id}/get.js - lang: Shell label: cURL source: @@ -100,6 +104,10 @@ post: schema: $ref: ../components/schemas/AdminUpdatePaymentRefundReason.yaml x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_refund-reasons_{id}/post.js - lang: Shell label: cURL source: @@ -144,6 +152,10 @@ delete: - cookie_auth: [] - jwt_token: [] x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_refund-reasons_{id}/delete.js - lang: Shell label: cURL source: @@ -156,26 +168,7 @@ delete: content: application/json: schema: - type: object - description: The deletion's details. - required: - - id - - object - - deleted - properties: - id: - type: string - title: id - description: The refund reason's ID. - object: - type: string - title: object - description: The name of the deleted object. - default: refund_reason - deleted: - type: boolean - title: deleted - description: Whether the refund reason was deleted. + $ref: ../components/schemas/AdminRefundReasonDeleteResponse.yaml '400': $ref: ../components/responses/400_error.yaml '401': diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml index 8f4770a9b5..a23a7baf44 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-options.yaml @@ -707,7 +707,10 @@ post: content: application/json: schema: - $ref: ../components/schemas/AdminCreateShippingOption.yaml + oneOf: + - $ref: ../components/schemas/AdminCreateFlatRateShippingOption.yaml + - $ref: ../components/schemas/AdminCreateCalculatedShippingOption.yaml + description: The shipping option's details. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCampaign.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCampaign.yaml index d77f5dbb8d..e1bb18e655 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminCampaign.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCampaign.yaml @@ -51,6 +51,7 @@ properties: - currency_code - limit - used + - attribute properties: id: type: string @@ -82,6 +83,13 @@ properties: property holds the total amount discounted so far. If the limit is `usage`, it holds the number of times the campaign's promotions have been used so far. + attribute: + type: string + title: attribute + description: The cart attribute to limit the budget by. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/promotion/campaign#attribute-based-budgets created_at: type: string format: date-time diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateCalculatedShippingOption.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateCalculatedShippingOption.yaml new file mode 100644 index 0000000000..0fd1b33fa8 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateCalculatedShippingOption.yaml @@ -0,0 +1,55 @@ +type: object +description: The calculated shipping option's details. +x-schemaName: AdminCreateCalculatedShippingOption +required: + - price_type + - name + - service_zone_id + - shipping_profile_id + - provider_id +properties: + price_type: + type: string + title: price_type + description: The calculated shipping option's price type. + enum: + - calculated + - flat + name: + type: string + title: name + description: The calculated shipping option's name. + service_zone_id: + type: string + title: service_zone_id + description: The ID of the associated service zone. + shipping_profile_id: + type: string + title: shipping_profile_id + description: The ID of the associated shipping profile. + data: + type: object + description: The calculated shipping option's data. + externalDocs: + url: >- + https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property + provider_id: + type: string + title: provider_id + description: >- + The ID of the fulfillment provider handling this calculated shipping + option. + type: + $ref: ./AdminCreateShippingOptionType.yaml + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. + rules: + type: array + description: The calculated shipping option's rules. + items: + $ref: ./AdminCreateShippingOptionRule.yaml + metadata: + type: object + description: The shipping option's metadata, can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateShippingOption.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateFlatRateShippingOption.yaml similarity index 52% rename from www/apps/api-reference/specs/store/components/schemas/AdminCreateShippingOption.yaml rename to www/apps/api-reference/specs/store/components/schemas/AdminCreateFlatRateShippingOption.yaml index f433c655a0..da47b8740e 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminCreateShippingOption.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateFlatRateShippingOption.yaml @@ -1,18 +1,18 @@ type: object -description: The shipping option's details. -x-schemaName: AdminCreateShippingOption +description: The flat rate shipping option's details. +x-schemaName: AdminCreateFlatRateShippingOption required: + - price_type + - prices - name - service_zone_id - shipping_profile_id - - price_type - provider_id - - prices properties: name: type: string title: name - description: The shipping option's name. + description: The flat-rate shipping option's name. service_zone_id: type: string title: service_zone_id @@ -24,8 +24,8 @@ properties: data: type: object description: >- - The shipping option's data, useful for the fulfillment provider handling - its processing. + The flat-rate shipping option's data, useful for the fulfillment provider + handling its processing. externalDocs: url: >- https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property @@ -65,6 +65,35 @@ properties: type: number title: amount description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. - type: object description: The price's details. x-schemaName: AdminCreateShippingOptionPriceWithRegion @@ -80,12 +109,44 @@ properties: type: number title: amount description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. rules: type: array description: The shipping option's rules. items: $ref: ./AdminCreateShippingOptionRule.yaml - type_id: - type: string - title: type_id - description: The ID of the shipping option type that this shipping option belongs to. + metadata: + type: object + description: The shipping option's metadata. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateRefundReason.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateRefundReason.yaml index a94aba8a11..ef7534dda6 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminCreateRefundReason.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateRefundReason.yaml @@ -3,6 +3,7 @@ description: The refund reason's details. x-schemaName: AdminCreateRefundReason required: - label + - code properties: label: type: string @@ -12,3 +13,10 @@ properties: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. + metadata: + type: object + description: The refund reason's metadata. Can hold custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminRefund.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminRefund.yaml index 229fb7729c..ee936d0dbf 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminRefund.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminRefund.yaml @@ -35,4 +35,4 @@ properties: payment: $ref: ./BasePayment.yaml refund_reason: - $ref: ./RefundReason.yaml + $ref: ./BaseRefundReason.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminRefundReason.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminRefundReason.yaml index a1f49a55fa..955aebe55f 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminRefundReason.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminRefundReason.yaml @@ -4,7 +4,7 @@ x-schemaName: AdminRefundReason required: - id - label - - metadata + - code - created_at - updated_at properties: @@ -36,3 +36,7 @@ properties: format: date-time title: updated_at description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminRefundReasonDeleteResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminRefundReasonDeleteResponse.yaml new file mode 100644 index 0000000000..394f1cb036 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminRefundReasonDeleteResponse.yaml @@ -0,0 +1,21 @@ +type: object +description: The deletion's details. +required: + - id + - object + - deleted +properties: + id: + type: string + title: id + description: The refund reason's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: refund_reason + deleted: + type: boolean + title: deleted + description: Whether the refund reason was deleted. +x-schemaName: AdminRefundReasonDeleteResponse diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminUpdatePaymentRefundReason.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminUpdatePaymentRefundReason.yaml index 1573aa64b7..132b0827dc 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminUpdatePaymentRefundReason.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminUpdatePaymentRefundReason.yaml @@ -9,4 +9,8 @@ properties: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. x-schemaName: AdminUpdatePaymentRefundReason diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseCartLineItem.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseCartLineItem.yaml index eca6c74f23..84bfd74ab8 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseCartLineItem.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseCartLineItem.yaml @@ -11,17 +11,6 @@ required: - unit_price - cart - cart_id - - original_total - - original_subtotal - - original_tax_total - - item_total - - item_subtotal - - item_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml index 2601c6fffd..172ddd7a93 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml @@ -9,14 +9,6 @@ required: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseRefund.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseRefund.yaml index 9a8cf91839..edd77dce4d 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseRefund.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseRefund.yaml @@ -35,4 +35,4 @@ properties: payment: type: object refund_reason: - $ref: ./RefundReason.yaml + $ref: ./BaseRefundReason.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/RefundReason.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseRefundReason.yaml similarity index 87% rename from www/apps/api-reference/specs/store/components/schemas/RefundReason.yaml rename to www/apps/api-reference/specs/store/components/schemas/BaseRefundReason.yaml index fad95d0cde..230330348e 100644 --- a/www/apps/api-reference/specs/store/components/schemas/RefundReason.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseRefundReason.yaml @@ -1,10 +1,10 @@ type: object description: The refund reason's details. -x-schemaName: RefundReason +x-schemaName: BaseRefundReason required: - id - label - - metadata + - code - created_at - updated_at properties: @@ -36,3 +36,7 @@ properties: format: date-time title: updated_at description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreShippingOptionListResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreShippingOptionListResponse.yaml index d41c99958f..25974fee50 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreShippingOptionListResponse.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreShippingOptionListResponse.yaml @@ -1,11 +1,137 @@ type: object -description: The shipping option's details. +description: The list of shipping options. x-schemaName: StoreShippingOptionListResponse required: - shipping_options properties: shipping_options: type: array - description: The shipping option's shipping options. + description: The list of shipping options. items: - $ref: ./StoreCartShippingOption.yaml + allOf: + - $ref: ./StoreCartShippingOption.yaml + - type: object + description: The shipping option's details. + required: + - service_zone + properties: + service_zone: + type: object + description: The shipping option's service zone. + required: + - id + - fulfillment_set_id + - fulfillment_set + properties: + id: + type: string + title: id + description: The service zone's ID. + fulfillment_set_id: + type: string + title: fulfillment_set_id + description: The ID of the service zone's fulfillment set. + fulfillment_set: + type: object + description: The service zone's fulfillment set. + required: + - id + - type + - location + properties: + id: + type: string + title: id + description: The fulfillment set's ID. + type: + type: string + title: type + description: The fulfillment set's type. + location: + type: object + description: The fulfillment set's location details. + required: + - id + - address + properties: + id: + type: string + title: id + description: The location's ID. + address: + type: object + description: The location's address. + x-schemaName: StoreFulfillmentAddress + required: + - id + - company + - address_1 + - address_2 + - city + - country_code + - province + - postal_code + - phone + - metadata + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The address's ID. + company: + type: string + title: company + description: The address's company. + address_1: + type: string + title: address_1 + description: The first line of the address. + address_2: + type: string + title: address_2 + description: The second line of the address. + city: + type: string + title: city + description: The address's city. + country_code: + type: string + title: country_code + description: The address's country code. + example: us + province: + type: string + title: province + description: The address's province. + postal_code: + type: string + title: postal_code + description: The address's postal code. + phone: + type: string + title: phone + description: The address's phone. + metadata: + type: object + description: >- + The address's metadata. Can hold custom + key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the address was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the address was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the address was deleted. + description: The shipping option's details. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index f0f6c10b3f..e5920687b0 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -1300,6 +1300,19 @@ paths: description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + security: + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + type: object + description: Optional additional data to pass to the underlying workflow. + properties: + additional_data: + type: object + description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. x-codeSamples: - lang: JavaScript label: JS SDK @@ -1363,19 +1376,6 @@ paths: description: Emitted when the customer in the cart is transferred. deprecated: false since: 2.8.0 - security: - - cookie_auth: [] - - jwt_token: [] - requestBody: - content: - application/json: - schema: - type: object - description: Optional additional data to pass to the underlying workflow. - properties: - additional_data: - type: object - description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. /store/carts/{id}/gift-cards: post: operationId: PostCartsIdGiftCards @@ -2915,6 +2915,20 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a collection's ID. + - type: array + description: Filter by collection IDs. + items: + type: string + title: id + description: The collection's ID. x-codeSamples: - lang: JavaScript label: JS SDK @@ -10475,6 +10489,7 @@ components: - currency_code - limit - used + - attribute properties: id: type: string @@ -10500,6 +10515,12 @@ components: title: used description: | How much of the budget has been used. If the limit is `spend`, this property holds the total amount discounted so far. If the limit is `usage`, it holds the number of times the campaign's promotions have been used so far. + attribute: + type: string + title: attribute + description: The cart attribute to limit the budget by. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/promotion/campaign#attribute-based-budgets created_at: type: string format: date-time @@ -10994,6 +11015,59 @@ components: enum: - publishable - secret + AdminCreateCalculatedShippingOption: + type: object + description: The calculated shipping option's details. + x-schemaName: AdminCreateCalculatedShippingOption + required: + - price_type + - name + - service_zone_id + - shipping_profile_id + - provider_id + properties: + price_type: + type: string + title: price_type + description: The calculated shipping option's price type. + enum: + - calculated + - flat + name: + type: string + title: name + description: The calculated shipping option's name. + service_zone_id: + type: string + title: service_zone_id + description: The ID of the associated service zone. + shipping_profile_id: + type: string + title: shipping_profile_id + description: The ID of the associated shipping profile. + data: + type: object + description: The calculated shipping option's data. + externalDocs: + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property + provider_id: + type: string + title: provider_id + description: The ID of the fulfillment provider handling this calculated shipping option. + type: + $ref: '#/components/schemas/AdminCreateShippingOptionType' + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. + rules: + type: array + description: The calculated shipping option's rules. + items: + $ref: '#/components/schemas/AdminCreateShippingOptionRule' + metadata: + type: object + description: The shipping option's metadata, can hold custom key-value pairs. AdminCreateCustomerGroup: type: object description: The customer group's details. @@ -11011,6 +11085,153 @@ components: externalDocs: url: https://docs.medusajs.com/api/admin#manage-metadata description: Learn how to manage metadata + AdminCreateFlatRateShippingOption: + type: object + description: The flat rate shipping option's details. + x-schemaName: AdminCreateFlatRateShippingOption + required: + - price_type + - prices + - name + - service_zone_id + - shipping_profile_id + - provider_id + properties: + name: + type: string + title: name + description: The flat-rate shipping option's name. + service_zone_id: + type: string + title: service_zone_id + description: The ID of the associated service zone. + shipping_profile_id: + type: string + title: shipping_profile_id + description: The ID of the associated shipping profile. + data: + type: object + description: The flat-rate shipping option's data, useful for the fulfillment provider handling its processing. + externalDocs: + url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property + price_type: + type: string + description: The shipping option's price type. If `flat`, the shipping option has a fixed price set in `prices`. Otherwise, the shipping option's price is calculated by the fulfillment provider. + enum: + - flat + - calculated + provider_id: + type: string + title: provider_id + description: The ID of the fulfillment provider handling this shipping option. + type: + $ref: '#/components/schemas/AdminCreateShippingOptionType' + prices: + type: array + description: The shipping option's prices. + items: + oneOf: + - type: object + description: The price's details. + x-schemaName: AdminCreateShippingOptionPriceWithCurrency + required: + - currency_code + - amount + properties: + currency_code: + type: string + title: currency_code + description: The price's currency code. + example: usd + amount: + type: number + title: amount + description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. + - type: object + description: The price's details. + x-schemaName: AdminCreateShippingOptionPriceWithRegion + required: + - region_id + - amount + properties: + region_id: + type: string + title: region_id + description: The ID of the region this price is used in. + amount: + type: number + title: amount + description: The price's amount. + rules: + type: array + description: The price's rules. + items: + type: object + description: The rule's details. + x-schemaName: PriceRule + required: + - attribute + - operator + - value + properties: + attribute: + type: string + title: attribute + description: The rule's attribute. + operator: + type: string + description: The rule's operator. + enum: + - gt + - lt + - eq + - lte + - gte + value: + type: number + title: value + description: The rule's value. + type_id: + type: string + title: type_id + description: The ID of the shipping option type that this shipping option belongs to. + rules: + type: array + description: The shipping option's rules. + items: + $ref: '#/components/schemas/AdminCreateShippingOptionRule' + metadata: + type: object + description: The shipping option's metadata. AdminCreateFulfillment: type: object description: The filfillment's details. @@ -12084,6 +12305,7 @@ components: x-schemaName: AdminCreateRefundReason required: - label + - code properties: label: type: string @@ -12093,6 +12315,13 @@ components: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. + metadata: + type: object + description: The refund reason's metadata. Can hold custom key-value pairs. AdminCreateRegion: type: object description: The region's details. @@ -12260,92 +12489,6 @@ components: type: string title: label_url description: The label's URL. - AdminCreateShippingOption: - type: object - description: The shipping option's details. - x-schemaName: AdminCreateShippingOption - required: - - name - - service_zone_id - - shipping_profile_id - - price_type - - provider_id - - prices - properties: - name: - type: string - title: name - description: The shipping option's name. - service_zone_id: - type: string - title: service_zone_id - description: The ID of the associated service zone. - shipping_profile_id: - type: string - title: shipping_profile_id - description: The ID of the associated shipping profile. - data: - type: object - description: The shipping option's data, useful for the fulfillment provider handling its processing. - externalDocs: - url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property - price_type: - type: string - description: The shipping option's price type. If `flat`, the shipping option has a fixed price set in `prices`. Otherwise, the shipping option's price is calculated by the fulfillment provider. - enum: - - flat - - calculated - provider_id: - type: string - title: provider_id - description: The ID of the fulfillment provider handling this shipping option. - type: - $ref: '#/components/schemas/AdminCreateShippingOptionType' - prices: - type: array - description: The shipping option's prices. - items: - oneOf: - - type: object - description: The price's details. - x-schemaName: AdminCreateShippingOptionPriceWithCurrency - required: - - currency_code - - amount - properties: - currency_code: - type: string - title: currency_code - description: The price's currency code. - example: usd - amount: - type: number - title: amount - description: The price's amount. - - type: object - description: The price's details. - x-schemaName: AdminCreateShippingOptionPriceWithRegion - required: - - region_id - - amount - properties: - region_id: - type: string - title: region_id - description: The ID of the region this price is used in. - amount: - type: number - title: amount - description: The price's amount. - rules: - type: array - description: The shipping option's rules. - items: - $ref: '#/components/schemas/AdminCreateShippingOptionRule' - type_id: - type: string - title: type_id - description: The ID of the shipping option type that this shipping option belongs to. AdminCreateShippingOptionRule: type: object description: The details of the shipping option rule. @@ -20507,7 +20650,7 @@ components: payment: $ref: '#/components/schemas/BasePayment' refund_reason: - $ref: '#/components/schemas/RefundReason' + $ref: '#/components/schemas/BaseRefundReason' AdminRefundReason: type: object description: The refund reason's details. @@ -20515,7 +20658,7 @@ components: required: - id - label - - metadata + - code - created_at - updated_at properties: @@ -20547,6 +20690,32 @@ components: format: date-time title: updated_at description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. + AdminRefundReasonDeleteResponse: + type: object + description: The deletion's details. + required: + - id + - object + - deleted + properties: + id: + type: string + title: id + description: The refund reason's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: refund_reason + deleted: + type: boolean + title: deleted + description: Whether the refund reason was deleted. + x-schemaName: AdminRefundReasonDeleteResponse AdminRegion: type: object description: The region's details. @@ -23246,6 +23415,10 @@ components: type: string title: description description: The refund reason's description. + code: + type: string + title: code + description: The refund reason's code. x-schemaName: AdminUpdatePaymentRefundReason AdminUpdatePriceList: type: object @@ -25106,17 +25279,6 @@ components: - unit_price - cart - cart_id - - original_total - - original_subtotal - - original_tax_total - - item_total - - item_subtotal - - item_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -25302,14 +25464,6 @@ components: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -27797,7 +27951,50 @@ components: payment: type: object refund_reason: - $ref: '#/components/schemas/RefundReason' + $ref: '#/components/schemas/BaseRefundReason' + BaseRefundReason: + type: object + description: The refund reason's details. + x-schemaName: BaseRefundReason + required: + - id + - label + - code + - created_at + - updated_at + properties: + id: + type: string + title: id + description: The refund reason's ID. + label: + type: string + title: label + description: The refund reason's label. + description: + type: string + title: description + description: The refund reason's description. + metadata: + type: object + description: The refund reason's metadata, can hold custom key-value pairs. + externalDocs: + url: https://docs.medusajs.com/api/store#manage-metadata + description: Learn how to manage metadata + created_at: + type: string + format: date-time + title: created_at + description: The date the refund reason was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the refund reason was updated. + code: + type: string + title: code + description: The refund reason's code. BaseRegion: type: object description: The region's details. @@ -30302,45 +30499,6 @@ components: type: number title: version description: The order version that the transaction belongs to. - RefundReason: - type: object - description: The refund reason's details. - x-schemaName: RefundReason - required: - - id - - label - - metadata - - created_at - - updated_at - properties: - id: - type: string - title: id - description: The refund reason's ID. - label: - type: string - title: label - description: The refund reason's label. - description: - type: string - title: description - description: The refund reason's description. - metadata: - type: object - description: The refund reason's metadata, can hold custom key-value pairs. - externalDocs: - url: https://docs.medusajs.com/api/store#manage-metadata - description: Learn how to manage metadata - created_at: - type: string - format: date-time - title: created_at - description: The date the refund reason was created. - updated_at: - type: string - format: date-time - title: updated_at - description: The date the refund reason was updated. RefundReasonResponse: type: object description: The refund reason's details. @@ -39911,16 +40069,140 @@ components: description: Learn how to manage metadata StoreShippingOptionListResponse: type: object - description: The shipping option's details. + description: The list of shipping options. x-schemaName: StoreShippingOptionListResponse required: - shipping_options properties: shipping_options: type: array - description: The shipping option's shipping options. + description: The list of shipping options. items: - $ref: '#/components/schemas/StoreCartShippingOption' + allOf: + - $ref: '#/components/schemas/StoreCartShippingOption' + - type: object + description: The shipping option's details. + required: + - service_zone + properties: + service_zone: + type: object + description: The shipping option's service zone. + required: + - id + - fulfillment_set_id + - fulfillment_set + properties: + id: + type: string + title: id + description: The service zone's ID. + fulfillment_set_id: + type: string + title: fulfillment_set_id + description: The ID of the service zone's fulfillment set. + fulfillment_set: + type: object + description: The service zone's fulfillment set. + required: + - id + - type + - location + properties: + id: + type: string + title: id + description: The fulfillment set's ID. + type: + type: string + title: type + description: The fulfillment set's type. + location: + type: object + description: The fulfillment set's location details. + required: + - id + - address + properties: + id: + type: string + title: id + description: The location's ID. + address: + type: object + description: The location's address. + x-schemaName: StoreFulfillmentAddress + required: + - id + - company + - address_1 + - address_2 + - city + - country_code + - province + - postal_code + - phone + - metadata + - created_at + - updated_at + - deleted_at + properties: + id: + type: string + title: id + description: The address's ID. + company: + type: string + title: company + description: The address's company. + address_1: + type: string + title: address_1 + description: The first line of the address. + address_2: + type: string + title: address_2 + description: The second line of the address. + city: + type: string + title: city + description: The address's city. + country_code: + type: string + title: country_code + description: The address's country code. + example: us + province: + type: string + title: province + description: The address's province. + postal_code: + type: string + title: postal_code + description: The address's postal code. + phone: + type: string + title: phone + description: The address's phone. + metadata: + type: object + description: The address's metadata. Can hold custom key-value pairs. + created_at: + type: string + format: date-time + title: created_at + description: The date the address was created. + updated_at: + type: string + format: date-time + title: updated_at + description: The date the address was updated. + deleted_at: + type: string + format: date-time + title: deleted_at + description: The date the address was deleted. + description: The shipping option's details. StoreShippingOptionResponse: type: object description: The shipping option's details. diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml index 50baa3659d..b68b07e132 100644 --- a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml @@ -46,6 +46,22 @@ post: prefix it will replace the entire default fields. externalDocs: url: '#select-fields-and-relations' + security: + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + type: object + description: Optional additional data to pass to the underlying workflow. + properties: + additional_data: + type: object + description: >- + Pass additional custom data to the API route. This data is + passed to the underlying workflow under the `additional_data` + parameter. x-codeSamples: - lang: JavaScript label: JS SDK @@ -89,19 +105,3 @@ post: description: Emitted when the customer in the cart is transferred. deprecated: false since: 2.8.0 - security: - - cookie_auth: [] - - jwt_token: [] - requestBody: - content: - application/json: - schema: - type: object - description: Optional additional data to pass to the underlying workflow. - properties: - additional_data: - type: object - description: >- - Pass additional custom data to the API route. This data is - passed to the underlying workflow under the `additional_data` - parameter. diff --git a/www/apps/api-reference/specs/store/paths/store_collections.yaml b/www/apps/api-reference/specs/store/paths/store_collections.yaml index 7851d0ff1e..b32e3a7e98 100644 --- a/www/apps/api-reference/specs/store/paths/store_collections.yaml +++ b/www/apps/api-reference/specs/store/paths/store_collections.yaml @@ -679,6 +679,20 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a collection's ID. + - type: array + description: Filter by collection IDs. + items: + type: string + title: id + description: The collection's ID. x-codeSamples: - lang: JavaScript label: JS SDK diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_refund-reasons_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_refund-reasons_[id].ts index 13ea714cbf..8bd538549e 100644 --- a/www/utils/generated/oas-output/operations/admin/delete_admin_refund-reasons_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_refund-reasons_[id].ts @@ -16,6 +16,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.refundReason.delete("ret_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) * - lang: Shell * label: cURL * source: |- @@ -29,26 +46,7 @@ * content: * application/json: * schema: - * type: object - * description: The deletion's details. - * required: - * - id - * - object - * - deleted - * properties: - * id: - * type: string - * title: id - * description: The refund reason's ID. - * object: - * type: string - * title: object - * description: The name of the deleted object. - * default: refund_reason - * deleted: - * type: boolean - * title: deleted - * description: Whether the refund reason was deleted. + * $ref: "#/components/schemas/AdminRefundReasonDeleteResponse" * "400": * $ref: "#/components/responses/400_error" * "401": diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts index 42dfad241b..8a64d8b61a 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_product-categories_[id].ts @@ -47,6 +47,44 @@ * description: Whether to retrieve a list of child categories. If you enable this, add to the `fields` query parameter `category_children` to set the children of a category in this field. You can either * pass `*category_children` to retreieve the fields of all child categories, or select specific fields to make the response size smaller. For example, * `fields=category_children.id,category_children.name`. + * - name: offset + * in: query + * description: The number of items to skip when retrieving a list. + * required: false + * schema: + * type: number + * title: offset + * description: The number of items to skip when retrieving a list. + * externalDocs: + * url: "#pagination" + * - name: limit + * in: query + * description: Limit the number of items returned in the list. + * required: false + * schema: + * type: number + * title: limit + * description: Limit the number of items returned in the list. + * externalDocs: + * url: "#pagination" + * - name: order + * in: query + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * required: false + * schema: + * type: string + * title: order + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * externalDocs: + * url: "#pagination" + * - name: with_deleted + * in: query + * description: Whether to include deleted records in the result. + * required: false + * schema: + * type: boolean + * title: with_deleted + * description: Whether to include deleted records in the result. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons_[id].ts index 453e4a7e11..2cfc25fee7 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_refund-reasons_[id].ts @@ -28,6 +28,23 @@ * - cookie_auth: [] * - jwt_token: [] * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.refundReason.retrieve("refr_123") + * .then(({ refund_reason }) => { + * console.log(refund_reason) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations.ts b/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations.ts index b1748ce2a2..9532254635 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations.ts @@ -2,7 +2,8 @@ * @oas [get] /admin/views/{entity}/configurations * operationId: GetViewsEntityConfigurations * summary: List View Configurations - * description: Retrieve a list of view configurations of an entity. The configurations can be filtered by fields like `id`. The configurations can also be paginated. An admin user can only retrieve their own configurations. + * description: Retrieve a list of view configurations of an entity. The configurations can be filtered by fields like `id`. The configurations can also be paginated. An admin user can only retrieve + * their own configurations. * x-authenticated: true * parameters: * - name: entity diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations_active.ts b/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations_active.ts index f720d4d689..0fa84f8d76 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations_active.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_views_[entity]_configurations_active.ts @@ -52,7 +52,8 @@ * description: Whether the active view configuration is the system default. * default_type: * type: string - * description: The type of the default view configuration if the active view is the system default. It will be `system` if the active view is the system default, `code` if no active view is set, or `undefined` if the active view isn't the system default. + * description: The type of the default view configuration if the active view is the system default. It will be `system` if the active view is the system default, `code` if no active view is set, or + * `undefined` if the active view isn't the system default. * enum: * - code * - system diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts index 492fa4493c..6ff9fa0d24 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories.ts @@ -19,6 +19,44 @@ * Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. * externalDocs: * url: "#select-fields-and-relations" + * - name: offset + * in: query + * description: The number of items to skip when retrieving a list. + * required: false + * schema: + * type: number + * title: offset + * description: The number of items to skip when retrieving a list. + * externalDocs: + * url: "#pagination" + * - name: limit + * in: query + * description: Limit the number of items returned in the list. + * required: false + * schema: + * type: number + * title: limit + * description: Limit the number of items returned in the list. + * externalDocs: + * url: "#pagination" + * - name: order + * in: query + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * required: false + * schema: + * type: string + * title: order + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * externalDocs: + * url: "#pagination" + * - name: with_deleted + * in: query + * description: Whether to include deleted records in the result. + * required: false + * schema: + * type: boolean + * title: with_deleted + * description: Whether to include deleted records in the result. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts index 799926b68b..f0087a23df 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_product-categories_[id].ts @@ -25,6 +25,44 @@ * Links](https://docs.medusajs.com/learn/fundamentals/api-routes/retrieve-custom-links) documentation. * externalDocs: * url: "#select-fields-and-relations" + * - name: offset + * in: query + * description: The number of items to skip when retrieving a list. + * required: false + * schema: + * type: number + * title: offset + * description: The number of items to skip when retrieving a list. + * externalDocs: + * url: "#pagination" + * - name: limit + * in: query + * description: Limit the number of items returned in the list. + * required: false + * schema: + * type: number + * title: limit + * description: Limit the number of items returned in the list. + * externalDocs: + * url: "#pagination" + * - name: order + * in: query + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * required: false + * schema: + * type: string + * title: order + * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`. + * externalDocs: + * url: "#pagination" + * - name: with_deleted + * in: query + * description: Whether to include deleted records in the result. + * required: false + * schema: + * type: boolean + * title: with_deleted + * description: Whether to include deleted records in the result. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons.ts b/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons.ts index 1b5a78dd1f..48c59d8990 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons.ts @@ -27,6 +27,26 @@ * schema: * $ref: "#/components/schemas/AdminCreateRefundReason" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.refundReason.create({ + * value: "refund", + * label: "Refund", + * }) + * .then(({ refund_reason }) => { + * console.log(refund_reason) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts index 22665f3654..bef7c44b14 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_refund-reasons_[id].ts @@ -33,6 +33,26 @@ * schema: * $ref: "#/components/schemas/AdminUpdatePaymentRefundReason" * x-codeSamples: + * - lang: JavaScript + * label: JS SDK + * source: |- + * import Medusa from "@medusajs/js-sdk" + * + * export const sdk = new Medusa({ + * baseUrl: import.meta.env.VITE_BACKEND_URL || "/", + * debug: import.meta.env.DEV, + * auth: { + * type: "session", + * }, + * }) + * + * sdk.admin.refundReason.update("ret_123", { + * value: "refund", + * label: "Refund", + * }) + * .then(({ refund_reason }) => { + * console.log(refund_reason) + * }) * - lang: Shell * label: cURL * source: |- diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts index dbefb69c79..0e989d7f0b 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-options.ts @@ -25,7 +25,10 @@ * content: * application/json: * schema: - * $ref: "#/components/schemas/AdminCreateShippingOption" + * oneOf: + * - $ref: "#/components/schemas/AdminCreateFlatRateShippingOption" + * - $ref: "#/components/schemas/AdminCreateCalculatedShippingOption" + * description: The shipping option's details. * x-codeSamples: * - lang: JavaScript * label: JS SDK diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations.ts b/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations.ts index d3c3da4f99..b5db92c3b4 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations.ts @@ -2,7 +2,8 @@ * @oas [post] /admin/views/{entity}/configurations * operationId: PostViewsEntityConfigurations * summary: Create View Configuration - * description: Create a new view configuration for an entity. If `is_system_default` is set to true, the created configuration will be set as the system default for the specified entity. Otherwise, it will be a custom configuration for the admin user. + * description: Create a new view configuration for an entity. If `is_system_default` is set to true, the created configuration will be set as the system default for the specified entity. Otherwise, it + * will be a custom configuration for the admin user. * x-authenticated: true * parameters: * - name: entity diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations_active.ts b/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations_active.ts index 00f6b0ee25..e91e5a94de 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations_active.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_views_[entity]_configurations_active.ts @@ -2,7 +2,9 @@ * @oas [post] /admin/views/{entity}/configurations/active * operationId: PostViewsEntityConfigurationsActive * summary: Make View Configuration Active - * description: Make a view configuration active. This will set the given view configuration as the active one for the specified entity for the admin user. An admin user can only set their own configurations as active. If the view configuration ID is `null`, the active view configuration will be cleared, and the `code` or system default view configuration type will be used as the active view. + * description: Make a view configuration active. This will set the given view configuration as the active one for the specified entity for the admin user. An admin user can only set their own + * configurations as active. If the view configuration ID is `null`, the active view configuration will be cleared, and the `code` or system default view configuration type will be used as the active + * view. * x-authenticated: true * parameters: * - name: entity diff --git a/www/utils/generated/oas-output/operations/store/get_store_collections.ts b/www/utils/generated/oas-output/operations/store/get_store_collections.ts index aceaff932c..ef7a42ba84 100644 --- a/www/utils/generated/oas-output/operations/store/get_store_collections.ts +++ b/www/utils/generated/oas-output/operations/store/get_store_collections.ts @@ -582,6 +582,20 @@ * type: boolean * title: with_deleted * description: Whether to include deleted records in the result. + * - name: id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: Filter by a collection's ID. + * - type: array + * description: Filter by collection IDs. + * items: + * type: string + * title: id + * description: The collection's ID. * x-codeSamples: * - lang: JavaScript * label: JS SDK diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts index 252318c424..807219fae5 100644 --- a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts @@ -37,6 +37,19 @@ * fields. Without prefix it will replace the entire default fields. * externalDocs: * url: "#select-fields-and-relations" + * security: + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * type: object + * description: Optional additional data to pass to the underlying workflow. + * properties: + * additional_data: + * type: object + * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. * x-codeSamples: * - lang: JavaScript * label: JS SDK @@ -100,19 +113,6 @@ * description: Emitted when the customer in the cart is transferred. * deprecated: false * since: 2.8.0 - * security: - * - cookie_auth: [] - * - jwt_token: [] - * requestBody: - * content: - * application/json: - * schema: - * type: object - * description: Optional additional data to pass to the underlying workflow. - * properties: - * additional_data: - * type: object - * description: Pass additional custom data to the API route. This data is passed to the underlying workflow under the `additional_data` parameter. - * + * */ diff --git a/www/utils/generated/oas-output/schemas/AdminCampaign.ts b/www/utils/generated/oas-output/schemas/AdminCampaign.ts index 4943ad6130..4be47f47eb 100644 --- a/www/utils/generated/oas-output/schemas/AdminCampaign.ts +++ b/www/utils/generated/oas-output/schemas/AdminCampaign.ts @@ -53,6 +53,7 @@ * - currency_code * - limit * - used + * - attribute * properties: * id: * type: string @@ -80,6 +81,12 @@ * description: > * How much of the budget has been used. If the limit is `spend`, this property holds the total amount discounted so far. If the limit is `usage`, it holds the number of times the campaign's * promotions have been used so far. + * attribute: + * type: string + * title: attribute + * description: The cart attribute to limit the budget by. + * externalDocs: + * url: https://docs.medusajs.com/resources/commerce-modules/promotion/campaign#attribute-based-budgets * created_at: * type: string * format: date-time diff --git a/www/utils/generated/oas-output/schemas/AdminCreateCalculatedShippingOption.ts b/www/utils/generated/oas-output/schemas/AdminCreateCalculatedShippingOption.ts new file mode 100644 index 0000000000..84080cc52b --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminCreateCalculatedShippingOption.ts @@ -0,0 +1,57 @@ +/** + * @schema AdminCreateCalculatedShippingOption + * type: object + * description: The calculated shipping option's details. + * x-schemaName: AdminCreateCalculatedShippingOption + * required: + * - price_type + * - name + * - service_zone_id + * - shipping_profile_id + * - provider_id + * properties: + * price_type: + * type: string + * title: price_type + * description: The calculated shipping option's price type. + * enum: + * - calculated + * - flat + * name: + * type: string + * title: name + * description: The calculated shipping option's name. + * service_zone_id: + * type: string + * title: service_zone_id + * description: The ID of the associated service zone. + * shipping_profile_id: + * type: string + * title: shipping_profile_id + * description: The ID of the associated shipping profile. + * data: + * type: object + * description: The calculated shipping option's data. + * externalDocs: + * url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property + * provider_id: + * type: string + * title: provider_id + * description: The ID of the fulfillment provider handling this calculated shipping option. + * type: + * $ref: "#/components/schemas/AdminCreateShippingOptionType" + * type_id: + * type: string + * title: type_id + * description: The ID of the shipping option type that this shipping option belongs to. + * rules: + * type: array + * description: The calculated shipping option's rules. + * items: + * $ref: "#/components/schemas/AdminCreateShippingOptionRule" + * metadata: + * type: object + * description: The shipping option's metadata, can hold custom key-value pairs. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreateShippingOption.ts b/www/utils/generated/oas-output/schemas/AdminCreateFlatRateShippingOption.ts similarity index 52% rename from www/utils/generated/oas-output/schemas/AdminCreateShippingOption.ts rename to www/utils/generated/oas-output/schemas/AdminCreateFlatRateShippingOption.ts index a5776dacf4..36c6fd2c3d 100644 --- a/www/utils/generated/oas-output/schemas/AdminCreateShippingOption.ts +++ b/www/utils/generated/oas-output/schemas/AdminCreateFlatRateShippingOption.ts @@ -1,20 +1,20 @@ /** - * @schema AdminCreateShippingOption + * @schema AdminCreateFlatRateShippingOption * type: object - * description: The shipping option's details. - * x-schemaName: AdminCreateShippingOption + * description: The flat rate shipping option's details. + * x-schemaName: AdminCreateFlatRateShippingOption * required: + * - price_type + * - prices * - name * - service_zone_id * - shipping_profile_id - * - price_type * - provider_id - * - prices * properties: * name: * type: string * title: name - * description: The shipping option's name. + * description: The flat-rate shipping option's name. * service_zone_id: * type: string * title: service_zone_id @@ -25,7 +25,7 @@ * description: The ID of the associated shipping profile. * data: * type: object - * description: The shipping option's data, useful for the fulfillment provider handling its processing. + * description: The flat-rate shipping option's data, useful for the fulfillment provider handling its processing. * externalDocs: * url: https://docs.medusajs.com/v2/resources/commerce-modules/fulfillment/shipping-option#data-property * price_type: @@ -61,6 +61,35 @@ * type: number * title: amount * description: The price's amount. + * rules: + * type: array + * description: The price's rules. + * items: + * type: object + * description: The rule's details. + * x-schemaName: PriceRule + * required: + * - attribute + * - operator + * - value + * properties: + * attribute: + * type: string + * title: attribute + * description: The rule's attribute. + * operator: + * type: string + * description: The rule's operator. + * enum: + * - gt + * - lt + * - eq + * - lte + * - gte + * value: + * type: number + * title: value + * description: The rule's value. * - type: object * description: The price's details. * x-schemaName: AdminCreateShippingOptionPriceWithRegion @@ -76,15 +105,47 @@ * type: number * title: amount * description: The price's amount. + * rules: + * type: array + * description: The price's rules. + * items: + * type: object + * description: The rule's details. + * x-schemaName: PriceRule + * required: + * - attribute + * - operator + * - value + * properties: + * attribute: + * type: string + * title: attribute + * description: The rule's attribute. + * operator: + * type: string + * description: The rule's operator. + * enum: + * - gt + * - lt + * - eq + * - lte + * - gte + * value: + * type: number + * title: value + * description: The rule's value. + * type_id: + * type: string + * title: type_id + * description: The ID of the shipping option type that this shipping option belongs to. * rules: * type: array * description: The shipping option's rules. * items: * $ref: "#/components/schemas/AdminCreateShippingOptionRule" - * type_id: - * type: string - * title: type_id - * description: The ID of the shipping option type that this shipping option belongs to. + * metadata: + * type: object + * description: The shipping option's metadata. * */ diff --git a/www/utils/generated/oas-output/schemas/AdminCreateRefundReason.ts b/www/utils/generated/oas-output/schemas/AdminCreateRefundReason.ts index 41342e8666..d53193ac3e 100644 --- a/www/utils/generated/oas-output/schemas/AdminCreateRefundReason.ts +++ b/www/utils/generated/oas-output/schemas/AdminCreateRefundReason.ts @@ -5,6 +5,7 @@ * x-schemaName: AdminCreateRefundReason * required: * - label + * - code * properties: * label: * type: string @@ -14,6 +15,13 @@ * type: string * title: description * description: The refund reason's description. + * code: + * type: string + * title: code + * description: The refund reason's code. + * metadata: + * type: object + * description: The refund reason's metadata. Can hold custom key-value pairs. * */ diff --git a/www/utils/generated/oas-output/schemas/AdminRefund.ts b/www/utils/generated/oas-output/schemas/AdminRefund.ts index 432cbe5a5d..91c4bdf0e9 100644 --- a/www/utils/generated/oas-output/schemas/AdminRefund.ts +++ b/www/utils/generated/oas-output/schemas/AdminRefund.ts @@ -37,7 +37,7 @@ * payment: * $ref: "#/components/schemas/BasePayment" * refund_reason: - * $ref: "#/components/schemas/RefundReason" + * $ref: "#/components/schemas/BaseRefundReason" * */ diff --git a/www/utils/generated/oas-output/schemas/AdminRefundReason.ts b/www/utils/generated/oas-output/schemas/AdminRefundReason.ts index e8d5b36f42..245596dd29 100644 --- a/www/utils/generated/oas-output/schemas/AdminRefundReason.ts +++ b/www/utils/generated/oas-output/schemas/AdminRefundReason.ts @@ -6,7 +6,7 @@ * required: * - id * - label - * - metadata + * - code * - created_at * - updated_at * properties: @@ -38,6 +38,10 @@ * format: date-time * title: updated_at * description: The date the refund reason was updated. + * code: + * type: string + * title: code + * description: The refund reason's code. * */ diff --git a/www/utils/generated/oas-output/schemas/AdminRefundReasonDeleteResponse.ts b/www/utils/generated/oas-output/schemas/AdminRefundReasonDeleteResponse.ts new file mode 100644 index 0000000000..90b4ff81dd --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminRefundReasonDeleteResponse.ts @@ -0,0 +1,26 @@ +/** + * @schema AdminRefundReasonDeleteResponse + * type: object + * description: The deletion's details. + * required: + * - id + * - object + * - deleted + * properties: + * id: + * type: string + * title: id + * description: The refund reason's ID. + * object: + * type: string + * title: object + * description: The name of the deleted object. + * default: refund_reason + * deleted: + * type: boolean + * title: deleted + * description: Whether the refund reason was deleted. + * x-schemaName: AdminRefundReasonDeleteResponse + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminUpdatePaymentRefundReason.ts b/www/utils/generated/oas-output/schemas/AdminUpdatePaymentRefundReason.ts index 79f3804d7a..0187d96ffa 100644 --- a/www/utils/generated/oas-output/schemas/AdminUpdatePaymentRefundReason.ts +++ b/www/utils/generated/oas-output/schemas/AdminUpdatePaymentRefundReason.ts @@ -11,6 +11,10 @@ * type: string * title: description * description: The refund reason's description. + * code: + * type: string + * title: code + * description: The refund reason's code. * x-schemaName: AdminUpdatePaymentRefundReason * */ diff --git a/www/utils/generated/oas-output/schemas/BaseCartLineItem.ts b/www/utils/generated/oas-output/schemas/BaseCartLineItem.ts index 1fd44e92bf..21905c6b2f 100644 --- a/www/utils/generated/oas-output/schemas/BaseCartLineItem.ts +++ b/www/utils/generated/oas-output/schemas/BaseCartLineItem.ts @@ -13,17 +13,6 @@ * - unit_price * - cart * - cart_id - * - original_total - * - original_subtotal - * - original_tax_total - * - item_total - * - item_subtotal - * - item_tax_total - * - total - * - subtotal - * - tax_total - * - discount_total - * - discount_tax_total * properties: * id: * type: string diff --git a/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts b/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts index 5856f7c847..d992e90af2 100644 --- a/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts +++ b/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts @@ -11,14 +11,6 @@ * - is_tax_inclusive * - created_at * - updated_at - * - original_total - * - original_subtotal - * - original_tax_total - * - total - * - subtotal - * - tax_total - * - discount_total - * - discount_tax_total * properties: * id: * type: string diff --git a/www/utils/generated/oas-output/schemas/BaseRefund.ts b/www/utils/generated/oas-output/schemas/BaseRefund.ts index 9a03e337d4..971424acb2 100644 --- a/www/utils/generated/oas-output/schemas/BaseRefund.ts +++ b/www/utils/generated/oas-output/schemas/BaseRefund.ts @@ -37,7 +37,7 @@ * payment: * $ref: "#/components/schemas/BasePayment" * refund_reason: - * $ref: "#/components/schemas/RefundReason" + * $ref: "#/components/schemas/BaseRefundReason" * */ diff --git a/www/utils/generated/oas-output/schemas/RefundReason.ts b/www/utils/generated/oas-output/schemas/BaseRefundReason.ts similarity index 85% rename from www/utils/generated/oas-output/schemas/RefundReason.ts rename to www/utils/generated/oas-output/schemas/BaseRefundReason.ts index 2a8ab353cd..bbb462d945 100644 --- a/www/utils/generated/oas-output/schemas/RefundReason.ts +++ b/www/utils/generated/oas-output/schemas/BaseRefundReason.ts @@ -1,12 +1,12 @@ /** - * @schema RefundReason + * @schema BaseRefundReason * type: object * description: The refund reason's details. - * x-schemaName: RefundReason + * x-schemaName: BaseRefundReason * required: * - id * - label - * - metadata + * - code * - created_at * - updated_at * properties: @@ -38,6 +38,10 @@ * format: date-time * title: updated_at * description: The date the refund reason was updated. + * code: + * type: string + * title: code + * description: The refund reason's code. * */ diff --git a/www/utils/generated/oas-output/schemas/StoreShippingOptionListResponse.ts b/www/utils/generated/oas-output/schemas/StoreShippingOptionListResponse.ts index 217025083f..47907a3254 100644 --- a/www/utils/generated/oas-output/schemas/StoreShippingOptionListResponse.ts +++ b/www/utils/generated/oas-output/schemas/StoreShippingOptionListResponse.ts @@ -1,16 +1,140 @@ /** * @schema StoreShippingOptionListResponse * type: object - * description: The shipping option's details. + * description: The list of shipping options. * x-schemaName: StoreShippingOptionListResponse * required: * - shipping_options * properties: * shipping_options: * type: array - * description: The shipping option's shipping options. + * description: The list of shipping options. * items: - * $ref: "#/components/schemas/StoreCartShippingOption" + * allOf: + * - $ref: "#/components/schemas/StoreCartShippingOption" + * - type: object + * description: The shipping option's details. + * required: + * - service_zone + * properties: + * service_zone: + * type: object + * description: The shipping option's service zone. + * required: + * - id + * - fulfillment_set_id + * - fulfillment_set + * properties: + * id: + * type: string + * title: id + * description: The service zone's ID. + * fulfillment_set_id: + * type: string + * title: fulfillment_set_id + * description: The ID of the service zone's fulfillment set. + * fulfillment_set: + * type: object + * description: The service zone's fulfillment set. + * required: + * - id + * - type + * - location + * properties: + * id: + * type: string + * title: id + * description: The fulfillment set's ID. + * type: + * type: string + * title: type + * description: The fulfillment set's type. + * location: + * type: object + * description: The fulfillment set's location details. + * required: + * - id + * - address + * properties: + * id: + * type: string + * title: id + * description: The location's ID. + * address: + * type: object + * description: The location's address. + * x-schemaName: StoreFulfillmentAddress + * required: + * - id + * - company + * - address_1 + * - address_2 + * - city + * - country_code + * - province + * - postal_code + * - phone + * - metadata + * - created_at + * - updated_at + * - deleted_at + * properties: + * id: + * type: string + * title: id + * description: The address's ID. + * company: + * type: string + * title: company + * description: The address's company. + * address_1: + * type: string + * title: address_1 + * description: The first line of the address. + * address_2: + * type: string + * title: address_2 + * description: The second line of the address. + * city: + * type: string + * title: city + * description: The address's city. + * country_code: + * type: string + * title: country_code + * description: The address's country code. + * example: "us" + * province: + * type: string + * title: province + * description: The address's province. + * postal_code: + * type: string + * title: postal_code + * description: The address's postal code. + * phone: + * type: string + * title: phone + * description: The address's phone. + * metadata: + * type: object + * description: The address's metadata. Can hold custom key-value pairs. + * created_at: + * type: string + * format: date-time + * title: created_at + * description: The date the address was created. + * updated_at: + * type: string + * format: date-time + * title: updated_at + * description: The date the address was updated. + * deleted_at: + * type: string + * format: date-time + * title: deleted_at + * description: The date the address was deleted. + * description: The shipping option's details. * */ diff --git a/www/utils/generated/route-examples-output/route-examples.json b/www/utils/generated/route-examples-output/route-examples.json index 1dc7a1b1a2..ce49cf9af5 100644 --- a/www/utils/generated/route-examples-output/route-examples.json +++ b/www/utils/generated/route-examples-output/route-examples.json @@ -662,6 +662,18 @@ "GET /admin/refund-reasons": { "js-sdk": "sdk.admin.refundReason.list()\n.then(({ refund_reasons, count, limit, offset }) => {\n console.log(refund_reasons)\n})" }, + "GET /admin/refund-reasons/{id}": { + "js-sdk": "sdk.admin.refundReason.retrieve(\"refr_123\")\n.then(({ refund_reason }) => {\n console.log(refund_reason)\n})" + }, + "POST /admin/refund-reasons": { + "js-sdk": "sdk.admin.refundReason.create({\n value: \"refund\",\n label: \"Refund\",\n})\n.then(({ refund_reason }) => {\n console.log(refund_reason)\n})" + }, + "POST /admin/refund-reasons/{id}": { + "js-sdk": "sdk.admin.refundReason.update(\"ret_123\", {\n value: \"refund\",\n label: \"Refund\",\n})\n.then(({ refund_reason }) => {\n console.log(refund_reason)\n})" + }, + "DELETE /admin/refund-reasons/{id}": { + "js-sdk": "sdk.admin.refundReason.delete(\"ret_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" + }, "POST /admin/regions": { "js-sdk": "sdk.admin.region.create({\n name: \"United States\",\n currency_code: \"usd\",\n})\n.then(({ region }) => {\n console.log(region)\n})" },