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.fulfillmentSet.retrieveServiceZone(
"fset_123",
"serzo_123"
)
.then(({ service_zone }) => {
console.log(service_zone)
}){
"service_zone": {
"id": "<string>",
"name": "<string>",
"fulfillment_set_id": "<string>",
"fulfillment_set": {},
"geo_zones": [
{
"id": "<string>",
"type": "country",
"country_code": "<string>",
"province_code": "us-ca",
"city": "<string>",
"postal_expression": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"shipping_options": [
{
"id": "<string>",
"name": "<string>",
"price_type": "calculated",
"service_zone_id": "<string>",
"service_zone": {},
"provider_id": "<string>",
"provider": {
"id": "<string>",
"is_enabled": true
},
"shipping_option_type_id": "<string>",
"type": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"label": "<string>",
"description": "<string>",
"code": "<string>",
"shipping_option_id": "<string>"
},
"shipping_profile_id": "<string>",
"shipping_profile": {
"id": "<string>",
"name": "<string>",
"type": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
},
"rules": [
{
"id": "<string>",
"attribute": "is_return",
"operator": "gt",
"value": "true",
"shipping_option_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"prices": [
{
"price_rules": [
{
"id": "<string>",
"value": "<string>",
"operator": "gt",
"attribute": "<string>",
"price_id": "<string>",
"priority": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"rules_count": 123,
"id": "<string>",
"title": "<string>",
"currency_code": "usd",
"amount": 123,
"raw_amount": {},
"min_quantity": 123,
"max_quantity": 123,
"price_set_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"data": {},
"metadata": {},
"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"
}
}Retrieve a service zone that belongs to a fulfillment set. be 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.fulfillmentSet.retrieveServiceZone(
"fset_123",
"serzo_123"
)
.then(({ service_zone }) => {
console.log(service_zone)
}){
"service_zone": {
"id": "<string>",
"name": "<string>",
"fulfillment_set_id": "<string>",
"fulfillment_set": {},
"geo_zones": [
{
"id": "<string>",
"type": "country",
"country_code": "<string>",
"province_code": "us-ca",
"city": "<string>",
"postal_expression": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"shipping_options": [
{
"id": "<string>",
"name": "<string>",
"price_type": "calculated",
"service_zone_id": "<string>",
"service_zone": {},
"provider_id": "<string>",
"provider": {
"id": "<string>",
"is_enabled": true
},
"shipping_option_type_id": "<string>",
"type": {
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z",
"label": "<string>",
"description": "<string>",
"code": "<string>",
"shipping_option_id": "<string>"
},
"shipping_profile_id": "<string>",
"shipping_profile": {
"id": "<string>",
"name": "<string>",
"type": "<string>",
"metadata": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
},
"rules": [
{
"id": "<string>",
"attribute": "is_return",
"operator": "gt",
"value": "true",
"shipping_option_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"prices": [
{
"price_rules": [
{
"id": "<string>",
"value": "<string>",
"operator": "gt",
"attribute": "<string>",
"price_id": "<string>",
"priority": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"rules_count": 123,
"id": "<string>",
"title": "<string>",
"currency_code": "usd",
"amount": 123,
"raw_amount": {},
"min_quantity": 123,
"max_quantity": 123,
"price_set_id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deleted_at": "2023-11-07T05:31:56Z"
}
],
"data": {},
"metadata": {},
"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"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The fulfillment set's ID.
The service zone'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 service zone's details.
The shipping option's service zone.
Show child attributes
The service zone's ID.
The service zone's name.
The service zone's fulfillment set id.
The service zone's geo zones.
Show child attributes
The geo zone's ID.
The geo zone's type.
country, province, city, zip The geo zone's country code.
The geo zone's lower-case ISO 3166-2 province code.
"us-ca"
The geo zone's city.
The geo zone's postal expression.
The geo zone's created at.
The geo zone's updated at.
The geo zone's deleted at.
The service zone's shipping options.
Show child attributes
The shipping option's ID.
The shipping option's name.
The shipping option's price type. If it's flat, the price is fixed and is set in the prices property. If it's calculated, the price is calculated on checkout by the associated fulfillment provider.
calculated, flat The ID of the service zone this option belongs to.
The ID of the provider handling fulfillments created from this shipping option.
The ID of the associated shipping option type.
The shipping option's details.
Show child attributes
The shipping option's ID.
The date the shipping option was created.
The date the shipping option was updated.
The date the shipping option was deleted.
The type's label.
The type's description.
The type's code.
The type's shipping option id.
The ID of the associated shipping profile.
The shipping profile's details..
Show child attributes
The shipping profile's ID.
The shipping profile's name.
The shipping profile's type.
The shipping profile's metadata, holds custom key-value pairs.
The date the shipping profile was created.
The date the shipping profile was updated.
The date the shipping profile was deleted.
The shipping option's rules.
Show child attributes
The shipping option rule's ID.
The shipping option rule's attribute.
"is_return"
The rule's operator.
gt, lt, eq, ne, in, lte, gte, nin The shipping option rule's value.
"true"
The ID of the shipping option this rule is for.
The date the shipping option rule was created.
The date the shipping option rule was updated.
The date the shipping option rule was deleted.
The shipping option's prices. If the price_type is calculated, this array will be empty since the price is calculated by the fulfillment provider during checkout.
Show child attributes
The price's rules.
Show child attributes
The price rule's ID.
The price rule's value.
The price rule's operator.
gt, lt, eq, ne, in, lte, gte, nin The price rule's attribute.
The ID of the price this rule applies to.
The price rule's priority.
The date the price rule was created.
The date the price rule was updated.
The date the price rule was deleted.
The number of rules the price has.
The price's ID.
The price's title.
The price's currency code.
"usd"
The price's amount.
The price's raw amount.
The minimum quantity required in the cart for this price to apply.
The maximum quantity that the cart's items must not surpass for this price to apply.
The ID of the price set this price belongs to.
The date the price was created.
The date the price was updated.
The date the price was deleted.
The shipping option's data, useful for the fulfillment provider handling fulfillments created from this option.
The shipping option's metadata, can hold custom key-value pairs.
The date the shipping option was created.
The date the shipping option was updated.
The date the shipping option was deleted.
The service zone's created at.
The service zone's updated at.
The service zone's deleted at.