<!-- Generated by scripts/build-docs.js. Edit docs/swagger.yaml or docs/guides/, then run `npm run docs:build`. -->

# Poll a write receipt

`GET https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets/receipts/{id}`

Module: Timesheets · operationId: `getTimeEntryReceipt` · Auth: `Authorization: Bearer <token>`
Web page: https://apidocs.sequipay.com/#/api/get-time-entry-receipt

Returns the outcome of a `POST /v1/timesheets` write by its receipt id. `status` is one of: `processing` (still queued), `saved` (with `result`: created | amended | adjustment), `refused` (with `detail`), `locked` (the pay period was already paid), or `failed` (with `retriable: true` — safe to retry the original write on the same `reference_id`).

Requires the `timesheets:write` scope — only a writer has receipts to poll.

## Path parameters

- `id` (string, **required**): The opaque receipt token returned by the write. It is bound to your company; a token for another company (or a malformed one) returns 404 / 400. Treat it as an opaque string. Example: `eyJjIjoiY21wXzAxSDhYIiwiciI6IjlmMWMyYTdlIn0.a1B2c3D4`.

## Example request

```bash
curl -X GET "https://{apiId}.execute-api.us-west-1.amazonaws.com/{stage}/v1/timesheets/receipts/eyJjIjoiY21wXzAxSDhYIiwiciI6IjlmMWMyYTdlIn0.a1B2c3D4" \
  -H "Authorization: Bearer $SEQUIFI_TOKEN"
```

## Responses

### 200: The receipt's current outcome.

- `status` (integer) Example: `200`.
- `message` (string) Example: `success`.
- `data` (object): The receipt outcome.
  - `receipt_id` (string): The opaque receipt token (same value the write returned). Example: `eyJjIjoiY21wXzAxSDhYIiwiciI6IjlmMWMyYTdlIn0.a1B2c3D4`.
  - `status` (string) One of: `queued`, `processing`, `saved`, `refused`, `locked`, `failed`. Example: `processing`.
  - `result` (string): Present when status is saved. One of: `created`, `amended`, `adjustment`.
  - `detail` (string): Present on saved / refused / locked / failed.
  - `retriable` (boolean): Present and true when status is failed — retry the original write.

### 400: The receipt id is missing or malformed.

```json
{
  "status": 400,
  "message": "invalid receipt id",
  "data": null
}
```

### 401: Missing, invalid, expired, or revoked token (from the authorizer).

### 403: The token lacks the required scope.

```json
{
  "error": "insufficient_scope",
  "required": "users:read"
}
```

### 404: No such receipt.

```json
{
  "status": 404,
  "message": "not found",
  "data": null
}
```

### 500: An infrastructure or data error. The endpoint fails closed — a 500, never a partial or empty-looking result.

```json
{
  "status": 500,
  "message": "internal error",
  "data": null
}
```

### 503: sequipay-core could not be reached or was busy. Transient — retry with the SAME `reference_id`; the write is idempotent, so a retry never duplicates.

```json
{
  "status": 503,
  "message": "core unavailable, retry",
  "data": null
}
```
