> For the complete documentation index, see [llms.txt](https://docs.settlers-united.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.settlers-united.com/s4-warriorslib-en/warriorslib-functions/warriorslib.settradingroute.md).

# WarriorsLib.SetTradingRoute

## `WarriorsLib.SetTradingRoute(sourceBuildingID, destinationBuildingID, player)`

Set the target market/harbor of a market/harbor to establish a trading route.

#### return value

* **Since Version 1.5.0**: success \[0, 1]
* Before: none

```lua
b1 = Buildings.GetFirstBuilding(1, Buildings.MARKETPLACE)
b2 = Buildings.GetFirstBuilding(3, Buildings.MARKETPLACE)
WarriorsLib.SetTradingRoute(b2, b1, 3)
WarriorsLib.TradeGood(b2, Goods.GOLDBAR, 100, 3)
```
