# Record a payer request

Page: https://app.myclaimhouse.com/docs/api/createPayerRequest

`POST /api/v1/payer_requests`

Records a request that came by letter or phone, about a claim (its payer) or with a payer of its own. The same payer and reference number again returns the first. Needs an Idempotency-Key header and a key with the submit permission.

Needs a key with `submit` permission.

## Request

### Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | Yes | Makes the request safe to repeat: a request with the same key and body returns the first answer (the reply has an idempotent-replayed header), and the same key with a different request is refused. 1 to 255 printable characters; a UUID is a good choice. At least 1 character. At most 255 characters. Matches `^[\x21-\x7e]{1,255}$`. |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `claim_id` | string | No | The claim the request is about. |
| `payer_id` | string | No | The payer that asks (pyr_..., a payer ID or an alias). Default: the claim's payer. |
| `reference_number` | string | Yes | The payer's reference number, from its letter: at most 30 characters (letters, digits, spaces and ! " & ' ( ) + , - . / ; ? =). |
| `requested` | string | Yes | What the payer asks for, in its words. |
| `due_date` | string (date) | No |  |

## Response

The payer request. Status `201`.

| Name | Type | Description |
| --- | --- | --- |
| `id` | string | An ID that starts with prq_. |
| `object` | string | Always `payer_request`. |
| `state` | string | One of: `open`, `answered`. |
| `source` | string | network (it arrived through the network) or staff (recorded by hand, from a letter). One of: `network`, `staff`. |
| `claim_id` | string or null | An ID that starts with clm_. |
| `payer` | object |  |
| `payer.id` | string | An ID that starts with pyr_. |
| `payer.payer_id` | string | The payer's own payer ID. |
| `payer.name` | string |  |
| `reference_number` | string | The payer's reference number: the answering attachment carries it. |
| `requested` | string | What the payer asks for, in its words. |
| `due_date` | string (date) or null |  |
| `answering_attachment_id` | string or null | An ID that starts with att_. |
| `answered_at` | string (date-time) or null |  |
| `created_at` | string (date-time) |  |

## Errors

| HTTP status | Code | What it means |
| --- | --- | --- |
| 401 | `UNAUTHORIZED` | A valid API key is required. Send it as "Authorization: Bearer <key>". |
| 403 | `PERMISSION_DENIED` | This API key is not allowed to do that. |
| 422 | `INVALID_REQUEST` | The request is not valid. |
| 400 | `IDEMPOTENCY_KEY_REQUIRED` | This request needs an Idempotency-Key header: a value you make up (a UUID is good), new for each new request. |
| 400 | `IDEMPOTENCY_KEY_INVALID` | The Idempotency-Key header must be 1 to 255 printable characters. |
| 422 | `IDEMPOTENCY_KEY_REUSED` | That Idempotency-Key was already used with a different request. |
| 409 | `IDEMPOTENCY_KEY_IN_USE` | A request with that Idempotency-Key is still running. Send it again with the same key after Retry-After seconds. |
| 429 | `TOO_MANY_REQUESTS` | Too many requests of this kind lately. Wait, then try again. |
| 413 | `PAYLOAD_TOO_LARGE` | The request body is larger than 1 MB. |
| 504 | `TIMEOUT` | The request took too long. Send it again with the same Idempotency-Key and body after Retry-After seconds: a 409 means it is still finishing (wait and send again), and any other answer is final. If this 504 comes back, find what the request made by listing with ?idempotency_key=<the key>. |
| 503 | `ATTACHMENTS_UNAVAILABLE` | Attachments are not available in live mode yet. Use a test key. |
| 500 | `INTERNAL` | Something went wrong on our side. Quote the request ID if you contact us. |

## Example

### Example request

```bash
curl -X POST "https://app.myclaimhouse.com/api/v1/payer_requests" \
  -H "Authorization: Bearer $CLAIMHOUSE_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
  "claim_id": "clm_01JM000000E00800000000002G",
  "reference_number": "LETTER-0915",
  "requested": "The perio chart for the scaling.",
  "due_date": "2026-10-15"
}'
```

### Example response: 201

```json
{
  "id": "prq_01JM000000E008000000000040",
  "object": "payer_request",
  "state": "open",
  "source": "staff",
  "claim_id": "clm_01JM000000E00800000000002G",
  "payer": {
    "id": "pyr_01JM000000E008000000000004",
    "payer_id": "00000",
    "name": "Example Dental Plan"
  },
  "reference_number": "LETTER-0915",
  "requested": "The perio chart for the scaling.",
  "due_date": "2026-10-15",
  "answering_attachment_id": null,
  "answered_at": null,
  "created_at": "2026-09-25T21:02:30.000000+00:00"
}
```
