Managing Transactions
Creating a Transaction
Creating a new transaction is a little more complex than most other actions in the API so please see our full breakdown of Creating a Simple Transaction.
Updating a Transaction
In order to update an existing Transaction, you'll need to retrieve an existing "Updateable" Transaction first. Once you have the TransactionUpdateModel
you can add/update/delete any properties you wish from that object and then all the UpdateTransactions()
method to commit the update.
var req = new TransactionUpdateableRequestModel()
{
IDs = new List<object> { 1234567890 }
};
var api = new TransactionsUpdateableApi(myRestEndpointUrl);
var results = api.GetTransactionsUpdateable(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
results.UpdateableTransactions[0].Description = "UPDATED!";
var updateModel = new TransactionUpdateRequestModel()
{
Transactions = results.UpdateableTransactions
};
var api = new TransactionsApi(myRestEndpointUrl);
var updateResults = api.UpdateTransactions(sa, updateModel);
if (updateResults.IsSuccessful)
{
//do work...
}
else
{
//handle error
}
}
else
{
//handle error
}
Cancelling a Transaction
In AlphaTrust® e-Sign, cancelling can ony be done by a Participant's action. If a transaction is cancelled by administrative action or through the API, this action is called "closing". By calling the CloseTransactions()
API call, you can close a transaction programmatically as shown in the example below:
var req = new TransactionCloseRequestModel()
{
IDs = new List<object> { 1234567890 }
};
var api = new TransactionsApi(myRestEndpointUrl);
var results = api.CloseTransactions(req, apiKey, apiSecret, apiUsername, apiPassword);
if (results.IsSuccessful.Value)
{
// do work...
}
else
{
// handle error
}
Transaction Workflow Explanation
Managing Participants
When you create a new Transaction, you are required to include at least one Document, one Participant, and one Task per Document/Participant. However, after the Transaction is created, you can add new Participants or update existing Participants via the API at any point as long as the transaction is still in the Pending status.