On-chain Operations
Replace a Transaction
Replace a submitted transaction on a supported chain, if it doesn’t already have an active replacement.
Request example
{
"transactionId": "transaction_123"
}
# Sample only. Generate a new signed token for each request
# (see Authentication). Tokens expire after 120 seconds.
curl --request POST \
--url "https://api.primevault.com/api/external/transactions/replace_transaction/" \
--header "Authorization: Bearer <signed JWT>" \
--header "Api-Key: <API key>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{"transactionId": "transaction_123"}'
replaceTransaction(request: {
transactionId: string;
}): Promise<Transaction>
{
"id": "transaction_replacement_456",
"orgId": "org_456",
"vaultId": "vault_123",
"status": "PENDING",
"transactionType": "OUTGOING",
"category": "TRANSFER",
"subCategory": "EXTERNAL_TRANSFER",
"createdAt": "2026-08-04T10:40:00Z",
"updatedAt": "2026-08-04T11:30:00Z",
"isDeleted": false,
"externalId": "invoice-1001-replacement",
"memo": "Vendor payout #1001",
"source": {
"type": "VAULT",
"id": "vault_123",
"subOrgId": "sub_org_123",
"name": "Treasury Vault"
},
"destination": {
"type": "CONTACT",
"id": "contact_456",
"name": "Operations Wallet",
"address": "0xAbC1234567890abcdef1234567890abcdef1234",
"chain": "ETHEREUM"
},
"blockChain": "ETHEREUM",
"asset": "ETH",
"amount": "0.50",
"nonce": 42
}
POST
/api/external/transactions/replace_transaction/
Replacement is accepted only for a SUBMITTED transaction on a chain that supports replacement and when no active replacement already exists.
Request body
string
required
The ID of the transaction to replace.
Response
{
"id": "transaction_replacement_456",
"orgId": "org_456",
"vaultId": "vault_123",
"status": "PENDING",
"transactionType": "OUTGOING",
"category": "TRANSFER",
"subCategory": "EXTERNAL_TRANSFER",
"createdAt": "2026-08-04T10:40:00Z",
"updatedAt": "2026-08-04T11:30:00Z",
"isDeleted": false,
"externalId": "invoice-1001-replacement",
"memo": "Vendor payout #1001",
"source": {
"type": "VAULT",
"id": "vault_123",
"subOrgId": "sub_org_123",
"name": "Treasury Vault"
},
"destination": {
"type": "CONTACT",
"id": "contact_456",
"name": "Operations Wallet",
"address": "0xAbC1234567890abcdef1234567890abcdef1234",
"chain": "ETHEREUM"
},
"blockChain": "ETHEREUM",
"asset": "ETH",
"amount": "0.50",
"nonce": 42
}
Approve the transaction
New transactions returnstatus: "PENDING" and wait for approval. Get the approval message for the transaction id, sign it with your API user’s key, then submit the approval. See Approvals.
With the SDK, call approveChangeRequest({ entityId: transaction.id, action: "approve" }) after this call.
Request example
{
"transactionId": "transaction_123"
}
# Sample only. Generate a new signed token for each request
# (see Authentication). Tokens expire after 120 seconds.
curl --request POST \
--url "https://api.primevault.com/api/external/transactions/replace_transaction/" \
--header "Authorization: Bearer <signed JWT>" \
--header "Api-Key: <API key>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{"transactionId": "transaction_123"}'
replaceTransaction(request: {
transactionId: string;
}): Promise<Transaction>
{
"id": "transaction_replacement_456",
"orgId": "org_456",
"vaultId": "vault_123",
"status": "PENDING",
"transactionType": "OUTGOING",
"category": "TRANSFER",
"subCategory": "EXTERNAL_TRANSFER",
"createdAt": "2026-08-04T10:40:00Z",
"updatedAt": "2026-08-04T11:30:00Z",
"isDeleted": false,
"externalId": "invoice-1001-replacement",
"memo": "Vendor payout #1001",
"source": {
"type": "VAULT",
"id": "vault_123",
"subOrgId": "sub_org_123",
"name": "Treasury Vault"
},
"destination": {
"type": "CONTACT",
"id": "contact_456",
"name": "Operations Wallet",
"address": "0xAbC1234567890abcdef1234567890abcdef1234",
"chain": "ETHEREUM"
},
"blockChain": "ETHEREUM",
"asset": "ETH",
"amount": "0.50",
"nonce": 42
}
⌘I
Request example
{
"transactionId": "transaction_123"
}
# Sample only. Generate a new signed token for each request
# (see Authentication). Tokens expire after 120 seconds.
curl --request POST \
--url "https://api.primevault.com/api/external/transactions/replace_transaction/" \
--header "Authorization: Bearer <signed JWT>" \
--header "Api-Key: <API key>" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data '{"transactionId": "transaction_123"}'
replaceTransaction(request: {
transactionId: string;
}): Promise<Transaction>
{
"id": "transaction_replacement_456",
"orgId": "org_456",
"vaultId": "vault_123",
"status": "PENDING",
"transactionType": "OUTGOING",
"category": "TRANSFER",
"subCategory": "EXTERNAL_TRANSFER",
"createdAt": "2026-08-04T10:40:00Z",
"updatedAt": "2026-08-04T11:30:00Z",
"isDeleted": false,
"externalId": "invoice-1001-replacement",
"memo": "Vendor payout #1001",
"source": {
"type": "VAULT",
"id": "vault_123",
"subOrgId": "sub_org_123",
"name": "Treasury Vault"
},
"destination": {
"type": "CONTACT",
"id": "contact_456",
"name": "Operations Wallet",
"address": "0xAbC1234567890abcdef1234567890abcdef1234",
"chain": "ETHEREUM"
},
"blockChain": "ETHEREUM",
"asset": "ETH",
"amount": "0.50",
"nonce": 42
}