Skip to main content
Create a template with one participant and one text parameter. The complete example records an acknowledgement; its machine-readable instruction performs no payment or token creation. The XML passes the documented local schema checks. Template approval and signing still need verification on your development service. Arrange that service access before running the submission steps.

Prerequisites

1. Define the contract

Download acknowledgement.xml. The complete file is shown below; you can also start with an empty file and add its sections in this order.

2. Validate the file

Load the contract schema set in your XML validator and validate the complete acknowledgement.xml file using these steps. Expected result: the schema set compiles and the contract has no XML validation errors. Correct invalid namespaces, missing required fields, or element ordering before submission. If you introduce a custom machine-readable element, also create its XSD, load it in the local namespace map, and confirm the provider’s schema resolution requirements. An arbitrary XML payload is not a verified provider-supported instruction.

3. Propose the template

Send the following requests over HTTPS with your account’s exact host, JWT, and application URL as Referer. Replace every placeholder before sending a request. Base64-encode the complete file’s UTF-8 bytes, then send:
The templateBase64 field contains that encoded XML. Propose Template returns Template. Record its identifier. In the sandbox, the submitted template enters automatic review. On other Neurons, give the identifier to the operator to arrange approval. See Contract approval. Retrieve it with Legal/GetContract using the request shown below and the template identifier to observe its lifecycle. Continue only when its state is Approved. If it remains Proposed or is Rejected, contact the operator before creating an instance.

4. Create an instance

Send the approved template identifier and the participant’s approved Legal Identity to Legal/CreateContract:
Record the returned Contract identifier separately from the template identifier. The role and parameter names are case-sensitive names from the template. Do not send empty arrays for this example.

5. Review and sign the instance

Retrieve the created instance using its identifier:
Present its human-readable text, parameters, participant identity, and Participant role to the signer. If any value is wrong, stop before signing. Use the participant’s existing key and its password. Calculate keySignature and requestSignature from the contract signature formulas, using the key’s keyId, localName, and namespace, the account password, and a fresh nonce. Bind the signature to the reviewed contractId, legalId, and role Participant. The key namespace is algorithm metadata retained during key creation. It is not the contract XML namespace. After the signer confirms the exact contract and role, submit the signature explicitly:
Retrieve the instance again with Legal/GetContract and the same contractId. Check the returned participant signature and contract lifecycle state. A successful signature request alone does not establish that every provider requirement is satisfied. For multiple parties, repeat review and signing in each party’s authorized application session using the contract lifecycle guide.

Recover and retain the result

Retain the template ID, instance ID, reviewed parameters, participant identity, and observed signature/lifecycle result. The example defines duration and archival periods; deleting your local files does not delete a signed contract. Follow the provider’s supported lifecycle and retention rules. Continue with a token and state machine, or adapt a LegalLab example to a different agreement.