Insurance
API Path
Reconciliation Report

Reconciliation Report

You get the policy and premium report per connection from the API to reconcile with your provider. The report on the panel's Reconciliation screen is built from the same data: Insurance Menu › Reconciliation.

  • The figures are read from your insurance orders themselves. For the same filter, the totals of the summary endpoint equal the sum of the rows of the rows endpoint and of the CSV file.
  • Statuses are the statuses at the time you get the report.
  • Orders created in the Checkout Form and through the API are all in the report; the premium may have been collected in a Lunixi payment, outside Lunixi or by the provider.

Authentication and signing: Flows › Authentication.

Filter

The three endpoints take the same filter:

Query parameterTypeRequiredDescription
fromstringYesStart of the period (inclusive). ISO 8601, time zone required (Z or ±hh:mm).
tostringYesEnd of the period (exclusive). ISO 8601, time zone required.
connectionIdstring (UUID)NoOnly the orders of this provider connection.
insuranceTypestringNoOnly the orders of this insurance type, e.g. TICKET_CANCELLATION.
currencystringNoOnly the orders in this currency, ISO 4217.
  • The period applies to the order creation time and is half-open: from inclusive, to exclusive. The period is at most 366 days.
  • In a query string, write the + sign of a time zone as %2B.

A request that breaks the period rules returns 422 insurance.validation.invalid:

fieldreasonMeaning
filter.from, filter.totimezone_requiredThe timestamp has no time zone.
filter.from, filter.toinvalid_timestampThe value is not an ISO 8601 timestamp.
filter.tonot_after_fromto is not after from.
filter.toperiod_too_longThe period is longer than 366 days.

If from or to is missing, connectionId is not a UUID, or currency or insuranceType is malformed, the request returns 400 VALIDATION_ERROR.

Summary: GET /api/v1/insurance/reconciliation/summary

Returns the totals of the period, grouped by connection, currency and who collects the premium.

source lunixi-sign.sh
REQ_PATH="/api/v1/insurance/reconciliation/summary?from=2026-09-01T00:00:00Z&to=2026-10-01T00:00:00Z"
lunixi_sign GET "$REQ_PATH"
 
curl "https://api-gateway.lunixi.com$REQ_PATH" \
  -H "X-Key-Id: $LUNIXI_KEY_ID" \
  -H "X-Date: $DATE" \
  -H "X-Nonce: $NONCE" \
  -H "X-Signature: $SIGNATURE"

data carries these fields:

FieldTypeDescription
period.from, period.tostringThe period you requested.
filters.connectionId, filters.insuranceType, filters.currencystring or nullThe filters applied; null when not sent.
groupsarrayOne group per connection, currency and premium collector; fields below.
generatedAtstringWhen the report was generated, ISO 8601.

groups[]:

FieldTypeDescription
provider.codestringThe provider's code in the Lunixi catalog.
provider.namestringThe provider's name.
provider.logoUrlstring or nullThe provider's logo.
provider.connectionIdstringThe ID of your provider connection.
currencystringCurrency, ISO 4217.
premiumCollectedBystringWho collects the premium: MERCHANT or PROVIDER.
totalsobjectTotals; fields below.

totals, amounts in minor units:

FieldWhat it counts
orderCount, premiumAmountOrders created in the period and their premiums.
collectedOrderCount, collectedPremiumAmountOrders whose premium was collected (collectionStatus: COLLECTED).
policyCountNumber of policies.
inForcePolicyCount, inForcePremiumAmountIn-force policies (ISSUED or CANCEL_PENDING) and their premiums. A policy with an open cancellation request is counted here until the provider confirms the cancellation.
cancelledPolicyCount, cancelledPremiumAmountPolicies whose cancellation the provider confirmed (CANCELLED) and their premiums.
refundedOrderCount, refundedPremiumAmountOrders whose premium refund is complete (refundStatus: REFUNDED).
refundOpenOrderCount, refundOpenPremiumAmountOrders whose premium refund is required, in progress or failed (REQUIRED, PENDING or FAILED).

Collection and refund totals are per order; policy totals are per policy.

Rows: GET /api/v1/insurance/reconciliation/orders

Returns the orders behind the summary together with their policies, newest first, in cursor-based pages. In addition to the filter parameters:

Query parameterTypeDescription
limitintegerOrders per page, 1-100. Default 100.
cursorstringpageInfo.nextCursor from the previous response. Not sent on the first page.

In the response, the rows are in the data.items array; pagination information is in pageInfo.

FieldTypeDescription
orderIdstringOrder ID (inso_…).
merchantOrderIdstring or nullYour own order number.
paymentIntentIdstring or nullID of the bound Lunixi payment.
externalPaymentIdstring or nullThe payment ID you reported for a premium collected outside Lunixi.
insuranceTypestringInsurance type.
connectionIdstringThe ID of your provider connection.
providerCodestringThe provider's code in the Lunixi catalog.
premiumCollectedBystringMERCHANT or PROVIDER.
paymentModestringNO_PAYMENT, LUNIXI_PAYMENT or EXTERNAL_PAYMENT.
premiumAmountintegerThe order premium, in minor units.
currencystringCurrency, ISO 4217.
collectionStatus, policyStatus, refundStatusstringThe order's status axes: Concepts › Order statuses.
createdAtstringWhen the order was created.
collectedAtstring or nullWhen the premium was collected.
refundedAtstring or nullWhen the refund was finalized.
policiesarrayThe order's policies; fields below. An empty array when there is no policy yet.

policies[]:

FieldTypeDescription
policyIdstringPolicy ID (insp_…).
basketItemIdstringThe basket item the policy insures.
policyNumberstring or nullThe number on the policy document.
policyStatusstringThe policy's status.
premiumAmountintegerThe policy premium, in minor units.
cancelledAtstring or nullWhen the cancellation was finalized.

A malformed cursor returns 422 insurance.validation.invalid (field: cursor).

CSV: GET /api/v1/insurance/reconciliation/export

Returns the report rows as a CSV file. The filter parameters are the same; it also takes cursor to continue a truncated file.

source lunixi-sign.sh
REQ_PATH="/api/v1/insurance/reconciliation/export?from=2026-09-01T00:00:00Z&to=2026-10-01T00:00:00Z"
lunixi_sign GET "$REQ_PATH"
 
curl "https://api-gateway.lunixi.com$REQ_PATH" \
  -H "X-Key-Id: $LUNIXI_KEY_ID" \
  -H "X-Date: $DATE" \
  -H "X-Nonce: $NONCE" \
  -H "X-Signature: $SIGNATURE" \
  -o reconciliation.csv
HeaderValue
Content-Typetext/csv; charset=utf-8
Content-Dispositionattachment; filename="insurance-reconciliation-<YYYY-MM-DD>.csv"
Cache-Controlno-store
X-Export-Order-CapThe maximum number of orders in one file.
  • The file is UTF-8 and starts with a BOM. Amounts are in minor units.
  • Each policy is one line. Order columns repeat on each policy line of the order; an order without a policy yet is a single line with empty policy columns. For the order total, sum orderPremiumAmountMinor once per orderId; for the policy total, sum policyPremiumAmountMinor.
  • A file holds at most 20,000 orders. When the limit is reached, the last line of the file is # truncated=true orderCap=20000 nextCursor=<cursor>; for the remaining orders, repeat the request with the same filter and cursor=<cursor>.
  • If the export is interrupted, the last line of the file is # export-aborted=true and the file is incomplete; download it again.
  • If the request fails validation, the response is not CSV but the JSON error envelope. Check the response's Content-Type header.
Column groupColumns
OrderorderId, merchantOrderId, paymentIntentId, externalPaymentId, orderCreatedAt, collectedAt, insuranceType, connectionId, providerCode, premiumCollectedBy, paymentMode, currency, orderPremiumAmountMinor, collectionStatus, orderPolicyStatus, refundStatus, refundedAt
PolicypolicyId, policyNumber, basketItemId, policyStatus, policyPremiumAmountMinor, cancelledAt

Errors

HTTPcodeWhat to do
400VALIDATION_ERRORFix the format of the query parameters.
422insurance.validation.invalidFix the period; see details.errors[] (Filter).

Common codes: Flows › Responses and errors.

Related