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.currency.retrieve("usd")
.then(({ currency }) => {
console.log(currency)
}){
"currency": {
"code": "usd",
"symbol": "$",
"symbol_native": "$",
"name": "<string>",
"decimal_digits": 123,
"rounding": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}Retrieve a currency by its code. You can expand the currency’s relations or select the fields that should be returned using the query parameters.
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.currency.retrieve("usd")
.then(({ currency }) => {
console.log(currency)
}){
"currency": {
"code": "usd",
"symbol": "$",
"symbol_native": "$",
"name": "<string>",
"decimal_digits": 123,
"rounding": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The currency's code.
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 currency's details.
The currency's currencies.
Show child attributes
The currency's code.
"usd"
The currency's symbol.
"$"
The currency's native symbol, if different than the symbol.
"$"
The currency's name.
The number of digits after the decimal for prices in this currency.
The rounding percision applied on prices in this currency.
The currency's creation date.
The currency's update date.
The currency's deletion date.