Sending envelopes with a Stamp field
Signing documents with a stamp is common in many countries. See how to use the eSignature REST API to enable signers to sign with electronic stamps.
In Asian countries, specifically in East Asia, people traditionally used to use a stamp to provide evidence of the identity of the contracting party. Recently, many companies in Asia have adopted a signature instead of a stamp, but there are still lots of companies that use stamps, especially in Japan. To enable stamps to be used for electronic signatures in the various countries and cultures where the practice is still common, Docusign introduced the Stamp feature. In this post, I’ll present several code examples for how to use the Stamp field.
Prerequisites
Before you use a stamp field in your envelope, log in to your Docusign developer account, then select Settings > Sending Settings page to confirm whether the “Enable signature stamp field” setting is enabled. If it isn’t, please enable it and save your changes. If the setting is greyed out and you are not able to enable it, please open a Support case to get further help to enable this setting. Once you enable the above setting, you are now ready to write the code.
Inserting a stamp into your envelope
You can put the stamp field in your envelope with the code below. I’m using the Apex Toolkit here, but I provide additional SDK examples following.
Apex Toolkit
dfsle.Tab signHereTab = new dfsle.SignHereTab()
.withStamp(new dfsle.SignHereTab.Stamp(
'stamp', // Type of stamp [signature | stamp]
null, // externalId
null, // format of the stamp [NameHanko | NameDateHanko]
null, // specifies the user's signature name
null, // phonetic spelling of the signature name, Hiragana version in Japanese
null, // stamp image
null, // date stamp
null // optional custom field
))
.withPosition(new dfsle.Tab.Position(1, 1, 320, 290, null, null));
Note that since the stamp is defined as a subtype of the signature field, you should use the SignHereTab.withStamp method to implement the stamp field.
The first parameter specifies the type of stamp. You may choose between stamp and signature. If you set the value as signature, then this field will be shown as a normal SignHere tab.
The second parameter specifies the external ID. This parameter is internally updated, so please set this value as null.
The third parameter specifies the format of the stamp. Valid values are NameHanko and NameDateHanko. NameHanko refers to the stamp that displays only the name of the signer. On the other hand, NameDateHanko refers to the stamp that displays both the name and date. This value is specified by the recipient, so please set this as null.
The fourth parameter is used to specify the signature name. If you are in Japan, you may put the recipient’s Kanji name into this parameter. But this value is specified by the recipient, so please set this as null.
The fifth parameter is used to specify the phonetic spelling of the signature name. If you are in Japan, you may set the Hiragana/Katakana version of the recipient’s signature name. But this value is specified by the recipient, so please set this as null.
The sixth parameter specifies the image of a stamp. This value is specified by the recipient, so please set this as null.
The seventh parameter specifies the area in which the date stamp is placed. This value is specified by the recipient, so please set this as null.
The eighth parameter specifies an optional custom field for the stamp.
And here is the corresponding code in some of our other SDK-supported languages:
C#
SignHere signHere1 = new SignHere {
AnchorString = "signHere",
AnchorUnits = "pixels",
AnchorYOffset = "10",
AnchorXOffset = "20",
StampType = "stamp"
};
Java
SignHere signHere = new SignHere();
signHere.setAnchorString("signature");
signHere.setAnchorUnits("pixels");
signHere.setAnchorYOffset("10");
signHere.setAnchorXOffset("20");
signHere.setStampType("stamp");
Node.js
let signHere1 = docusign.SignHere.constructFromObject({
anchorString: "signHere",
anchorYOffset: "10",
anchorUnits: "pixels",
anchorXOffset: "20",
stampType: "stamp"
})
PHP
$sign_here = new SignHere([
'anchor_string' => 'signature',
'anchor_units' => 'pixels',
'anchor_y_offset' => '10',
'anchor_x_offset' => '20',
'stamp_type' => 'stamp'
]);
Python
sign_here1 = SignHere(
anchor_string="signature",
anchor_units="pixels",
anchor_y_offset="10",
anchor_x_offset="20",
stamp_type="stamp"
)
Ruby
sign_here1 = DocuSign_eSign::SignHere.new
sign_here1.anchor_string = '/sn1/'
sign_here1.anchor_units = 'pixels'
sign_here1.anchor_x_offset = '20'
sign_here1.anchor_y_offset = '10'
sign_here1.stamp_type = 'stamp'
Rest API
This example shows the raw JSON for the stamp:
"tabs": {
"signHereTabs": [
{
"name": "New Signature Tab",
"tabLabel": "SignatureTab",
"xPosition": "269",
"yPosition": "701",
"required": "true",
"documentId": "1",
"pageNumber": "1",
"stampType": "stamp"
}
]
}
That’s it for how you set the stamp field in your envelope. If you are in Japan especially, your recipient can send and sign the envelope with their eHanko by adopting the eHanko provided by the Docusign library. All you need to do is input your last name in Japanese; then our library will generate the eHanko for you. I highly recommend you try this feature, as it will simplify the signing process and free you from bringing your Hanko every time for signing.
Additional resources
Byungjae Chung has been a Developer Support Engineer for Docusign since 2022. He specializes in helping developers resolve issues they encounter when developing applications using Docusign APIs. You can reach Byungjae on LinkedIn.
Related posts