# Statuses and errors

## Request status

| Status              | What it means for the user                                                   |
| ------------------- | ---------------------------------------------------------------------------- |
| `needs_info`        | The business needs answers first (`open_questions`). Nothing was sent.       |
| `awaiting_customer` | The user confirms it themselves, as `next_step` said. Nothing was sent yet.  |
| `delivered`         | The business has been told and is asked to answer by `respond_by`.           |
| `answered`          | The business answered. What it wrote was sent to the user directly.          |
| `no_response`       | The business did not answer in time. It can be called on `fallback.phone`.   |
| `unconfirmed`       | It was never confirmed, or its questions never answered, so it was not sent. |
| `not_chosen`        | The user chose another business for this matched request.                    |
| `withdrawn`         | The user withdrew it from their phone. The business was told.                |

For a match, `match.status` is `awaiting_customer`, `open` (no business has answered yet),
`replied` (at least one answered; the user can choose one), `chosen`, `no_response` (none chosen
in time; the user can still choose), `unconfirmed` or `withdrawn`. `match.replies` lists each
business's answer.

## Errors

| Code           | Meaning                                                                                 |
| -------------- | --------------------------------------------------------------------------------------- |
| `invalid`      | Something in the input is wrong. The text names the field.                              |
| `not_found`    | No such business or reference.                                                          |
| `not_sent`     | `user_requested` was false: the user had not asked for it to be sent. Nothing was sent. |
| `not_allowed`  | The business is not taking this request here. The text gives its phone number, if any.  |
| `expired`      | Not completed in time, so not sent. A request started again is a new one.               |
| `rate_limited` | An allowance was used up. It frees up with time, not with more calls.                   |
| `internal`     | Something went wrong on our side.                                                       |

A contact can be turned away when its holder presses the confirmation button. The page they see
says why. The tools do not.
