docs: generate + configure js sdk reference (#9714)
Manually generate the JS SDK reference + add it to the sidebar
This commit is contained in:
1 parent
af3c6b0d93
commit
a1190b7208
476 files changed
+76450
-189
No files matched your search
+31
@@ -0,0 +1,31 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addInboundItems
|
||||
|
||||
This method adds inbound (or return) items to an exchange. These inbound items will
|
||||
have the action `RETURN_ITEM`.
|
||||
|
||||
This method sends a request to the [Add Inbound Items](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidinbounditems)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.addInboundItems("exchange_123", {
|
||||
items: [{
|
||||
id: "orli_123",
|
||||
quantity: 1
|
||||
}]
|
||||
})
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminAddExchangeInboundItems](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminAddExchangeInboundItems/page.mdx)","description":"The items to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reason","type":"[ExchangeReason](../../../../../types/enums/types.ExchangeReason/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the return.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addInboundItems"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated with the exchange, with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangeReturnResponse","type":"[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"received_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ReturnStatus](../../../../../order/types/order.ReturnStatus-1/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addInboundItems"/>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addInboundShipping
|
||||
|
||||
This method adds an inbound (or return) shipping method to an exchange.
|
||||
The inbound shipping method will have a `SHIPPING_ADD` action.
|
||||
|
||||
This method sends a request to the [Add Inbound Shipping](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidinboundshippingmethod)
|
||||
API route.
|
||||
|
||||
This method sends a request to the [Add Inbound Shipping](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidinboundshippingmethod)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.addInboundShipping("exchange_123", {
|
||||
shipping_option_id: "so_123"
|
||||
})
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminExchangeAddInboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeAddInboundShipping/page.mdx)","description":"The shipping method's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_option_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the return.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addInboundShipping"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated with the exchange, with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangeReturnResponse","type":"[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"received_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ReturnStatus](../../../../../order/types/order.ReturnStatus-1/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addInboundShipping"/>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addOutboundItems
|
||||
|
||||
This method adds outbound (or new) items to an exchange.
|
||||
These outbound items will have the action `ITEM_ADD`.
|
||||
|
||||
This method sends a request to the [Add Outbound Items](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidoutbounditems)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.addOutboundItems("exchange_123", {
|
||||
items: [{
|
||||
id: "variant_123",
|
||||
quantity: 1
|
||||
}]
|
||||
})
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminAddExchangeOutboundItems](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminAddExchangeOutboundItems/page.mdx)","description":"The items to add.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"`object`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"reason","type":"[ExchangeReason](../../../../../types/enums/types.ExchangeReason/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addOutboundItems"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangePreviewResponse","type":"[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addOutboundItems"/>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addOutboundShipping
|
||||
|
||||
This method adds an outbound shipping method to an exchange. The outbound shipping method
|
||||
will have a `SHIPPING_ADD` action.
|
||||
|
||||
This method sends a request to the [Add Outbound Shipping](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidoutboundshippingmethod)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.addOutboundShipping("exchange_123", {
|
||||
shipping_option_id: "so_123"
|
||||
})
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminExchangeAddOutboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeAddOutboundShipping/page.mdx)","description":"The shipping method's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"shipping_option_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"custom_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addOutboundShipping"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangePreviewResponse","type":"[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="addOutboundShipping"/>
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# cancel
|
||||
|
||||
This method cancels an exchange. It sends a request to the
|
||||
[Cancel Exchange](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidcancel) API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.cancel("exchange_123")
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="cancel"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details.","expandable":false,"children":[{"name":"AdminExchangeResponse","type":"[AdminExchangeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="cancel"/>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# cancelRequest
|
||||
|
||||
This method cancels an exchange request. It sends a request to the
|
||||
[Cancel Exchange Request](https://docs.medusajs.com/v2/api/admin#exchanges\_deleteexchangesidrequest)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.cancel("exchange_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="cancelRequest"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The cancelation's details.","expandable":false,"children":[{"name":"AdminExchangeDeleteResponse","type":"[AdminExchangeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"exchange\"`","description":"The type of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted","type":"`boolean`","description":"Whether the item was deleted successfully.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="cancelRequest"/>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# create
|
||||
|
||||
This method creates an admin exchange. It sends a request to the
|
||||
[Create Exchange](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchanges) API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.create({
|
||||
order_id: "order_123"
|
||||
})
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateExchange/page.mdx)","description":"The exchange's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"`\"replace\"` \\| `\"refund\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details.","expandable":false,"children":[{"name":"AdminExchangeResponse","type":"[AdminExchangeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# deleteInboundShipping
|
||||
|
||||
This method removes the shipping method for returning items in the exchange using the ID
|
||||
of the method's `SHIPPING_ADD` action.
|
||||
|
||||
Every shipping method has an `actions` property, whose value is an array of actions.
|
||||
You can check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Remove Inbound Shipping](https://docs.medusajs.com/v2/api/admin#exchanges\_deleteexchangesidinboundshippingmethodaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.deleteInboundShipping(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the shipping method's `SHIPPING_ADD` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the return.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteInboundShipping"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated with the exchange, with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangeReturnResponse","type":"[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"received_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ReturnStatus](../../../../../order/types/order.ReturnStatus-1/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteInboundShipping"/>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# deleteOutboundShipping
|
||||
|
||||
This method removes the shipping method for delivering outbound items in the exchange using
|
||||
the ID of the method's `SHIPPING_ADD` action.
|
||||
|
||||
Every shipping method has an `actions` property, whose value is an array of actions.
|
||||
You can check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Remove Outbound Shipping](https://docs.medusajs.com/v2/api/admin#exchanges\_deleteexchangesidoutboundshippingmethodaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.deleteOutboundShipping(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the shipping method's `SHIPPING_ADD` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteOutboundShipping"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangePreviewResponse","type":"[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteOutboundShipping"/>
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a paginated list of exchanges. It sends a request to the
|
||||
[List Exchanges](https://docs.medusajs.com/v2/api/admin#exchanges\_getexchanges)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of exchanges:
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.list()
|
||||
.then(({ exchanges, count, limit, offset }) => {
|
||||
console.log(exchanges)
|
||||
})
|
||||
```
|
||||
|
||||
To configure the pagination, pass the `limit` and `offset` query parameters.
|
||||
|
||||
For example, to retrieve only 10 items and skip 10 items:
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ exchanges, count, limit, offset }) => {
|
||||
console.log(exchanges)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each exchange:
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.list({
|
||||
fields: "id,*order"
|
||||
})
|
||||
.then(({ exchanges, count, limit, offset }) => {
|
||||
console.log(exchanges)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"query","type":"[AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminExchangeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilteLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminExchangeListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of exchanges.","expandable":false,"children":[{"name":"AdminExchangeListResponse","type":"[AdminExchangeListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminExchangeListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# removeInboundItem
|
||||
|
||||
This method removes an inbound (or return) item from an exchange using the ID of the
|
||||
item's `RETURN_ITEM` action.
|
||||
|
||||
Every item has an `actions` property, whose value is an array of actions.
|
||||
You can check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Remove Inbound Item](https://docs.medusajs.com/v2/api/admin#exchanges\_deleteexchangesidinbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.removeInboundItem(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the return item's `RETURN_ITEM` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the return.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeInboundItem"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated with the exchange, with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangeReturnResponse","type":"[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"received_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ReturnStatus](../../../../../order/types/order.ReturnStatus-1/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeInboundItem"/>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# removeOutboundItem
|
||||
|
||||
This method removes an outbound (or new) item from an exchange using the ID
|
||||
of the item's `ITEM_ADD` action.
|
||||
|
||||
Every item has an `actions` property, whose value is an array of actions.
|
||||
You can check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Update Outbound Item](https://docs.medusajs.com/v2/api/admin#exchanges\_deleteexchangesidoutbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.removeOutboundItem(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the new exchange item's `ITEM_ADD` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeOutboundItem"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangePreviewResponse","type":"[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="removeOutboundItem"/>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# request
|
||||
|
||||
This method confirms an exchange request, applying its changes on the associated order.
|
||||
|
||||
This method sends a request to the [Confirm Exchange](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidrequest)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.request("exchange_123", {})
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminRequestExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRequestExchange/page.mdx)","description":"The confirmation's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="request"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeRequestResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeRequestResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange and associated return's details with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangeRequestResponse","type":"[AdminExchangeRequestResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeRequestResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"received_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children"Line truncated
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves an exchange by its ID. It sends a request to the
|
||||
[Get Exchange](https://docs.medusajs.com/v2/api/admin#exchanges\_getexchangesid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve an exchange by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.retrieve("exchange_123")
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.retrieve("exchange_123", {
|
||||
fields: "id,*order"
|
||||
})
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details.","expandable":false,"children":[{"name":"AdminExchangeResponse","type":"[AdminExchangeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateInboundItem
|
||||
|
||||
This method updates an inbound (or return) item from an exchange using the ID of
|
||||
the item's `RETURN_ITEM` action.
|
||||
|
||||
Every item has an `actions` property, whose value is an array of actions. You can
|
||||
check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Update Inbound Item](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidinbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.updateInboundItem(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
quantity: 1
|
||||
}
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the return item's `RETURN_ITEM` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateExchangeInboundItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateExchangeInboundItem/page.mdx)","description":"The details to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"quantity","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reason_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the return.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateInboundItem"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated with the exchange, with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangeReturnResponse","type":"[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"received_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ReturnStatus](../../../../../order/types/order.ReturnStatus-1/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateInboundItem"/>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateInboundShipping
|
||||
|
||||
This method updates the shipping method for returning items in the exchange using the ID
|
||||
of the method's `SHIPPING_ADD` action.
|
||||
|
||||
Every shipping method has an `actions` property, whose value is an array of actions.
|
||||
You can check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Update Inbound Shipping](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidinboundshippingmethodaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.updateInboundShipping(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
custom_amount: 10
|
||||
}
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the shipping method's `SHIPPING_ADD` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminExchangeUpdateInboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeUpdateInboundShipping/page.mdx)","description":"The details to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"custom_amount","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the return.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateInboundShipping"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated with the exchange, with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangeReturnResponse","type":"[AdminExchangeReturnResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeReturnResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"received_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ReturnStatus](../../../../../order/types/order.ReturnStatus-1/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateInboundShipping"/>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateOutboundItem
|
||||
|
||||
This method updates an outbound (or new) item from an exchange using the ID
|
||||
of the item's `ITEM_ADD` action.
|
||||
|
||||
Every item has an `actions` property, whose value is an array of actions.
|
||||
You can check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Update Inbound Item](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidoutbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.updateOutboundItem(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
quantity: 1
|
||||
}
|
||||
)
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the new exchange item's `ITEM_ADD` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateExchangeOutboundItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateExchangeOutboundItem/page.mdx)","description":"The item's details to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"quantity","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"reason_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOutboundItem"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangePreviewResponse","type":"[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOutboundItem"/>
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateOutboundShipping
|
||||
|
||||
This method updates the shipping method for delivering outbound items in the exchange using
|
||||
the ID of the method's `SHIPPING_ADD` action.
|
||||
|
||||
Every shipping method has an `actions` property, whose value is an array of actions.
|
||||
You can check the action's name using its `action` property, and use the value of the `id` property.
|
||||
|
||||
This method sends a request to the [Update Outbound Shipping](https://docs.medusajs.com/v2/api/admin#exchanges\_postexchangesidoutboundshippingmethodaction\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.exchange.updateOutboundShipping(
|
||||
"exchange_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
custom_amount: 10
|
||||
}
|
||||
)
|
||||
.then(({ exchange }) => {
|
||||
console.log(exchange)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The exchange's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the shipping method's `SHIPPING_ADD` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminExchangeUpdateOutboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangeUpdateOutboundShipping/page.mdx)","description":"The details to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"custom_amount","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the exchange.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOutboundShipping"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The exchange's details with a preview of the order when the exchange is applied.","expandable":false,"children":[{"name":"AdminExchangePreviewResponse","type":"[AdminExchangePreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchangePreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_items","type":"[BaseExchangeItem](../../../../../types/interfaces/types.BaseExchangeItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_items","type":"[AdminReturnItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturnItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"difference_due","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`BaseOrder`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`BaseOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOutboundShipping"/>
|
||||
+223
@@ -0,0 +1,223 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# client
|
||||
|
||||
## baseUrl
|
||||
|
||||
___
|
||||
|
||||
## globalHeaders
|
||||
|
||||
### tags
|
||||
|
||||
Tags to cache data under for Next.js applications.
|
||||
|
||||
Learn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).
|
||||
|
||||
___
|
||||
|
||||
## publishableKey
|
||||
|
||||
___
|
||||
|
||||
## apiKey
|
||||
|
||||
___
|
||||
|
||||
## auth
|
||||
|
||||
### type
|
||||
|
||||
### jwtTokenStorageKey
|
||||
|
||||
### jwtTokenStorageMethod
|
||||
|
||||
### type
|
||||
|
||||
### jwtTokenStorageKey
|
||||
|
||||
### jwtTokenStorageMethod
|
||||
|
||||
___
|
||||
|
||||
## logger
|
||||
|
||||
### error
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### warn
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### info
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### debug
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
#### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## debug
|
||||
|
||||
## error
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## warn
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## info
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## debug
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
## constructor
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"config","type":"[Config](../../../types/js_sdk.admin.Config/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"baseUrl","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"globalHeaders","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"publishableKey","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apiKey","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"auth","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"`\"jwt\"` \\| `\"session\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtTokenStorageKey","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtTokenStorageMethod","type":"`\"local\"` \\| `\"session\"` \\| `\"memory\"` \\| `\"nostore\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"logger","type":"[Logger](../../../types/js_sdk.admin.Logger/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"error","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"warn","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"info","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"debug","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"debug","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="new Client"/>
|
||||
|
||||
___
|
||||
|
||||
`fetch` closely follows (and uses under the hood) the native `fetch` API. There are, however, few key differences:
|
||||
- Non 2xx statuses throw a `FetchError` with the status code as the `status` property, rather than resolving the promise
|
||||
- You can pass `body` and `query` as objects, and they will be encoded and stringified.
|
||||
- The response gets parsed as JSON if the `accept` header is set to `application/json`, otherwise the raw Response object is returned
|
||||
|
||||
Since the response is dynamically determined, we cannot know if it is JSON or not. Therefore, it is important to pass `Response` as the return type
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"`unknown`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetch"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"input","type":"`string` \\| `URL` \\| `Request`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"init","type":"[FetchArgs](../../../types/js_sdk.admin.FetchArgs/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"query","type":"`Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"body","type":"`RequestInit`[`\"body\"`] \\| `Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetch"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<T>","optional":false,"defaultValue":"","description":"Promise<T>","expandable":false,"children":[{"name":"T","type":"T","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetch"/>
|
||||
|
||||
`fetchStream` is a helper method to deal with server-sent events. It returns an object with a stream and an abort function.
|
||||
It follows a very similar interface to `fetch`, with the return value being an async generator.
|
||||
The stream is an async generator that yields `ServerSentEventMessage` objects, which contains the event name, stringified data, and few other properties.
|
||||
The caller is responsible for handling `disconnect` events and aborting the stream. The caller is also responsible for parsing the data field.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"input","type":"`string` \\| `URL` \\| `Request`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"init","type":"[FetchArgs](../../../types/js_sdk.admin.FetchArgs/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"query","type":"`Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"body","type":"`RequestInit`[`\"body\"`] \\| `Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetchStream"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[FetchStreamResponse](../../../interfaces/js_sdk.admin.FetchStreamResponse/page.mdx)>","optional":false,"defaultValue":"","description":"FetchStreamResponse","expandable":false,"children":[{"name":"FetchStreamResponse","type":"[FetchStreamResponse](../../../interfaces/js_sdk.admin.FetchStreamResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"stream","type":"`null` \\| AsyncGenerator<[ServerSentEventMessage](../../../interfaces/js_sdk.admin.ServerSentEventMessage/page.mdx), void, unknown>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"comment","type":"`string`","description":"Ignored by the client.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"event","type":"`string`","description":"A string identifying the type of event described.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`string`","description":"The data field for the message. Split by new lines.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `number`","description":"The event ID to set the EventSource object's last event ID value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"retry","type":"`number`","description":"The reconnection time.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"abort","type":"() => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetchStream"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"token","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="clearToken"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="clearToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"ClientFetch","type":"(`input`: [FetchInput](../../../types/js_sdk.admin.FetchInput/page.mdx), `init?`: [FetchArgs](../../../types/js_sdk.admin.FetchArgs/page.mdx)) => Promise<Response>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="initClient"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"object \\| object","type":"`object` \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getApiKeyHeader_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"object \\| object","type":"`object` \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getPublishableKeyHeader_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"object \\| object","type":"`object` \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getJwtHeader_"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"token","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"void","type":"`void`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"undefined \\| null \\| string","type":"`undefined` \\| `null` \\| `string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"storageMethod","type":"`\"session\"` \\| `\"local\"` \\| `\"memory\"` \\| `\"nostore\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"storageKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getTokenStorageInfo_"/>
|
||||
|
||||
<TypeList types={[{"name":"storageMethod","type":"`\"session\"` \\| `\"local\"` \\| `\"memory\"` \\| `\"nostore\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"storageKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getTokenStorageInfo_"/>
|
||||
Reference in new issue
Block a user