Skip to content
On this page

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.

csharp
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:

csharp
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
}