---
title: Create Order
description: Track an insurance order by registering it with order ID, affiliate ID, and provider details.
---

After initializing an order, an affiliate should call this API to track the insurance order. We must pass order id, affiliate id, provider id and category in request. If the request has valid details, we will get a reference id and a url to track it.

POST

```
https://kraken.airpay.co.in/airpay/ms/insurance/api/create-order
```

## Header

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| Content-Type  required | String | Value : application/x-www-form-urlencoded (required) | `application/x-www-form-urlencodeds` |
| processor-key  required | String<br>(`1-20`) | Authentication key for airpay (required) | `xvAvkuxKczNf8sapHZv5ia9qzPEB9iPRvtLr4iJn4SzmMjfuWgVvSsXvyw==` |
| checksum  required | String | Sha256 of value of hash('sha256','(orderid)(affiliateid)(providerid), processor-key) here key is AIRPAYKEY as provided | `d1e2629f8b5818all186a4b7d8e5d9a03b6aef297842ec571ad0cc2278bcfcf93` |

## Request Body

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| order_id  required | Alphanumeric  <br>(20) | Should be unique eg 12345678901234567890 | `MAWEB107051612117107` |
| affiliate_id  required | Numeric  <br>(1-10) | Required provided source of orderid eg 649648 | `AF0028SF1644819013` |
| provider_id  required | Numeric  <br>(1-10) | Provided insurance company id Required eg 1234 | `7` |
| cat  optional | Text | This is insurance category. It will redirect to insurer landing page of that category | `PA` |

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| status  required | Numeric | Api status [1- success,0-fail](length 1) | `1,0` |
| data  required | Jsonarray | If fail data will be null,<br>If 200 then data will be with id in insurance system and url |
| message  required | string<br>(`50`) | Message | `success,Duplicate Order` |

## Request Example

```
curl --location 'https://kraken.airpay.co.in/airpay/ms/insurance/api/create-order' \
--header 'content_type: application/x-www-form-urlencoded' \
--header 'processor-key: xvAvkuxKczNf8sapHZv5ia9qzPEB9iPRvtLr4iJn4SzmMjfuWgVvSsXvyw==' \
--header 'checksum: d1e2629f8b5818all186a4b7d8e5d9a03b6aef297842ec571ad0cc2278bcfcf93' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Cookie: _csrf=103936bf3ssa2098165c59d08c9288e68459dcac60bba4d83cdb7c0a17163ea6a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22XORQcv-kviZ_teErDmi5drwuAhdUQpZE%22%3B%7D' \
--data-urlencode 'order_id=MAWEB107051612117107' \
--data-urlencode 'affiliate_id=AF0028SF1644819013' \
--data-urlencode 'cat=PA' \
--data-urlencode 'provider_id=7'
```

### Success Response

```
{
    "status": "1",
    "data": {
        "referenceid": 45794,
        "url": "https://arpy.example.com/partner_sso?enc=gaMupoEmSBDj005WH0KcunUK+P1Do1P5N+V6BBOdl030Wuo3w6xXIct0lyskZpyfuIEuEPTnklKpSzWEvkdQOcE0AEdJzoyPbYXI4n9WZtyCSeI74XF0QQ+V6aCYfqJhdocV655bsWHoharjqswuioirqHtXUNb/NC5kkS06aBOxrIfIz1Rl848DkRiSptI+FLo3o93ExerdsL0tOtTx8FlWeo8p8sKIDp5vocXQsFHX+tFaFCyBOSVUZpNrWiSKuGn/bLxDAky+rOEVVGvmUXecGS7iO7CJIUutuHT+NMKZklZWkXCDtxm9M84IZkxU&package_code=AIRPAY_PA&redirect_url=product_landing"
    },
    "message": "success"
}
```

### Error Response

```
{
    "status": "0",
    "data": [],
    "message": "Duplicate Order"
}
```