Submit batch transactions
POST/transactions/batch
API for submitting multiple transactions in a batch. The response can have three outcomes:
- If all transactions succeed, a 202 code is returned
- If some transactions succeed, a 206 code is returned with the failed transactions
- If all transactions fail, a 206 code is returned with the failed transactions
There are two ways to submit transactions.
- Submitting in JSON format:
- First encode the transaction in BCS. If your language has a BCS-supporting library, use it.
- If you cannot encode BCS directly, you can use the Encode Submission API. When using this API, you must only send requests to a trusted node, as the node could tamper with the request content.
- Sign the encoded transaction.
- Submit the signed transaction with "application/json" Content-Type.
- Submitting in BCS format:
- Submit the BCS-encoded signed transaction with "application/x.aptos.signed_transaction+bcs" Content-Type.
Request
Responses
- 202
- 400
- 401
- 403
- 404
- 410
- 429
Successful Response
Response Headers
X-APTOS-BLOCK-HEIGHT
Current block height of the chain
X-APTOS-CHAIN-ID
Chain ID of the current chain
X-APTOS-EPOCH
Current epoch of the chain
X-APTOS-LEDGER-OLDEST-VERSION
Oldest unpruned ledger version of the chain
X-APTOS-LEDGER-TIMESTAMPUSEC
Current timestamp of the chain
X-APTOS-LEDGER-VERSION
Current ledger version of the chain
X-APTOS-OLDEST-BLOCK-HEIGHT
Oldest unpruned block height of the chain
X-APTOS-CURSOR
Cursor for the next page
X-APTOS-GAS-USED
Amount of gas actually used for transaction execution
Bad Request
Unauthorized
Forbidden
Not Found
Block Pruned
Too Many Requests