Price a physical-mail letter without creating it
Returns the exact price of a letter without creating one — no side effects, nothing stored.
Returns the exact price of a letter without creating one — no side effects, nothing stored. Provide country plus either pageCount (minimum 1) or pdfBase64, in which case Dairo counts the pages of the actual file; print and delivery default to the same values as the create call (grayscale, simplex, economy). The response is a letter_price whose upper-case currency and amount (VAT included) are what the letter is billed when mailed. The quote runs the same destination and option validation as POST /v1/letters, so a successful quote also confirms the combination is sendable. Requires only the letters:read scope, so a read-only key can quote prices.
Scope: letters:read. Send the API key as a bearer token; Scopes lists what each one reaches.
Request
Body
Required, application/json: LetterPriceRequest.
Give the destination (country or to.country) and one page source: pageCount, pdfBase64, file, or templateId (rendered with templateData and to to count pages). First match wins in that order.
| Field | Type | Required | Description |
|---|---|---|---|
country | string | no | ISO 3166-1 alpha-2 country code. Optional when to.country is given. |
pageCount | integer or null | no | (minimum 1) |
pdfBase64 | string or null | no | |
print | LetterPrintOptions | no | |
delivery | LetterDelivery | no | |
paperTypes | array of LetterPaperType | no | |
file | LetterFileRef | no | |
templateId | string or null | no | A stored letter template; rendered to count pages. |
templateData | object or null | no | Values for the template's placeholders. |
to | PostalAddress or null | no | Recipient. Its country prices the letter when country is absent; a template render composites it (a sample recipient is used when absent). |
Response
200 Success. Body: application/json, LetterPrice.
| Field | Type | Required | Description |
|---|---|---|---|
object | "letter_price" | yes | |
currency | string | yes | Upper-case ISO 4217 code, e.g. EUR. |
amount | number | yes | The price the letter is billed, VAT included (the same gross basis as the charge). |
walletAmount | number | no | The price in the credits-wallet currency, at the same conversion rate the charge uses (rounded to the cent). |
walletCurrency | string | no | The credits-wallet currency (USD). |
walletRate | number | no | The conservative rate from the letter currency (EUR) to the wallet currency used for walletAmount (walletAmount = amount × walletRate, rounded to the cent). |
country | string | no | |
pageCount | integer | no | |
delivery | LetterDelivery | no | |
print | LetterPrintOptions | no | |
breakdown | object | no |
Errors
Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.
| Status | Meaning |
|---|---|
400 | The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch). |
401 | The API key is missing or invalid. |
403 | The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted). |
404 | No such resource in this account (resource_not_found). |
422 | The request is well-formed but a field failed validation (validation_failed). |
429 | Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached). |
500 | An unexpected error; retry with backoff, then contact support (internal_error). |
Create a physical-mail letter
Create (and queue) a physical-mail letter
Get one letter with its delivery-event timeline
Returns the full letter, including the complete to/from addresses (list items carry only city and country), the price, and an inline events timeline holding the 100 most recent events, newest first.