Sign PDF API Base 64 Encoded

This API will accept base 64 encoded string as input and return the digitally signed pdf.

Request Method

POST

Request URL

{{BASE_URL}}/einv/pdf/sign/binary

Request Headers

Parameter
Data Type
Field Validations
Description

x-cleartax-auth-token

String

Cannot be empty

Mandatory. User auth token.

gstin

String

NA

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

Request Path Params

There are no path parameters for this API.

Request Query Params

Parameter
Data Type
Field Validations
Description

x

Integer

Number

Optional. X coordinate on pdf from top left Ex. 100 Default: 350

y

Integer

Number

Optional. Y coordinate on pdf from top left Ex. 50 Default: 750

pageList

NA

Enum - ALL

Optional. Parameter to denote if all signature needs to be placed on all pages. Ex. โ€œALLโ€ Default: Signature is added on the last page of the document.

pageNumberList

String

String (comma-separated numbers)

Optional. If signature is required on specific pages, this parameter can be used. Ex. โ€œ1,3,5โ€

Request Body

Parameter
Body Type
Field Validations
Description

base64String

String

Should be a valid base64 encoded string.

Mandatory. Base 64 encoded string of pdf file.

Response Status Codes

HTTP Status Code
Description

200

For a successful retrieval

400

If there some invalid/incorrect content in the request.

401

If the user is not authenticated for the operation

403

If the user is not authorized for the operation

Response Schema

Returns sign pdf

Sample Request & Response

Request

Response (Success)

HTTP Status Code - 200

Response (Error)

HTTP Status Code - 200

Response Body - If dsc is not enabled.

API Validations

  1. The base 64 string in the request body should be a PDF file.

  2. Size limit of the file is 1MB.

API Constraints

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

  2. If the auth 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. Users should add the dsc setting on the UI. Also only admin or super admin user can sign dsc

  4. Max input file size supported is 1MB.

  5. X,Y Signature coordinates depend on the resolution of the PDF. If the signature exceeds the actual page size, the signature wonโ€™t be visible on the output PDF.

Last updated

Was this helpful?