Get Transaction by ID
This guide walks you through retrieving the details of a specific eSignature transaction using the Stewart Sign API.
When to Use
Retrieving a transaction by ID is useful when you need to:
- Check the current status of a transaction (e.g.,
draft,esign_pending,completed,canceled) - View participant details and signing progress
- Get document metadata associated with the transaction
- Verify transaction details before performing updates
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.
- The transaction ID of the eSignature transaction you want to retrieve.
Endpoint
GET /transactions/{id}
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string (UUID) | Yes | The unique identifier of the eSignature transaction. |
Code Snippet
Use the following code snippet to retrieve a transaction by its ID. Replace <transactionId> with the actual transaction ID, and <accessToken> with your API access token.
const axios = require("axios");
const transactionId = "<transactionId>";
const config = {
method: "get",
url: `https://public-api.sign.stewart.com/transactions/${transactionId}`,
headers: {
Authorization: "Bearer <accessToken>",
},
};
axios(config)
.then(function (response) {
console.log("Transaction retrieved successfully:", response.data);
})
.catch(function (error) {
console.log(error.response?.data || error.message);
});
Successful Response
On success, the API returns the full transaction object including documents, participants, and status:
{
"id": "391866a6-8ebb-4533-b6ab-c7bb4d6fbd38",
"status": "esign_pending",
"documents": [
{
"id": "8d976a23-b865-4fcd-9165-ddc0aedaf614",
"title": "Purchase Agreement",
"sessionType": "esign"
}
],
"participants": [
{
"id": "37da192e-6420-4b9c-9951-a979eeaf8889",
"email": "client@example.com",
"firstName": "John",
"lastName": "Doe"
}
]
}
Error Responses
| Status | Reason |
|---|---|
401 Unauthorized | Invalid or expired Bearer token |
404 Not Found | No transaction found with the provided ID |
Steps to Execute the Code Snippet
- Create a new file named
get_transaction.js. - Copy and paste the code snippet provided above into the new file.
- Replace
<transactionId>and<accessToken>with the appropriate values. - Save the file and open a terminal or command prompt.
- Navigate to the folder where you saved the
get_transaction.jsfile. - Run the following command to execute the script:
node get_transaction.js
If the request is successful, you'll see the transaction details 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.