import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.returnReason.retrieve("ret_123")
.then(({ return_reason }) => {
console.log(return_reason)
}){
"return_reason": {
"id": "<string>",
"value": "<string>",
"label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"metadata": {}
}
}Retrieve a return reason by its ID. You can expand the return reason’s relations or select the fields that should be returned.
import Switchyard from "@switchyard/js-sdk"
export const sdk = new Medusa({
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
debug: import.meta.env.DEV,
auth: {
type: "session",
},
})
sdk.admin.returnReason.retrieve("ret_123")
.then(({ return_reason }) => {
console.log(return_reason)
}){
"return_reason": {
"id": "<string>",
"value": "<string>",
"label": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "<string>",
"metadata": {}
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The return reason's ID.
Comma-separated fields that should be included in the returned data. if a field is prefixed with + it will be added to the default fields, using - will remove it from the default fields. without prefix it will replace the entire default fields.
OK
The return reason's details.
The return reason's details.
Show child attributes
The return reason's ID.
The return reason's value.
The return reason's label.
The date the return reason was created.
The date the return reason was updated.
The return reason's description.
The return reason's metadata, can hold custom key-value pairs.