Get Signed PDF

This API will accept any PDF as input and return the digitally signed pdf.

Request Method

POST

Request URL

{base_url}/einv/pdf/sign

Request Headers

ParameterData TypeField ValidationsDescription

x-cleartax-auth-token

String

Cannot be empty

Mandatory.

User auth token.

gstin

String

Mandatory.

This is the GSTIN of the business, as registered on ClearTax.

Request Path Parameters

There are no path parameters for this API.

Request Query Parameters

There are no query parameters for this API.

Request Body

ParameterData TypeField ValidationsDescription

file

form-data

Content type: application/pdf

Mandatory.

PDF file to be signed.

x

form-data

number

Optional. X coordinate on pdf from top left Ex. 100

y

form-data

number

Optional. Y coordinate on pdf from top left Ex. 50

pageList

form-data

Enum - ALL

Optional. Parameter to denote if all signature needs to be placed on all pages. Ex. “ALL”

pageNumberList

form-data

String (comma-separated numbers)

Optional. If signature is required on specific pages, this parameter can be used. Ex. “1,3,5”

Sample Request

Sample Input File-

Response Status Codes

HTTP Status CodeDescription

200

For a successful retrieval

401

If the user is not authenticated for the operation

403

If the user is not authorized for the operation

Response Schema

Returns signed pdf.

Sample Response (Success)

HTTP Status Code: 200

Response Body (Succeeded state): Signed pdf

Sample Output File-

Sample Response (Error)

HTTP Status Code: 200

Response Body:

If DSC is not enabled-

{
    "ErrorList": [
        {
            "ErrorCode": "300109",
            "ErrorMessage": "Exception occurred while sign PDF.",
            "ErrorSource": "CLEARTAX"
        }
    ]
}

Authorization error-

{
    "error_code": "403",
    "error_message": "You don't have access",
    "error_source": "CLEARTAX"
}

API Validations

  1. The file in the request should be a PDF file.

  2. Size limit of the file should be less than 1MB.

API Constraints

  1. This API needs to be authenticated with a valid user authentication token. If the authentication token is not present or is invalid, the API will return HTTP Status Code 401.

  2. If the authentication token is valid, but the user does not have the authorization to download invoice with given search parameters, then the API will return an error "You don't have any data present for the selected Document Details".

  3. You should first enable DSC setting on Clear E-Invoice Portal. Also only admin or super admin user can sign DSC.

  4. X,Y Signature coordinates depend on the resolution of the PDF. If signature exceeds the actual page size, signature won’t be visible on the output PDF.

  5. For landscape pdf we can use x and y as <=500 ,anything above 500 will be set to default value.

Last updated