Finally, the last part of the transaction is the metadata (JSON object of the document with all its details). This revisits all of the JSON objects created earlier and combines them into one JSON object at the same time.
First thing to note is that the post back URL should be defined within a document settings object if users wish to have the document automatically sent back to their server after a completed signing flow.
It’s also important to note that when creating a full document in one transaction, the pageIndex and invitationIndex must be defined in the tag objects at this point. In this case, the pageIndex refers to the page position of the page you wish to place this tag on. For example, if 2 files are uploaded, file A, and file B, where file A has 3 pages and file B has 2 pages. If our pageIndex is defined as 4, we simply access the 4th page uploaded to the server. In this case, the tag would be placed on the first page of file B. The same logic applies for the invitationIndex. This will simply define which invitation the tag belongs to and this will be decided by using the invitationIndex to the invitation at position invitationIndex in the JSON object of invitations.