Insurance
API Path
Claims

Claims

For an issued policy, you report the claim to your provider through your provider connection. You file the claim with POST /api/v1/insurance/policies/{policyId}/claims and track its outcome from the claim endpoint and by webhook.

  • A claim is a notification. Lunixi passes the claim to your provider and shows the outcome of that submission. The assessment of the claim (acceptance, rejection, payment) is done by the insurance company; its result is not part of the claim.
  • Lunixi does not store the document. The document you send is processed only in this request and passed to your provider. The document's content is not included in responses, request logs or webhooks.
  • A claim belongs to a policy. Insurance is per unit; take the policyId value from the order's policies[] array: Order object.

Authentication and signing: Flows › Authentication.

Policies that accept a claim

ConditionIf not met
The insurance type supports claims. Today only TICKET_CANCELLATION.412 insurance.claim.not_supported
The product in your connection supports claims.412 insurance.claim.not_supported
The policy is in force: the policy's policyStatus is ISSUED.409 insurance.claim.state_conflict; see State conflict
The policy has no open claim.409 insurance.claim.state_conflict, reason: claim_open

What counts is the status of that policy (policies[].policyStatus), not of the order. A policy has at most one open claim at a time: a claim with status PENDING, SUBMITTED or UNKNOWN is open. While a claim that reached the provider (SUBMITTED) exists, no second claim can be filed for the same policy. A FAILED claim does not prevent a new one.

Flow

Prepare the document

Prepare the document the insurance type requires as a PDF: Documents.

File the claim

Call POST /api/v1/insurance/policies/{policyId}/claims with the incident time and the document. Lunixi opens the claim and passes it to your provider in the same request.

Handle the outcome

Continue according to the status value in the response: Outcomes. When the outcome is final, the insurance.claim.submitted or insurance.claim.failed webhook is sent.

Get the provider's document

Once the claim is SUBMITTED, you can get the provider's claim document from the document endpoint.

Filing a claim: POST /api/v1/insurance/policies/{policyId}/claims

Idempotency-Key is required. See Retries and Idempotency-Key.

Path parameterDescription
policyIdPolicy ID (insp_…).
FieldTypeRequiredDescription
incidentAtstringYesTime of the incident the claim is about; ISO 8601 with a time zone. TICKET_CANCELLATION: the time the ticket was cancelled with the carrier. A time at most 5 minutes in the future is accepted.
documentsarrayYesDocuments; each document the type requires exactly once. Fields below.

Documents

FieldTypeDescription
documents[].kindstringType of the document; values below.
documents[].contentTypestringOnly application/pdf.
documents[].contentBase64stringBase64 content of the PDF file.
Insurance typekindDocument
TICKET_CANCELLATIONCANCELLATION_PROOFThe document you received from the carrier showing that the ticket was cancelled. Required.
  • The total size of the documents may be at most 3 MB after base64 decoding. A request over the limit returns 400 VALIDATION_ERROR or 422 insurance.validation.invalid (field: documents, reason: too_large).
  • The file must be a PDF; a document whose content is not a PDF returns 422.
  • The document may carry your buyer's personal data. Lunixi does not store the document and passes it to the provider; the document's content is not included in request logs.
source lunixi-sign.sh
REQ_PATH="/api/v1/insurance/policies/<policyId>/claims"
CONTENT=$(base64 < cancellation-proof.pdf | tr -d '\n')
BODY=$(printf '{"incidentAt":"2026-10-12T09:30:00+03:00","documents":[{"kind":"CANCELLATION_PROOF","contentType":"application/pdf","contentBase64":"%s"}]}' "$CONTENT")
printf '%s' "$BODY" > claim.json
lunixi_sign POST "$REQ_PATH" "$BODY"
 
curl -X POST "https://api-gateway.lunixi.com$REQ_PATH" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: insurance-claim-1001" \
  -H "X-Key-Id: $LUNIXI_KEY_ID" \
  -H "X-Date: $DATE" \
  -H "X-Nonce: $NONCE" \
  -H "Digest: $DIGEST" \
  -H "X-Signature: $SIGNATURE" \
  --data-binary @claim.json

The body can be large because of the document; so the example sends the body from a file. Compute Digest from exactly the body you write to the file.

Response

When the request completes, it returns 201 with the claim object in data. If the provider recorded the claim, status is SUBMITTED; if the outcome is not final, it is UNKNOWN.

Outcomes

OutcomeResponseOn the claimWhat to do
The provider recorded the claim201status: SUBMITTEDThe claim was reported. insurance.claim.submitted is sent. You can get the provider's document from the document endpoint.
The outcome is not final201status: UNKNOWNThe request reached the provider but its outcome is unknown. The claim is not sent again; the outcome is verified with the provider. When it is final, insurance.claim.submitted or insurance.claim.failed arrives. Do not file a new claim for the same policy in the meantime.
The provider rejected the claim422 insurance.claim.rejectedstatus: FAILED, errorCode: insurance.claim.rejectedThe provider did not accept the claim; retrying the same request does not change the result. insurance.claim.failed is sent. If needed, you can file a new claim with a new Idempotency-Key.
The provider was unreachable503 insurance.provider.unavailablestatus: FAILED, errorCode: insurance.provider.unavailableThe claim was not passed to the provider. If the claim was opened, it becomes FAILED and insurance.claim.failed is sent. Send it again later with a new Idempotency-Key.

If the outcome cannot be verified, the claim is reviewed and stays UNKNOWN until its outcome is final.

Retries and Idempotency-Key

  • Filing a claim passes the document to the provider in the same request. The request can take up to 45 seconds; set your client's timeout accordingly.
  • If you did not get a response after a timeout or a 5xx, repeat the request with the same Idempotency-Key and the same body. If the claim was opened on the first attempt, no new claim is opened; the existing claim is returned with its current status and the document is not sent to the provider again.
  • The same key returns the same claim whatever its status. To send a FAILED claim again, generate a new key.
  • If you use the same key with a different request (another policy, incident time or document), 409 insurance.idempotency.conflict is returned.

Claim object

FieldTypeDescription
claimIdstringClaim ID (insclm_…).
orderIdstringThe policy's order (inso_…).
policyIdstringThe policy the claim was filed for (insp_…).
insuranceTypestringInsurance type, e.g. TICKET_CANCELLATION.
statusstringStatus of the claim; see Statuses.
sourcestringWhere the claim was filed: MERCHANT_API or PANEL.
incidentAtstringTime of the incident the claim is about, ISO 8601.
documentKindsstring[]Types of the documents sent with the claim. The document itself is not part of the claim.
errorCodestring or nullIf the claim is FAILED, the Lunixi code of the reason: insurance.claim.rejected or insurance.provider.unavailable.
submittedAtstring or nullThe time it was confirmed that the provider recorded the claim. null until SUBMITTED.
createdAtstringCreation time, ISO 8601.
updatedAtstringLast change time, ISO 8601.

The claim does not contain the provider's claim reference or error codes.

Statuses

statusMeaning
PENDINGThe claim was opened and is being passed to the provider. You see this value only when you read the claim while the request is still running or when you repeat a request with the same Idempotency-Key.
SUBMITTEDThe provider recorded the claim.
UNKNOWNThe request reached the provider but its outcome is unknown; the outcome is being verified.
FAILEDThe provider rejected the claim or the request did not reach the provider. The reason is in errorCode.

SUBMITTED and FAILED are final; they do not change.

Listing: GET /api/v1/insurance/claims

Returns your claims from newest to oldest, in cursor-based pages.

Query parameterTypeDescription
limitintegerRecords per page, 1-100. Default 25.
cursorstringpageInfo.nextCursor from the previous response. Not sent on the first page.
orderIdstringOnly the claims of this order (inso_…).
policyIdstringOnly the claims of this policy (insp_…).
statusstringOnly claims with this status: PENDING, SUBMITTED, UNKNOWN or FAILED.

In the response, the claims are in the data.items array; pagination information is in pageInfo. A malformed cursor returns 422 insurance.validation.invalid (field: cursor).

source lunixi-sign.sh
REQ_PATH="/api/v1/insurance/claims?limit=25&policyId=<policyId>"
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"

Retrieving: GET /api/v1/insurance/claims/{claimId}

Returns a single claim. In the response, data is the claim object. Use this endpoint to track a claim whose outcome is UNKNOWN or to verify an outcome you did not receive by webhook.

The provider's claim document: GET /api/v1/insurance/claims/{claimId}/document

Returns the document the provider issued for the claim as a PDF. The document is available only when the claim is SUBMITTED.

  • Lunixi does not store the document. It is fetched from the provider on every request and passed to you as is.
  • A successful response returns 200 and the body is the PDF file itself; there is no JSON envelope. Error responses are the JSON error envelope; tell them apart by the response's Content-Type header.
HeaderValue
Content-Typeapplication/pdf
Content-Dispositionattachment; filename="<claimId>.pdf"
Cache-Controlno-store
source lunixi-sign.sh
REQ_PATH="/api/v1/insurance/claims/<claimId>/document"
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 claim.pdf
SituationResponse
The claim is SUBMITTEDThe document is returned.
The claim has another status409 insurance.claim.state_conflict, reason: claim_not_submitted
The provider cannot provide the document at that moment503 insurance.document.unavailable (details.retryable: true). The claim does not change; repeat the request later, increasing the wait between retries.

Errors

HTTPcodeWhat to do
400VALIDATION_ERRORFix the format. This error is also returned if Idempotency-Key is missing, kind or contentType is not recognised, contentBase64 is not base64 or an undefined field was sent.
404insurance.policy.not_foundThe policy was not found or belongs to another account. Take the policyId value from the order.
404insurance.claim.not_foundThe claim was not found or belongs to another account.
409insurance.claim.state_conflictSee details.reason; table below.
409insurance.idempotency.conflictThe same Idempotency-Key was used with a different request; generate a new key for a new claim.
412insurance.claim.not_supportedA claim cannot be filed for this policy: the insurance type or the product in your connection does not support claims.
422insurance.validation.invalidFix the details.errors[] fields; table below.
422insurance.claim.rejectedThe provider did not accept the claim; the claim becomes FAILED.
503insurance.provider.unavailableThe provider could not be reached; if the claim was opened, it becomes FAILED. Send it again later with a new Idempotency-Key.
503insurance.document.unavailableOnly on the document endpoint: the provider's document cannot be retrieved right now; try again later.

Common codes: Flows › Responses and errors. Details of the codes: Error Codes › Claims.

State conflict

reasonMeaning
policy_not_issuedThe policy was not issued: not requested yet, being issued, outcome not final or could not be issued.
policy_cancel_pendingThe policy has an open cancellation request.
policy_cancelledThe policy was cancelled.
claim_openThe policy has an open claim (PENDING, SUBMITTED or UNKNOWN). If present, details.claimId is the ID of the open claim.
claim_not_submittedThe document is available only for a claim the provider recorded (SUBMITTED).

Field violations

fieldreasonMeaning
incidentAtrequiredThe incident time was not sent.
incidentAttimezone_requiredThe timestamp has no time zone.
incidentAtinvalid_timestampThe value is not an ISO 8601 timestamp.
incidentAtin_futureThe incident time is more than 5 minutes in the future.
documentstoo_largeThe total size of the documents exceeds 3 MB.
documents[i].contentnot_pdfThe document's content is not a PDF.

Related