All Products
Search
Document Center

Blockchain as a Service:Initiate an on-chain transaction

Last Updated:Mar 31, 2026

Submits a transaction to the blockchain network and returns a result after the transaction is written to the ledger and passes node validation.

Request syntax

POST /api/v1/networks/{network}/transactions/invoke

Path parameters

ParameterDescription
networkThe Fabric channel name.

Query parameters

ParameterTypeRequiredDescription
timeoutIntegerNoThe maximum wait time in seconds to confirm whether the submitted transaction succeeded. Default value: 180.
content_checkStringNoThe Content Moderation check configuration. Specifies which moderation suggestion (pass, block, or review) causes the request to be rejected. Separate multiple values with commas (,). Default value: "" (Content Moderation is disabled).

Request body

Content-Type: application/json

ParameterTypeRequiredDescription
chaincodeStringYesThe name of the target smart contract (chaincode).
argsList\<String\>NoThe arguments for the smart contract call. When args is specified, the function and byte_args parameters are ignored.
functionStringNoThe name of the smart contract function to call.
byte_argsList\<String\>NoThe Base64-encoded arguments for the smart contract call, excluding the function name.
transientMap\<String, String\>NoThe transient map for this call. Keys are names; values are data.
byte_transientMap\<String, String\>NoThe transient map for this call, where values are Base64-encoded. Merged with transient; keys in byte_transient override matching keys in transient.
invoke_chainList\<ChaincodeCall\>NoThe list of smart contracts and their private data collections invoked by the target smart contract. Required when the target smart contract invokes another smart contract. Used for discovery and ensuring transactions satisfy the endorsement policy.

ChaincodeCall object

ParameterTypeRequiredDescription
chaincodeStringYesThe name of the smart contract.
collectionsList\<String\>NoThe names of the private data collections accessed by the smart contract.

Response elements

FieldTypeDescription
SuccessBooleanIndicates whether the request succeeded.
ErrorErrorThe error details.
ResultResponseThe transaction result.

Error object

FieldTypeDescription
codeIntegerThe error code.
messageStringThe error message.
request_idStringThe request ID.

Result object

FieldTypeDescription
idStringThe transaction ID.
statusStringThe status code returned by the smart contract.
eventList\<Event\>The list of blockchain events generated by the transaction.
dataStringThe Base64-encoded data returned by the smart contract.

Event object

FieldTypeDescription
idStringThe event ID, unique within the channel.
nameStringThe event name.
typeEventTypeThe event type. Valid values: Tx, Config, Contract, Block. For transaction invocations, this is always Contract.
contentStringThe event content. When type is Contract, the content is Base64-encoded.

Examples

Request example

curl -X POST "http://your.gateway.endpoint/api/v1/networks/channel3/transactions/invoke" \
  -H "accept: application/json" \
  -H "Authorization: Bearer <your-access-token>" \
  -H "Content-Type: application/json" \
  -d '{"chaincode":"sacc","args":["set","provider","aliyun"],"transients":{"key":"value"}}'

Response example

{
  "Success": true,
  "Result": {
    "id": "1bdbc050691cdf7c03faca74ebfa5711b18fb8acc23cabbd16a1a692d00785a1",
    "status": "200",
    "events": [],
    "data": "YWxpeXVu"
  },
  "Error": {
    "code": 200,
    "message": "Success",
    "request_id": "5945a095-5730-4f63-9ef9-ddbcb2cda8c8"
  }
}

Error codes

For a list of error codes, see Error codes.