chore(docs): Updated API Reference (automated) (#12268)

Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2025-04-23 08:50:17 +00:00
committed by GitHub
parent cb53b8a529
commit c7065fcd2b
37 changed files with 392 additions and 156 deletions

View File

@@ -14711,9 +14711,6 @@ paths:
},
})
To convert a draft order to an order:
```ts
sdk.admin.draftOrder.convertToOrder("order_123")
.then(({ order }) => {
console.log(order)
@@ -15553,6 +15550,73 @@ paths:
'500':
$ref: '#/components/responses/500_error'
x-workflow: updateDraftOrderShippingMethodWorkflow
delete:
operationId: DeleteDraftOrdersIdEditShippingMethodsMethodMethod_id
summary: Remove Shipping Method from Draft Order
x-sidebar-summary: Remove Shipping Method
description: Remove the shipping method in a draft order that is being edited.
x-authenticated: true
parameters:
- name: id
in: path
description: The draft order's ID.
required: true
schema:
type: string
- name: method_id
in: path
description: The shipping method'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.draftOrder.removeShippingMethod(
"order_123",
"shipping_method_123"
)
.then(({ draft_order_preview }) => {
console.log(draft_order_preview)
})
- lang: Shell
label: cURL
source: |-
curl -X DELETE '{backend_url}/admin/draft-orders/{id}/edit/shipping-methods/method/{method_id}' \
-H 'Authorization: Bearer {access_token}'
tags:
- Draft Orders
responses:
'200':
description: OK
'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: removeDraftOrderShippingMethodWorkflow
/admin/draft-orders/{id}/edit/shipping-methods/{action_id}:
post:
operationId: PostDraftOrdersIdEditShippingMethodsAction_id
@@ -15634,8 +15698,8 @@ paths:
x-workflow: updateDraftOrderActionShippingMethodWorkflow
delete:
operationId: DeleteDraftOrdersIdEditShippingMethodsAction_id
summary: Remove Shipping Method from Draft Order
x-sidebar-summary: Remove Shipping Method
summary: Remove New Shipping Method from Draft Order
x-sidebar-summary: Remove New Shipping Method
description: |
Remove the shipping method in a draft order using the `ID` of the method's `SHIPPING_ADD` action.
@@ -63142,17 +63206,20 @@ components:
type: object
description: The state of the step's invokation function.
x-schemaName: WorkflowExecutionFn
required:
- state
- status
properties:
state:
type: string
description: The invokation step's state.
enum:
- failed
- not_started
- invoking
- compensating
- done
- reverted
- failed
- dormant
- skipped
- skipped_failure
@@ -63166,9 +63233,6 @@ components:
- waiting_response
- temp_failure
- permanent_failure
required:
- state
- status
definition:
type: object
description: The step's definition details.
@@ -63191,9 +63255,13 @@ components:
title: continueOnPermanentFailure
description: Whether the workflow should continue executing even if its status is changed to failed.
skipOnPermanentFailure:
type: boolean
title: skipOnPermanentFailure
description: Whether the workflow should skip subsequent steps in case of a permanent failure.
oneOf:
- type: string
title: skipOnPermanentFailure
description: The ID of the step to skip to in case of a permanent failure.
- type: boolean
title: skipOnPermanentFailure
description: Whether the workflow should skip subsequent steps in case of a permanent failure.
maxRetries:
type: number
title: maxRetries
@@ -63223,17 +63291,20 @@ components:
type: object
description: The state of the step's compensation function.
x-schemaName: WorkflowExecutionFn
required:
- state
- status
properties:
state:
type: string
description: The compensation function's state.
enum:
- failed
- not_started
- invoking
- compensating
- done
- reverted
- failed
- dormant
- skipped
- skipped_failure
@@ -63247,9 +63318,6 @@ components:
- waiting_response
- temp_failure
- permanent_failure
required:
- state
- status
depth:
type: number
title: depth