> For the complete documentation index, see [llms.txt](https://docs.smolrefuel.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.smolrefuel.com/integrate/api-integration.md).

# API Integration

### Tokens that support permit

1. Get a quote from odos
2. POST <https://api.smolrefuel.com/quote> with body {"chainId":1,"priceRoute":{... quote from odos ...}, "srcDecimals":18,"params":{"token":"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72","from":"USER\_ADDRESS","amount":"1000000000000000000"}}
3. POST <https://api.smolrefuel.com/refuel> with body {"chainId":1,"priceRoute":{... quote from odos ...}, "srcDecimals":18,"params":{"token":"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72","from":"USER\_ADDRESS","amount":"1000000000000000000", deadline:string, v:number, r:string, s:string}, partner: "your name", tokenPrices:{...}}
4. Trade will be sent and you'll get back a tx hash

### Tokens that don't support permit

1. POST <https://api.smolrefuel.com/loan-quote> with body {"chainId":1,"token":"0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5","from":"USER\_ADDRESS","amount":"100000000"}
2. Have user sign the message

   ```typescript
   I commit to completing the swap on smolrefuel.com after receiving my loan
   ```
3. Send that signature to POST <https://api.smolrefuel.com/get-loan>, with body

   ```typescript
   {
           chainId,
           token,
           from,
           amount,
           signature,
           partner
    }
   ```
4. Have user send an approve() transaction on the token approving our contract
5. POST <https://api.smolrefuel.com/execute-swap> with body

   ```typescript
   {
           chainId,
           token,
           from,
           partner
   }
   ```
