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

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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -323,7 +323,7 @@
* },
* })
*
* sdk.admin.promotion.create({
* sdk.admin.promotion.create({
* name: "My Promotion",
* description: "This is a test promotion",
* code: "PROMO123",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -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"
*
*/

View File

@@ -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"
*
*/

View File

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