Skip to main content

Create a Test Transaction

This guide walks you through creating a test eSignature transaction using the Stewart Sign API. The test endpoint generates a fully configured transaction with mock data, making it ideal for development and testing.

When to Use

The test transaction endpoint is useful when you need to:

  • Quickly create a transaction for development or QA testing
  • Verify your integration setup without preparing real documents
  • Test different authentication types, signing orders, and tag configurations
  • Generate sample iframe URLs for embedding

Requirements

  1. You need to have Node.js installed on your system.
  2. You'll also need the axios library. You can install it using the following command:
npm install axios
  1. A valid Bearer token (JWT) for authentication.

Endpoint

GET /transactions/test

Query Parameters

ParameterTypeRequiredDefaultDescription
numsignersnumberNoNumber of test signers to generate
numdocumentsnumberNoNumber of test documents to generate
authenticationstringNoAuthentication type: none, personal-password, two-factor-authentication, mixed
sendEmailstringNo"false"Whether to send signing emails ("true" or "false")
sessionTypestringNoSession type: esign, ron, or both
readOnlystringNoWhether documents are read-only
tagTypesstring[]No[]Tag types to include
style_presetstringNo"standard-view"UI style preset
return_payloadstringNoIf "true", returns the payload without creating the transaction
kbaRequiredstringNoKBA requirement setting
credentialAnalysisRequiredstringNoCredential analysis requirement
signingOrderstringNoEnable signing order ("true" or "false")
phoneNumberstringNoPhone number (required for SMS two-factor)
twoFactorContactstringNoTwo-factor contact method: sms or email
taggingQueuestringNoEnable tagging queue ("true" or "false")

Code Snippet

Use the following code snippet to create a test transaction. Replace <accessToken> with your API access token.

const axios = require("axios");

const config = {
method: "get",
url: "https://public-api.sign.stewart.com/transactions/test",
params: {
numsigners: 2,
numdocuments: 1,
authentication: "none",
sendEmail: "false",
sessionType: "esign",
},
headers: {
Authorization: "Bearer <accessToken>",
},
};

axios(config)
.then(function (response) {
console.log("Test transaction created:", response.data);
console.log("Iframe URL:", response.data.url);
})
.catch(function (error) {
console.log(error.response?.data || error.message);
});

Successful Response

On success, the API returns the transaction data along with iframe URLs:

{
"url": "https://consumer.sign.stewart.com/...",
"urls": [...],
"id": "391866a6-8ebb-4533-b6ab-c7bb4d6fbd38",
"esignId": "8d976a23-b865-4fcd-9165-ddc0aedaf614",
"status": "esign_pending",
"payload": {
"participants": [...],
"documents": [...]
},
"iframe": {
"url": "...",
"urls": [...]
}
}

Error Responses

StatusReason
400 Bad RequestMissing phone number when using SMS two-factor authentication
401 UnauthorizedInvalid or expired Bearer token

Steps to Execute the Code Snippet

  1. Create a new file named create_test_transaction.js.
  2. Copy and paste the code snippet provided above into the new file.
  3. Replace <accessToken> with your API access token.
  4. Save the file and open a terminal or command prompt.
  5. Navigate to the folder where you saved the create_test_transaction.js file.
  6. Run the following command to execute the script:
node create_test_transaction.js

If the request is successful, you'll see the test transaction details and iframe URL displayed in the console. In case of an error, the error details will be displayed instead.

Additional Resources

For more information about the eSignature API, visit the API reference.

If you need further assistance or have questions, feel free to reach out to our support team.