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
- You need to have Node.js installed on your system.
- You'll also need the axios library. You can install it using the following command:
npm install axios
- A valid Bearer token (JWT) for authentication.
Endpoint
GET /transactions/test
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
numsigners | number | No | — | Number of test signers to generate |
numdocuments | number | No | — | Number of test documents to generate |
authentication | string | No | — | Authentication type: none, personal-password, two-factor-authentication, mixed |
sendEmail | string | No | "false" | Whether to send signing emails ("true" or "false") |
sessionType | string | No | — | Session type: esign, ron, or both |
readOnly | string | No | — | Whether documents are read-only |
tagTypes | string[] | No | [] | Tag types to include |
style_preset | string | No | "standard-view" | UI style preset |
return_payload | string | No | — | If "true", returns the payload without creating the transaction |
kbaRequired | string | No | — | KBA requirement setting |
credentialAnalysisRequired | string | No | — | Credential analysis requirement |
signingOrder | string | No | — | Enable signing order ("true" or "false") |
phoneNumber | string | No | — | Phone number (required for SMS two-factor) |
twoFactorContact | string | No | — | Two-factor contact method: sms or email |
taggingQueue | string | No | — | Enable 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
| Status | Reason |
|---|---|
400 Bad Request | Missing phone number when using SMS two-factor authentication |
401 Unauthorized | Invalid or expired Bearer token |
Steps to Execute the Code Snippet
- Create a new file named
create_test_transaction.js. - Copy and paste the code snippet provided above into the new file.
- Replace
<accessToken>with your API access token. - Save the file and open a terminal or command prompt.
- Navigate to the folder where you saved the
create_test_transaction.jsfile. - 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.