* chore(docs): Generated References (automated) * fix sidebar and links * removed reflection path section --------- Co-authored-by: shahednasser <shahednasser@users.noreply.github.com> Co-authored-by: Shahed nasser <shahednasser@gmail.com>
16632 lines
586 KiB
Plaintext
16632 lines
586 KiB
Plaintext
---
|
|
displayed_sidebar: jsClientSidebar
|
|
slug: /references/js-client/AdminOrdersResource
|
|
---
|
|
|
|
import ParameterTypes from "@site/src/components/ParameterTypes"
|
|
|
|
# AdminOrdersResource
|
|
|
|
This class is used to send requests to [Admin Order API Routes](https://docs.medusajs.com/api/admin#orders). All its method
|
|
are available in the JS Client under the `medusa.admin.orders` property.
|
|
|
|
All methods in this class require [user authentication](AdminAuthResource.mdx#createsession).
|
|
|
|
Orders are purchases made by customers, typically through a storefront using [CartsResource](CartsResource.mdx). Draft orders created by the admin are also transformed to an Order once the payment is captured.
|
|
Managing orders include managing fulfillment, payment, claims, reservations, and more.
|
|
|
|
Related Guide: [How to manage orders](https://docs.medusajs.com/modules/orders/admin/manage-orders).
|
|
|
|
## Methods
|
|
|
|
### addShippingMethod
|
|
|
|
Add a shipping method to an order. If another shipping method exists with the same shipping profile, the previous shipping method will be replaced.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.addShippingMethod(orderId, {
|
|
price: 1000,
|
|
option_id,
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderShippingMethodsReq`](../internal/classes/internal.AdminPostOrdersOrderShippingMethodsReq.mdx)",
|
|
"description": "The shipping method to be added.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "data",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "The data required for the Shipping Option to create a Shipping Method. This depends on the Fulfillment Provider.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "option_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Shipping Option to create the Shipping Method from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The price (excluding VAT) that should be charged for the Shipping Method",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### archive
|
|
|
|
Archive an order and change its status.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.archive(orderId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### cancel
|
|
|
|
Cancel an order and change its status. This will also cancel any associated fulfillments and payments, and it may fail if the payment or fulfillment Provider
|
|
is unable to cancel the payment/fulfillment.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.cancel(orderId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### cancelClaim
|
|
|
|
Cancel a claim and change its status. A claim can't be canceled if it has a refund, if its fulfillments haven't been canceled, of if its associated return hasn't been canceled.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.cancelClaim(orderId, claimId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the claim belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claimId",
|
|
"type": "`string`",
|
|
"description": "The claim's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `claims` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### cancelClaimFulfillment
|
|
|
|
Cancel a claim's fulfillment and change its fulfillment status to `canceled`.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.cancelClaimFulfillment(orderId, claimId, fulfillmentId)
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the claim is associated with.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claimId",
|
|
"type": "`string`",
|
|
"description": "The claim's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillmentId",
|
|
"type": "`string`",
|
|
"description": "The fulfillment's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### cancelFulfillment
|
|
|
|
Cancel an order's fulfillment and change its fulfillment status to `canceled`.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.cancelFulfillment(orderId, fulfillmentId)
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the fulfillment belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillmentId",
|
|
"type": "`string`",
|
|
"description": "The fulfillment's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### cancelSwap
|
|
|
|
Cancel a swap and change its status.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.cancelSwap(orderId, swapId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the swap belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swapId",
|
|
"type": "`string`",
|
|
"description": "The swap's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `swaps` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### cancelSwapFulfillment
|
|
|
|
Cancel a swap's fulfillment and change its fulfillment status to `canceled`.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.cancelSwapFulfillment(orderId, swapId, fulfillmentId)
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the swap is associated with.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swapId",
|
|
"type": "`string`",
|
|
"description": "The ID of the swap the fulfillment belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillmentId",
|
|
"type": "`string`",
|
|
"description": "The fulfillment's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### capturePayment
|
|
|
|
Capture all the payments associated with an order. The payment of canceled orders can't be captured.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.capturePayment(orderId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order whose payments should be captured.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### complete
|
|
|
|
Complete an order and change its status. A canceled order can't be completed.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.complete(orderId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### createClaim
|
|
|
|
Create a claim for an order. If a return shipping method is specified, a return will also be created and associated with the claim. If the claim's type is `refund`,
|
|
the refund is processed as well.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.createClaim(orderId, {
|
|
type: "refund",
|
|
claim_items: [
|
|
{
|
|
item_id,
|
|
quantity: 1,
|
|
},
|
|
],
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderClaimsReq`](../internal/classes/internal.AdminPostOrdersOrderClaimsReq.mdx)",
|
|
"description": "The claim to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "additional_items",
|
|
"type": "[`AdditionalItem`](../internal/classes/internal.AdditionalItem-2.mdx)[]",
|
|
"description": "The new items to send to the Customer. This is only used if the claim's type is `replace`.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "quantity",
|
|
"type": "`number`",
|
|
"description": "The quantity of the Product Variant.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "variant_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Product Variant.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "claim_items",
|
|
"type": "[`Item`](../internal/classes/internal.Item-5.mdx)[]",
|
|
"description": "The Claim Items that the Claim will consist of.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "images",
|
|
"type": "`string`[]",
|
|
"description": "A list of image URL's that will be associated with the Claim",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Line Item that will be claimed.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "note",
|
|
"type": "`string`",
|
|
"description": "Short text describing the Claim Item in further detail.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "quantity",
|
|
"type": "`number`",
|
|
"description": "The number of items that will be returned",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "reason",
|
|
"type": "[`ClaimReason`](../internal/enums/internal.internal.ClaimReason.mdx)",
|
|
"description": "The reason for the Claim",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "MISSING_ITEM",
|
|
"type": "``\"missing_item\"``",
|
|
"description": "",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "OTHER",
|
|
"type": "``\"other\"``",
|
|
"description": "",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "PRODUCTION_FAILURE",
|
|
"type": "``\"production_failure\"``",
|
|
"description": "",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "WRONG_ITEM",
|
|
"type": "``\"wrong_item\"``",
|
|
"description": "",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "tags",
|
|
"type": "`string`[]",
|
|
"description": "A list of tags to add to the Claim Item",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to true no notification will be send related to this Claim.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refund_amount",
|
|
"type": "`number`",
|
|
"description": "The amount to refund the customer. This is used when the claim's type is `refund`.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "return_location_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the location used for the associated return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "return_shipping",
|
|
"type": "[`ReturnShipping`](../internal/classes/internal.ReturnShipping-3.mdx)",
|
|
"description": "Optional details for the Return Shipping Method, if the items are to be sent back. Providing this field will result in a return being created and associated with the claim.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "option_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping option used for the return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The shipping method's price.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`AddressPayload`](../internal/classes/internal.AddressPayload.mdx)",
|
|
"description": "An optional shipping address to send the claimed items to. If not provided, the parent order's shipping address will be used.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "address_1",
|
|
"type": "`string`",
|
|
"description": "Address line 1",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "address_2",
|
|
"type": "`string`",
|
|
"description": "Address line 2",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "city",
|
|
"type": "`string`",
|
|
"description": "City",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "company",
|
|
"type": "`string`",
|
|
"description": "Company",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "country_code",
|
|
"type": "`string`",
|
|
"description": "The 2 character ISO code of the country in lower case",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "first_name",
|
|
"type": "`string`",
|
|
"description": "First name",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "last_name",
|
|
"type": "`string`",
|
|
"description": "Last name",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "phone",
|
|
"type": "`string`",
|
|
"description": "Phone Number",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "postal_code",
|
|
"type": "`string`",
|
|
"description": "Postal Code",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "province",
|
|
"type": "`string`",
|
|
"description": "Province",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-2.mdx)[]",
|
|
"description": "The Shipping Methods to send the additional Line Items with. This is only used if the claim's type is `replace`.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "data",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of an existing Shipping Method",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "option_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Shipping Option to create a Shipping Method from",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The price to charge for the Shipping Method",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "type",
|
|
"type": "``\"refund\"`` \\| ``\"replace\"``",
|
|
"description": "The type of the Claim. This will determine how the Claim is treated: `replace` Claims will result in a Fulfillment with new items being created, while a `refund` Claim will refund the amount paid for the claimed items.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `claims` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### createClaimShipment
|
|
|
|
Create a shipment for the claim and mark its fulfillment as shipped. If the shipment is created successfully, this changes the claim's fulfillment status
|
|
to either `partially_shipped` or `shipped`, depending on whether all the items were shipped.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.createClaimShipment(orderId, claimId, {
|
|
fulfillment_id,
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the claim belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claimId",
|
|
"type": "`string`",
|
|
"description": "The claim's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderClaimsClaimShipmentsReq`](../internal/classes/internal.AdminPostOrdersOrderClaimsClaimShipmentsReq.mdx)",
|
|
"description": "The shipment to create.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "fulfillment_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Fulfillment.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tracking_numbers",
|
|
"type": "`string`[]",
|
|
"description": "An array of tracking numbers for the shipment.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `claims` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### createFulfillment
|
|
|
|
Create a Fulfillment of an Order using the fulfillment provider, and change the order's fulfillment status to either `partially_fulfilled` or `fulfilled`, depending on
|
|
whether all the items were fulfilled.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.createFulfillment(orderId, {
|
|
items: [
|
|
{
|
|
item_id,
|
|
quantity: 1,
|
|
},
|
|
],
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the fulfillment belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderFulfillmentsReq`](../internal/classes/internal.AdminPostOrdersOrderFulfillmentsReq.mdx)",
|
|
"description": "The fulfillment to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "items",
|
|
"type": "[`Item`](../internal/classes/internal.Item-4.mdx)[]",
|
|
"description": "The Line Items to include in the Fulfillment.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "item_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Line Item to fulfill.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "quantity",
|
|
"type": "`number`",
|
|
"description": "The quantity of the Line Item to fulfill.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "location_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the location where the items will be fulfilled from.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, no notification will be sent to the customer related to this fulfillment.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### createShipment
|
|
|
|
Create a shipment and mark a fulfillment as shipped. This changes the order's fulfillment status to either `partially_shipped` or `shipped`, depending on
|
|
whether all the items were shipped.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.createShipment(order_id, {
|
|
fulfillment_id,
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderShipmentReq`](../internal/classes/internal.AdminPostOrdersOrderShipmentReq.mdx)",
|
|
"description": "The shipment to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "fulfillment_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Fulfillment.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to true no notification will be send related to this Shipment.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tracking_numbers",
|
|
"type": "`string`[]",
|
|
"description": "The tracking numbers for the shipment.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### createSwap
|
|
|
|
Create a swap for an order. This includes creating a return that is associated with the swap.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.createSwap(orderId, {
|
|
return_items: [
|
|
{
|
|
item_id,
|
|
quantity: 1,
|
|
},
|
|
],
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderSwapsReq`](../internal/classes/internal.AdminPostOrdersOrderSwapsReq.mdx)",
|
|
"description": "The swap to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "additional_items",
|
|
"type": "[`AdditionalItem`](../internal/classes/internal.AdditionalItem-1.mdx)[]",
|
|
"description": "The new items to send to the Customer.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "quantity",
|
|
"type": "`number`",
|
|
"description": "The quantity of the Product Variant.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "variant_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Product Variant.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "allow_backorder",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, swaps can be completed with items out of stock",
|
|
"optional": true,
|
|
"defaultValue": "true",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "custom_shipping_options",
|
|
"type": "[`CustomShippingOption`](../internal/classes/internal.CustomShippingOption.mdx)[]",
|
|
"description": "An array of custom shipping options to potentially create a Shipping Method from to send the additional items.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "option_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Shipping Option.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The custom price of the Shipping Option.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, no notification will be sent to the customer related to this Swap.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "return_items",
|
|
"type": "[`ReturnItem`](../internal/classes/internal.ReturnItem.mdx)[]",
|
|
"description": "The Line Items to associate with the swap's return.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "item_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Line Item that will be returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "note",
|
|
"type": "`string`",
|
|
"description": "An optional note with information about the Return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "quantity",
|
|
"type": "`number`",
|
|
"description": "The number of items that will be returned",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "reason_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Return Reason to use.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "return_location_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the location used for the associated return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "return_shipping",
|
|
"type": "[`ReturnShipping`](../internal/classes/internal.ReturnShipping-2.mdx)",
|
|
"description": "The shipping method associated with the swap's return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "option_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping option used for the return.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The shipping method's price.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the sales channel associated with the swap.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `swaps` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### createSwapShipment
|
|
|
|
Create a shipment for a swap and mark its fulfillment as shipped. This changes the swap's fulfillment status to either `shipped` or `partially_shipped`, depending on
|
|
whether all the items were shipped.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.createSwapShipment(orderId, swapId, {
|
|
fulfillment_id,
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the swap belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swapId",
|
|
"type": "`string`",
|
|
"description": "The swap's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderSwapsSwapShipmentsReq`](../internal/classes/internal.AdminPostOrdersOrderSwapsSwapShipmentsReq.mdx)",
|
|
"description": "The shipment to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "fulfillment_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Fulfillment.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to true no notification will be sent related to this Claim.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tracking_numbers",
|
|
"type": "`string`[]",
|
|
"description": "The tracking numbers for the shipment.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `swaps` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### fulfillClaim
|
|
|
|
Create a Fulfillment for a Claim, and change its fulfillment status to `partially_fulfilled` or `fulfilled` depending on whether all the items were fulfilled.
|
|
It may also change the status to `requires_action` if any actions are required.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.fulfillClaim(orderId, claimId, {}).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the claim belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claimId",
|
|
"type": "`string`",
|
|
"description": "The claim's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderClaimsClaimFulfillmentsReq`](../internal/classes/internal.AdminPostOrdersOrderClaimsClaimFulfillmentsReq.mdx)",
|
|
"description": "The fulfillment to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "location_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the fulfillment's location.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, no notification will be sent to the customer related to this Claim.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `claims` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### fulfillSwap
|
|
|
|
Create a Fulfillment for a Swap and change its fulfillment status to `fulfilled`. If it requires any additional actions,
|
|
its fulfillment status may change to `requires_action`.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.fulfillSwap(orderId, swapId, {
|
|
no_notification: true,
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the swap belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swapId",
|
|
"type": "`string`",
|
|
"description": "The swap's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderSwapsSwapFulfillmentsReq`](../internal/classes/internal.AdminPostOrdersOrderSwapsSwapFulfillmentsReq.mdx)",
|
|
"description": "The fulfillment to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "location_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the fulfillment's location.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, no notification will be sent to the customer related to this swap.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `swaps` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### list
|
|
|
|
Retrieve a list of orders. The orders can be filtered by fields such as `status` or `display_id` passed in the `query` parameter. The order can also be paginated.
|
|
|
|
#### Example
|
|
|
|
To list orders:
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.list().then(({ orders, limit, offset, count }) => {
|
|
console.log(orders.length)
|
|
})
|
|
```
|
|
|
|
To specify relations that should be retrieved within the orders:
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.list({
|
|
expand: "customers",
|
|
})
|
|
.then(({ orders, limit, offset, count }) => {
|
|
console.log(orders.length)
|
|
})
|
|
```
|
|
|
|
By default, only the first `50` records are retrieved. You can control pagination by specifying the `limit` and `offset` properties:
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.list({
|
|
expand: "customers",
|
|
limit,
|
|
offset,
|
|
})
|
|
.then(({ orders, limit, offset, count }) => {
|
|
console.log(orders.length)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "query",
|
|
"type": "[`AdminGetOrdersParams`](../internal/classes/internal.AdminGetOrdersParams.mdx)",
|
|
"description": "Filters and pagination configurations applied on the retrieved orders.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "[`DateComparisonOperator`](../internal/classes/internal.DateComparisonOperator.mdx)",
|
|
"description": "Date filters to apply on the orders' `canceled_at` date.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "gt",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be greater than this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gte",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be greater than or equal to this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "lt",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be less than this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "lte",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be less than or equal to this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "Cart ID to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "[`DateComparisonOperator`](../internal/classes/internal.DateComparisonOperator.mdx)",
|
|
"description": "Date filters to apply on the orders' `created_at` date.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "gt",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be greater than this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gte",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be greater than or equal to this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "lt",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be less than this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "lte",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be less than or equal to this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "Currency code to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "Customer ID to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`string`",
|
|
"description": "Display ID to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "Email to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "expand",
|
|
"type": "`string`",
|
|
"description": "Comma-separated relations that should be expanded in the returned data.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fields",
|
|
"type": "`string`",
|
|
"description": "Comma-separated fields that should be included in the returned data.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "`string`[]",
|
|
"description": "Fulfillment statuses to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "ID to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"type": "`number`",
|
|
"description": "Limit the number of items returned in the list.",
|
|
"optional": false,
|
|
"defaultValue": "50",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "offset",
|
|
"type": "`number`",
|
|
"description": "The number of items to skip when retrieving a list.",
|
|
"optional": false,
|
|
"defaultValue": "0",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "`string`[]",
|
|
"description": "Payment statuses to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "q",
|
|
"type": "`string`",
|
|
"description": "Search term to search orders' shipping address, first name, email, and display ID.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string` \\| `string`[]",
|
|
"description": "Regions to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "`string`[]",
|
|
"description": "Sales channel IDs to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "`string`[]",
|
|
"description": "Statuses to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "`string`",
|
|
"description": "Tax rate to filter orders by.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "[`DateComparisonOperator`](../internal/classes/internal.DateComparisonOperator.mdx)",
|
|
"description": "Date filters to apply on the orders' `updated_at` date.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "gt",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be greater than this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gte",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be greater than or equal to this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "lt",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be less than this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "lte",
|
|
"type": "`Date`",
|
|
"description": "The filtered date must be less than or equal to this value.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersListRes`](../modules/internal.mdx#adminorderslistres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the list of orders with pagination fields.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersListRes",
|
|
"type": "[`PaginatedResponse`](../internal/interfaces/internal.PaginatedResponse.mdx) & { `orders`: [`Order`](../internal/classes/internal.Order.mdx)[] }",
|
|
"description": "The list of orders with pagination fields.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "count",
|
|
"type": "`number`",
|
|
"description": "The total number of items available.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"type": "`number`",
|
|
"description": "The maximum number of items that can be returned in the list.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "offset",
|
|
"type": "`number`",
|
|
"description": "The number of items skipped before the returned items in the list.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "orders",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)[]",
|
|
"description": "An array of order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### processSwapPayment
|
|
|
|
Process a swap's payment either by refunding or issuing a payment. This depends on the `difference_due` of the swap. If `difference_due` is negative, the amount is refunded.
|
|
If `difference_due` is positive, the amount is captured.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.processSwapPayment(orderId, swapId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the swap belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swapId",
|
|
"type": "`string`",
|
|
"description": "The swap's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `swaps` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### refundPayment
|
|
|
|
Refund an amount for an order. The amount must be less than or equal the `refundable_amount` of the order.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.refundPayment(orderId, {
|
|
amount: 1000,
|
|
reason: "Do not like it",
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order whose customer should be refunded.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderRefundsReq`](../internal/classes/internal.AdminPostOrdersOrderRefundsReq.mdx)",
|
|
"description": "The refund's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "amount",
|
|
"type": "`number`",
|
|
"description": "The amount to refund. It should be less than or equal the `refundable_amount` of the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, no notification will be sent to the customer related to this Refund.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "note",
|
|
"type": "`string`",
|
|
"description": "A note with additional details about the Refund.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "reason",
|
|
"type": "`string`",
|
|
"description": "The reason for the Refund.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### requestReturn
|
|
|
|
Request and create a return for items in an order. If the return shipping method is specified, it will be automatically fulfilled.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.requestReturn(orderId, {
|
|
items: [
|
|
{
|
|
item_id,
|
|
quantity: 1,
|
|
},
|
|
],
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderReturnsReq`](../internal/classes/internal.AdminPostOrdersOrderReturnsReq.mdx)",
|
|
"description": "The return to be created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "items",
|
|
"type": "[`OrdersReturnItem`](../internal/classes/internal.OrdersReturnItem.mdx)[]",
|
|
"description": "The line items that will be returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "item_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Line Item.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "note",
|
|
"type": "`string`",
|
|
"description": "An optional note with information about the Return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "quantity",
|
|
"type": "`number`",
|
|
"description": "The quantity of the Line Item.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "reason_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Return Reason to use.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "location_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the location used for the return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, no notification will be sent to the customer related to this Return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "note",
|
|
"type": "`string`",
|
|
"description": "An optional note with information about the Return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "receive_now",
|
|
"type": "`boolean`",
|
|
"description": "A flag to indicate if the Return should be registerd as received immediately.",
|
|
"optional": true,
|
|
"defaultValue": "false",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refund",
|
|
"type": "`number`",
|
|
"description": "The amount to refund.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "return_shipping",
|
|
"type": "[`ReturnShipping`](../internal/classes/internal.ReturnShipping-1.mdx)",
|
|
"description": "The Shipping Method to be used to handle the return shipment.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "option_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping option used for the return.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The shipping method's price.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the return under the `returns` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### retrieve
|
|
|
|
Retrieve an order's details.
|
|
|
|
#### Example
|
|
|
|
A simple example that retrieves an order by its ID:
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders.retrieve(orderId).then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
To specify relations that should be retrieved:
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.retrieve(orderId, {
|
|
expand: "customer",
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "query",
|
|
"type": "[`FindParams`](../internal/classes/internal.FindParams.mdx)",
|
|
"description": "Configurations to apply on the retrieved order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "expand",
|
|
"type": "`string`",
|
|
"description": "Comma-separated relations that should be expanded in the returned data.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fields",
|
|
"type": "`string`",
|
|
"description": "Comma-separated fields that should be included in the returned data.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### update
|
|
|
|
Update and order's details.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.update(orderId, {
|
|
email: "user@example.com",
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderReq`](../internal/classes/internal.AdminPostOrdersOrderReq.mdx)",
|
|
"description": "The attributes to update in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`AddressPayload`](../internal/classes/internal.AddressPayload.mdx)",
|
|
"description": "The order's billing address",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "address_1",
|
|
"type": "`string`",
|
|
"description": "Address line 1",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "address_2",
|
|
"type": "`string`",
|
|
"description": "Address line 2",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "city",
|
|
"type": "`string`",
|
|
"description": "City",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "company",
|
|
"type": "`string`",
|
|
"description": "Company",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "country_code",
|
|
"type": "`string`",
|
|
"description": "The 2 character ISO code of the country in lower case",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "first_name",
|
|
"type": "`string`",
|
|
"description": "First name",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "last_name",
|
|
"type": "`string`",
|
|
"description": "Last name",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "phone",
|
|
"type": "`string`",
|
|
"description": "Phone Number",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "postal_code",
|
|
"type": "`string`",
|
|
"description": "Postal Code",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "province",
|
|
"type": "`string`",
|
|
"description": "Province",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "Record<`string`, `unknown`\\>[]",
|
|
"description": "The discounts applied to the order",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "Record<`string`, `unknown`\\>[]",
|
|
"description": "The line items of the order",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to `true`, no notification will be sent to the customer related to this order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_method",
|
|
"type": "[`PaymentMethod`](../internal/classes/internal.PaymentMethod.mdx)",
|
|
"description": "The payment method chosen for the order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "data",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "The data to attach to the payment.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "provider_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the payment provider used in the order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "`string`",
|
|
"description": "ID of the region that the order is associated with.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`AddressPayload`](../internal/classes/internal.AddressPayload.mdx)",
|
|
"description": "The order's shipping address",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "address_1",
|
|
"type": "`string`",
|
|
"description": "Address line 1",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "address_2",
|
|
"type": "`string`",
|
|
"description": "Address line 2",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "city",
|
|
"type": "`string`",
|
|
"description": "City",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "company",
|
|
"type": "`string`",
|
|
"description": "Company",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "country_code",
|
|
"type": "`string`",
|
|
"description": "The 2 character ISO code of the country in lower case",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "first_name",
|
|
"type": "`string`",
|
|
"description": "First name",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "last_name",
|
|
"type": "`string`",
|
|
"description": "Last name",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "phone",
|
|
"type": "`string`",
|
|
"description": "Phone Number",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "postal_code",
|
|
"type": "`string`",
|
|
"description": "Postal Code",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "province",
|
|
"type": "`string`",
|
|
"description": "Province",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "shipping_method",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-1.mdx)[]",
|
|
"description": "The Shipping Method used for shipping the order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "data",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "The data to attach to the shipping method.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "Record<`string`, `unknown`\\>[]",
|
|
"description": "The line items associated with this shipping methods.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The price of the shipping method.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "profile_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping profile used in the order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "provider_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping provider used in the order.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|
|
|
|
___
|
|
|
|
### updateClaim
|
|
|
|
Update a claim's details.
|
|
|
|
#### Example
|
|
|
|
```ts
|
|
import Medusa from "@medusajs/medusa-js"
|
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
|
// must be previously logged in or use api token
|
|
medusa.admin.orders
|
|
.updateClaim(orderId, claimId, {
|
|
no_notification: true,
|
|
})
|
|
.then(({ order }) => {
|
|
console.log(order.id)
|
|
})
|
|
```
|
|
|
|
#### Parameters
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the order that the claim belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claimId",
|
|
"type": "`string`",
|
|
"description": "The claim's ID.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payload",
|
|
"type": "[`AdminPostOrdersOrderClaimsClaimReq`](../internal/classes/internal.AdminPostOrdersOrderClaimsClaimReq.mdx)",
|
|
"description": "The attributes to update in the claim.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "claim_items",
|
|
"type": "[`Item`](../internal/classes/internal.Item-6.mdx)[]",
|
|
"description": "The Claim Items that the Claim will consist of.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Claim Item.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "images",
|
|
"type": "[`Image`](../internal/classes/internal.Image.mdx)[]",
|
|
"description": "A list of image URL's that will be associated with the Claim",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "Image ID",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "url",
|
|
"type": "`string`",
|
|
"description": "Image URL",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "note",
|
|
"type": "`string`",
|
|
"description": "Short text describing the Claim Item in further detail.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "reason",
|
|
"type": "`string`",
|
|
"description": "The reason for the Claim",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tags",
|
|
"type": "[`Tag`](../internal/classes/internal.Tag.mdx)[]",
|
|
"description": "A list o tags to add to the Claim Item",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "Tag ID",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "value",
|
|
"type": "`string`",
|
|
"description": "Tag value",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "If set to true no notification will be send related to this Swap.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-3.mdx)[]",
|
|
"description": "The Shipping Methods to send the additional Line Items with.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "data",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional set of key-value pairs to hold additional information.",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The ID of an existing Shipping Method",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "option_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the Shipping Option to create a Shipping Method from",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "price",
|
|
"type": "`number`",
|
|
"description": "The price to charge for the Shipping Method",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"name": "customHeaders",
|
|
"type": "Record<`string`, `any`\\>",
|
|
"description": "Custom headers to attach to the request.",
|
|
"optional": false,
|
|
"defaultValue": "{}",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]} />
|
|
|
|
#### Returns
|
|
|
|
<ParameterTypes parameters={[
|
|
{
|
|
"name": "ResponsePromise",
|
|
"type": "[`ResponsePromise`](../modules/internal.mdx#responsepromise)<[`AdminOrdersRes`](../modules/internal.mdx#adminordersres)\\>",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"description": "Resolves to the order's details. You can access the swap under the `claims` property.",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "AdminOrdersRes",
|
|
"type": "`object`",
|
|
"description": "The order's details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "order",
|
|
"type": "[`Order`](../internal/classes/internal.Order.mdx)",
|
|
"description": "Order details.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": [
|
|
{
|
|
"name": "billing_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the billing address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "billing_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the billing address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "canceled_at",
|
|
"type": "`Date`",
|
|
"description": "The date the order was canceled on.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart",
|
|
"type": "[`Cart`](../internal/classes/internal.Cart.mdx)",
|
|
"description": "The details of the cart associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "cart_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the cart associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "claims",
|
|
"type": "[`ClaimOrder`](../internal/classes/internal.ClaimOrder.mdx)[]",
|
|
"description": "The details of the claims created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "created_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was created.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"type": "[`Currency`](../internal/classes/internal.Currency.mdx)",
|
|
"description": "The details of the currency used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "currency_code",
|
|
"type": "`string`",
|
|
"description": "The 3 character currency code that is used in the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer",
|
|
"type": "[`Customer`](../internal/classes/internal.Customer.mdx)",
|
|
"description": "The details of the customer associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "customer_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the customer associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount rounded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "discounts",
|
|
"type": "[`Discount`](../internal/classes/internal.Discount-1.mdx)[]",
|
|
"description": "The details of the discounts applied on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "display_id",
|
|
"type": "`number`",
|
|
"description": "The order's display ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order",
|
|
"type": "[`DraftOrder`](../internal/classes/internal.DraftOrder.mdx)",
|
|
"description": "The details of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "draft_order_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the draft order this order was created from.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "edits",
|
|
"type": "[`OrderEdit`](../internal/classes/internal.OrderEdit.mdx)[]",
|
|
"description": "The details of the order edits done on the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "email",
|
|
"type": "`string`",
|
|
"description": "The email associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "external_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of an external order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillment_status",
|
|
"type": "[`FulfillmentStatus`](../internal/enums/internal.FulfillmentStatus.mdx)",
|
|
"description": "The order's fulfillment status",
|
|
"optional": false,
|
|
"defaultValue": "not_fulfilled",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "fulfillments",
|
|
"type": "[`Fulfillment`](../internal/classes/internal.Fulfillment.mdx)[]",
|
|
"description": "The details of the fulfillments created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_tax_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards with taxes",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_total",
|
|
"type": "`number`",
|
|
"description": "The total of gift cards",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_card_transactions",
|
|
"type": "[`GiftCardTransaction`](../internal/classes/internal.GiftCardTransaction.mdx)[]",
|
|
"description": "The gift card transactions made in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "gift_cards",
|
|
"type": "[`GiftCard`](../internal/classes/internal.GiftCard-1.mdx)[]",
|
|
"description": "The details of the gift card used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "id",
|
|
"type": "`string`",
|
|
"description": "The order's ID",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "idempotency_key",
|
|
"type": "`string`",
|
|
"description": "Randomly generated key used to continue the processing of the order in case of failure.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "item_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on items",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that belong to the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "metadata",
|
|
"type": "Record<`string`, `unknown`\\>",
|
|
"description": "An optional key-value map with additional details",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "no_notification",
|
|
"type": "`boolean`",
|
|
"description": "Flag for describing whether or not notifications related to this should be send.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "paid_total",
|
|
"type": "`number`",
|
|
"description": "The total amount paid",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payment_status",
|
|
"type": "[`PaymentStatus`](../internal/enums/internal.PaymentStatus.mdx)",
|
|
"description": "The order's payment status",
|
|
"optional": false,
|
|
"defaultValue": "not_paid",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "payments",
|
|
"type": "[`Payment`](../internal/classes/internal.Payment.mdx)[]",
|
|
"description": "The details of the payments used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "raw_discount_total",
|
|
"type": "`number`",
|
|
"description": "The total of discount",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refundable_amount",
|
|
"type": "`number`",
|
|
"description": "The amount that can be refunded",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunded_total",
|
|
"type": "`number`",
|
|
"description": "The total amount refunded if the order is returned.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "refunds",
|
|
"type": "[`Refund`](../internal/classes/internal.Refund.mdx)[]",
|
|
"description": "The details of the refunds created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region",
|
|
"type": "[`Region`](../internal/classes/internal.Region.mdx)",
|
|
"description": "The details of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "region_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the region this order was created in.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returnable_items",
|
|
"type": "[`LineItem`](../internal/classes/internal.LineItem.mdx)[]",
|
|
"description": "The details of the line items that are returnable as part of the order, swaps, or claims",
|
|
"optional": true,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "returns",
|
|
"type": "[`Return`](../internal/classes/internal.Return.mdx)[]",
|
|
"description": "The details of the returns created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel",
|
|
"type": "[`SalesChannel`](../internal/classes/internal.SalesChannel.mdx)",
|
|
"description": "The details of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "sales_channel_id",
|
|
"type": "``null`` \\| `string`",
|
|
"description": "The ID of the sales channel this order belongs to.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address",
|
|
"type": "[`Address`](../internal/classes/internal.Address.mdx)",
|
|
"description": "The details of the shipping address associated with the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_address_id",
|
|
"type": "`string`",
|
|
"description": "The ID of the shipping address associated with the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_methods",
|
|
"type": "[`ShippingMethod`](../internal/classes/internal.ShippingMethod-4.mdx)[]",
|
|
"description": "The details of the shipping methods used in the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The tax total applied on shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "shipping_total",
|
|
"type": "`number`",
|
|
"description": "The total of shipping",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "status",
|
|
"type": "[`OrderStatus`](../internal/enums/internal.OrderStatus.mdx)",
|
|
"description": "The order's status",
|
|
"optional": false,
|
|
"defaultValue": "pending",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "subtotal",
|
|
"type": "`number`",
|
|
"description": "The subtotal of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "swaps",
|
|
"type": "[`Swap`](../internal/classes/internal.Swap.mdx)[]",
|
|
"description": "The details of the swaps created for the order.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": true,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_rate",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The order's tax rate",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "tax_total",
|
|
"type": "``null`` \\| `number`",
|
|
"description": "The total of tax",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "total",
|
|
"type": "`number`",
|
|
"description": "The total amount of the order",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
},
|
|
{
|
|
"name": "updated_at",
|
|
"type": "`Date`",
|
|
"description": "The date with timezone at which the resource was updated.",
|
|
"optional": false,
|
|
"defaultValue": "",
|
|
"expandable": false,
|
|
"children": []
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]} />
|