curl --location --request POST 'https://connect.dispatchable.com/route_engine/api/v1/formulas' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "National Auto Shipping Formula",
"base_price_source": "route_engine",
"base_rate_value": 125,
"nation_code": "USA",
"min_quote": 350,
"max_quote": 1450,
"rounding_method": "nearest",
"round_to": 5,
"additional_markup_type": "percentage",
"additional_markup_value": 0.075,
"required_deposit_type": "percentage",
"required_deposit_value": 0.1,
"rules": [
{
"label": "Alaska & Hawaii Surcharge",
"priority": 10,
"enabled": true,
"stop_on_match": false,
"conditions": [
{
"field": "pickup_state",
"operator": "in",
"value": [
"AK",
"HI"
]
}
],
"action": "apply_surcharge",
"unit": "fixed",
"value": 350,
"meta": {
"note": "Extra remote state fee"
}
},
{
"label": "Long Distance Discount",
"priority": 20,
"enabled": true,
"stop_on_match": false,
"conditions": [
{
"field": "total_miles",
"operator": "gt",
"value": 1200
}
],
"action": "apply_markup",
"unit": "percentage",
"value": -0.15,
"meta": {
"note": "Discount for large hauls"
}
}
],
"lanes": [
{
"from_state": "CA",
"from_zip": "90001",
"to_state": "TX",
"to_zip": "73301",
"strategy": "per_mile",
"per_mile_rate": 0.65,
"min_quote": 450,
"max_quote": 1300,
"enabled": true
},
{
"from_state": "NY",
"from_zip": "10001",
"to_state": "FL",
"to_zip": "33101",
"strategy": "fixed",
"fixed_quote": 995,
"min_quote": 850,
"max_quote": 1400,
"enabled": true
}
]
}'