# Import a communication cost receipt (/api-reference/survey-channels/importRetentionDeliveryCost)

`POST /v1/retention/messages/cost-receipts`

Base URL: `https://api.bitelio.com`

Merchant server only, secret key with retention:view, retention:edit and settings:manage. Imports one provider invoice line for an attempted external delivery. Identify an initial delivery by deliveryId, a native WhatsApp question/confirmation turn by turnId, or either by providerMessageId. Do not combine deliveryId with turnId. If a providerMessageId is included it must match that exact row. Native turns count as separate provider attempts and are not assumed free. amountMinor is an integer string in currency minor units. Zero requires explicit cost evidence. Replaying an identical receipt is idempotent; changing a recorded amount or reusing its reference returns COST_RECEIPT_CONFLICT (400). Evidence is labelled MERCHANT_PROVIDER_RECEIPT, not an automatically verified provider bill. A delivery acknowledgement does not establish its cost. No currency conversion is performed. Missing costs remain pending and cached results update in the background. Limit120 requests/minute shared per project.

## Request body

- `receiptId`: string (required)
- `currency`: string (required)
- `amountMinor`: string (required)
- `providerMessageId`: string
- `deliveryId`: string
- `turnId`: string — Native WhatsApp turn ID, instead of deliveryId. Use providerMessageId when reconciling a provider invoice.

Example:

```json
null
```

## Responses

### `200` — Success

- `deliveryId`: string
- `recorded`: enum (true) (required)
- `turnId`: string

```json
null
```

### `400` — Invalid input, unsupported currency or conflicting receipt

### `401` — Secret API key required

### `403` — Required project permission is missing

### `404` — No attempted external delivery matches in this project, or retention is unavailable

### `429` — Project rate limit exceeded. Retry-After identifies the wait in seconds.

### `503` — Rate limiter temporarily unavailable; retry later.

## Example request

```bash
curl -X POST 'https://api.bitelio.com/v1/retention/messages/cost-receipts' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d 'null'
```
