Guides
Offers
Send, counter, accept, decline and withdraw offers.
Offers work where the marketplace takes them (offers: true in GET /marketplaces). Counteroffers and trades work where it takes trades.
curl -X POST "https://dev.siteswap.pro/api/v1/offers" -H "Authorization: Bearer ssk_YOUR_KEY" -H "Content-Type: application/json" \
-d '{"listing_id":"1042","kind":"cash","quantity":20,"total":300,"note":"Can pick up Friday."}'const res = await fetch("https://dev.siteswap.pro/api/v1/offers?status=open&direction=received", {
headers: { Authorization: "Bearer " + process.env.SITESWAP_KEY },
});
for (const o of (await res.json()).data) console.log(o.id, o.other_company.name, o.quantity, o.unit, o.total_cents / 100);import os, requests
h = {"Authorization": "Bearer " + os.environ["SITESWAP_KEY"]}
r = requests.post("https://dev.siteswap.pro/api/v1/offers/88/accept", headers=h)
print(r.status_code, r.json())How an offer moves
| From | Call | To |
|---|---|---|
| open | POST /offers/{id}/accept (the other side) | accepted. The quantity is set aside on the listing at once. |
| open | POST /offers/{id}/decline (the other side) | declined |
| open | POST /offers/{id}/withdraw (the side that sent it) | withdrawn |
| open | POST /offers/{id}/counter (the other side) | countered; a new open offer answers it |
| open | 7 days pass | expired |
Handing over and cancelling an accepted offer are done on the site, in the conversation.
SiteSwap API v1Support