docs: generate API reference for 2.10.0 (#13330)

This commit is contained in:
Shahed Nasser
2025-08-28 20:05:37 +03:00
committed by GitHub
parent 494d28ebe4
commit 5c6e172c61
57 changed files with 3726 additions and 70 deletions
@@ -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
*
*/
@@ -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
*
*/
@@ -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
@@ -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
*
*/
@@ -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: []
@@ -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: []
@@ -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: []
@@ -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
*
*/
@@ -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
*
*/
@@ -323,7 +323,7 @@
* },
* })
*
* sdk.admin.promotion.create({
* sdk.admin.promotion.create({
* name: "My Promotion",
* description: "This is a test promotion",
* code: "PROMO123",
@@ -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
*
*/
@@ -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
*
*/