BitelioBitelio

Import a communication cost receipt

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.

POST
/v1/retention/messages/cost-receipts

Authorization

ApiKeyAuth

AuthorizationBearer <token>

API Key authentication. Secret keys (sk_*) are required for all endpoints except /v1/track. Public keys (pk_*) only work with the /v1/track endpoint for client-side event tracking. The project is automatically derived from the key.

In: header

Request Body

application/json

receiptId?string
Length1 <= length <= 200
currency?string
Match^[A-Z]{3}$
amountMinor?string
Match^(0|[1-9]\d{0,13})$
providerMessageId?string
Length1 <= length <= 500
deliveryId*string
Length1 <= length <= 100
turnId?string

Native WhatsApp turn ID, instead of deliveryId. Use providerMessageId when reconciling a provider invoice.

Lengthlength <= 100
[key: string]?never

Response Body

application/json

curl -X POST "https://bitelio-api.heltia.com/v1/retention/messages/cost-receipts" \  -H "Content-Type: application/json" \  -d '{    "receiptId": "invoice-2026-10:line-14",    "currency": "EUR",    "amountMinor": "7"  }'
{
  "deliveryId": "string",
  "recorded": true,
  "turnId": "string"
}
Empty
Empty
Empty
Empty
Empty
Empty