Insurance
API Path
Selling Without a Basket Item

Selling Without a Basket Item

Some insurance types do not cover a basket item; the buyer purchases the insurance on its own. For example, annual personal accident (PERSONAL_ACCIDENT) covers a person, not a product in the basket. The quote for these types is obtained without a basket item, and the coverage details are in the type object. Some types are sold both ways: with a basket item and without one (for example pet health insurance, PET_HEALTH).

  • Selling without a basket item is available only on the API path. Types sold only without a basket item are not offered on the Checkout Form or on payment links; types sold both ways are offered there only with a basket item.
  • Which types are sold without a basket item is in the type catalog: the types with no item category and the types marked "also sold without a basket item" (Insurance Types and Schemas).
  • Lead types, which do not return a quote, are not covered by this page: Leads.
  • A type sold only with a basket item cannot be requested without one; a type sold only without a basket item is not offered with one.

Authentication and signing: Flows › Authentication.

Flow

Selling without a basket itemProcess: list the types sold without a basket item, get a quote without a basket source, create the order, collect the premium according to the option premiumCollectedBy value and track the order.EligibilityGET …/productsQuoteno basket sourceOrderPOST …/ordersCollect the premiumpremiumCollectedByTrack the orderGET …/orders/{orderId}LEGENDSTEPWITHOUT A BASKET ITEM
… stands for /api/v1/insurance. Call GET …/products without paymentIntentId; the response lists only the types sold without a basket item.

Check eligibility

Call GET /api/v1/insurance/products without paymentIntentId. The response returns the types enabled on your account that are sold without a basket item; basketItemIds is an empty array. Details: Eligibility › Without a basket item.

Get a quote

Do not send context.items or paymentIntentId in the quote request. Send the insured person's and the policy's details in the quote request, as for basket-linked types. The rules are below.

Create an order

Create an order with the option the buyer confirmed: Orders and Payment Binding. The order rules are the same as for basket-linked sales.

Collect the premium

Collection depends on the option's premiumCollectedBy value: Collecting the premium.

Track the policy

Track the order from the order endpoint; once the policy is issued, get its document: Policy Document.

Quote

The request is the same as the Quotes endpoint; only the basket source is not sent.

  • context.items and paymentIntentId are not sent. If either is sent, the quote is treated as basket-linked and types sold only without a basket item are not offered.
  • basketItemId is not sent on the type object; if it is, the request receives 422 insurance.validation.invalid.
  • If a type sold only with a basket item is requested without one, 412 insurance.type.not_available is returned.
  • The amount limits you set for a type on your account work on the item amount; they do not apply to sales without a basket item.
  • The response format is the same. In the options, basketItemIds is an empty array and paymentIntentId is null.

A quote request for PERSONAL_ACCIDENT with the policy fields. Values are examples; replace the values in angle brackets with your buyer's details, and the occupation code with a code you got from the reference endpoint:

{
  "insuranceType": "PERSONAL_ACCIDENT",
  "currency": "TRY",
  "merchantOrderId": "order-2001",
  "insured": [
    {
      "identityType": "TCKN",
      "identityNumber": "<identity number>",
      "birthDate": "<YYYY-MM-DD>",
      "email": "<email>",
      "phone": "<E.164 phone>"
    }
  ],
  "accident": {
    "coverageStartDate": "<YYYY-MM-DD>",
    "occupationCode": "<occupation code>",
    "beneficiaryName": "<beneficiary name>"
  }
}
source lunixi-sign.sh
BODY='<quote request, compact JSON>'
lunixi_sign POST "/api/v1/insurance/quotes" "$BODY"
 
curl -X POST "https://api-gateway.lunixi.com/api/v1/insurance/quotes" \
  -H "Content-Type: application/json" \
  -H "X-Key-Id: $LUNIXI_KEY_ID" \
  -H "X-Date: $DATE" \
  -H "X-Nonce: $NONCE" \
  -H "Digest: $DIGEST" \
  -H "X-Signature: $SIGNATURE" \
  --data-raw "$BODY"

Type fields: Insurance Types and Schemas › PERSONAL_ACCIDENT.

Collecting the premium

The option's premiumCollectedBy value shows who collects the premium. The collection paths are the same as for basket-linked sales:

premiumCollectedByCollectionDetails
PROVIDERYour provider collects the premium.Provider Collection
MERCHANT, with a Lunixi paymentThe premium is a separate item in your Lunixi payment's basket.With a Lunixi payment
MERCHANT, outside LunixiYou collect the premium through your own channel, report the payment and request the policy.Premium and Payment › Outside Lunixi

With a Lunixi payment

Create the payment with POST /api/v1/payments/intents (Checkout Form) and add the premium item to the basket. Then bind the order to the payment with bind-payment: Binding to a payment.

  • No item with insurance fields is needed in the basket. The premium item can be in the basket on its own or together with your items that carry no insurance fields.
  • Because the quote is not linked to a basket, the payment's basket is not compared with the quote; the other items in the basket do not affect the binding.
  • The premium item rules apply as they are: the item's id is the order's orderId, its price is the order's premiumAmount, and the item carries no insurance fields.
  • The premium of insurance sold without a basket item is not collected through payment links.

A payment request with only the premium item. The amount is an example:

{
  "amount": 45000,
  "currency": "TRY",
  "orderId": "order-2001",
  "callbackUrl": "https://example.com/payments/callback",
  "basketItems": [
    {
      "id": "inso_<32 hex digits>",
      "name": "Insurance premium",
      "price": 45000,
      "category1": "insurance",
      "itemType": "VIRTUAL"
    }
  ]
}

Errors

HTTPcodeWhat to do
412insurance.type.not_availableThe type is not sold without a basket item or is not enabled on your account. Check the Eligibility list.
422insurance.validation.invalidThe type fields do not satisfy the rules, or basketItemId was sent on the type object. details.errors[] gives the field path and the reason.
422insurance.reference.unknownA reference code is not recognized or has no counterpart at your connection's provider.
409insurance.order.premium_item_mismatchThe premium item in the Lunixi payment's basket does not match the order. See the premium item rules.

Other codes: Quotes › Errors, Error Codes.

Related