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

View File

@@ -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)
})

View File

@@ -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",

View File

@@ -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)
})

View File

@@ -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)
})

View File

@@ -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)
})

View File

@@ -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)
})

View File

@@ -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)
})

View File

@@ -0,0 +1 @@
curl '{backend_url}/admin/feature-flags'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/orders/{id}/shipping-options' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/shipping-option-types' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -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}"
}'

View File

@@ -0,0 +1,2 @@
curl -X DELETE '{backend_url}/admin/shipping-option-types/{id}' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -0,0 +1,2 @@
curl '{backend_url}/admin/shipping-option-types/{id}' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -0,0 +1,2 @@
curl -X POST '{backend_url}/admin/shipping-option-types/{id}' \
-H 'Authorization: Bearer {access_token}'

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

File diff suppressed because it is too large Load Diff

View File

@@ -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}:

View File

@@ -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

View File

@@ -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
}
```

View File

@@ -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

View File

@@ -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

View File

@@ -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: []

View File

@@ -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: []

View File

@@ -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: []

View File

@@ -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

View File

@@ -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

View File

@@ -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.

View File

@@ -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.

View File

@@ -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.

View File

@@ -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

View File

@@ -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

View File

@@ -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..