List the ways a method can be priced
const options = {
method: 'GET',
headers: {'X-Spree-Seller-Id': '<x-spree-seller-id>', Authorization: 'Bearer <token>'}
};
fetch('http://{defaultHost}/api/v3/seller/delivery_methods/calculators', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url http://{defaultHost}/api/v3/seller/delivery_methods/calculators \
--header 'Authorization: Bearer <token>' \
--header 'X-Spree-Seller-Id: <x-spree-seller-id>'{
"data": [
{
"type": "flat_percent_item_total",
"name": "Flat Percent",
"preference_schema": [
{
"key": "flat_percent",
"type": "decimal",
"default": 0
}
]
},
{
"type": "flat_rate",
"name": "Flat rate",
"preference_schema": [
{
"key": "amounts",
"type": "hash",
"default": {}
},
{
"key": "amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "flexi_rate",
"name": "Flexible Rate per package item",
"preference_schema": [
{
"key": "first_item",
"type": "decimal",
"default": 0
},
{
"key": "additional_item",
"type": "decimal",
"default": 0
},
{
"key": "max_items",
"type": "integer",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "per_item",
"name": "Flat rate per package item",
"preference_schema": [
{
"key": "amounts",
"type": "hash",
"default": {}
},
{
"key": "amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "price_sack",
"name": "Price sack",
"preference_schema": [
{
"key": "minimal_amount",
"type": "decimal",
"default": 0
},
{
"key": "normal_amount",
"type": "decimal",
"default": 0
},
{
"key": "discount_amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "digital_delivery",
"name": "Digital Delivery",
"preference_schema": [
{
"key": "amounts",
"type": "hash",
"default": {}
},
{
"key": "amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
}
]
}List the ways a method can be priced
GET
/
api
/
v3
/
seller
/
delivery_methods
/
calculators
List the ways a method can be priced
const options = {
method: 'GET',
headers: {'X-Spree-Seller-Id': '<x-spree-seller-id>', Authorization: 'Bearer <token>'}
};
fetch('http://{defaultHost}/api/v3/seller/delivery_methods/calculators', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request GET \
--url http://{defaultHost}/api/v3/seller/delivery_methods/calculators \
--header 'Authorization: Bearer <token>' \
--header 'X-Spree-Seller-Id: <x-spree-seller-id>'{
"data": [
{
"type": "flat_percent_item_total",
"name": "Flat Percent",
"preference_schema": [
{
"key": "flat_percent",
"type": "decimal",
"default": 0
}
]
},
{
"type": "flat_rate",
"name": "Flat rate",
"preference_schema": [
{
"key": "amounts",
"type": "hash",
"default": {}
},
{
"key": "amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "flexi_rate",
"name": "Flexible Rate per package item",
"preference_schema": [
{
"key": "first_item",
"type": "decimal",
"default": 0
},
{
"key": "additional_item",
"type": "decimal",
"default": 0
},
{
"key": "max_items",
"type": "integer",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "per_item",
"name": "Flat rate per package item",
"preference_schema": [
{
"key": "amounts",
"type": "hash",
"default": {}
},
{
"key": "amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "price_sack",
"name": "Price sack",
"preference_schema": [
{
"key": "minimal_amount",
"type": "decimal",
"default": 0
},
{
"key": "normal_amount",
"type": "decimal",
"default": 0
},
{
"key": "discount_amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
},
{
"type": "digital_delivery",
"name": "Digital Delivery",
"preference_schema": [
{
"key": "amounts",
"type": "hash",
"default": {}
},
{
"key": "amount",
"type": "decimal",
"default": 0
},
{
"key": "currency",
"type": "string",
"default": "USD"
}
]
}
]
}Was this page helpful?
⌘I

