Create ADLD Policy API
This API allows external partners to create an Accidental Damage & Liquid Damage (ADLD) protection policy. It validates authentication, required fields, product eligibility, duration limits, calculates the protection plan price, generates a unique policy ID, and saves the policy record.
Authentication
All API requests must include the API key in the request header.
| Header | Type | Required | Description |
|---|---|---|---|
| X-API-Key | string | Required | Your Assurify API key for authentication |
| Content-Type | string | Required | application/json |
Request Body Parameters
All fields marked as required must be included in the request payload.
| Parameter | Type | Required | Description |
|---|---|---|---|
| product | string | Required | Product type (e.g., "Mobile", "Laptop"). Must be eligible for ADLD coverage. |
| duration | string | Required | Plan duration in format "1 Year", "2 Years", etc. Must not exceed the maximum allowed duration for the product category. |
| deviceprice | number | Required | Purchase price of the device. Used to calculate the protection plan premium. |
| name | string | Required | Full name of the customer |
| string | Required | Customer's email address | |
| phone | string | Required | Customer's phone number |
| address | string | Required | Customer's full address |
| city | string | Required | City name |
| state | string | Required | State name |
| pincode | string | Required | Postal/ZIP code |
| brand | string | Required | Device brand (e.g., "Apple", "Samsung"). Used to determine the applicable premium rate. |
| model | string | Required | Device model name or number |
| imei1_serialno | string | Required | Device IMEI number or serial number |
| policysource | string | Required | Partner/source company name. Must match an existing Assurify account. |
| brand_warranty_duration | integer | Required | Manufacturer warranty duration in years (e.g., 1, 2). Used to calculate brand warranty end date. |
Success Response
On successful policy creation, the API returns HTTP 201 Created with the following fields:
| Field | Type | Description |
|---|---|---|
| policyid | string | Generated unique policy ID (e.g., B250217P0010001) |
| device purchase date | datetime | Timestamp when the policy was created (used as device purchase date) |
| brand warranty start | datetime | Brand warranty start date (same as device purchase date) |
| brand warranty end | datetime | Brand warranty end date, calculated as start date + brand_warranty_duration years |
| plan purchase date | datetime | Timestamp when the protection plan was purchased |
| policy status | string | Always "Created" on successful policy creation |
| protection plan price | number | Calculated premium: deviceprice × rate × years, rounded to 2 decimal places |
| orderid | string | Generated cart order ID (format: BASC{count}) |
Error Responses
The API may return the following error codes:
| Status Code | Error Type | Description | Solution |
|---|---|---|---|
| 401 | Unauthorized | Authorization header is missing | Include the X-API-Key header in your request |
| 401 | Unauthorized | Un-Authorized API Call | Ensure the X-API-Key value is valid and active |
| 400 | Bad Request | One or more required fields are missing or empty | Ensure all 15 required fields are present and non-empty |
| 400 | Validation Error | Invalid duration format | Use format "1 Year", "2 Years", etc. |
| 400 | Validation Error | Product is not eligible for ADLD insurance | Use a product type supported under ADLD coverage |
| 400 | Validation Error | Duration exceeds maximum allowed for product category | Reduce the duration to within the allowed limit for the product |
| 400 | Validation Error | Rate not defined for the given brand and category | Use a supported brand for the selected product |
| 400 | Validation Error | ADLD plan not available for the given product and duration | Verify the plan exists for the selected product and duration combination |
| 400 | Validation Error | Policy source account does not exist | Ensure policysource matches a valid registered Assurify account name |
| 400 | Serializer Error | Policy or cart data failed validation | Check the response body for specific field-level errors |