docs: generate + configure js sdk reference (#9714)
Manually generate the JS SDK reference + add it to the sidebar
This commit is contained in:
+35
@@ -0,0 +1,35 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addInboundItems
|
||||
|
||||
This method adds inbound (or return) items to the claim. These inbound items will have a `RETURN_ITEM` action.
|
||||
|
||||
This method sends a request to the [Add Inbound Items](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidinbounditems)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.addInboundItems(
|
||||
"claim_123",
|
||||
{
|
||||
items: [
|
||||
{
|
||||
id: "orli_123",
|
||||
quantity: 1
|
||||
}
|
||||
]
|
||||
},
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the claim to add the inbound items to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminAddClaimInboundItems](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminAddClaimInboundItems/page.mdx)","description":"The inbound items' details.","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":"[ClaimReason](../../../../../types/enums/types.ClaimReason/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<[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated with the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimReturnPreviewResponse","type":"[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/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"/>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addInboundShipping
|
||||
|
||||
This method adds an inbound (or return) shipping method to a claim.
|
||||
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#claims\_postclaimsidinboundshippingmethod)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.addInboundShipping(
|
||||
"claim_123",
|
||||
{
|
||||
shipping_option_id: "so_123",
|
||||
custom_amount: 10
|
||||
},
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminClaimAddInboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimAddInboundShipping/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<[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated wth the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimReturnPreviewResponse","type":"[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/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"/>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addItems
|
||||
|
||||
This method adds items to the claim. It sends a request to the
|
||||
[Add Items](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidclaimitems) API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.addItems("claim_123", {
|
||||
items: [
|
||||
{
|
||||
id: "orli_123",
|
||||
quantity: 1
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the claim to add the items to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminAddClaimItems](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminAddClaimItems/page.mdx)","description":"The items' details.","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":"[ClaimReason](../../../../../types/enums/types.ClaimReason/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 claim.","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="addItems"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The claim's details with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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="addItems"/>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addOutboundItems
|
||||
|
||||
This method adds outbound (or new) items to a claim. These outbound items will have an `ITEM_ADD` action.
|
||||
It sends a request to the [Add Outbound Items](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidoutbounditems)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.addOutboundItems(
|
||||
"claim_123",
|
||||
{
|
||||
items: [{
|
||||
id: "orli_123",
|
||||
quantity: 1
|
||||
}]
|
||||
},
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the claim to add the outbound items to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminAddClaimOutboundItems](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminAddClaimOutboundItems/page.mdx)","description":"The items' details.","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":"[ClaimReason](../../../../../types/enums/types.ClaimReason/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 claim.","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<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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"/>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# addOutboundShipping
|
||||
|
||||
This method adds outbound an outbound shipping method to a claim.
|
||||
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#claims\_postclaimsidoutboundshippingmethod)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
* sdk.admin.claim.addOutboundShipping(
|
||||
"claim_123",
|
||||
{
|
||||
shipping_option_id: "so_123",
|
||||
custom_amount: 10
|
||||
},
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminClaimAddOutboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimAddOutboundShipping/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 claim.","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<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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 a claim. It sends a request to the
|
||||
[Cancel Claim](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidcancel) API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.cancel("claim_123")
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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 claim.","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<[AdminClaimResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The claim's details.","expandable":false,"children":[{"name":"AdminClaimResponse","type":"[AdminClaimResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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"/>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# cancelRequest
|
||||
|
||||
This method cancels a requested claim. It sends a request to the
|
||||
[Cancel Claim Request](https://docs.medusajs.com/v2/api/admin#claims\_deleteclaimsidrequest)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.cancelRequest(
|
||||
"claim_123",
|
||||
)
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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 claim.","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<[AdminClaimDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The cancelation's details.","expandable":false,"children":[{"name":"AdminClaimDeleteResponse","type":"[AdminClaimDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimDeleteResponse/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":"`\"claim\"`","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"/>
|
||||
+26
File diff suppressed because one or more lines are too long
+30
@@ -0,0 +1,30 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# deleteInboundShipping
|
||||
|
||||
This method deletes a shipping method for returning items in the claim using the ID of the method's `SHIPPING_ADD` action.
|
||||
It sends a request to the [Remove Inbound Shipping](https://docs.medusajs.com/v2/api/admin#claims\_deleteclaimsidinboundshippingmethodaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.deleteInboundShipping(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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<[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated wth the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimReturnPreviewResponse","type":"[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/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"/>
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# deleteOutboundShipping
|
||||
|
||||
This method deletes the shipping method for delivering outbound items in the claim 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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.deleteOutboundShipping(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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 claim.","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<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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"/>
|
||||
+53
File diff suppressed because one or more lines are too long
+30
@@ -0,0 +1,30 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# removeInboundItem
|
||||
|
||||
This method removes an inbound (or return) item from a claim using the ID of the item's `RETURN_ITEM` action.
|
||||
It sends a request to the [Remove Inbound Item](https://docs.medusajs.com/v2/api/admin#claims\_deleteclaimsidinbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.removeInboundItem(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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<[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated wth the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimReturnPreviewResponse","type":"[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/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"/>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# removeItem
|
||||
|
||||
This method removes a claim item from a claim by the ID of the item's `WRITE_OFF_ITEM` action.
|
||||
It sends a request to the [Remove Claim Item](https://docs.medusajs.com/v2/api/admin#claims\_deleteclaimsidclaimitemsaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.removeItem(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the order item's `WRITE_OFF_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 claim.","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="removeItem"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The claim's details with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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="removeItem"/>
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# removeOutboundItem
|
||||
|
||||
This method removes an outbound (or new) item from a claim using the ID of the item's `ITEM_ADD` action.
|
||||
It sends a request to the [Remove Outbound Item](https://docs.medusajs.com/v2/api/admin#claims\_deleteclaimsidoutbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.removeOutboundItem(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the new claim 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 claim.","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<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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"/>
|
||||
+27
File diff suppressed because one or more lines are too long
+38
@@ -0,0 +1,38 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves a claim. It sends a request to the
|
||||
[Get Claim](https://docs.medusajs.com/v2/api/admin#claims\_getclaimsid) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a claim by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.retrieve("claim_123")
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.retrieve("claim_123", {
|
||||
fields: "id,*additional_items"
|
||||
})
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
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 claim'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 claim.","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<[AdminClaimResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The claim's details.","expandable":false,"children":[{"name":"AdminClaimResponse","type":"[AdminClaimResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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"/>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateInboundItem
|
||||
|
||||
This method updates an inbound (or return) item of a claim using the ID of the item's `RETURN_ITEM` action.
|
||||
It sends a request to the [Update Inbound Item](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidinbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.updateInboundItem(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
quantity: 1
|
||||
},
|
||||
)
|
||||
.then(({ return: returnData }) => {
|
||||
console.log(returnData)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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":"[AdminUpdateClaimInboundItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateClaimInboundItem/page.mdx)","description":"The details to update in the inbound item.","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<[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the return associated wth the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimReturnPreviewResponse","type":"[AdminClaimReturnPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimReturnPreviewResponse/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"/>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateInboundShipping
|
||||
|
||||
This method updates a shipping method for returning items in the claim using the ID of the method's `SHIPPING_ADD` action.
|
||||
It sends a request to the [Update Inbound Shipping](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidinboundshippingmethodaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.updateInboundShipping(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
custom_amount: 10
|
||||
},
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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":"[AdminClaimUpdateInboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimUpdateInboundShipping/page.mdx)","description":"The details to update in the shipping method","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 claim.","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<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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="updateInboundShipping"/>
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateItem
|
||||
|
||||
This method updates a claim item by the ID of the item's `WRITE_OFF_ITEM` action. It
|
||||
sends a request to the [Update Claim Item](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidclaimitemsaction\_id) API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.updateItem(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
quantity: 1
|
||||
}
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the order item's `WRITE_OFF_ITEM` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateClaimItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateClaimItem/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 claim.","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="updateItem"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The claim's details with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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="updateItem"/>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateOutboundItem
|
||||
|
||||
This method updates an outbound (or new) item of a claim using the ID of the item's `ITEM_ADD` action.
|
||||
It sends a request to the [Update Outbound Item](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidoutbounditemsaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.updateOutboundItem(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
quantity: 1
|
||||
},
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actionId","type":"`string`","description":"The id of the new claim item's `ITEM_ADD` action.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateClaimOutboundItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateClaimOutboundItem/page.mdx)","description":"The item's details.","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 claim.","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<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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"/>
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# updateOutboundShipping
|
||||
|
||||
This method updates the shipping method for delivering outbound items in a claim using the ID of the method's `SHIPPING_ADD` action.
|
||||
It sends a request to the [Update Outbound Shipping](https://docs.medusajs.com/v2/api/admin#claims\_postclaimsidoutboundshippingmethodaction\_id)
|
||||
API route.
|
||||
|
||||
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.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.claim.updateOutboundShipping(
|
||||
"claim_123",
|
||||
"ordchact_123",
|
||||
{
|
||||
custom_amount: 10
|
||||
},
|
||||
)
|
||||
.then(({ claim }) => {
|
||||
console.log(claim)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The claim'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":"[AdminClaimUpdateOutboundShipping](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimUpdateOutboundShipping/page.mdx)","description":"The shipping method's details.","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 claim.","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<[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the claim, with a preview of the order when the claim is applied.","expandable":false,"children":[{"name":"AdminClaimPreviewResponse","type":"[AdminClaimPreviewResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaimPreviewResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_preview","type":"`AdminOrderPreview`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"`AdminOrder`","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":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[OrderClaimType](../../../../../fulfillment/types/fulfillment.OrderClaimType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_id","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_version","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":"additional_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_items","type":"[BaseClaimItem](../../../../../types/interfaces/types.BaseClaimItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`AdminOrderShippingMethod`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"refund_amount","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"no_notification","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactions","type":"`BaseOrderTransaction`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `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