docs: generate JS SDK reference with fixes (#12161)
This commit is contained in:
1 parent
90f9149735
commit
734f4fecbc
26 files changed
+6189
-6130
No files matched your search
+1
-1
@@ -561,7 +561,7 @@ API route.
|
||||
### Example
|
||||
|
||||
```ts
|
||||
* sdk.admin.claim.addOutboundShipping(
|
||||
sdk.admin.claim.addOutboundShipping(
|
||||
"claim_123",
|
||||
{
|
||||
shipping_option_id: "so_123",
|
||||
|
||||
+18
-35
@@ -114,8 +114,6 @@ This method creates a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To create a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.create({
|
||||
email: "test@test.com",
|
||||
@@ -150,8 +148,6 @@ This method updates a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To update a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.update("order_123", {
|
||||
email: "test@test.com",
|
||||
@@ -178,13 +174,12 @@ This method converts a draft order to an order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To convert a draft order to an order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.convertToOrder("order_123")
|
||||
.then(({ order }) => {
|
||||
console.log(order)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
@@ -203,8 +198,6 @@ This method adds items to a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To add items to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.addItems("order_123", {
|
||||
items: [
|
||||
@@ -236,8 +229,6 @@ This method updates an item that is part of an action in a draft order. It sends
|
||||
|
||||
### Example
|
||||
|
||||
To update an item that is part of an action in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateActionItem("order_123", "action_123", {
|
||||
quantity: 2,
|
||||
@@ -264,8 +255,6 @@ This method removes an item that is part of an action in a draft order. It sends
|
||||
|
||||
### Example
|
||||
|
||||
To remove an item that is part of an action in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.removeActionItem("order_123", "action_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
@@ -290,8 +279,6 @@ This method updates an item in a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To update an item in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateItem("order_123", "item_123", {
|
||||
quantity: 2,
|
||||
@@ -307,7 +294,7 @@ sdk.admin.draftOrder.updateItem("order_123", "item_123", {
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"This method updates an item in a draft order. It sends a request to the\n[Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders\\_postordereditsiditemsitem\\_id) API route.","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the orLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The draft order preview's details.","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","dLine truncated
|
||||
|
||||
___
|
||||
|
||||
@@ -318,8 +305,6 @@ This method adds promotions to a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To add promotions to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.addPromotions("order_123", {
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
@@ -346,8 +331,6 @@ This method removes promotions from a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To remove promotions from a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.removePromotions("order_123", {
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
@@ -371,8 +354,6 @@ This method adds a shipping method to a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To add a shipping method to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.addShippingMethod("order_123", {
|
||||
shipping_option_id: "shipping_option_123",
|
||||
@@ -399,8 +380,6 @@ This method updates a shipping method in a draft order. It sends a request to th
|
||||
|
||||
### Example
|
||||
|
||||
To update a shipping method in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateShippingMethod("order_123", "action_123", {
|
||||
shipping_option_id: "shipping_option_123",
|
||||
@@ -427,8 +406,6 @@ This method removes a shipping method from a draft order. It sends a request to
|
||||
|
||||
### Example
|
||||
|
||||
To remove a shipping method from a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.removeShippingMethod("order_123", "action_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
@@ -448,13 +425,27 @@ ___
|
||||
|
||||
## updateShippingMethod
|
||||
|
||||
This method updates a shipping method in a draft order. It sends a request to the
|
||||
[Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders\_postordereditsidshipping-methodsaction\_id) API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateShippingMethod("order_123", "sm_123", {
|
||||
shipping_option_id: "so_123",
|
||||
})
|
||||
.then(({ draft_order_preview }) => {
|
||||
console.log(draft_order_preview)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"methodId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateDraftOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateDraftOrderShippingMethod/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_option_id","type":"`string`","description":"ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`number`","description":"Custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`null` \\| `string`","description":"Internal note for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateShippingMethod"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The draft order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"methodId","type":"`string`","description":"The shipping method's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateDraftOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateDraftOrderShippingMethod/page.mdx)","description":"The data to update the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_option_id","type":"`string`","description":"ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`number`","description":"Custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`null` \\| `string`","description":"Internal note for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateShippingMethod"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the ordeLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The draft order preview's details.","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","dLine truncated
|
||||
|
||||
___
|
||||
|
||||
@@ -465,8 +456,6 @@ This method begins an edit to a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To begin an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.beginEdit("order_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
@@ -491,8 +480,6 @@ This method cancels an edit to a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To cancel an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.cancelEdit("order_123")
|
||||
.then(({ id, object, deleted }) => {
|
||||
@@ -517,8 +504,6 @@ This method requests an edit to a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To request an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.requestEdit("order_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
@@ -543,8 +528,6 @@ This method confirms an edit to a draft order. It sends a request to the
|
||||
|
||||
### Example
|
||||
|
||||
To confirm an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.confirmEdit("order_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
|
||||
+3
-8
@@ -25,25 +25,20 @@ API route.
|
||||
### Example
|
||||
|
||||
```ts
|
||||
const token = await sdk.auth.register("user", "emailpass", {
|
||||
await sdk.auth.register("user", "emailpass", {
|
||||
email: "user@gmail.com",
|
||||
password: "supersecret"
|
||||
})
|
||||
|
||||
sdk.admin.invite.accept(
|
||||
// all subsequent requests will use the token in the header
|
||||
const { user } = await sdk.admin.invite.accept(
|
||||
{
|
||||
email: "user@gmail.com",
|
||||
first_name: "John",
|
||||
last_name: "Smith",
|
||||
invite_token: "12345..."
|
||||
},
|
||||
{
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
)
|
||||
.then(({ user }) => {
|
||||
console.log(user)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
+21
-2
@@ -424,10 +424,29 @@ ___
|
||||
|
||||
## createCreditLine
|
||||
|
||||
This method creates a credit line for an order. It sends a request to the
|
||||
[Create Credit Line](https://docs.medusajs.com/api/admin#orders\_postordersidcredit-lines) API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.order.createCreditLine(
|
||||
"order_123",
|
||||
{
|
||||
amount: 100,
|
||||
reference: "order",
|
||||
reference_id: "order_123",
|
||||
}
|
||||
)
|
||||
.then(({ order }) => {
|
||||
console.log(order)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"orderId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"Omit<[CreateOrderCreditLineDTO](../../../../../order/interfaces/order.CreateOrderCreditLineDTO/page.mdx), \"order_id\">","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"[BigNumberInput](../../../../../order/types/order.BigNumberInput/page.mdx)","description":"The amount of the credit line.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../order/types/order.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"reference","type":"`null` \\| `string`","description":"The reference model name that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`null` \\| `string`","description":"The reference model id that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order detail","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCreditLine"/>
|
||||
<TypeList types={[{"name":"orderId","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"Omit<[CreateOrderCreditLineDTO](../../../../../order/interfaces/order.CreateOrderCreditLineDTO/page.mdx), \"order_id\">","description":"The credit line's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"[BigNumberInput](../../../../../order/types/order.BigNumberInput/page.mdx)","description":"The amount of the credit line.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../order/types/order.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"reference","type":"`null` \\| `string`","description":"The reference model name that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`null` \\| `string`","description":"The reference model id that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order detail","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCreditLine"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx)[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx)[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"`number`","description":"The tax total applied on the order's items, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"`number`","description":"The total of the order including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"`number`","description":"TLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order's details.","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx)[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx)[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"`number`","description":"The tax total applied on the order's items, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"`number`","description":"The total of the order including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"`numbeLine truncated
|
||||
+1
-1
@@ -12,7 +12,7 @@ API route.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
* sdk.admin.claim.addOutboundShipping(
|
||||
sdk.admin.claim.addOutboundShipping(
|
||||
"claim_123",
|
||||
{
|
||||
shipping_option_id: "so_123",
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method adds items to a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To add items to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.addItems("order_123", {
|
||||
items: [
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method adds promotions to a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To add promotions to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.addPromotions("order_123", {
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method adds a shipping method to a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To add a shipping method to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.addShippingMethod("order_123", {
|
||||
shipping_option_id: "shipping_option_123",
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method begins an edit to a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To begin an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.beginEdit("order_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method cancels an edit to a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To cancel an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.cancelEdit("order_123")
|
||||
.then(({ id, object, deleted }) => {
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method confirms an edit to a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To confirm an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.confirmEdit("order_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
|
||||
+1
-2
@@ -7,13 +7,12 @@ This method converts a draft order to an order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To convert a draft order to an order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.convertToOrder("order_123")
|
||||
.then(({ order }) => {
|
||||
console.log(order)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method creates a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To create a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.create({
|
||||
email: "test@test.com",
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method removes an item that is part of an action in a draft order. It sends
|
||||
|
||||
## Example
|
||||
|
||||
To remove an item that is part of an action in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.removeActionItem("order_123", "action_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method removes a shipping method from a draft order. It sends a request to
|
||||
|
||||
## Example
|
||||
|
||||
To remove a shipping method from a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.removeShippingMethod("order_123", "action_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method removes promotions from a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To remove promotions from a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.removePromotions("order_123", {
|
||||
promo_codes: ["PROMO_CODE_1", "PROMO_CODE_2"],
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method requests an edit to a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To request an edit to a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.requestEdit("order_123")
|
||||
.then(({ draft_order_preview }) => {
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method updates a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To update a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.update("order_123", {
|
||||
email: "test@test.com",
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method updates an item that is part of an action in a draft order. It sends
|
||||
|
||||
## Example
|
||||
|
||||
To update an item that is part of an action in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateActionItem("order_123", "action_123", {
|
||||
quantity: 2,
|
||||
|
||||
-2
@@ -7,8 +7,6 @@ This method updates a shipping method in a draft order. It sends a request to th
|
||||
|
||||
## Example
|
||||
|
||||
To update a shipping method in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateShippingMethod("order_123", "action_123", {
|
||||
shipping_option_id: "shipping_option_123",
|
||||
|
||||
+1
-3
@@ -7,8 +7,6 @@ This method updates an item in a draft order. It sends a request to the
|
||||
|
||||
## Example
|
||||
|
||||
To update an item in a draft order:
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateItem("order_123", "item_123", {
|
||||
quantity: 2,
|
||||
@@ -24,4 +22,4 @@ sdk.admin.draftOrder.updateItem("order_123", "item_123", {
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"This method updates an item in a draft order. It sends a request to the\n[Update Draft Order Item](https://docs.medusajs.com/api/admin#draft-orders\\_postordereditsiditemsitem\\_id) API route.","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the orLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The draft order preview's details.","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","dLine truncated
|
||||
+16
-2
@@ -2,10 +2,24 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# updateShippingMethod
|
||||
|
||||
This method updates a shipping method in a draft order. It sends a request to the
|
||||
[Update Draft Order Shipping Method](https://docs.medusajs.com/api/admin#draft-orders\_postordereditsidshipping-methodsaction\_id) API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.draftOrder.updateShippingMethod("order_123", "sm_123", {
|
||||
shipping_option_id: "so_123",
|
||||
})
|
||||
.then(({ draft_order_preview }) => {
|
||||
console.log(draft_order_preview)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"methodId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateDraftOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateDraftOrderShippingMethod/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_option_id","type":"`string`","description":"ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`number`","description":"Custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`null` \\| `string`","description":"Internal note for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateShippingMethod"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The draft order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"methodId","type":"`string`","description":"The shipping method's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateDraftOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateDraftOrderShippingMethod/page.mdx)","description":"The data to update the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_option_id","type":"`string`","description":"ID of the shipping option to associate with the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`number`","description":"Custom amount for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`null` \\| `string`","description":"Internal note for the shipping method.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateShippingMethod"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the ordeLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminDraftOrderPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The draft order preview's details.","expandable":false,"children":[{"name":"draft_order_preview","type":"[AdminDraftOrderPreview](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminDraftOrderPreview/page.mdx)","description":"The details of the preview on the draft order.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_requested_total","type":"`number`","description":"The total amount for the items requested to be returned.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The details of the changes on the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx) & `object`[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx) & `object`[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","dLine truncated
|
||||
+3
-8
@@ -12,25 +12,20 @@ API route.
|
||||
## Example
|
||||
|
||||
```ts
|
||||
const token = await sdk.auth.register("user", "emailpass", {
|
||||
await sdk.auth.register("user", "emailpass", {
|
||||
email: "user@gmail.com",
|
||||
password: "supersecret"
|
||||
})
|
||||
|
||||
sdk.admin.invite.accept(
|
||||
// all subsequent requests will use the token in the header
|
||||
const { user } = await sdk.admin.invite.accept(
|
||||
{
|
||||
email: "user@gmail.com",
|
||||
first_name: "John",
|
||||
last_name: "Smith",
|
||||
invite_token: "12345..."
|
||||
},
|
||||
{
|
||||
Authorization: `Bearer ${token}`
|
||||
}
|
||||
)
|
||||
.then(({ user }) => {
|
||||
console.log(user)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
+21
-2
@@ -2,10 +2,29 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# createCreditLine
|
||||
|
||||
This method creates a credit line for an order. It sends a request to the
|
||||
[Create Credit Line](https://docs.medusajs.com/api/admin#orders\_postordersidcredit-lines) API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.order.createCreditLine(
|
||||
"order_123",
|
||||
{
|
||||
amount: 100,
|
||||
reference: "order",
|
||||
reference_id: "order_123",
|
||||
}
|
||||
)
|
||||
.then(({ order }) => {
|
||||
console.log(order)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"orderId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"Omit<[CreateOrderCreditLineDTO](../../../../../order/interfaces/order.CreateOrderCreditLineDTO/page.mdx), \"order_id\">","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"[BigNumberInput](../../../../../order/types/order.BigNumberInput/page.mdx)","description":"The amount of the credit line.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../order/types/order.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"reference","type":"`null` \\| `string`","description":"The reference model name that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`null` \\| `string`","description":"The reference model id that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order detail","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCreditLine"/>
|
||||
<TypeList types={[{"name":"orderId","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"Omit<[CreateOrderCreditLineDTO](../../../../../order/interfaces/order.CreateOrderCreditLineDTO/page.mdx), \"order_id\">","description":"The credit line's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"amount","type":"[BigNumberInput](../../../../../order/types/order.BigNumberInput/page.mdx)","description":"The amount of the credit line.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string` \\| `number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../order/types/order.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"reference","type":"`null` \\| `string`","description":"The reference model name that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reference_id","type":"`null` \\| `string`","description":"The reference model id that the credit line is generated from","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order detail","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the order.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createCreditLine"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx)[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx)[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"`number`","description":"The tax total applied on the order's items, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"`number`","description":"The total of the order including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"`number`","description":"TLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order's details.","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx)[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx)[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string`","description":"The order's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"`number`","description":"The tax total applied on the order's items, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"`number`","description":"The total of the order including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"`numbeLine truncated
|
||||
Reference in new issue
Block a user