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.create({
value: "refund",
label: "Refund",
})
.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": {}
}
}Create a return reason.
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.create({
value: "refund",
label: "Refund",
})
.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.
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.
The details of the return reason to create.
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.