Create new transactions
curl --request POST \
--url https://api.anchorage-staging.com/v2/subaccounts/transactions \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"amount": "1000.00",
"assetType": "BTC",
"destinationSubaccountId": "3eeaf765-0df2-49c9-9e1f-db9cf3e796dd",
"idempotentId": "12838927347",
"sourceSubaccountId": "ec761b5e-fd2c-497a-a9a0-f8738ac97bdf",
"transactionMemo": "This is a memo"
}
]
}
'import requests
url = "https://api.anchorage-staging.com/v2/subaccounts/transactions"
payload = { "transactions": [
{
"amount": "1000.00",
"assetType": "BTC",
"destinationSubaccountId": "3eeaf765-0df2-49c9-9e1f-db9cf3e796dd",
"idempotentId": "12838927347",
"sourceSubaccountId": "ec761b5e-fd2c-497a-a9a0-f8738ac97bdf",
"transactionMemo": "This is a memo"
}
] }
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transactions: [
{
amount: '1000.00',
assetType: 'BTC',
destinationSubaccountId: '3eeaf765-0df2-49c9-9e1f-db9cf3e796dd',
idempotentId: '12838927347',
sourceSubaccountId: 'ec761b5e-fd2c-497a-a9a0-f8738ac97bdf',
transactionMemo: 'This is a memo'
}
]
})
};
fetch('https://api.anchorage-staging.com/v2/subaccounts/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"transactionIds": [
{
"idempotentId": "12838927347",
"transactionId": "c4c4652f-0c07-472c-a7f8-955fbe07775d"
}
]
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Create new transactions
Permissions required: Subaccount
Create new transactions between subaccounts of the same Program Customer. This is a transactional operation, all transactions will be created successfully or none will.
POST
/
subaccounts
/
transactions
Create new transactions
curl --request POST \
--url https://api.anchorage-staging.com/v2/subaccounts/transactions \
--header 'Api-Access-Key: <api-key>' \
--header 'Api-Signature: <api-signature>' \
--header 'Api-Timestamp: <api-timestamp>' \
--header 'Content-Type: application/json' \
--data '
{
"transactions": [
{
"amount": "1000.00",
"assetType": "BTC",
"destinationSubaccountId": "3eeaf765-0df2-49c9-9e1f-db9cf3e796dd",
"idempotentId": "12838927347",
"sourceSubaccountId": "ec761b5e-fd2c-497a-a9a0-f8738ac97bdf",
"transactionMemo": "This is a memo"
}
]
}
'import requests
url = "https://api.anchorage-staging.com/v2/subaccounts/transactions"
payload = { "transactions": [
{
"amount": "1000.00",
"assetType": "BTC",
"destinationSubaccountId": "3eeaf765-0df2-49c9-9e1f-db9cf3e796dd",
"idempotentId": "12838927347",
"sourceSubaccountId": "ec761b5e-fd2c-497a-a9a0-f8738ac97bdf",
"transactionMemo": "This is a memo"
}
] }
headers = {
"Api-Signature": "<api-signature>",
"Api-Timestamp": "<api-timestamp>",
"Api-Access-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Api-Signature': '<api-signature>',
'Api-Timestamp': '<api-timestamp>',
'Api-Access-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
transactions: [
{
amount: '1000.00',
assetType: 'BTC',
destinationSubaccountId: '3eeaf765-0df2-49c9-9e1f-db9cf3e796dd',
idempotentId: '12838927347',
sourceSubaccountId: 'ec761b5e-fd2c-497a-a9a0-f8738ac97bdf',
transactionMemo: 'This is a memo'
}
]
})
};
fetch('https://api.anchorage-staging.com/v2/subaccounts/transactions', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"data": {
"transactionIds": [
{
"idempotentId": "12838927347",
"transactionId": "c4c4652f-0c07-472c-a7f8-955fbe07775d"
}
]
}
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}{
"errorType": "InternalError",
"message": "Missing required field 'amount'."
}Authorizations
An API key associated with a security role
Headers
A hex-encoded Ed25519 signature of timestamp_epoch_seconds + uppercase(http_method) + request_path + request_body.
Construction example:
toHex(
ed25519Sign(
signing_key,
'{}{}{}{}'.format(timestamp_epoch_seconds, toUpper(httpMethod), httpRequestPath, httpBody)
)
)
Pattern:
^[0-9A-Fa-f]{128,160}$Current timestamp, represented as unix epoch seconds
Body
application/json
Details of the transactions to create
Required array length:
1 - 100 elementsShow child attributes
Show child attributes
Response
Successfully created the transactions
Show child attributes
Show child attributes
Was this page helpful?