# Record a delivery cost receipt (/es/api-reference/survey-channels/recordRetentionDeliveryCost)

`POST /v1/retention/messages/{id}/cost-receipt`

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 it by deliveryId or providerMessageId; if both are provided they must match. 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. The path id identifies the delivery; it need not be repeated in the body.

## Path parameters

- `id`: string (required)

## Request body

- `receiptId`: string (required)
- `currency`: string (required)
- `amountMinor`: string (required)
- `providerMessageId`: string

Example:

```json
{
  "receiptId": "invoice-2026-10:line-14",
  "currency": "EUR",
  "amountMinor": "7"
}
```

## Responses

### `200` — Success

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

```json
{
  "deliveryId": "string",
  "recorded": true
}
```

### `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/{id}/cost-receipt' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"receiptId":"invoice-2026-10:line-14","currency":"EUR","amountMinor":"7"}'
```
