---
title: eSign Link Generation
description: This API will create an invoice for the customer in order to accept the payment.
---

This API is for generating esign link for getting signatures on some document or agreement. After generating the link, user can browse and complete his eSign process. In this process, user will receive eSigned document via mail. We must pass docrefid, email, first name, last name, mobile no and doc link in request. If the request has valid details, we will get a unique link for esign.

## POST

```
https://kraken.airpay.co.in/airpay/ms/esign/api/create-esign-request
```

## Header

| Field | Type | Description |
| --- | --- | --- |
| affiliate | Text | Will be provided by Airpay (required) |
| checksum | Text | $string = $param.self::$secret_key;sha256(<concate all values+SECRET KEY>); (required) |
| processor-key | Text | Will be provided by airpay ( required) |

## Parameter

| Field      | Type         | Required | Description                                                   |
| ---------- | ------------ | -------- | ------------------------------------------------------------- |
| docrefid   | Alphanumeric | Yes      | Document reference ID (length 7). Will be provided by Airpay. |
| email      | Text         | Yes      | Email (length 120)                                            |
| first_name | Text         | No       | First name (min 2, max 100)                                   |
| last_name  | Text         | No       | Last name (min 2, max 100)                                    |
| mobile_no  | Numeric      | No       | Mobile number (length 10)                                     |
| doclink    | Alphanumeric | No       | Document link (length 125). Must be unique.                   |


## Request-Example:

```
curl --location --request POST 'https://kraken.airpay.co.in/airpay/ms/esign/api/create-esign-request' \
--header 'affiliate: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'checksum: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'processor-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--form 'docrefid="55AAVB8"' \
--form 'email="xyz@airpay.co.in"' \
--form 'doclink="https://examples.airpay.co.in/admin/esign_html_template/100035"' \
--form 'mobile_no="7558599593"' \
--form 'first_name="Prasanth"' \
--form 'last_name="krishna"'
```

## Success 200

| Field | Type | Description |
| --- | --- | --- |
| status | Numeric | Status code (length 3) |
| message | Text | Message<br>Success - 200 (The transaction is success)<br>Transaction in Process - 211 (The transaction is processing)<br>Failed - 400 (The transaction is failed)<br>Dropped - 401 (The transaction will not register properly)<br>Cancel - 402 (payment that has not yet been processed)<br>Incomplete - 403 (Not recieved any call back from bank)<br>Bounced - 405 (The transaction has bounced)<br>No Records - 503 (There are no records found) |
| txn_id | Alphanumeric | Transaction id |
| url | Text | Generated Esign link |
## Success-Response:

```
HTTP/1.1 200 OK
{
     "status": 200,
     "message": "success",
     "txn_id": 1048,
     "url": "https://www.test_arpy.in/cPoTe1kh3"
}
```
## Error-Response:

```
HTTP/1.1 400 Failed
 {
     "status": 400,
     "message": "Documnent reference id does not exist"
 }
```