Aptos · Example Payload

Submit_Transaction

This endpoint accepts transaction submissions in two formats. To submit a transaction as JSON, you must submit a SubmitTransactionRequest. To build this request, do the following: 1. Encode the transaction as BCS. If you are using a language that has native BCS support, make sure of that library. If not, you may take advantage of /transactions/encode_submission. When using this endpoint, make sure you trust the node you're talking to, as it is possible they could manipulate your request. 2. Sign the encoded transaction and use it to create a TransactionSignature. 3. Submit the request. Make sure to use the "application/json" Content-Type. To submit a transaction as BCS, you must submit a SignedTransaction encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs. Make sure to use the `application/x.aptos.signed_transaction+bcs` Content-Type.

Transactions

Submit_Transaction is an example object payload from Aptos, with 9 top-level fields. It illustrates the shape of data this provider's APIs accept or return.

Top-level fields

methodpathoperationIdsummarydescriptiontagsparametersrequestBodyresponses

Example Payload

Raw ↑
{
  "method": "POST",
  "path": "/transactions",
  "operationId": "submit_transaction",
  "summary": "Submit transaction",
  "description": "This endpoint accepts transaction submissions in two formats.\n\nTo submit a transaction as JSON, you must submit a SubmitTransactionRequest.\nTo build this request, do the following:\n\n1. Encode the transaction as BCS. If you are using a language that has\nnative BCS support, make sure of that library. If not, you may take\nadvantage of /transactions/encode_submission. When using this\nendpoint, make sure you trust the node you're talking to, as it is\npossible they could manipulate your request.\n2. Sign the encoded transaction and use it to create a TransactionSignature.\n3. Submit the request. Make sure to use the \"application/json\" Content-Type.\n\nTo submit a transaction as BCS, you must submit a SignedTransaction\nencoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.\nMake sure to use the `application/x.aptos.signed_transaction+bcs` Content-Type.",
  "tags": [
    "Transactions"
  ],
  "parameters": [],
  "requestBody": {
    "contentType": "application/json",
    "schema": {
      "$ref": "#/components/schemas/SubmitTransactionRequest"
    },
    "example": null
  },
  "responses": {
    "202": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/PendingTransaction"
      },
      "example": {}
    },
    "400": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "403": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "404": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "413": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "500": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "503": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    },
    "507": {
      "contentType": "application/json",
      "schema": {
        "$ref": "#/components/schemas/AptosError"
      },
      "example": {}
    }
  }
}