---
title: XML Request Generate
description: This API will create an invoice for the customer in order to accept the payment.
---

This API is for generating xml request for esign. We must pass docrefid, doclink, email, first name, last name and mobile no in request. If the request has valid details, we will get a success response.

## POST

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

## 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) |
| doclink    | URL          | Yes      | Document link                    |
| 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)        |

## Request-Example:

```
curl --location --request POST 'https://kraken.airpay.co.in/airpay/ms/esign/api/generate-request-xml' \
--header 'affiliate: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'checksum: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'processor-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--form 'docrefid="YPRWJZJ"' \
  --form 'email="xyz@airpay.co.in"' \
  --form 'doclink="https://leads.airpay.co.in/tc_retailer.php?id=177"' \
  --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<br>Failed - 400 |
| url | Url | Generated url |
| xml | Text | Generated xml |
## Success-Response:

```
HTTP/1.1 200 OK
{
     "status": 200,
     "xml": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?><Esign AuthMode=\"1\" aspId=\"ABCAPSPLPROD001071\" ekycId=\"\" ekycIdType=\"A\" responseSigType=\"pkcs7\" responseUrl=\"https://test_esign.arpy.co.in/api/SignResponse\" sc=\"Y\" ts=\"2022-07-28T10:37:11\" txn=\"OCN11SCAJ3\" ver=\"2.1\">...</Esign>\n",
     "message": "success",
    "url": "https://esign-example.com/nsdl-essp/authenticate/esign-doc/"
}
```
## Error-Response:

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