Skip to content

Create Dispatch Strategy

POST {{BASE_HABITAT_URL}}/api/v3/strategies

Required scope: strategies:write

Strategies allow you to configure ranked preferences for which DSPs should receive an order, based on several parameters. Our algorithm determines the strategy based on this order:

  1. Which Merchant the order is for
  2. Which Territory the order is in (If no merchant-specific Strategy is set)
  3. Ranked by either cheapest price or fastest delivery time
  4. Banned DSPs filtered out
  5. Preferred DSPs bumped to top

We then use this ranked list to request the delivery from the top down (i_.e in the case that the ‘top’ DSP rejects the order, we move to the next one)_

Creating a Strategy is currently not available via API - go to your Dispatch Settings to configure DSP routing strategies on a per-territory and per-merchant basis

{
"strategy": {
"tie_breaker": "cheapest",
"name": "Cheapest test",
"default": true
},
"strategy_providers": [
{
"name": "relay",
"type": "ban",
"index": 0
}
]
}
Terminal window
curl --request POST '${BASE_HABITAT_URL}/api/v3/strategies' \
--data '{
"strategy": {
"tie_breaker": "cheapest",
"name": "Cheapest test",
"default": true
},
"strategy_providers": [
{
"name": "relay",
"type": "ban",
"index": 0
}
]
}'
{
"type": "success",
"data": {
"strategies": [
{
"id": "3390e635-d510-4f51-b809-513db03d2e76",
"operator_id": 1,
"default": true,
"tie_breaker": "cheapest",
"name": "Default (Cheapest)"
}
],
"strategy_providers": [],
"providers": [
"doordash",
"uber",
"ally",
"relay",
"cutcats",
"quickness"
]
}
}