In order to use the embedded signature block a party instance must be created. This is done using the /createparty method as detailed in the API documentation. This will allow you to supply optional first name, surname and email address details and will return a "party_instance_id".
Once the party instance ID has been created this is then used to create the signature block iframe.
The /createparty endpoint will also return the URL to use for the signature block.
The iframe will allow the user to confirm the first name, surname and email details as supplied when the party instance was created. If these details were not supplied at that time, then the user can enter them here.
Once those details have been entered then the user will be asked to create their signature, either by drawing one or by using a pre-set one* based on the name details supplied.
Once the user has created their signature, they will now click the "APPLY SIGNATURE"* button. This will then set that party instance as "signed" and it is now ready to be used when sending the transaction.
* The preset signature option can be disabled and the button label can be changed in the request to the /createparty endpoint.
Additionally the behaviour of the name and email fields can be set along with the header text.
So that the parent page knows the user has completed the signature process a JavaScript post message will be sent with the data value of "signed". An event listener can be set on the parent page to listen for this.
More details can be found here: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
Now that the party instance has been created and the parent window has been notified, the transaction can be sent using the /signature method as normal. The party_instance_id will need to be supplied in the party array.
As the party supplied will have already been "signed" the transaction will be sent and completed in the same process with the completed documents then being returned to the sender and the party. If required the completed documents can be returned immediately.
More information on the API methods can be found here.
https://portal.virtualsignature.com/api-doc/docs
Please see below some examples of the embedded signature block with different configuration options set.