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.store.list()
.then(({ stores, count, limit, offset }) => {
console.log(stores)
}){
"limit": 123,
"offset": 123,
"count": 123,
"stores": [
{
"id": "<string>",
"name": "<string>",
"supported_currencies": [
{
"id": "<string>",
"currency_code": "usd",
"store_id": "<string>",
"is_default": true,
"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"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"default_sales_channel_id": "<string>",
"default_region_id": "<string>",
"default_location_id": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"estimate_count": 123
}Retrieve a list of stores. The stores can be filtered by fields such as id. The stores can also be sorted or paginated.
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.store.list()
.then(({ stores, count, limit, offset }) => {
console.log(stores)
}){
"limit": 123,
"offset": 123,
"count": 123,
"stores": [
{
"id": "<string>",
"name": "<string>",
"supported_currencies": [
{
"id": "<string>",
"currency_code": "usd",
"store_id": "<string>",
"is_default": true,
"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"
},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"default_sales_channel_id": "<string>",
"default_region_id": "<string>",
"default_location_id": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
],
"estimate_count": 123
}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 number of items to skip when retrieving a list.
Limit the number of items returned in the list.
The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with -.
Search term to filter the store's searchable properties.
Filter by a store ID.
Filter by a store name.
Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
Whether to include deleted records in the result.
OK
The paginated list of stores.
The maximum number of items returned.
The number of items skipped before retrieving the returned items.
The total number of items.
The list of stores.
Show child attributes
The store's ID.
The store's name.
The store's supported currencies.
Show child attributes
The currency's ID.
The currency's code.
"usd"
The ID of the store this currency belongs to.
Whether this currency is the default in the store.
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.
The date the currency was created.
The date the currency was updated.
The date the currency was deleted.
The ID of the sales channel used by default in the store.
The ID of the region used by default in the store.
The ID of the stock location used by default in the store.
The store's metadata, can hold custom key-value pairs.
The date the store was created.
The date the store was updated.
The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.