diff --git a/www/apps/api-reference/generated/generated-admin-sidebar.mjs b/www/apps/api-reference/generated/generated-admin-sidebar.mjs index 85fa41cef3..6c92236ece 100644 --- a/www/apps/api-reference/generated/generated-admin-sidebar.mjs +++ b/www/apps/api-reference/generated/generated-admin-sidebar.mjs @@ -222,6 +222,13 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Feature Flags", + "children": [], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Fulfillment Providers", @@ -679,6 +686,24 @@ const generatedgeneratedAdminSidebarSidebar = { "loaded": false, "showLoadingIfEmpty": true }, + { + "type": "category", + "title": "Shipping Option Types", + "children": [ + { + "type": "link", + "path": "shipping-option-types_shippingoptiontype_schema", + "title": "ShippingOptionType Object", + "loaded": true, + "badge": { + "variant": "neutral", + "text": "Schema" + } + } + ], + "loaded": false, + "showLoadingIfEmpty": true + }, { "type": "category", "title": "Shipping Options", diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_shipping-options/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_shipping-options/get.js new file mode 100644 index 0000000000..abdb04fb2a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_orders_{id}_shipping-options/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.order.listShippingOptions("order_123") +.then(({ shipping_options }) => { + console.log(shipping_options) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js index d930063c5b..e14a5d2103 100644 --- a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js @@ -8,7 +8,7 @@ export const sdk = new Medusa({ }, }) -sdk.admin.promotion.create({ +sdk.admin.promotion.create({ name: "My Promotion", description: "This is a test promotion", code: "PROMO123", diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types/get.js new file mode 100644 index 0000000000..57b9b86d47 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types/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.shippingOptionType.list() +.then(({ shipping_option_types, count, limit, offset }) => { + console.log(shipping_option_types) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types/post.js new file mode 100644 index 0000000000..68d7085737 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types/post.js @@ -0,0 +1,18 @@ +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.shippingOptionType.create({ + label: "Standard", + code: "standard", + description: "Ship in 2-3 days." +}) +.then(({ shipping_option_type }) => { + console.log(shipping_option_type) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{id}/delete.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{id}/delete.js new file mode 100644 index 0000000000..ff17d5e14c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{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.shippingOptionType.delete("sotype_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_shipping-option-types_{id}/get.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{id}/get.js new file mode 100644 index 0000000000..be83569a45 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{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.shippingOptionType.retrieve("sotype_123") +.then(({ shipping_option_type }) => { + console.log(shipping_option_type) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{id}/post.js b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{id}/post.js new file mode 100644 index 0000000000..8f44ebffbf --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_shipping-option-types_{id}/post.js @@ -0,0 +1,16 @@ +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.shippingOptionType.update("sotype_123", { + code: "express" +}) +.then(({ shipping_option_type }) => { + console.log(shipping_option_type) +}) \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_feature-flags/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_feature-flags/get.sh new file mode 100644 index 0000000000..15bc3d560a --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_feature-flags/get.sh @@ -0,0 +1 @@ +curl '{backend_url}/admin/feature-flags' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_shipping-options/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_shipping-options/get.sh new file mode 100644 index 0000000000..e5c6fbf696 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_shipping-options/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/orders/{id}/shipping-options' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types/get.sh new file mode 100644 index 0000000000..1c57f71acc --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/shipping-option-types' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types/post.sh new file mode 100644 index 0000000000..2c841ee43d --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types/post.sh @@ -0,0 +1,7 @@ +curl -X POST '{backend_url}/admin/shipping-option-types' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "label": "{value}", + "code": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/delete.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/delete.sh new file mode 100644 index 0000000000..b150c54893 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/delete.sh @@ -0,0 +1,2 @@ +curl -X DELETE '{backend_url}/admin/shipping-option-types/{id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/get.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/get.sh new file mode 100644 index 0000000000..72450d9bef --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/get.sh @@ -0,0 +1,2 @@ +curl '{backend_url}/admin/shipping-option-types/{id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/post.sh new file mode 100644 index 0000000000..cbead35f0c --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_shipping-option-types_{id}/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/shipping-option-types/{id}' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml index 69a57280bd..f433c655a0 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminCreateShippingOption.yaml @@ -7,7 +7,6 @@ required: - shipping_profile_id - price_type - provider_id - - type - prices properties: name: @@ -86,3 +85,7 @@ properties: 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. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariantInventoryItemLink.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariantInventoryItemLink.yaml index 6a804fff49..ca4d89e735 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariantInventoryItemLink.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminProductVariantInventoryItemLink.yaml @@ -22,3 +22,7 @@ properties: description: The associated inventory item's ID. inventory: $ref: ./AdminInventoryItem.yaml + required_quantity: + type: number + title: required_quantity + description: The inventory item's required quantity. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeDeleteResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeDeleteResponse.yaml new file mode 100644 index 0000000000..14903ff85f --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeDeleteResponse.yaml @@ -0,0 +1,21 @@ +type: object +description: The response returned after deleting a shipping option type. +x-schemaName: AdminShippingOptionTypeDeleteResponse +required: + - id + - object + - deleted +properties: + id: + type: string + title: id + description: The shipping option type's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: shipping_option_type + deleted: + type: boolean + title: deleted + description: Whether the Shipping Option Type was deleted. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeListResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeListResponse.yaml new file mode 100644 index 0000000000..63070d85df --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeListResponse.yaml @@ -0,0 +1,33 @@ +type: object +description: The paginated list of shipping option types. +x-schemaName: AdminShippingOptionTypeListResponse +required: + - limit + - offset + - count + - shipping_option_types +properties: + limit: + type: number + title: limit + description: The maximum number of items returned. + offset: + type: number + title: offset + description: The number of items skipped before returning the results. + count: + type: number + title: count + description: The total number of items. + estimate_count: + type: number + title: estimate_count + description: >- + The estimated count retrieved from the PostgreSQL query planner, which may + be inaccurate. + x-featureFlag: index_engine + shipping_option_types: + type: array + description: The list of shipping option types. + items: + $ref: ./AdminShippingOptionType.yaml diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeResponse.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeResponse.yaml new file mode 100644 index 0000000000..d8723366ca --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminShippingOptionTypeResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The shipping option type's details. +x-schemaName: AdminShippingOptionTypeResponse +required: + - shipping_option_type +properties: + shipping_option_type: + $ref: ./AdminShippingOptionType.yaml diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 4ce02a5081..924c273973 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -97,12 +97,16 @@ tags: description: | An exchange is the replacement of an item that the customer ordered with another. - These API routes allow admin users t create and manage exchanges. + These API routes allow admin users to create and manage exchanges. externalDocs: description: Learn more about the order exchanges. url: https://docs.medusajs.com/resources/commerce-modules/order/exchange x-associatedSchema: $ref: '#/components/schemas/AdminExchange' + - name: Feature Flags + description: | + Feature flags are used to enable or disable certain features in your Medusa application. + These API routes allow admin users to view feature flags. - name: Fulfillment Providers description: | A fulfillment provider is a third-party integration or custom logic used to fulfill an order's items. @@ -390,6 +394,15 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/sales-channel x-associatedSchema: $ref: '#/components/schemas/AdminSalesChannel' + - name: Shipping Option Types + x-associatedSchema: + $ref: '#/components/schemas/AdminShippingOptionType' + description: | + Shipping option types define a group of shipping options with shared shipping characterstics. For example, you may have "Standard" and "Express" shipping option types. + These API routes allow admins to manage shipping option types. + externalDocs: + description: Learn more about shipping option types. + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profiles-and-types - name: Shipping Options description: | A shipping option is a way of shipping an item to or from the customer. @@ -18371,6 +18384,46 @@ paths: $ref: '#/components/responses/500_error' x-workflow: cancelBeginOrderExchangeWorkflow x-events: [] + /admin/feature-flags: + get: + operationId: GetFeatureFlags + summary: List Feature Flags + description: Retrieve a list of feature flags. The feature flags can be filtered by fields such as `id`. The feature flags can also be sorted or paginated. + x-authenticated: false + parameters: [] + x-codeSamples: + - lang: Shell + label: cURL + source: curl '{backend_url}/admin/feature-flags' + tags: + - Feature Flags + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + description: SUMMARY + required: + - feature_flags + properties: + feature_flags: + type: object + description: The list of feature flags. + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.10.0 /admin/fulfillment-providers: get: operationId: GetFulfillmentProviders @@ -25269,7 +25322,7 @@ paths: payload: |- ```ts { - id, // the ID of the shipment + id, // the ID of the fulfillment no_notification, // (boolean) whether to notify the customer } ``` @@ -25329,20 +25382,6 @@ paths: type: string title: item_id description: The item id's details. - - name: order_id - in: query - required: false - schema: - oneOf: - - type: string - title: order_id - description: The order's order id. - - type: array - description: The order's order id. - items: - type: string - title: order_id - description: The order id's details. - name: version in: query required: false @@ -25505,6 +25544,80 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /admin/orders/{id}/shipping-options: + get: + operationId: GetOrdersIdShippingOptions + summary: List Shipping Options for Order + x-sidebar-summary: List Shipping Options + description: Retrieve a list of shipping options that can be used for outbound shipping in an order. This is especially useful when adding outbound shipping to order exchanges or claims. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - 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.order.listShippingOptions("order_123") + .then(({ shipping_options }) => { + console.log(shipping_options) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/orders/{id}/shipping-options' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + description: The list of shipping options. + required: + - shipping_options + properties: + shipping_options: + type: array + description: The list of shipping options. + items: + type: object + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: listShippingOptionsForOrderWorkflow + x-events: [] + x-since: 2.10.0 /admin/orders/{id}/transfer: post: operationId: PostOrdersIdTransfer @@ -36545,7 +36658,7 @@ paths: }, }) - sdk.admin.promotion.create({ + sdk.admin.promotion.create({ name: "My Promotion", description: "This is a test promotion", code: "PROMO123", @@ -36633,7 +36746,6 @@ paths: required: false schema: type: string - title: promotion_type description: The promotion type to retrieve rules for. enum: - standard @@ -36644,11 +36756,21 @@ paths: required: false schema: type: string - title: application_method_type description: The application method type to retrieve rules for. enum: - fixed - percentage + - name: application_method_target_type + in: query + description: The application method target type to retrieve rules for. + required: false + schema: + type: string + description: The application method target type to retrieve rules for. + enum: + - items + - shipping_methods + - order security: - api_token: [] - cookie_auth: [] @@ -36790,6 +36912,14 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: application_method_target_type + in: query + description: The application method target type to retrieve rules for. + required: false + schema: + type: string + title: application_method_target_type + description: The application method target type to retrieve rules for. security: - api_token: [] - cookie_auth: [] @@ -39480,6 +39610,20 @@ paths: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: order_id + in: query + required: false + schema: + oneOf: + - type: string + title: order_id + description: Filter by an order's ID to retrieve its associated reservations. + - type: array + description: Filter by multiple order IDs to retrieve their associated reservations. + items: + type: string + title: order_id + description: An order's ID. security: - api_token: [] - cookie_auth: [] @@ -44193,6 +44337,876 @@ paths: $ref: '#/components/responses/500_error' x-workflow: linkProductsToSalesChannelWorkflow x-events: [] + /admin/shipping-option-types: + get: + operationId: GetShippingOptionTypes + summary: List Shipping Option Types + description: Retrieve a list of shipping option types. The shipping option types can be filtered by fields such as `id`. The shipping option types can also be sorted or paginated. + x-authenticated: true + parameters: + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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' + - 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. + - name: q + in: query + description: Search query to apply on the shipping option type's searchable properties. + required: false + schema: + type: string + title: q + description: Search query to apply on the shipping option type's searchable properties. + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a shipping option type's ID. + - type: array + description: Filter by shipping option type IDs. + items: + type: string + title: id + description: A shipping option type's ID. + - name: label + in: query + required: false + schema: + oneOf: + - type: string + title: label + description: Filter by a shipping option type's label. + - type: array + description: Filter by shipping option type labels. + items: + type: string + title: label + description: A label. + - name: code + in: query + required: false + schema: + oneOf: + - type: string + title: code + description: Filter by a shipping option type's code. + - type: array + description: Filter by shipping option type codes. + items: + type: string + title: code + description: A code. + - name: created_at + in: query + description: Filter by a shipping option type's creation date. + required: false + schema: + type: object + description: Filter by a shipping option type's creation date. + properties: + $and: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a shipping option type's update date. + required: false + schema: + type: object + description: Filter by a shipping option type's update date. + properties: + $and: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: deleted_at + in: query + description: Filter by a shipping option type's deletion date. + required: false + schema: + type: object + description: Filter by a shipping option type's deletion date. + properties: + $and: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + - type: object + description: Filter by values not matching the conditions in this parameter. + - type: array + description: Filter by values not matching the conditions in this parameter. + items: + type: string + title: $not + description: Filter by values not matching the conditions in this parameter. + $gt: + type: string + title: $gt + description: Filter by values greater than this parameter. Useful for numbers and dates only. + $gte: + type: string + title: $gte + description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + $lt: + type: string + title: $lt + description: Filter by values less than this parameter. Useful for numbers and dates only. + $lte: + type: string + title: $lte + description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: $and + in: query + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + required: false + schema: + type: array + description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - 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.shippingOptionType.list() + .then(({ shipping_option_types, count, limit, offset }) => { + console.log(shipping_option_types) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/shipping-option-types' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionTypeListResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.10.0 + post: + operationId: PostShippingOptionTypes + summary: Create Shipping Option Type + description: Create a shipping option type. + x-authenticated: true + parameters: + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminCreateShippingOptionType' + 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.shippingOptionType.create({ + label: "Standard", + code: "standard", + description: "Ship in 2-3 days." + }) + .then(({ shipping_option_type }) => { + console.log(shipping_option_type) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/shipping-option-types' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "label": "{value}", + "code": "{value}" + }' + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionTypeResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: createShippingOptionTypesWorkflow + x-events: + - name: shipping-option-type.created + payload: |- + ```ts + [{ + id, // The ID of the shipping option type + }] + ``` + description: Emitted when shipping option types are created. + deprecated: false + since: 2.10.0 + x-since: 2.10.0 + /admin/shipping-option-types/{id}: + get: + operationId: GetShippingOptionTypesId + summary: Get a Shipping Option Type + description: Retrieve a shipping option type by its ID. You can expand the shipping option type's relations or select the fields that should be returned. + x-authenticated: true + parameters: + - name: id + in: path + description: The shipping option type's ID. + required: true + schema: + type: string + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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: + - api_token: [] + - 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.shippingOptionType.retrieve("sotype_123") + .then(({ shipping_option_type }) => { + console.log(shipping_option_type) + }) + - lang: Shell + label: cURL + source: |- + curl '{backend_url}/admin/shipping-option-types/{id}' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionTypeResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-since: 2.10.0 + post: + operationId: PostShippingOptionTypesId + summary: Update a Shipping Option Type + description: Update a shipping option type's details. + x-authenticated: true + parameters: + - name: id + in: path + description: The shipping option type's ID. + required: true + schema: + type: string + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminUpdateShippingOption' + 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.shippingOptionType.update("sotype_123", { + code: "express" + }) + .then(({ shipping_option_type }) => { + console.log(shipping_option_type) + }) + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/shipping-option-types/{id}' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionTypeResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: updateShippingOptionTypesWorkflow + x-events: + - name: shipping-option-type.updated + payload: |- + ```ts + [{ + id, // The ID of the shipping option type + }] + ``` + description: Emitted when shipping option types are updated. + deprecated: false + since: 2.10.0 + x-since: 2.10.0 + delete: + operationId: DeleteShippingOptionTypesId + summary: Delete a Shipping Option Type + x-sidebar-summary: Delete Shipping Option Type + description: Delete a shipping option type. + x-authenticated: true + parameters: + - name: id + in: path + description: The shipping option type's ID. + required: true + schema: + type: string + security: + - api_token: [] + - 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.shippingOptionType.delete("sotype_123") + .then(({ deleted }) => { + console.log(deleted) + }) + - lang: Shell + label: cURL + source: |- + curl -X DELETE '{backend_url}/admin/shipping-option-types/{id}' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminShippingOptionTypeDeleteResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: deleteShippingOptionTypesWorkflow + x-events: + - name: shipping-option-type.deleted + payload: |- + ```ts + [{ + id, // The ID of the shipping option type + }] + ``` + description: Emitted when shipping option types are deleted. + deprecated: false + since: 2.10.0 + x-since: 2.10.0 /admin/shipping-options: get: operationId: GetShippingOptions @@ -56677,7 +57691,6 @@ components: - shipping_profile_id - price_type - provider_id - - type - prices properties: name: @@ -56750,6 +57763,10 @@ components: 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. @@ -64571,6 +65588,10 @@ components: description: The associated inventory item's ID. inventory: $ref: '#/components/schemas/AdminInventoryItem' + required_quantity: + type: number + title: required_quantity + description: The inventory item's required quantity. AdminProductVariantInventoryLink: type: object description: The details of an association between a product variant and an inventory item. @@ -65889,6 +66910,69 @@ components: type: string title: shipping_option_id description: The type's shipping option id. + AdminShippingOptionTypeDeleteResponse: + type: object + description: The response returned after deleting a shipping option type. + x-schemaName: AdminShippingOptionTypeDeleteResponse + required: + - id + - object + - deleted + properties: + id: + type: string + title: id + description: The shipping option type's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: shipping_option_type + deleted: + type: boolean + title: deleted + description: Whether the Shipping Option Type was deleted. + AdminShippingOptionTypeListResponse: + type: object + description: The paginated list of shipping option types. + x-schemaName: AdminShippingOptionTypeListResponse + required: + - limit + - offset + - count + - shipping_option_types + properties: + limit: + type: number + title: limit + description: The maximum number of items returned. + offset: + type: number + title: offset + description: The number of items skipped before returning the results. + count: + type: number + title: count + description: The total number of items. + estimate_count: + type: number + title: estimate_count + description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + x-featureFlag: index_engine + shipping_option_types: + type: array + description: The list of shipping option types. + items: + $ref: '#/components/schemas/AdminShippingOptionType' + AdminShippingOptionTypeResponse: + type: object + description: The shipping option type's details. + x-schemaName: AdminShippingOptionTypeResponse + required: + - shipping_option_type + properties: + shipping_option_type: + $ref: '#/components/schemas/AdminShippingOptionType' AdminShippingProfile: type: object description: The shipping profile's details.. diff --git a/www/apps/api-reference/specs/admin/openapi.yaml b/www/apps/api-reference/specs/admin/openapi.yaml index 26435aba6e..1da14eed04 100644 --- a/www/apps/api-reference/specs/admin/openapi.yaml +++ b/www/apps/api-reference/specs/admin/openapi.yaml @@ -126,12 +126,18 @@ tags: another. - These API routes allow admin users t create and manage exchanges. + These API routes allow admin users to create and manage exchanges. externalDocs: description: Learn more about the order exchanges. url: https://docs.medusajs.com/resources/commerce-modules/order/exchange x-associatedSchema: $ref: ./components/schemas/AdminExchange.yaml + - name: Feature Flags + description: > + Feature flags are used to enable or disable certain features in your + Medusa application. + + These API routes allow admin users to view feature flags. - name: Fulfillment Providers description: > A fulfillment provider is a third-party integration or custom logic used @@ -516,6 +522,19 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/sales-channel x-associatedSchema: $ref: ./components/schemas/AdminSalesChannel.yaml + - name: Shipping Option Types + x-associatedSchema: + $ref: ./components/schemas/AdminShippingOptionType.yaml + description: > + Shipping option types define a group of shipping options with shared + shipping characterstics. For example, you may have "Standard" and + "Express" shipping option types. + + These API routes allow admins to manage shipping option types. + externalDocs: + description: Learn more about shipping option types. + url: >- + https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profiles-and-types - name: Shipping Options description: > A shipping option is a way of shipping an item to or from the customer. @@ -828,6 +847,8 @@ paths: $ref: paths/admin_exchanges_{id}_outbound_shipping-method_{action_id}.yaml /admin/exchanges/{id}/request: $ref: paths/admin_exchanges_{id}_request.yaml + /admin/feature-flags: + $ref: paths/admin_feature-flags.yaml /admin/fulfillment-providers: $ref: paths/admin_fulfillment-providers.yaml /admin/fulfillment-providers/{id}/options: @@ -921,6 +942,8 @@ paths: $ref: paths/admin_orders_{id}_line-items.yaml /admin/orders/{id}/preview: $ref: paths/admin_orders_{id}_preview.yaml + /admin/orders/{id}/shipping-options: + $ref: paths/admin_orders_{id}_shipping-options.yaml /admin/orders/{id}/transfer: $ref: paths/admin_orders_{id}_transfer.yaml /admin/orders/{id}/transfer/cancel: @@ -1071,6 +1094,10 @@ paths: $ref: paths/admin_sales-channels_{id}.yaml /admin/sales-channels/{id}/products: $ref: paths/admin_sales-channels_{id}_products.yaml + /admin/shipping-option-types: + $ref: paths/admin_shipping-option-types.yaml + /admin/shipping-option-types/{id}: + $ref: paths/admin_shipping-option-types_{id}.yaml /admin/shipping-options: $ref: paths/admin_shipping-options.yaml /admin/shipping-options/{id}: diff --git a/www/apps/api-reference/specs/admin/paths/admin_feature-flags.yaml b/www/apps/api-reference/specs/admin/paths/admin_feature-flags.yaml new file mode 100644 index 0000000000..d39e5c546f --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_feature-flags.yaml @@ -0,0 +1,42 @@ +get: + operationId: GetFeatureFlags + summary: List Feature Flags + description: >- + Retrieve a list of feature flags. The feature flags can be filtered by + fields such as `id`. The feature flags can also be sorted or paginated. + x-authenticated: false + parameters: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_feature-flags/get.sh + tags: + - Feature Flags + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + description: SUMMARY + required: + - feature_flags + properties: + feature_flags: + type: object + description: The list of feature flags. + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.10.0 diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml index 82a142e520..f1a9428a2d 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_fulfillments_{fulfillment_id}_shipments.yaml @@ -148,7 +148,7 @@ post: payload: |- ```ts { - id, // the ID of the shipment + id, // the ID of the fulfillment no_notification, // (boolean) whether to notify the customer } ``` diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml index 8d252a054e..8e8fa778f5 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_line-items.yaml @@ -60,20 +60,6 @@ get: type: string title: item_id description: The item id's details. - - name: order_id - in: query - required: false - schema: - oneOf: - - type: string - title: order_id - description: The order's order id. - - type: array - description: The order's order id. - items: - type: string - title: order_id - description: The order id's details. - name: version in: query required: false diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_shipping-options.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_shipping-options.yaml new file mode 100644 index 0000000000..f059e6d815 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_shipping-options.yaml @@ -0,0 +1,62 @@ +get: + operationId: GetOrdersIdShippingOptions + summary: List Shipping Options for Order + x-sidebar-summary: List Shipping Options + description: >- + Retrieve a list of shipping options that can be used for outbound shipping + in an order. This is especially useful when adding outbound shipping to + order exchanges or claims. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_orders_{id}_shipping-options/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_orders_{id}_shipping-options/get.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + type: object + description: The list of shipping options. + required: + - shipping_options + properties: + shipping_options: + type: array + description: The list of shipping options. + items: + type: object + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: listShippingOptionsForOrderWorkflow + x-events: [] + x-since: 2.10.0 diff --git a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml index 135b6e8756..9a71b85c85 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-attribute-options_{rule_type}.yaml @@ -37,7 +37,6 @@ get: required: false schema: type: string - title: promotion_type description: The promotion type to retrieve rules for. enum: - standard @@ -48,11 +47,21 @@ get: required: false schema: type: string - title: application_method_type description: The application method type to retrieve rules for. enum: - fixed - percentage + - name: application_method_target_type + in: query + description: The application method target type to retrieve rules for. + required: false + schema: + type: string + description: The application method target type to retrieve rules for. + enum: + - items + - shipping_methods + - order security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml index 18945b8058..bded42bbd8 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_promotions_rule-value-options_{rule_type}_{rule_attribute_id}.yaml @@ -90,6 +90,14 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: application_method_target_type + in: query + description: The application method target type to retrieve rules for. + required: false + schema: + type: string + title: application_method_target_type + description: The application method target type to retrieve rules for. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml b/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml index fd8f57eda3..b19b5c37cb 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_reservations.yaml @@ -614,6 +614,22 @@ get: type: boolean title: with_deleted description: Whether to include deleted records in the result. + - name: order_id + in: query + required: false + schema: + oneOf: + - type: string + title: order_id + description: Filter by an order's ID to retrieve its associated reservations. + - type: array + description: >- + Filter by multiple order IDs to retrieve their associated + reservations. + items: + type: string + title: order_id + description: An order's ID. security: - api_token: [] - cookie_auth: [] diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-option-types.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-option-types.yaml new file mode 100644 index 0000000000..06efa1215b --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-option-types.yaml @@ -0,0 +1,684 @@ +get: + operationId: GetShippingOptionTypes + summary: List Shipping Option Types + description: >- + Retrieve a list of shipping option types. The shipping option types can be + filtered by fields such as `id`. The shipping option types can also be + sorted or paginated. + x-authenticated: true + parameters: + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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' + - 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. + - name: q + in: query + description: >- + Search query to apply on the shipping option type's searchable + properties. + required: false + schema: + type: string + title: q + description: >- + Search query to apply on the shipping option type's searchable + properties. + - name: id + in: query + required: false + schema: + oneOf: + - type: string + title: id + description: Filter by a shipping option type's ID. + - type: array + description: Filter by shipping option type IDs. + items: + type: string + title: id + description: A shipping option type's ID. + - name: label + in: query + required: false + schema: + oneOf: + - type: string + title: label + description: Filter by a shipping option type's label. + - type: array + description: Filter by shipping option type labels. + items: + type: string + title: label + description: A label. + - name: code + in: query + required: false + schema: + oneOf: + - type: string + title: code + description: Filter by a shipping option type's code. + - type: array + description: Filter by shipping option type codes. + items: + type: string + title: code + description: A code. + - name: created_at + in: query + description: Filter by a shipping option type's creation date. + required: false + schema: + type: object + description: Filter by a shipping option type's creation date. + properties: + $and: + type: array + description: >- + Join query parameters with an AND condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: >- + Join query parameters with an OR condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: updated_at + in: query + description: Filter by a shipping option type's update date. + required: false + schema: + type: object + description: Filter by a shipping option type's update date. + properties: + $and: + type: array + description: >- + Join query parameters with an AND condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: >- + Join query parameters with an OR condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: deleted_at + in: query + description: Filter by a shipping option type's deletion date. + required: false + schema: + type: object + description: Filter by a shipping option type's deletion date. + properties: + $and: + type: array + description: >- + Join query parameters with an AND condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $and + $or: + type: array + description: >- + Join query parameters with an OR condition. Each object's content + is the same type as the expected query parameters. + items: + type: object + title: $or + $eq: + oneOf: + - type: string + title: $eq + description: Filter by an exact match. + - type: array + description: Filter by an exact match. + items: + type: string + title: $eq + description: Filter by an exact match. + $ne: + type: string + title: $ne + description: Filter by values not equal to this parameter. + $in: + type: array + description: Filter by values in this array. + items: + type: string + title: $in + description: Filter by values in this array. + $nin: + type: array + description: Filter by values not in this array. + items: + type: string + title: $nin + description: Filter by values not in this array. + $not: + oneOf: + - type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + - type: object + description: >- + Filter by values not matching the conditions in this + parameter. + - type: array + description: >- + Filter by values not matching the conditions in this + parameter. + items: + type: string + title: $not + description: >- + Filter by values not matching the conditions in this + parameter. + $gt: + type: string + title: $gt + description: >- + Filter by values greater than this parameter. Useful for numbers + and dates only. + $gte: + type: string + title: $gte + description: >- + Filter by values greater than or equal to this parameter. Useful + for numbers and dates only. + $lt: + type: string + title: $lt + description: >- + Filter by values less than this parameter. Useful for numbers and + dates only. + $lte: + type: string + title: $lte + description: >- + Filter by values less than or equal to this parameter. Useful for + numbers and dates only. + $like: + type: string + title: $like + description: Apply a `like` filter. Useful for strings only. + $re: + type: string + title: $re + description: Apply a regex filter. Useful for strings only. + $ilike: + type: string + title: $ilike + description: Apply a case-insensitive `like` filter. Useful for strings only. + $fulltext: + type: string + title: $fulltext + description: Filter to apply on full-text properties. + $overlap: + type: array + description: Filter arrays that have overlapping values with this parameter. + items: + type: string + title: $overlap + description: Filter arrays that have overlapping values with this parameter. + $contains: + type: array + description: Filter arrays that contain some of the values of this parameter. + items: + type: string + title: $contains + description: Filter arrays that contain some of the values of this parameter. + $contained: + type: array + description: Filter arrays that contain all values of this parameter. + items: + type: string + title: $contained + description: Filter arrays that contain all values of this parameter. + $exists: + type: boolean + title: $exists + description: Filter by whether a value for this parameter exists (not `null`). + - name: $and + in: query + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an AND condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $and + - name: $or + in: query + description: >- + Join query parameters with an OR condition. Each object's content is the + same type as the expected query parameters. + required: false + schema: + type: array + description: >- + Join query parameters with an OR condition. Each object's content is + the same type as the expected query parameters. + items: + type: object + title: $or + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-option-types/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-option-types/get.sh + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingOptionTypeListResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.10.0 +post: + operationId: PostShippingOptionTypes + summary: Create Shipping Option Type + description: Create a shipping option type. + x-authenticated: true + parameters: + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminCreateShippingOptionType.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-option-types/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-option-types/post.sh + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingOptionTypeResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: createShippingOptionTypesWorkflow + x-events: + - name: shipping-option-type.created + payload: |- + ```ts + [{ + id, // The ID of the shipping option type + }] + ``` + description: Emitted when shipping option types are created. + deprecated: false + since: 2.10.0 + x-since: 2.10.0 diff --git a/www/apps/api-reference/specs/admin/paths/admin_shipping-option-types_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_shipping-option-types_{id}.yaml new file mode 100644 index 0000000000..3ec2229f45 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_shipping-option-types_{id}.yaml @@ -0,0 +1,213 @@ +get: + operationId: GetShippingOptionTypesId + summary: Get a Shipping Option Type + description: >- + Retrieve a shipping option type by its ID. You can expand the shipping + option type's relations or select the fields that should be returned. + x-authenticated: true + parameters: + - name: id + in: path + description: The shipping option type's ID. + required: true + schema: + type: string + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-option-types_{id}/get.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-option-types_{id}/get.sh + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingOptionTypeResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-since: 2.10.0 +post: + operationId: PostShippingOptionTypesId + summary: Update a Shipping Option Type + description: Update a shipping option type's details. + x-authenticated: true + parameters: + - name: id + in: path + description: The shipping option type's ID. + required: true + schema: + type: string + - name: fields + in: query + 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. + required: false + schema: + type: string + title: fields + 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: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminUpdateShippingOption.yaml + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-option-types_{id}/post.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-option-types_{id}/post.sh + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingOptionTypeResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: updateShippingOptionTypesWorkflow + x-events: + - name: shipping-option-type.updated + payload: |- + ```ts + [{ + id, // The ID of the shipping option type + }] + ``` + description: Emitted when shipping option types are updated. + deprecated: false + since: 2.10.0 + x-since: 2.10.0 +delete: + operationId: DeleteShippingOptionTypesId + summary: Delete a Shipping Option Type + x-sidebar-summary: Delete Shipping Option Type + description: Delete a shipping option type. + x-authenticated: true + parameters: + - name: id + in: path + description: The shipping option type's ID. + required: true + schema: + type: string + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: JavaScript + label: JS SDK + source: + $ref: ../code_samples/JavaScript/admin_shipping-option-types_{id}/delete.js + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_shipping-option-types_{id}/delete.sh + tags: + - Shipping Option Types + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminShippingOptionTypeDeleteResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: deleteShippingOptionTypesWorkflow + x-events: + - name: shipping-option-type.deleted + payload: |- + ```ts + [{ + id, // The ID of the shipping option type + }] + ``` + description: Emitted when shipping option types are deleted. + deprecated: false + since: 2.10.0 + x-since: 2.10.0 diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminCreateShippingOption.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminCreateShippingOption.yaml index 69a57280bd..f433c655a0 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminCreateShippingOption.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminCreateShippingOption.yaml @@ -7,7 +7,6 @@ required: - shipping_profile_id - price_type - provider_id - - type - prices properties: name: @@ -86,3 +85,7 @@ properties: 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. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminProductVariantInventoryItemLink.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminProductVariantInventoryItemLink.yaml index 6a804fff49..ca4d89e735 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminProductVariantInventoryItemLink.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminProductVariantInventoryItemLink.yaml @@ -22,3 +22,7 @@ properties: description: The associated inventory item's ID. inventory: $ref: ./AdminInventoryItem.yaml + required_quantity: + type: number + title: required_quantity + description: The inventory item's required quantity. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeDeleteResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeDeleteResponse.yaml new file mode 100644 index 0000000000..14903ff85f --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeDeleteResponse.yaml @@ -0,0 +1,21 @@ +type: object +description: The response returned after deleting a shipping option type. +x-schemaName: AdminShippingOptionTypeDeleteResponse +required: + - id + - object + - deleted +properties: + id: + type: string + title: id + description: The shipping option type's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: shipping_option_type + deleted: + type: boolean + title: deleted + description: Whether the Shipping Option Type was deleted. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeListResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeListResponse.yaml new file mode 100644 index 0000000000..63070d85df --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeListResponse.yaml @@ -0,0 +1,33 @@ +type: object +description: The paginated list of shipping option types. +x-schemaName: AdminShippingOptionTypeListResponse +required: + - limit + - offset + - count + - shipping_option_types +properties: + limit: + type: number + title: limit + description: The maximum number of items returned. + offset: + type: number + title: offset + description: The number of items skipped before returning the results. + count: + type: number + title: count + description: The total number of items. + estimate_count: + type: number + title: estimate_count + description: >- + The estimated count retrieved from the PostgreSQL query planner, which may + be inaccurate. + x-featureFlag: index_engine + shipping_option_types: + type: array + description: The list of shipping option types. + items: + $ref: ./AdminShippingOptionType.yaml diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeResponse.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeResponse.yaml new file mode 100644 index 0000000000..d8723366ca --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminShippingOptionTypeResponse.yaml @@ -0,0 +1,8 @@ +type: object +description: The shipping option type's details. +x-schemaName: AdminShippingOptionTypeResponse +required: + - shipping_option_type +properties: + shipping_option_type: + $ref: ./AdminShippingOptionType.yaml diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index 2348e1e2ac..c480633af1 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -12052,7 +12052,6 @@ components: - shipping_profile_id - price_type - provider_id - - type - prices properties: name: @@ -12125,6 +12124,10 @@ components: 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. @@ -19946,6 +19949,10 @@ components: description: The associated inventory item's ID. inventory: $ref: '#/components/schemas/AdminInventoryItem' + required_quantity: + type: number + title: required_quantity + description: The inventory item's required quantity. AdminProductVariantInventoryLink: type: object description: The details of an association between a product variant and an inventory item. @@ -21264,6 +21271,69 @@ components: type: string title: shipping_option_id description: The type's shipping option id. + AdminShippingOptionTypeDeleteResponse: + type: object + description: The response returned after deleting a shipping option type. + x-schemaName: AdminShippingOptionTypeDeleteResponse + required: + - id + - object + - deleted + properties: + id: + type: string + title: id + description: The shipping option type's ID. + object: + type: string + title: object + description: The name of the deleted object. + default: shipping_option_type + deleted: + type: boolean + title: deleted + description: Whether the Shipping Option Type was deleted. + AdminShippingOptionTypeListResponse: + type: object + description: The paginated list of shipping option types. + x-schemaName: AdminShippingOptionTypeListResponse + required: + - limit + - offset + - count + - shipping_option_types + properties: + limit: + type: number + title: limit + description: The maximum number of items returned. + offset: + type: number + title: offset + description: The number of items skipped before returning the results. + count: + type: number + title: count + description: The total number of items. + estimate_count: + type: number + title: estimate_count + description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + x-featureFlag: index_engine + shipping_option_types: + type: array + description: The list of shipping option types. + items: + $ref: '#/components/schemas/AdminShippingOptionType' + AdminShippingOptionTypeResponse: + type: object + description: The shipping option type's details. + x-schemaName: AdminShippingOptionTypeResponse + required: + - shipping_option_type + properties: + shipping_option_type: + $ref: '#/components/schemas/AdminShippingOptionType' AdminShippingProfile: type: object description: The shipping profile's details.. diff --git a/www/utils/generated/events-output.json b/www/utils/generated/events-output.json index 54aeefb31b..22e6bb0768 100644 --- a/www/utils/generated/events-output.json +++ b/www/utils/generated/events-output.json @@ -658,7 +658,7 @@ "name": "shipment.created", "parentName": "FulfillmentWorkflowEvents", "propertyName": "SHIPMENT_CREATED", - "payload": "```ts\n{\n id, // the ID of the shipment\n no_notification, // (boolean) whether to notify the customer\n}\n```", + "payload": "```ts\n{\n id, // the ID of the fulfillment\n no_notification, // (boolean) whether to notify the customer\n}\n```", "description": "Emitted when a shipment is created for an order.", "workflows": [ "createOrderShipmentWorkflow" @@ -676,6 +676,42 @@ ], "deprecated": false }, + { + "name": "shipping-option-type.updated", + "parentName": "ShippingOptionTypeWorkflowEvents", + "propertyName": "UPDATED", + "payload": "```ts\n[{\n id, // The ID of the shipping option type\n}]\n```", + "description": "Emitted when shipping option types are updated.", + "workflows": [ + "updateShippingOptionTypesWorkflow" + ], + "since": "2.10.0", + "deprecated": false + }, + { + "name": "shipping-option-type.created", + "parentName": "ShippingOptionTypeWorkflowEvents", + "propertyName": "CREATED", + "payload": "```ts\n[{\n id, // The ID of the shipping option type\n}]\n```", + "description": "Emitted when shipping option types are created.", + "workflows": [ + "createShippingOptionTypesWorkflow" + ], + "since": "2.10.0", + "deprecated": false + }, + { + "name": "shipping-option-type.deleted", + "parentName": "ShippingOptionTypeWorkflowEvents", + "propertyName": "DELETED", + "payload": "```ts\n[{\n id, // The ID of the shipping option type\n}]\n```", + "description": "Emitted when shipping option types are deleted.", + "workflows": [ + "deleteShippingOptionTypesWorkflow" + ], + "since": "2.10.0", + "deprecated": false + }, { "name": "payment.captured", "parentName": "PaymentEvents", diff --git a/www/utils/generated/oas-output/base/admin.oas.base.yaml b/www/utils/generated/oas-output/base/admin.oas.base.yaml index f80a441e74..02e228fdfe 100644 --- a/www/utils/generated/oas-output/base/admin.oas.base.yaml +++ b/www/utils/generated/oas-output/base/admin.oas.base.yaml @@ -114,12 +114,18 @@ tags: another. - These API routes allow admin users t create and manage exchanges. + These API routes allow admin users to create and manage exchanges. externalDocs: description: Learn more about the order exchanges. url: https://docs.medusajs.com/resources/commerce-modules/order/exchange x-associatedSchema: $ref: "#/components/schemas/AdminExchange" + - name: Feature Flags + description: > + Feature flags are used to enable or disable certain features in your Medusa + application. + + These API routes allow admin users to view feature flags. - name: Fulfillment Providers description: > A fulfillment provider is a third-party integration or custom logic used @@ -161,10 +167,10 @@ tags: $ref: "#/components/schemas/AdminFulfillment" - name: Gift Cards description: > - A gift card is a prepaid card that can be used to pay for items during checkout. + A gift card is a prepaid card that can be used to pay for items during + checkout. - Gift cards can be purchased by customers, or created by admin users. When a gift card is redeemed, its amount - is added to the customer's store credit account, which can then be used to pay for items during checkout. + Gift cards can be purchased by customers, or created by admin users. When a gift card is redeemed, its amount is added to the customer's store credit account, which can then be used to pay for items during checkout. These API routes allow admin users to manage gift cards, transfer gift cards between customers, and more. @@ -471,6 +477,17 @@ tags: url: https://docs.medusajs.com/resources/commerce-modules/sales-channel x-associatedSchema: $ref: "#/components/schemas/AdminSalesChannel" + - name: Shipping Option Types + x-associatedSchema: + $ref: "#/components/schemas/AdminShippingOptionType" + description: > + Shipping option types define a group of shipping options with shared shipping characterstics. For example, + you may have "Standard" and "Express" shipping option types. + + These API routes allow admins to manage shipping option types. + externalDocs: + description: Learn more about shipping option types. + url: https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profiles-and-types - name: Shipping Options description: > A shipping option is a way of shipping an item to or from the customer. @@ -520,8 +537,9 @@ tags: $ref: "#/components/schemas/AdminStockLocation" - name: Store Credit Accounts description: > - A store credit account is a ledger of store credit transactions for a customer. They hold the customer's store credit balance, - including their credit and debit amounts. + A store credit account is a ledger of store credit transactions for a + customer. They hold the customer's store credit balance, including their + credit and debit amounts. Store credit accounts allow you to build features that let customers pay for items using their store credit balance, such as gift cards or loyalty points. @@ -592,8 +610,9 @@ tags: $ref: "#/components/schemas/AdminTaxRegion" - name: Transaction Groups description: > - A transaction group is a group of transactions that belong to a store credit account. - It allows you to group transactions together, such as all transactions related to a specific gift card. + A transaction group is a group of transactions that belong to a store + credit account. It allows you to group transactions together, such as all + transactions related to a specific gift card. These API routes allow admin users to list transaction groups. diff --git a/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-option-types_[id].ts b/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-option-types_[id].ts new file mode 100644 index 0000000000..77f3ffb8b5 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/delete_admin_shipping-option-types_[id].ts @@ -0,0 +1,78 @@ +/** + * @oas [delete] /admin/shipping-option-types/{id} + * operationId: DeleteShippingOptionTypesId + * summary: Delete a Shipping Option Type + * x-sidebar-summary: Delete Shipping Option Type + * description: Delete a shipping option type. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The shipping option type's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - 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.shippingOptionType.delete("sotype_123") + * .then(({ deleted }) => { + * console.log(deleted) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X DELETE '{backend_url}/admin/shipping-option-types/{id}' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Shipping Option Types + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminShippingOptionTypeDeleteResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: deleteShippingOptionTypesWorkflow + * x-events: + * - name: shipping-option-type.deleted + * payload: |- + * ```ts + * [{ + * id, // The ID of the shipping option type + * }] + * ``` + * description: Emitted when shipping option types are deleted. + * deprecated: false + * since: 2.10.0 + * x-since: 2.10.0 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_feature-flags.ts b/www/utils/generated/oas-output/operations/admin/get_admin_feature-flags.ts new file mode 100644 index 0000000000..4b84810c04 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_feature-flags.ts @@ -0,0 +1,43 @@ +/** + * @oas [get] /admin/feature-flags + * operationId: GetFeatureFlags + * summary: List Feature Flags + * description: Retrieve a list of feature flags. The feature flags can be filtered by fields such as `id`. The feature flags can also be sorted or paginated. + * x-authenticated: false + * parameters: [] + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: curl '{backend_url}/admin/feature-flags' + * tags: + * - Feature Flags + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * type: object + * description: SUMMARY + * required: + * - feature_flags + * properties: + * feature_flags: + * type: object + * description: The list of feature flags. + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-since: 2.10.0 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts index 0d68f0b8b4..fff5c1880d 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_line-items.ts @@ -53,20 +53,6 @@ * type: string * title: item_id * description: The item id's details. - * - name: order_id - * in: query - * required: false - * schema: - * oneOf: - * - type: string - * title: order_id - * description: The order's order id. - * - type: array - * description: The order's order id. - * items: - * type: string - * title: order_id - * description: The order id's details. * - name: version * in: query * required: false diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_shipping-options.ts b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_shipping-options.ts new file mode 100644 index 0000000000..968bca6ad9 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_orders_[id]_shipping-options.ts @@ -0,0 +1,77 @@ +/** + * @oas [get] /admin/orders/{id}/shipping-options + * operationId: GetOrdersIdShippingOptions + * summary: List Shipping Options for Order + * x-sidebar-summary: List Shipping Options + * description: Retrieve a list of shipping options that can be used for outbound shipping in an order. This is especially useful when adding outbound shipping to order exchanges or claims. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The order's ID. + * required: true + * schema: + * type: string + * security: + * - api_token: [] + * - 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.order.listShippingOptions("order_123") + * .then(({ shipping_options }) => { + * console.log(shipping_options) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/orders/{id}/shipping-options' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * type: object + * description: The list of shipping options. + * required: + * - shipping_options + * properties: + * shipping_options: + * type: array + * description: The list of shipping options. + * items: + * $ref: "#/components/schemas/AdminShippingOption" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: listShippingOptionsForOrderWorkflow + * x-events: [] + * x-since: 2.10.0 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts index 0e50789276..17ba2adc32 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-attribute-options_[rule_type].ts @@ -29,7 +29,6 @@ * required: false * schema: * type: string - * title: promotion_type * description: The promotion type to retrieve rules for. * enum: * - standard @@ -40,11 +39,21 @@ * required: false * schema: * type: string - * title: application_method_type * description: The application method type to retrieve rules for. * enum: * - fixed * - percentage + * - name: application_method_target_type + * in: query + * description: The application method target type to retrieve rules for. + * required: false + * schema: + * type: string + * description: The application method target type to retrieve rules for. + * enum: + * - items + * - shipping_methods + * - order * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts index 05bca11bf0..ed3a0dc7d1 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_promotions_rule-value-options_[rule_type]_[rule_attribute_id].ts @@ -82,6 +82,14 @@ * type: boolean * title: with_deleted * description: Whether to include deleted records in the result. + * - name: application_method_target_type + * in: query + * description: The application method target type to retrieve rules for. + * required: false + * schema: + * type: string + * title: application_method_target_type + * description: The application method target type to retrieve rules for. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts b/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts index c0817fc187..116ac33bf1 100644 --- a/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts +++ b/www/utils/generated/oas-output/operations/admin/get_admin_reservations.ts @@ -519,6 +519,20 @@ * type: boolean * title: with_deleted * description: Whether to include deleted records in the result. + * - name: order_id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: order_id + * description: Filter by an order's ID to retrieve its associated reservations. + * - type: array + * description: Filter by multiple order IDs to retrieve their associated reservations. + * items: + * type: string + * title: order_id + * description: An order's ID. * security: * - api_token: [] * - cookie_auth: [] diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-option-types.ts b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-option-types.ts new file mode 100644 index 0000000000..86ebcab0b4 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-option-types.ts @@ -0,0 +1,538 @@ +/** + * @oas [get] /admin/shipping-option-types + * operationId: GetShippingOptionTypes + * summary: List Shipping Option Types + * description: Retrieve a list of shipping option types. The shipping option types can be filtered by fields such as `id`. The shipping option types can also be sorted or paginated. + * x-authenticated: true + * parameters: + * - name: fields + * in: query + * 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. + * required: false + * schema: + * type: string + * title: fields + * 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" + * - 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. + * - name: q + * in: query + * description: Search query to apply on the shipping option type's searchable properties. + * required: false + * schema: + * type: string + * title: q + * description: Search query to apply on the shipping option type's searchable properties. + * - name: id + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: id + * description: Filter by a shipping option type's ID. + * - type: array + * description: Filter by shipping option type IDs. + * items: + * type: string + * title: id + * description: A shipping option type's ID. + * - name: label + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: label + * description: Filter by a shipping option type's label. + * - type: array + * description: Filter by shipping option type labels. + * items: + * type: string + * title: label + * description: A label. + * - name: code + * in: query + * required: false + * schema: + * oneOf: + * - type: string + * title: code + * description: Filter by a shipping option type's code. + * - type: array + * description: Filter by shipping option type codes. + * items: + * type: string + * title: code + * description: A code. + * - name: created_at + * in: query + * description: Filter by a shipping option type's creation date. + * required: false + * schema: + * type: object + * description: Filter by a shipping option type's creation date. + * properties: + * $and: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * $or: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: updated_at + * in: query + * description: Filter by a shipping option type's update date. + * required: false + * schema: + * type: object + * description: Filter by a shipping option type's update date. + * properties: + * $and: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * $or: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: deleted_at + * in: query + * description: Filter by a shipping option type's deletion date. + * required: false + * schema: + * type: object + * description: Filter by a shipping option type's deletion date. + * properties: + * $and: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * $or: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * $eq: + * oneOf: + * - type: string + * title: $eq + * description: Filter by an exact match. + * - type: array + * description: Filter by an exact match. + * items: + * type: string + * title: $eq + * description: Filter by an exact match. + * $ne: + * type: string + * title: $ne + * description: Filter by values not equal to this parameter. + * $in: + * type: array + * description: Filter by values in this array. + * items: + * type: string + * title: $in + * description: Filter by values in this array. + * $nin: + * type: array + * description: Filter by values not in this array. + * items: + * type: string + * title: $nin + * description: Filter by values not in this array. + * $not: + * oneOf: + * - type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * - type: object + * description: Filter by values not matching the conditions in this parameter. + * - type: array + * description: Filter by values not matching the conditions in this parameter. + * items: + * type: string + * title: $not + * description: Filter by values not matching the conditions in this parameter. + * $gt: + * type: string + * title: $gt + * description: Filter by values greater than this parameter. Useful for numbers and dates only. + * $gte: + * type: string + * title: $gte + * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only. + * $lt: + * type: string + * title: $lt + * description: Filter by values less than this parameter. Useful for numbers and dates only. + * $lte: + * type: string + * title: $lte + * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only. + * $like: + * type: string + * title: $like + * description: Apply a `like` filter. Useful for strings only. + * $re: + * type: string + * title: $re + * description: Apply a regex filter. Useful for strings only. + * $ilike: + * type: string + * title: $ilike + * description: Apply a case-insensitive `like` filter. Useful for strings only. + * $fulltext: + * type: string + * title: $fulltext + * description: Filter to apply on full-text properties. + * $overlap: + * type: array + * description: Filter arrays that have overlapping values with this parameter. + * items: + * type: string + * title: $overlap + * description: Filter arrays that have overlapping values with this parameter. + * $contains: + * type: array + * description: Filter arrays that contain some of the values of this parameter. + * items: + * type: string + * title: $contains + * description: Filter arrays that contain some of the values of this parameter. + * $contained: + * type: array + * description: Filter arrays that contain all values of this parameter. + * items: + * type: string + * title: $contained + * description: Filter arrays that contain all values of this parameter. + * $exists: + * type: boolean + * title: $exists + * description: Filter by whether a value for this parameter exists (not `null`). + * - name: $and + * in: query + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * required: false + * schema: + * type: array + * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $and + * - name: $or + * in: query + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * required: false + * schema: + * type: array + * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters. + * items: + * type: object + * title: $or + * security: + * - api_token: [] + * - 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.shippingOptionType.list() + * .then(({ shipping_option_types, count, limit, offset }) => { + * console.log(shipping_option_types) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/shipping-option-types' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Shipping Option Types + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminShippingOptionTypeListResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-since: 2.10.0 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/get_admin_shipping-option-types_[id].ts b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-option-types_[id].ts new file mode 100644 index 0000000000..f46b6fa3fd --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/get_admin_shipping-option-types_[id].ts @@ -0,0 +1,79 @@ +/** + * @oas [get] /admin/shipping-option-types/{id} + * operationId: GetShippingOptionTypesId + * summary: Get a Shipping Option Type + * description: Retrieve a shipping option type by its ID. You can expand the shipping option type's relations or select the fields that should be returned. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The shipping option type's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * 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. + * required: false + * schema: + * type: string + * title: fields + * 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: + * - api_token: [] + * - 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.shippingOptionType.retrieve("sotype_123") + * .then(({ shipping_option_type }) => { + * console.log(shipping_option_type) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl '{backend_url}/admin/shipping-option-types/{id}' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Shipping Option Types + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminShippingOptionTypeResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-since: 2.10.0 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts b/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts index 0a7737cc02..8796b7270b 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_promotions.ts @@ -323,7 +323,7 @@ * }, * }) * - * sdk.admin.promotion.create({ + * sdk.admin.promotion.create({ * name: "My Promotion", * description: "This is a test promotion", * code: "PROMO123", diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-option-types.ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-option-types.ts new file mode 100644 index 0000000000..25357f418b --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-option-types.ts @@ -0,0 +1,99 @@ +/** + * @oas [post] /admin/shipping-option-types + * operationId: PostShippingOptionTypes + * summary: Create Shipping Option Type + * description: Create a shipping option type. + * x-authenticated: true + * parameters: + * - name: fields + * in: query + * 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. + * required: false + * schema: + * type: string + * title: fields + * 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: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminCreateShippingOptionType" + * 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.shippingOptionType.create({ + * label: "Standard", + * code: "standard", + * description: "Ship in 2-3 days." + * }) + * .then(({ shipping_option_type }) => { + * console.log(shipping_option_type) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/shipping-option-types' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "label": "{value}", + * "code": "{value}" + * }' + * tags: + * - Shipping Option Types + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminShippingOptionTypeResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: createShippingOptionTypesWorkflow + * x-events: + * - name: shipping-option-type.created + * payload: |- + * ```ts + * [{ + * id, // The ID of the shipping option type + * }] + * ``` + * description: Emitted when shipping option types are created. + * deprecated: false + * since: 2.10.0 + * x-since: 2.10.0 + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_shipping-option-types_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-option-types_[id].ts new file mode 100644 index 0000000000..c346407fe6 --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_shipping-option-types_[id].ts @@ -0,0 +1,98 @@ +/** + * @oas [post] /admin/shipping-option-types/{id} + * operationId: PostShippingOptionTypesId + * summary: Update a Shipping Option Type + * description: Update a shipping option type's details. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The shipping option type's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * 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. + * required: false + * schema: + * type: string + * title: fields + * 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: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminUpdateShippingOption" + * 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.shippingOptionType.update("sotype_123", { + * code: "express" + * }) + * .then(({ shipping_option_type }) => { + * console.log(shipping_option_type) + * }) + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/shipping-option-types/{id}' \ + * -H 'Authorization: Bearer {access_token}' + * tags: + * - Shipping Option Types + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminShippingOptionTypeResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: updateShippingOptionTypesWorkflow + * x-events: + * - name: shipping-option-type.updated + * payload: |- + * ```ts + * [{ + * id, // The ID of the shipping option type + * }] + * ``` + * description: Emitted when shipping option types are updated. + * deprecated: false + * since: 2.10.0 + * x-since: 2.10.0 + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminCreateShippingOption.ts b/www/utils/generated/oas-output/schemas/AdminCreateShippingOption.ts index c6057f95d4..a5776dacf4 100644 --- a/www/utils/generated/oas-output/schemas/AdminCreateShippingOption.ts +++ b/www/utils/generated/oas-output/schemas/AdminCreateShippingOption.ts @@ -9,7 +9,6 @@ * - shipping_profile_id * - price_type * - provider_id - * - type * - prices * properties: * name: @@ -82,6 +81,10 @@ * 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. * */ diff --git a/www/utils/generated/oas-output/schemas/AdminProductVariantInventoryItemLink.ts b/www/utils/generated/oas-output/schemas/AdminProductVariantInventoryItemLink.ts index 4b4a678c3e..5e2a2f7e6b 100644 --- a/www/utils/generated/oas-output/schemas/AdminProductVariantInventoryItemLink.ts +++ b/www/utils/generated/oas-output/schemas/AdminProductVariantInventoryItemLink.ts @@ -24,6 +24,10 @@ * description: The associated inventory item's ID. * inventory: * $ref: "#/components/schemas/AdminInventoryItem" + * required_quantity: + * type: number + * title: required_quantity + * description: The inventory item's required quantity. * */ diff --git a/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeDeleteResponse.ts b/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeDeleteResponse.ts new file mode 100644 index 0000000000..2f017c0f7e --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeDeleteResponse.ts @@ -0,0 +1,26 @@ +/** + * @schema AdminShippingOptionTypeDeleteResponse + * type: object + * description: The response returned after deleting a shipping option type. + * x-schemaName: AdminShippingOptionTypeDeleteResponse + * required: + * - id + * - object + * - deleted + * properties: + * id: + * type: string + * title: id + * description: The shipping option type's ID. + * object: + * type: string + * title: object + * description: The name of the deleted object. + * default: shipping_option_type + * deleted: + * type: boolean + * title: deleted + * description: Whether the Shipping Option Type was deleted. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeListResponse.ts b/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeListResponse.ts new file mode 100644 index 0000000000..56fa2782b0 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeListResponse.ts @@ -0,0 +1,36 @@ +/** + * @schema AdminShippingOptionTypeListResponse + * type: object + * description: The paginated list of shipping option types. + * x-schemaName: AdminShippingOptionTypeListResponse + * required: + * - limit + * - offset + * - count + * - shipping_option_types + * properties: + * limit: + * type: number + * title: limit + * description: The maximum number of items returned. + * offset: + * type: number + * title: offset + * description: The number of items skipped before returning the results. + * count: + * type: number + * title: count + * description: The total number of items. + * estimate_count: + * type: number + * title: estimate_count + * description: The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate. + * x-featureFlag: index_engine + * shipping_option_types: + * type: array + * description: The list of shipping option types. + * items: + * $ref: "#/components/schemas/AdminShippingOptionType" + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeResponse.ts b/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeResponse.ts new file mode 100644 index 0000000000..60e8543398 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminShippingOptionTypeResponse.ts @@ -0,0 +1,13 @@ +/** + * @schema AdminShippingOptionTypeResponse + * type: object + * description: The shipping option type's details. + * x-schemaName: AdminShippingOptionTypeResponse + * required: + * - shipping_option_type + * properties: + * shipping_option_type: + * $ref: "#/components/schemas/AdminShippingOptionType" + * +*/ + diff --git a/www/utils/generated/route-examples-output/route-examples.json b/www/utils/generated/route-examples-output/route-examples.json index d5efe1eb9c..e7a4d98839 100644 --- a/www/utils/generated/route-examples-output/route-examples.json +++ b/www/utils/generated/route-examples-output/route-examples.json @@ -398,6 +398,9 @@ "POST /admin/orders/{id}/fulfillments/{fulfillmentid}/mark-as-delivered": { "js-sdk": "sdk.admin.order.markAsDelivered(\n \"order_123\",\n \"ful_123\",\n)\n.then(({ order }) => {\n console.log(order)\n})" }, + "GET /admin/orders/{id}/shipping-options": { + "js-sdk": "sdk.admin.order.listShippingOptions(\"order_123\")\n.then(({ shipping_options }) => {\n console.log(shipping_options)\n})" + }, "GET /admin/orders/{id}/changes": { "js-sdk": "sdk.admin.order.listChanges(\"order_123\")\n.then(({ order_changes }) => {\n console.log(order_changes)\n})" }, @@ -636,7 +639,7 @@ "js-sdk": "sdk.admin.promotion.list()\n.then(({ promotions, count, limit, offset }) => {\n console.log(promotions)\n})" }, "POST /admin/promotions": { - "js-sdk": "sdk.admin.promotion.create({ \n name: \"My Promotion\",\n description: \"This is a test promotion\",\n code: \"PROMO123\",\n starts_at: \"2021-01-01\",\n ends_at: \"2021-01-01\",\n})\n.then(({ promotion }) => {\n console.log(promotion)\n})" + "js-sdk": "sdk.admin.promotion.create({\n name: \"My Promotion\",\n description: \"This is a test promotion\",\n code: \"PROMO123\",\n starts_at: \"2021-01-01\",\n ends_at: \"2021-01-01\",\n})\n.then(({ promotion }) => {\n console.log(promotion)\n})" }, "POST /admin/promotions/{id}": { "js-sdk": "sdk.admin.promotion.update(\"promo_123\", {\n code: \"PROMO123\",\n})\n.then(({ promotion }) => {\n console.log(promotion)\n})" @@ -920,6 +923,21 @@ "GET /admin/workflows-executions/{id}": { "js-sdk": "sdk.admin.workflowExecution.retrieve(\"wrk_123\")\n.then(({ workflow_execution }) => {\n console.log(workflow_execution)\n})" }, + "POST /admin/shipping-option-types": { + "js-sdk": "sdk.admin.shippingOptionType.create({\n label: \"Standard\",\n code: \"standard\",\n description: \"Ship in 2-3 days.\"\n})\n.then(({ shipping_option_type }) => {\n console.log(shipping_option_type)\n})" + }, + "POST /admin/shipping-option-types/{id}": { + "js-sdk": "sdk.admin.shippingOptionType.update(\"sotype_123\", {\n code: \"express\"\n})\n.then(({ shipping_option_type }) => {\n console.log(shipping_option_type)\n})" + }, + "GET /admin/shipping-option-types": { + "js-sdk": "sdk.admin.shippingOptionType.list()\n.then(({ shipping_option_types, count, limit, offset }) => {\n console.log(shipping_option_types)\n})" + }, + "GET /admin/shipping-option-types/{id}": { + "js-sdk": "sdk.admin.shippingOptionType.retrieve(\"sotype_123\")\n.then(({ shipping_option_type }) => {\n console.log(shipping_option_type)\n})" + }, + "DELETE /admin/shipping-option-types/{id}": { + "js-sdk": "sdk.admin.shippingOptionType.delete(\"sotype_123\")\n.then(({ deleted }) => {\n console.log(deleted)\n})" + }, "POST /auth/{actor}/{method}/register": { "js-sdk": "await sdk.auth.register(\n \"customer\",\n \"emailpass\",\n {\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n }\n)\n\n// all subsequent requests will use the token in the header\nconst { customer } = await sdk.store.customer.create({\n email: \"customer@gmail.com\",\n password: \"supersecret\"\n})" },