# Send an offer

> Sends an offer on a listing of another company, where its marketplace takes offers: cash, a trade or both, as the listing allows. Accepting it later sets the quantity aside.


`POST https://dev.siteswap.pro/api/v1/offers`

Sends an offer on a listing of another company, where its marketplace takes offers: cash, a trade or both, as the listing allows. Accepting it later sets the quantity aside.

Needs the `offers` scope.

## Body

- `kind` ("cash" | "trade" | "both"): Left out where the listing takes cash only
- `quantity` (number, required): How much or how many, in the listing's unit
- `total` (number): The total cash, in dollars
- `cash_from` ("me" | "them"): With `both`: who pays the cash
- `trade_listing_id` (string): One of your listings (or theirs, when you counter as the poster)
- `trade_quantity` (number)
- `trade_text` (string): An item offered in trade, in words, when it is not a listing
- `want_text` (string): On a wanted listing: what you want in return
- `note` (string)
- `listing_id` (string, required): The listing

```json
{
  "listing_id": "1042",
  "kind": "cash",
  "quantity": 20,
  "total": 0,
  "note": "Can pick up Friday."
}
```

## Responses

- 201: Created
- 400: bad_request, key_in_url or invalid_json: the request could not be read
- 401: missing_key or invalid_key: no key, or a key that is not valid or was revoked
- 403: key_pending, key_declined, scope_missing, terms_required or account_unavailable: see Errors
- 404: not_found: nothing here that you may see
- 409: second_offer: you have an open offer on this listing already; listing_closed
- 413: too_large: the body is over 256 KB
- 422: invalid: the offer was refused; `message` says why
- 429: rate_limited or daily_quota: wait for Retry-After seconds

## Response fields

- `id` (string)
- `listing_id` (string)
- `listing_title` (string)
- `status` ("open" | "accepted" | "declined" | "withdrawn" | "expired" | "countered" | "completed" | "cancelled"): Where the offer stands
- `direction` ("sent" | "received"): `sent` when your company made it
- `other_company` (object)
- `other_company.slug` (string): The company's address on SiteSwap, `/c/{slug}`
- `other_company.name` (string)
- `other_company.kind` (string): What kind of company, for example `contractor` or `supplier`
- `other_company.url` (string): Its public page
- `kind` ("cash" | "trade" | "both"): Cash, a trade, or a trade with cash
- `quantity` (number)
- `unit` (string)
- `total_cents` (integer): The cash part, in US cents
- `trade_listing_id` (string | null): A listing offered in trade
- `trade_quantity` (number | null): How much of it
- `trade_text` (string | null): An item offered in trade, in words
- `want_text` (string | null): What is wanted in return, in words
- `note` (string)
- `counter_of` (string | null): The offer this one answers
- `expires_at` (string): An open offer ends then. ISO 8601 in UTC
- `created_at` (string): When it was made. ISO 8601 in UTC
- `decided_at` (string | null): When it was answered

```json
{
  "data": {
    "id": "string",
    "listing_id": "string",
    "listing_title": "string",
    "status": "open",
    "direction": "sent",
    "other_company": {
      "slug": "string",
      "name": "string",
      "kind": "string",
      "url": "string"
    },
    "kind": "cash",
    "quantity": 0,
    "unit": "string",
    "total_cents": 0,
    "trade_listing_id": "string",
    "trade_quantity": 0,
    "trade_text": "string",
    "want_text": "string",
    "note": "string",
    "counter_of": "string",
    "expires_at": "string",
    "created_at": "string",
    "decided_at": "string"
  },
  "meta": {
    "request_id": "3f9a1c0b7d2e",
    "api_version": "v1"
  }
}
```

## Example

```bash
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":0,"note":"Can pick up Friday."}'
```