# Fill an offer

> One transaction: the buyer pays in SOL, 95% to the seller, 5% to the PAYDAY buy and burn, coins to the buyer. Market offers are priced on chain when it lands and carry your limit (maxPay). If the price moves past it (errCode 6016) or within the same block (NO_FILL_PRICE_MOVED, 6022), build the fill again, show the buyer the new pay and ask again.


`POST https://payday.direct/api/otc/fill`

One transaction: the buyer pays in SOL, 95% to the seller, 5% to the PAYDAY buy and burn, coins to the buyer. Market offers are priced on chain when it lands and carry your limit (`maxPay`). If the price moves past it (`errCode` 6016) or within the same block (`NO_FILL_PRICE_MOVED`, 6022), build the fill again, show the buyer the new `pay` and ask again.

## Body

- `wallet` (string, required): The wallet that signs and pays
- `listing` (string, required)
- `amountRaw` (string, required): Raw units to buy

```json
{
  "wallet": "BuyerWa11et11111111111111111111111111111111",
  "listing": "L1st1ngAddre55111111111111111111111111111111",
  "amountRaw": "250000000000"
}
```

## Responses

- 200: OK
- 400: Refused; nothing to sign
- 429: Over the limit. Retry-After says when to try again.

```json
{
  "ok": true,
  "tx": "BASE64_UNSIGNED_V0",
  "units": 88112,
  "networkFeeLamports": 7800,
  "pay": "8100000",
  "fee": "405000",
  "toSeller": "7695000",
  "maxPay": "8181001",
  "lockedPrice": {
    "num": "30000000000",
    "den": "1000000000000000"
  },
  "floored": false,
  "amountRaw": "250000000000",
  "rentLamports": 0,
  "rentNote": null
}
```

## Example

```bash
curl -X POST "https://payday.direct/api/otc/fill" \
  -H "Content-Type: application/json" \
  -d '{"wallet":"BuyerWa11et11111111111111111111111111111111","listing":"L1st1ngAddre55111111111111111111111111111111","amountRaw":"250000000000"}'
```