Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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.updateOrderChange(
"ordch_123",
{
carry_over_promotions: true
}
)
.then(({ order_change }) => {
console.log(order_change)
})
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
curl -X POST '{backend_url}/admin/draft-orders/{id}' \
-H 'Authorization: Bearer {jwt_token}'
-H 'Authorization: Bearer {jwt_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"email": "[email protected]"
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
curl -X POST '{backend_url}/admin/order-changes/{id}' \
-H 'Authorization: Bearer {access_token}' \
-H 'Content-Type: application/json' \
--data-raw '{
"carry_over_promotions": true
}'
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,10 @@ properties:
type: number
title: shipping_discount_total
description: The total discount amount applied on the draft order's shipping.
custom_display_id:
type: string
title: custom_display_id
description: The custom display ID of the draft order.
externalDocs:
url: >-
https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id
Original file line number Diff line number Diff line change
Expand Up @@ -677,3 +677,10 @@ properties:
type: number
title: shipping_discount_total
description: The total discount amount applied on the draft order's shipping.
custom_display_id:
type: string
title: custom_display_id
description: The custom display ID of the draft order.
externalDocs:
url: >-
https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,10 @@ properties:
type: number
title: shipping_discount_total
description: The total discount amount applied on the order's shipping.
custom_display_id:
type: string
title: custom_display_id
description: The custom display ID of the order.
externalDocs:
url: >-
https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ properties:
format: date-time
title: updated_at
description: The date the order change was updated.
carry_over_promotions:
type: boolean
title: carry_over_promotions
description: >-
Whether promotions from the original order should be carried over to the
order change (specifically, exchanges).
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
type: object
description: The details of the order change.
x-schemaName: AdminOrderChangeResponse
required:
- order_change
properties:
order_change:
$ref: ./AdminOrderChange.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -679,3 +679,10 @@ properties:
type: number
title: shipping_discount_total
description: The total discount amount applied on the order's shipping.
custom_display_id:
type: string
title: custom_display_id
description: The custom display ID of the order.
externalDocs:
url: >-
https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ required:
- ean
- upc
- thumbnail
- images
- allow_backorder
- manage_inventory
- hs_code
Expand Down Expand Up @@ -149,7 +150,7 @@ properties:
type: array
description: The variant's images.
items:
$ref: ./AdminProductImage.yaml
$ref: ./BaseProductImage.yaml
thumbnail:
type: string
title: thumbnail
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@ properties:
description: >-
Whether the promotion is tax inclusive. If enabled, the promotion is
applied after tax is calculated.
limit:
type: number
title: limit
description: The limit of times the promotion can be used.
used:
type: number
title: used
description: The number of times the promotion has been used.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type: object
description: The data to update in the order change.
x-schemaName: AdminUpdateOrderChange
properties:
carry_over_promotions:
type: boolean
title: carry_over_promotions
description: >-
Whether promotions from the original order should be carried over to the
order change (specifically, exchanges).
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,10 @@ properties:
type: number
title: shipping_discount_total
description: The total discount amount applied on the order's shipping.
custom_display_id:
type: string
title: custom_display_id
description: The custom display ID of the order.
externalDocs:
url: >-
https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ properties:
type: object
description: The image's metadata, can hold custom key-value pairs.
externalDocs:
url: https://docs.medusajs.com/api/store#manage-metadata
url: https://docs.medusajs.com/api/admin#manage-metadata
description: Learn how to manage metadata
rank:
type: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ required:
- ean
- upc
- thumbnail
- images
- allow_backorder
- manage_inventory
- hs_code
Expand Down Expand Up @@ -138,3 +139,8 @@ properties:
type: string
title: thumbnail
description: The variant's thumbnail.
images:
type: array
description: The variant's images.
items:
$ref: ./BaseProductImage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,3 +321,10 @@ properties:
type: number
title: shipping_discount_total
description: The total discount amount applied on the order's shipping.
custom_display_id:
type: string
title: custom_display_id
description: The custom display ID of the order.
externalDocs:
url: >-
https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,9 @@ properties:
format: date-time
title: updated_at
description: The date the order change was updated.
carry_over_promotions:
type: boolean
title: carry_over_promotions
description: >-
Whether promotions from the original order should be carried over to the
order change (specifically, exchanges).
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ required:
- action
- details
- internal_note
- ordering
- created_at
- updated_at
properties:
Expand Down Expand Up @@ -98,3 +99,7 @@ properties:
format: date-time
title: updated_at
description: The date the action was updated.
ordering:
type: number
title: ordering
description: The action's ordering among other actions in the same order change.
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,10 @@ properties:
type: number
title: shipping_discount_total
description: The total discount amount applied on the order's shipping.
custom_display_id:
type: string
title: custom_display_id
description: The custom display ID of the order.
externalDocs:
url: >-
https://docs.medusajs.com/resources/commerce-modules/order/custom-display-id
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ properties:
type: string
title: thumbnail
description: The variant's thumbnail.
images:
type: array
description: The variant's images.
items:
$ref: ./BaseProductImage.yaml
required:
- options
- length
Expand All @@ -139,6 +144,7 @@ required:
- hs_code
- mid_code
- material
- images
- deleted_at
- manage_inventory
- allow_backorder
Expand Down
Loading
Loading