Creating An Incoming Transaction Request
Basic Description
This endpoint is used to create an Incoming Transaction Request from an Exchange to an Address in Taurus-PROTECT.
To understand what is a Transaction, what is a Request and the differences between these two concepts, please refer to the following page in the Taurus User Guides.
This endpoint would accept a POST Request with a JSON payload containing the Incoming Transaction Request details. The amount
, fromExchangeId
, and toAddressId
are the only required parameters that must be included within the JSON payload.
Prerequisites
Required Roles
Certain API endpoints require that the user has a specific role in order to access them. Roles are used to restrict access to certain functionality within the system and ensure that only authorized users are able to perform specific actions.
Here is the list of required Roles for this particular endpoint:
- RequestCreator
- TPUser
To find out more about roles, please refer to the following page in the Taurus User Guides.
Required Input Parameters
Certain API endpoints require specific input parameters. Here is the list of Required Input Parameters for this particular endpoint:
- amount: the amount of the selected currency
- fromExchangeId : the originating Exchange Account
- toAddressId : the destination internal Address
Preconditions
It is important to note that the selected Exchange Account and Addresses needs to pre-exist and be active in the system. In addition, the amount within the Transaction Request needs to be smaller than the total amount of funds that is held on the originating Exchange Account for the process to be successful.
Call Example
You can find a basic example in cURL below.
Please note that you will need to update the BASEURL
and the APITOKEN
for the command to function.
In this example, Taurus-PROTECT has created a new Incoming Transaction Request with 1 BTC as the specified amount to be transferred from the Exchange with ID 6 to the internal Address 487229 and has assigned it a unique ID of 4210837.
export BASEURL=https://taurus-protect-instance.com
export APIToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwiZXh0ZXJuYWxVc2VySUQiOiJ0ZWFtMUV4dGVybmFsVXNlcklEIiwidGVuYW50SUQiOjEsImNhcGl0YWxUZW5hbnRJRCI6MSwiZmlyc3RuYW1lIjoiSm9obiIsImxhc3RuYW1lIjoiRG9lIiwicm9sZXMiOlsidHB1c2VyIl0sImVtYWlsIjoidGVhbTFAYmFuay5jb20iLCJ1c2VybmFtZSI6InRlYW0xIiwiand0X3JlbmV3YWJsZV9hbW91bnQiOjAsImlzX3RvdHBfZW5hYmxlZCI6ZmFsc2UsImF1dGhfc3RhdHVzIjoiU1VDQ0VTUyIsImxhc3RfbG9naW4iOiIyMDIzLTAxLTAxVDAwOjAwOjAwLjE0OTc0NDIzMloiLCJsb2dnZWRfaW5fd2l0aF9zc28iOmZhbHNlLCJrZXkiOiIiLCJleHAiOjE2ODEyMTkyNzYsImlhdCI6MTY4MTIxNzQ3Nn0.K_85arIrigpkN1yHttCydpeT6oVg2c6PyQnuji907Og
curl --location "$BASEURL/api/rest/v1/requests/incoming" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Bearer $APIToken" \
--data '{
"amount": "1",
"fromExchangeId": "6",
"toAddressId": "487229",
"comment": "API-Documentation - Test 18"
}'
This piece of code sends a POST request to https://your-protect-instance.example.com/api/rest/v1/requests/incoming with the JSON string in the request body.
Call Result
A successful response for the POST call to create an incoming Transaction Request might look like this:
{
"result": {
"id": "4210837",
"tenantId": "1",
"currency": "BTC",
"envelope": "Cgc0MjEwODM3EN3UoKu0wYatFyABKpEECAISBmtyYWtlbioXCgpyZXF1ZXN0X2lkEAEaBzQyMTA4MzcqEgoJcnVsZXNfa2V5EAEaA0JUQyogCg1jdXJyZW5jeV9uYW1lEAEaDUJpdGNvaW4gLSBCVEMqUQoLY3VycmVuY3lfaWQQARpANTg0NzM3ZTNjNGZkMjZmYWUzMDA3MGQ3NzM0NGE4YWU5MmJiODlmZWU5OTg3NTdmNmIwZWU5ZDcxZWQwNzRhMSoRCghjdXJyZW5jeRABGgNCVEMqIgoGc291cmNlEAQaDggCEgoIBhIGa3Jha2VuIgZzb3VyY2UqcgoLZGVzdGluYXRpb24QBRpUElIIvd4dEiIzRWNnY01KeGlReldwVHRXN2VIOTRHTFBlUTN5VkZKSnRFGhF0Zy10cmFkZWQgYWRkcmVzcyIVbS80NCcvMCcvNzUnLzAnLzE4MDEnIgtkZXN0aW5hdGlvbiqYAQoGYW1vdW50EAoagwEKAQESBjAuMDAwMhoHMjYzOTUuMyAIKgNCVEMyA0NIRjphCh12YWxpZGF0b3ItY29yZUB0YXVydXNncm91cC5jaBJA/JpITPz3e1RGAFwUDTk/oEdj0tpIILnzuU1dVhHNEcr4uXhDsvDPYNnTgmM6mp+qTsEq6iOk0SmORX3V1m3q8CIGYW1vdW50Kh0KEXRvdGFsX2ZpYXRfYW1vdW50EAEaBjAuMDAwMg==",
"status": "CREATED",
"trails": [
{
"userId": "11",
"externalUserId": "[email protected]",
"action": "created",
"comment": "API-Documentation - Test 18",
"requestStatus": "CREATED"
},
{
"userId": "1",
"externalUserId": "[email protected]",
"action": "approvers_assigned",
"comment": "rule = [source: any, destination: any, amount: any], approvals = ['team1': 1 sig, 'team2': 1 sig]",
"requestStatus": "CREATED"
}
],
"rule": "rule = [source: any, destination: any, amount: any], approvals = ['team1': 1 sig, 'team2': 1 sig]",
"approvers": {
"parallel": [
{
"sequential": [
{
"externalGroupID": "team1",
"minimumSignatures": 1
},
{
"externalGroupID": "team2",
"minimumSignatures": 1
}
]
}
]
},
"type": "payment",
"currencyInfo": {
"name": "Bitcoin",
"symbol": "BTC",
"blockchain": "BTC",
"decimals": "8",
"isUTXOBased": true,
"enabled": true,
"id": "584737e3c4fd26fae30070d77344a8ae92bb89fee998757f6b0ee9d71ed074a1",
"displayName": "Bitcoin - BTC",
"type": "native",
"network": "mainnet"
}
}
}
Taurus-PROTECT responds with a JSON object containing the request details, including the Request status
and the newly assigned Requestid
.
Requirements for Future Use
For this particular endpoint, we need to store the Requestid
as it will be required in the next steps where we will sign the Transaction Request.
You can find the Swagger-generated page for this endpoint in the following link.
Updated 22 days ago