# Counter an offer

> Answers an open offer of the other company with other terms, where the marketplace takes trades. The offer answered stops being open in the same step, so only one of the two can be accepted.


`POST https://dev.siteswap.pro/api/v1/offers/{id}/counter`

Answers an open offer of the other company with other terms, where the marketplace takes trades. The offer answered stops being open in the same step, so only one of the two can be accepted.

Needs the `offers` scope.

## Parameters

- `id` (path, string, required): The offer to answer

## 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)

```json
{
  "kind": "cash",
  "quantity": 20,
  "total": 150
}
```

## 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
- 413: too_large: the body is over 256 KB
- 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/1042/counter" \
  -H "Authorization: Bearer ssk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"kind":"cash","quantity":20,"total":150}'
```