---
title: eSign Using Doc Signer API
slug: api-marketplace/esign-using-doc-signer-api
description: Learn how to incorporate digital signatures seamlessly into your document workflows with the eSign Using Doc Signer API. This document provides detailed information on API authentication, input parameters, and sample cURL commands for making API calls. Cu
createdAt: 2023-08-07T06:36:16.420Z
---

# Introduction

Introducing the "**eSign Using Doc Signer API**" – a cutting-edge solution that revolutionizes the way documents are electronically signed, combining the advanced capabilities of **Document Signer Certificates Class 2 and Class 3**. This API empowers you to seamlessly incorporate digital signatures into your document workflows, leveraging the enhanced security of Class 2 and Class 3 certificates. What sets this API apart is its remarkable ability to provide complete customization of the signing process. With the freedom to precisely tailor the position of the signature within the document, you can ensure a seamless alignment with your unique requirements. By utilizing this innovative API, you not only elevate the efficiency and convenience of document signing, but you also unlock the potential for enhanced security and compliance. **Experience a new era of electronic signatures, where every document is effortlessly signed, sealed, and delivered with precision.**

# Authentication

API authentication is a crucial security process that ensures authorized access to an application programming interface (API). It involves validating the identity of users or systems seeking to interact with the API. Please use the `access token` shared with you by your assigned Signzy's CSM. Please set the value of the key `Authorization` in the headers to the `access token`, while making an API call. In this way, Signzy's system will be able to authenticate you and you will be able to make a successful API call.&#x20;

# API Details

## Sample cURL

:::CodeblockTabs
Pre Production

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/esign/docSigner' \
--header 'Content-Type: application/json' \
--header 'Authorization: *********************************' \
--data '{
    "pdf": "",
    "signatureOptions": "docSignerClass3",
    "certificateId": "",
    "signatures": [
        {
            "pageNo": [
                1
            ],
            "signaturePosition": ["CUSTOMIZE"],
            "xCoordinate": [10],
            "yCoordinate": [10],
            "height": 70,
            "width": 130
        },
        {
            "pageNo": [
                "LAST"
            ],
            "signaturePosition": [
                "TopLeft"
            ],
            "height": 70,
            "width": 130
        }
    ],
    "logoUrl": "",
    "fileTtl": "2 days",
    "reason": "Test",
    "location": "Bangalore",
    "estamp": {
        "stampDetails": [
            {
                "stateCode": "KA",
                "articleCode": "KA",
                "stampDutyValue": 10,
                "purposeOfStampDuty": "test",
                "count": "1"
            }
        ],
        "type": "eStamp",
        "firstPartyName": "A",
        "secondPartyName": "B",
        "stampDutyPaidBy": "A",
        "considerationPrice": "50"
    }
}'
```

Production

```curl
curl --location 'https://api.signzy.app/api/v3/esign/docSigner' \
--header 'Content-Type: application/json' \
--header 'Authorization: *********************************' \
--data '{
    "pdf": "",
    "signatureOptions": "docSignerClass3",
    "certificateId": "",
    "signatures": [
        {
            "pageNo": [
                1
            ],
            "signaturePosition": ["CUSTOMIZE"],
            "xCoordinate": [10],
            "yCoordinate": [10],
            "height": 70,
            "width": 130
        },
        {
            "pageNo": [
                "LAST"
            ],
            "signaturePosition": [
                "TopLeft"
            ],
            "height": 70,
            "width": 130
        }
    ],
    "logoUrl": "",
    "fileTtl": "2 days",
    "reason": "Test",
    "location": "Bangalore",
    "estamp": {
        "stampDetails": [
            {
                "stateCode": "KA",
                "articleCode": "KA",
                "stampDutyValue": 10,
                "purposeOfStampDuty": "test",
                "count": "1"
            }
        ],
        "type": "eStamp",
        "firstPartyName": "A",
        "secondPartyName": "B",
        "stampDutyPaidBy": "A",
        "considerationPrice": "50"
    }
}'
```

Pre Production (e-Challan)

```curl
curl --location 'https://api-preproduction.signzy.app/api/v3/esign/docSigner' \
--header 'Content-Type: application/json' \
--header 'Authorization: *********************************' \
--data '{
    "pdf": "",
    "signatureOptions": "docSignerClass2",
    "certificateId": "",
    "signatures": [
        {
            "pageNo": [
                "LAST"
            ],
            "signaturePosition": [
                "customize"
            ],
            "xCoordinate": [
                100,
                150,
                200
            ],
            "yCoordinate": [
                50,
                50,
                20
            ],
            "height": 100,
            "width": 200
        }
    ],
    "estamp": {
        "type": "eChallan",
        "secondPartyName": "",
        "firstPartyName": "",
        "stateCode": "",
        "articleCode": "",
        "purposeOfStampDuty": "",
        "amount": 30,
        "location": "topLeft",
        "custmonDefacement": "true",
        "pageNo": [
            5,
            12
        ],
        "message": "Stamp duty of Rs.{{amount}} paid via Stamp Paper Certificate No. {{challanNo}} dated {{challanDate}}"
    },
    "logoUrl": "",
    "fileTtl": "2 days"
}'
```

Production (e-Challan)

```curl
curl --location 'https://api.signzy.app/api/v3/esign/docSigner' \
--header 'Content-Type: application/json' \
--header 'Authorization: *********************************' \
--data '{
    "pdf": "",
    "signatureOptions": "docSignerClass2",
    "certificateId": "",
    "signatures": [
        {
            "pageNo": [
                "LAST"
            ],
            "signaturePosition": [
                "customize"
            ],
            "xCoordinate": [
                100,
                150,
                200
            ],
            "yCoordinate": [
                50,
                50,
                20
            ],
            "height": 100,
            "width": 200
        }
    ],
    "estamp": {
        "type": "eChallan",
        "secondPartyName": "",
        "firstPartyName": "",
        "stateCode": "",
        "articleCode": "",
        "purposeOfStampDuty": "",
        "amount": 30,
        "location": "topLeft",
        "custmonDefacement": "true",
        "pageNo": [
            5,
            12
        ],
        "message": "Stamp duty of Rs.{{amount}} paid via Stamp Paper Certificate No. {{challanNo}} dated {{challanDate}}"
    },
    "logoUrl": "",
    "fileTtl": "2 days"
}'
```
:::

## Input Parameters

| **Parameter Name**           | **Type**         | **Mandatory/Optional**  | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| ---------------------------- | ---------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| pdf                          | String           | Mandatory               | Pass the document to be signed in below formats -<br />- URL of the PDF file<br />- Base64 of the PDF file                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| signatureOptions             | String           | Mandatory               | Pass either of the below 2 supported signature options -<br />- <font color="#3b9f0f">`docSignerClass2`</font><br />- <font color="#3b9f0f">`docSignerClass3`</font>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| certificateId                | String           | Mandatory               | Pass the certificate ID of <font color="#3b9f0f">`docSignerClass2` </font>or <font color="#3b9f0f">`docSignerClass3`</font>whichever you want to use to sign the document. CertificateID can be generated by using UploadDocSignConfig API.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| signatures                   | Array of Objects | Mandatory               | An array of signature objects where the signatures will be placed                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| signatures.pageNo            | Array            | Mandatory               | Array of page numbers to specify where the signature(s) should be placed. <br />**Note -** In case where signature needs to be placed on all pages, pass the value <font color="#3b9f0f">`ALL`</font><br />In case where signature needs to be placed on all pages, pass the value <font color="#3b9f0f">`LAST`</font>                                                                                                                                                                                                                                                                                                                                                                                                                       |
| signatures.signaturePosition | String           | Mandatory               | Position for the signature on the specified page. It will accept the following values -<br />- <font color="#3b9f0f">`TOPLEFT`</font><br />- <font color="#3b9f0f">`TOPCENTER`</font><br />- <font color="#3b9f0f">`TOPRIGHT`</font><br />- <font color="#3b9f0f">`MIDDLELEFT`</font><br />- <font color="#3b9f0f">`MIDDLECENTER`</font><br />- <font color="#3b9f0f">`MIDDLERIGHT`</font><br />- <font color="#3b9f0f">`BOTTOMLEFT`</font><br />- <font color="#3b9f0f">`BOTTOMCENTER`</font><br />- <font color="#3b9f0f">`BOTTOMRIGHT`</font><br />- <font color="#3b9f0f">`CUSTOMIZE`</font><br />In case of passing the value "<font color="#3b9f0f">`CUSTOMIZE`</font>", the xCoordinate, yCoordinate, height and width must be passed |
| signatures.xCoordinate       | Array of Numbers | Conditionally Mandatory | X-coordinate for the specified signature placement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| signatures.yCoordinate       | Array of Numbers | Conditionally Mandatory | Y-coordinate for the specified signature placement.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| signatures.height            | Number           | Conditionally Mandatory | Height of the signature box for the specified page. The minimum value is 70(pixels). If no value is provided or a value less than 70 is passed, it will be set to the default height of 70.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| signatures.width             | Number           | Conditionally Mandatory | Width of the signature box for the specified page. The minimum value is 130(pixels). If no value is provided or a value less than 130 is passed, it will be set to the default width of 130.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| logoUrl                      | String           | Mandatory               | URL of the logo of the client which will be used in the sign that will appear on the signed pdf file.<br />It can have 3 allowed formats -<br />- PNG (.png)<br />- JPG (.jpg)<br />- JPEG (.jpeg)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| fileTtl                      | String           | Mandatory               | The time to live for the signed PDF file. Post this TTL, the file will be deleted. It should be in days. For example, 2 days.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| reason                       | String           | Optional                | **Only applicale in cases of Doc Signer Class 3.&#x20;**<br />You can pass a reason for the signing<br />You can remove this from the request body if you are using Doc Signer Class 2.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| location                     | String           | Optional                | **Only applicale in cases of Doc Signer Class 3.&#x20;**<br />You can pass a location for the signing. For example, Bangalore.<br />You can remove this from the request body if you are using Doc Signer Class 2.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

### Parameter with description needed in case of estamping only

| **Parameters**                  | **Description**                                                                                                                                                                                                                                                                                           | **Type**         | **Mandatory/Optional**                 |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | -------------------------------------- |
| type                            | You want to use estamp or eChallan.<br />Please pass <font color="#3b9f0f">`"eStamp"`</font> if you want to use eStamping                                                                                                                                                                                 | String           | Mandatory                              |
| stampDetails                    | Details of the stamp papers which needs to be stamped on the document                                                                                                                                                                                                                                     | Array Of Objects | Mandatory                              |
| stampDetails.stateCode          | State code of the states where estamps are valid. <br />Possible values : \["KA", "MH", "GJ", "AP", "AN", "AS", "BR", "CT", "CH", "DN", "DD", "DL", "HP", "JK", "JH", "LA", "OR", "PY", "RJ", "TN", "TR", "UP", "UT", "PB", "WB", "GA", "HR", "KL", "MN", "ML", "MZ", "NL", "LD", "SK", "AR", "TG", "MP"] | String           | Mandatory                              |
| firstPartyName                  | Name of first party involved in the transaction                                                                                                                                                                                                                                                           | String           | Mandatory                              |
| secondPartyName                 | Name of second party involved in the transactiton                                                                                                                                                                                                                                                         | String           | Mandatory                              |
| stampDetails.stampDutyValue     | Amount of the stamp duty                                                                                                                                                                                                                                                                                  | String           | Mandatory in cases when type is eStamp |
| stampDetails.purposeOfStampDuty | Purpose of stamp duty                                                                                                                                                                                                                                                                                     | String           | Mandatory                              |
| considerationPrice              | Amount of fund involved in the transaction                                                                                                                                                                                                                                                                | string           | Mandatory in cases when type is eStamp |
| stampDetails.articleCode        | Article Code for E-stamping                                                                                                                                                                                                                                                                               | String           | Mandatory                              |
| stampDutyPaidBy                 | Name of the party who paid the stamp duty(first party or second party)                                                                                                                                                                                                                                    | String           | Mandatory                              |
| stampDetails.count              | Count of the stamp papers that needs to be used                                                                                                                                                                                                                                                           | String           | Mandatory                              |

### Parameter with description needed in case of echallan only

| **Parameters**     | **Description**                                                                                                                                                                                                                                                                                                                                                                                | **Type** | **Mandatory/Optional**                    |
| ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------- |
| type               | You want to use estamp or eChallan.<br />Please pass <font color="#3b9f0f">`"eChallan"`</font>, if you want to use eChallan.                                                                                                                                                                                                                                                                   | String   | Mandatory                                 |
| stateCode          | State code of the states where echallans are valid. <br />Possible values : \["KA", "MH", "GJ", "AP", "AN", "AS", "BR", "CT", "CH", "DN", "DD", "DL", "HP", "JK", "JH", "LA", "OR", "PY", "RJ", "TN", "TR", "UP", "UT", "PB", "WB", "GA", "HR", "KL", "MN", "ML", "MZ", "NL", "LD", "SK", "AR", "TG", "MP"]                                                                                    | String   | Mandatory                                 |
| firstPartyName     | Name of first party involved in the transaction                                                                                                                                                                                                                                                                                                                                                | String   | Mandatory                                 |
| secondPartyName    | Name of second party involved in the transactiton                                                                                                                                                                                                                                                                                                                                              | String   | Mandatory                                 |
| purposeOfStampDuty | Purpose of stamp duty/challan                                                                                                                                                                                                                                                                                                                                                                  | String   | Mandatory                                 |
| articleCode        | Article Code                                                                                                                                                                                                                                                                                                                                                                                   | String   | Mandatory                                 |
| location           | Location of defacement<br />Available Option : topLeft, topCenter, middleLeft, middleCenter, bottomLeft, bottomCenter<br />Right not included as there can be space issue.                                                                                                                                                                                                                     | String   | Optional (By default bottomLeft)          |
| amount             | amount of the eChallan duty                                                                                                                                                                                                                                                                                                                                                                    | String   | Mandatory                                 |
| pageNo             | Page no on which defacement is needed.                                                                                                                                                                                                                                                                                                                                                         | Array    | optional(By default first page)           |
| custmonDefacement  | custmDefacement is required or not                                                                                                                                                                                                                                                                                                                                                             | boolean  | Optional(By default false)                |
| message            | text for custom defacement, It can contain variables. the variable should be enclosed in \{\{}} and can be one from the given *&#x7B;&#x7B;challanNo}}*,*&#x7B;&#x7B;challanDate}}*,*&#x7B;&#x7B;stateCode}}*,*&#x7B;&#x7B;firstParty}}*,*&#x7B;&#x7B;articleCode}}*,*&#x7B;&#x7B;amount}}*,*&#x7B;&#x7B;secondPartyName}}*,*&#x7B;&#x7B;purposeOfStampDuty}}*,*&#x7B;&#x7B;stampDutyPaidBy}}* | String   | Mandatory when custmonDefacement is true  |

## Sample Response

:::CodeblockTabs
200

```json
{
    "pdf": "",
    "signatureOptions": "",
    "signedPdf": "",
} 
```
:::

## Output Parameters

| **Parameter Name** | **Type** | **Description**                                                                                                                                                                                 |
| ------------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| pdf                | String   | The input PDF document to be signed                                                                                                                                                             |
| signatureOptions   | String   | 2 supported signature options -<br />- <font color="#3b9f0f">`docSignerClass2`</font><br />- <font color="#3b9f0f">`docSignerClass3`</font><br />Either of the 2 was used to sign the document. |
| signedPdf          | String   | The signed PDF document after signing using the supported class 2 or class 3 document signer certificates.<br />- If the input PDF is a URL or Base64, the signed PDF would be a URL.           |

## Sample Errors

:::CodeblockTabs
400

```json
{
    "name": "error",
    "message": "docSignerClass3CertificateValues is not allowed",
    "reason": "VALIDATION_ERROR",
    "type": "Bad Request",
    "statusCode": 400
}
```

400

```json
{
    "name": "error",
    "message": "signatures[0].signaturePosition[0] must be one of [TOPLEFT, TOPCENTER, TOPRIGHT, MIDDLELEFT, MIDDLECENTER, MIDDLERIGHT, BOTTOMLEFT, BOTTOMCENTER, BOTTOMRIGHT, CUSTOMIZE]",
    "reason": "VALIDATION_ERROR",
    "type": "Bad Request",
    "statusCode": 400
}
```

400

```json
{
    "name": "error",
    "message": "signatures[0].xCoordinate is not allowed",
    "reason": "VALIDATION_ERROR",
    "type": "Bad Request",
    "statusCode": 400
}
```

401

```json
{
    "message": "Invalid authentication credentials"
}
```

409

```json
{
    "name": "error",
    "message": "Error from upstream in signing of the document with the given inputs for Document Signer Certificate Class3 method",
    "reason": "VALIDATION_ERROR",
    "type": "Bad Request",
    "statusCode": 409
}
```

500

```json
{
    "error": {
        "name": "error",
        "message": "Internal Server Error",
        "reason": "INTERNAL_SERVER_ERROR",
        "type": "Internal Server Error",
        "statusCode": 500
    }
}
```
:::

## Error Parameter

| **Parameter** | **Type** | **Description**                                 |
| ------------- | -------- | ----------------------------------------------- |
| name          | String   | In case of error, the name will come as "error" |
| message       | String   | Error Message                                   |
| reason        | String   | Reason for the Error                            |
| type          | String   | Type of Error                                   |
| statusCode    | String   | Status code of the Error                        |

## Error Codes

| **Error Code** | **Error Message**     | **Explanation**                                                    |
| -------------- | --------------------- | ------------------------------------------------------------------ |
| 400            | Bad Request           | Input parameter has a missing required parameter or invalid inputs |
| 401            | Authorization Failed  | Authorization token is invalid                                     |
| 409            | Upstream Error        | Error from the upstream while doing the signing                    |
| 500            | Internal Server Error | Internal error at Signzy, Please reach out to help\@signzy.com     |

