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.customerGroup.list()
.then(({ customer_groups, count, limit, offset }) => {
console.log(customer_groups)
}){
"limit": 123,
"offset": 123,
"count": 123,
"customer_groups": [
{
"id": "<string>",
"name": "<string>",
"customers": [
{}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}Retrieve a list of customer groups. The customer groups can be filtered by fields such as id. The customer groups 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.customerGroup.list()
.then(({ customer_groups, count, limit, offset }) => {
console.log(customer_groups)
}){
"limit": 123,
"offset": 123,
"count": 123,
"customer_groups": [
{
"id": "<string>",
"name": "<string>",
"customers": [
{}
],
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}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 customer group's searchable properties.
Filter by a customer group's IDs.
Filter by a customer group's name.
Filter by the ID of a customer to retrieve its groups.
Filter by an ID of a user to retrieve the customer groups they created.
Filter the customer group by its creation date.
Show child attributes
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.
Filter by an exact match.
Filter by values not equal to this parameter.
Filter by values in this array.
The value to match.
Filter by values not in this array.
The value not to match.
Filter by values not matching this parameter.
Filter by values greater than this parameter. Useful for numbers and dates only.
Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
Filter by values less than this parameter. Useful for numbers and dates only.
Filter by values less than or equal to this parameter. Useful for numbers and dates only.
Apply a like filter. Useful for strings only.
Apply a regex filter. Useful for strings only.
Apply a case-insensitive like filter. Useful for strings only.
Filter to apply on full-text properties.
Filter arrays that have overlapping values with this parameter.
The values to match.
Filter arrays that contain some of the values of this parameter.
The values to match.
Filter arrays that contain all values of this parameter.
The values to match.
Filter by whether a value for this parameter exists (not null).
Filter the customer groups by their update date.
Show child attributes
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.
Filter by an exact match.
Filter by values not equal to this parameter.
Filter by values in this array.
The value to match.
Filter by values not in this array.
The value not to match.
Filter by values not matching this parameter.
Filter by values greater than this parameter. Useful for numbers and dates only.
Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
Filter by values less than this parameter. Useful for numbers and dates only.
Filter by values less than or equal to this parameter. Useful for numbers and dates only.
Apply a like filter. Useful for strings only.
Apply a regex filter. Useful for strings only.
Apply a case-insensitive like filter. Useful for strings only.
Filter to apply on full-text properties.
Filter arrays that have overlapping values with this parameter.
The values to match.
Filter arrays that contain some of the values of this parameter.
The values to match.
Filter arrays that contain all values of this parameter.
The values to match.
Filter by whether a value for this parameter exists (not null).
Filter the customer groups by their deletion date.
Show child attributes
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.
Filter by an exact match.
Filter by values not equal to this parameter.
Filter by values in this array.
The value to match.
Filter by values not in this array.
The value not to match.
Filter by values not matching this parameter.
Filter by values greater than this parameter. Useful for numbers and dates only.
Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
Filter by values less than this parameter. Useful for numbers and dates only.
Filter by values less than or equal to this parameter. Useful for numbers and dates only.
Apply a like filter. Useful for strings only.
Apply a regex filter. Useful for strings only.
Apply a case-insensitive like filter. Useful for strings only.
Filter to apply on full-text properties.
Filter arrays that have overlapping values with this parameter.
The values to match.
Filter arrays that contain some of the values of this parameter.
The values to match.
Filter arrays that contain all values of this parameter.
The values to match.
Filter by whether a value for this parameter exists (not null).
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 customer groups. The paginated list of customer groups.
The maximum number of items retrieved.
The number of items skipped before retrieving the returned items.
The total number of items
The list of customer groups.
Show child attributes
The customer group's ID.
The customer group's name.
The customer group's customers.
The customer group's metadata, used to store custom key-value pairs.
The customer group's creation date.
The customer group's update date.