---
title: /sendPayloadToBeSigned
slug: sendpayloadtobesigned
createdAt: 2024-01-09T12:30:00.561Z
---

{
  "id": "LlQykhBC2sCGw0HBshjPo",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "http://1.1.1.1/sendPayloadToBeSigned",
    "servers": [
      {
        "url": "http://1.1.1.1/sendPayloadToBeSigned"
      }
    ],
    "name": "",
    "description": "<ul>\n<li>\n<p>This function is used to send a payload for signing, to check the transaction's status, you can access the getTransactionByToken function using the token generated by getCurrentToken before sending this request.</p>\n</li>\n<li>\n<p>sendPayloadToBeSigned - for Stellar transactions only at the moment</p>\n</li>\n</ul>\n<p>********** NOTE: success or failure in this api call does not necessarily means success or failure in the transaction itself.\nfor example, the transaction may work by the response to the client can be lost in communication (if the internet is down for the client).</p>\n<p>********** another example is that the transaction was approved here but failed in the signing process\nTo know the status of the transaction you can access the function getTransactionByToken.\nTo get the token to send those functions you should call getCurrentToken one action BEFORE sendTransaction.\nmyTokenToStoreInTheDb = user.getCurrentToken()\nsendPayloadToBeSigned(...)\n.....\nuser.getTransactionByToken(myTokenToStoreInTheDb,\"BTC\")</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "account_id",
          "type": "integer",
          "example": 1,
          "description": "The account ID we want to use in this operation",
          "default": 1
        },
        {
          "kind": "required",
          "name": "coin_type",
          "type": "string",
          "example": "XLM",
          "description": "<p>Currency to sign with, Currently supported only for XLM.</p>",
          "default": "XLM"
        },
        {
          "kind": "required",
          "name": "bytesToSign",
          "type": "string",
          "example": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859",
          "description": "64 hexadecimal chars to sign on without 0x",
          "default": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859"
        },
        {
          "kind": "optional",
          "name": "from_address",
          "type": "string",
          "example": "GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ",
          "description": "the address to send transaction from",
          "default": "GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ"
        },
        {
          "kind": "optional",
          "name": "description",
          "type": "string",
          "example": "example",
          "description": "free text for the transaction",
          "default": "example"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "Request data for signing a transaction.",
          "customType": "sendPayloadToBeSignedRequest",
          "schema": [
            {
              "name": "AccountId",
              "kind": "optional",
              "type": "integer",
              "description": "The ID of the user's account.",
              "example": 1,
              "default": 1
            },
            {
              "name": "BytesToSign",
              "kind": "optional",
              "type": "string",
              "description": "The bytes to sign for the transaction.",
              "example": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859",
              "default": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859"
            },
            {
              "name": "CoinType",
              "kind": "optional",
              "type": "string",
              "description": "The cryptocurrency type (e.g., XLM).",
              "example": "XLM",
              "default": "XLM"
            },
            {
              "name": "SpecificFromAddress",
              "kind": "optional",
              "type": "string",
              "description": "The source address for the transaction.",
              "example": "GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ",
              "default": "GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ"
            },
            {
              "name": "UserDescription",
              "kind": "optional",
              "type": "string",
              "description": "A description provided by the user for the transaction.",
              "example": "example",
              "default": "example"
            },
            {
              "name": "Meta",
              "kind": "optional",
              "type": "object",
              "modelRef": "#/components/schemas/MetaTokensendPayloadToBeSigned",
              "customType": "MetaTokensendPayloadToBeSigned",
              "schema": [
                {
                  "name": "FunctionName",
                  "kind": "optional",
                  "type": "string",
                  "description": "The Function to be called",
                  "example": "sendPayloadToBeSigned",
                  "default": "sendPayloadToBeSigned"
                },
                {
                  "name": "RandomData",
                  "kind": "optional",
                  "type": "string",
                  "description": "Random Data",
                  "example": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229",
                  "default": "288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229"
                },
                {
                  "name": "Destination",
                  "kind": "optional",
                  "type": "string",
                  "description": "Id of the server",
                  "example": "",
                  "default": "b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea"
                },
                {
                  "name": "Time",
                  "kind": "optional",
                  "type": "string",
                  "description": "UTC Time of execution",
                  "example": "2021-02-07T18:37:46.948Z",
                  "default": "2021-02-07T18:37:46.948Z"
                },
                {
                  "name": "Source",
                  "kind": "optional",
                  "type": "string",
                  "description": "User public key",
                  "example": "",
                  "default": "048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99"
                },
                {
                  "name": "AccessToken",
                  "kind": "optional",
                  "type": "string",
                  "description": "Token used for authentication purposes",
                  "example": "51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087",
                  "default": "51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087"
                }
              ]
            }
          ],
          "modelRef": "#/components/schemas/sendPayloadToBeSignedRequest",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "success",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "customType": "sendPayloadToBeSignedResponse",
            "schema": [
              {
                "name": "FunctionData",
                "kind": "optional",
                "type": "object",
                "example": "",
                "schema": [
                  {
                    "name": "ApprovalRequestStatus",
                    "kind": "optional",
                    "type": "integer",
                    "description": "returning integer type by enum options - \n\nPENDING = 0         #pending approval\nBEING_CANCELLED = 1 #canceled request\nEXPIRED = 2         #expired request\nAPPROVED = 3        #enough approvers before expired\nBEING_HANDLED = 4   #currently in handler\nHANDLED = 5        #finished handling\nCHECK_HANDLED = 6  #need to check status - if system shutdown while being handled\n",
                    "example": 4,
                    "default": 4
                  },
                  {
                    "name": "BytesToSign",
                    "kind": "optional",
                    "type": "string",
                    "description": "64 hexadecimal chars to sign on without 0x.",
                    "example": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859",
                    "default": "233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859"
                  }
                ]
              },
              {
                "name": "Meta",
                "kind": "optional",
                "type": "object",
                "modelRef": "#/components/schemas/MetaResponse",
                "customType": "MetaResponse",
                "schema": [
                  {
                    "name": "AccessToken",
                    "kind": "optional",
                    "type": "string",
                    "description": "The new access token generated after this operation",
                    "example": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6",
                    "default": "a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6"
                  },
                  {
                    "name": "Destination",
                    "kind": "optional",
                    "type": "string",
                    "description": "Id of the server",
                    "example": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622",
                    "default": "042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622"
                  },
                  {
                    "name": "Source",
                    "kind": "optional",
                    "type": "string",
                    "description": "User public key",
                    "example": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355",
                    "default": "df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355"
                  },
                  {
                    "name": "Time",
                    "kind": "optional",
                    "type": "string",
                    "description": "UTC Time of execution",
                    "example": "2021-02-14 09:58:52.320",
                    "default": "2021-02-14 09:58:52.320"
                  }
                ]
              }
            ],
            "modelRef": "#/components/schemas/sendPayloadToBeSignedResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "examples": {
      "languages": [
        {
          "id": "example-0-curl",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url 'http://1.1.1.1/sendPayloadToBeSigned?account_id=1&coin_type=XLM&bytesToSign=233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859&from_address=GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ&description=example' \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"AccountId\": 1,\n     \"BytesToSign\": \"233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859\",\n     \"CoinType\": \"XLM\",\n     \"SpecificFromAddress\": \"GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ\",\n     \"UserDescription\": \"example\",\n     \"Meta\": {\n     \"FunctionName\": \"sendPayloadToBeSigned\",\n     \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n     \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n     \"Time\": \"2021-02-07T18:37:46.948Z\",\n     \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n     \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\n     }\n     }'"
        },
        {
          "id": "example-1-javascript",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"AccountId\": 1,\n   \"BytesToSign\": \"233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859\",\n   \"CoinType\": \"XLM\",\n   \"SpecificFromAddress\": \"GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ\",\n   \"UserDescription\": \"example\",\n   \"Meta\": {\n      \"FunctionName\": \"sendPayloadToBeSigned\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\n   }\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"http://1.1.1.1/sendPayloadToBeSigned?account_id=1&coin_type=XLM&bytesToSign=233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859&from_address=GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ&description=example\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "example-2-ruby",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"http://1.1.1.1/sendPayloadToBeSigned?account_id=1&coin_type=XLM&bytesToSign=233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859&from_address=GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ&description=example\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"AccountId\": 1,\n   \"BytesToSign\": \"233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859\",\n   \"CoinType\": \"XLM\",\n   \"SpecificFromAddress\": \"GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ\",\n   \"UserDescription\": \"example\",\n   \"Meta\": {\n      \"FunctionName\": \"sendPayloadToBeSigned\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\n   }\n})\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "example-3-python",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"http://1.1.1.1/sendPayloadToBeSigned?account_id=1&coin_type=XLM&bytesToSign=233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859&from_address=GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ&description=example\"\n\npayload = json.dumps({\n   \"AccountId\": 1,\n   \"BytesToSign\": \"233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859\",\n   \"CoinType\": \"XLM\",\n   \"SpecificFromAddress\": \"GBMDG2KCYGH3CKERPIVY6W7KG2MQOP7DNT3SGF2X3E6UTDZ3RKBAAUXQ\",\n   \"UserDescription\": \"example\",\n   \"Meta\": {\n      \"FunctionName\": \"sendPayloadToBeSigned\",\n      \"RandomData\": \"288cd49d4b8bf00e7d6114b78d5668d5581d6b953fafef779133caa844cd4229\",\n      \"Destination\": \"b9cb8afe52f1d52521cf2b62dfe12146156ad5328f83c62c20c7da81b263356a61340de745c858998544c041798b01c2f4fac31bebe52a19280a32cd57d6d374ea\",\n      \"Time\": \"2021-02-07T18:37:46.948Z\",\n      \"Source\": \"048b99461a70a49abe63fd585cb224177a22a92d2e9e4ddfbc0027887bee9d1843388f42a3eb2e740565e115ad8b7981abf59e3b03b771f4b063b53c517d7a9d99\",\n      \"AccessToken\": \"51311c84d2c8fd2fafbe56ceb1fb30a99d3417abfc55769577338ab286798087\"\n   }\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "example-0-curl"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// success\n{\n  \"FunctionData\": {\n    \"ApprovalRequestStatus\": 4,\n    \"BytesToSign\": \"233c83369d1afc58bfca8a62bf227ed264b07810bfd3075113d4c5a587a4f859\"\n  },\n  \"Meta\": {\n    \"AccessToken\": \"a3e816b5bc04302d99da94705ec2309a4a63fe10d6aed3c5f6fc9e7ff27c6be6\",\n    \"Destination\": \"042c671aeb148d9b2bb4918399c4c925f3764248c5ab2d5194ab0f32664132834692699a75e7fafb5af35f183b7d8a68bdc3b3e6ebfaff8ab555b9a3caf8090622\",\n    \"Source\": \"df4b76a23067a9d782d09a7372ed526ec713cf6d771fac4dbdb9610f7af36d570a157eed76986b8e85afde12888d10d10bef461399e490f3d7e4db44cde1b6e355\",\n    \"Time\": \"2021-02-14 09:58:52.320\"\n  }\n}"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "id": "vbLct8D0x0QVDxT41ThiU",
      "type": "bulleted-list",
      "children": [
        {
          "id": "gS3NlKJGt5lVnPh4bEhIo",
          "type": "list-item",
          "children": [
            {
              "id": "wnfSAPdVvnES96HKNJs1J",
              "type": "list-item-child",
              "children": [
                {
                  "text": "This function is used to send a payload for signing, to check the transaction's status, you can access the getTransactionByToken function using the token generated by getCurrentToken before sending this request.",
                  "id": "SAUoaifIiDFqHC7BjwwyH"
                }
              ]
            }
          ]
        },
        {
          "id": "fwcjyxtJmFPbo-kJM2OXL",
          "type": "list-item",
          "children": [
            {
              "id": "RjsUslcHCFYd5BAGCdwbL",
              "type": "list-item-child",
              "children": [
                {
                  "text": "sendPayloadToBeSigned - for Stellar transactions only at the moment",
                  "id": "oC9aKzJl4grwN2qG3sAGq"
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "id": "iRaE1AAUZDsDUTCnYbowt",
      "type": "paragraph",
      "children": [
        {
          "text": "",
          "id": "GpPHvEIx0GmgTuFuKw8fv"
        },
        {
          "text": "",
          "bold": true,
          "id": "XV13WASUKwBCDubmCkV_o"
        },
        {
          "text": "",
          "id": "U7ZEgbM73PopLWXXzJVdc"
        },
        {
          "text": "",
          "bold": true,
          "id": "DBhdOhato4bXr_t4zcabA"
        },
        {
          "text": "** NOTE: success or failure in this api call does not necessarily means success or failure in the transaction itself.\n",
          "id": "Qe0srSs7tAUnv6Xf2x7LH"
        },
        {
          "text": "",
          "id": "tjMssq7qTHpy_eG_zZYlL"
        },
        {
          "text": "for example, the transaction may work by the response to the client can be lost in communication (if the internet is down for the client).",
          "id": "4yFKhatCgoL1x6bOpBdaf"
        },
        {
          "text": "",
          "id": "TmtieZOhaSIHY8L_pavsn"
        }
      ]
    },
    {
      "id": "-S00z2ml1o5ZanxFiruUK",
      "type": "paragraph",
      "children": [
        {
          "text": "",
          "id": "HufSAqiI-NAp6B2c2pT73"
        },
        {
          "text": "",
          "bold": true,
          "id": "8r-KV4Mp6B68KBPh4Gseb"
        },
        {
          "text": "",
          "id": "Fg6TtCnYH-7hMlkXhpiVR"
        },
        {
          "text": "",
          "bold": true,
          "id": "5WXHflg0z_NgSodrIMn9O"
        },
        {
          "text": "** another example is that the transaction was approved here but failed in the signing process\nTo know the status of the transaction you can access the function getTransactionByToken.",
          "id": "TDjYX1g1KaEimdS5DCCsl"
        },
        {
          "text": "",
          "id": "HpDgQh5XSoI-DWfT1rj1x"
        },
        {
          "text": "\nTo get the token to send those functions you should call getCurrentToken one action BEFORE sendTransaction.",
          "id": "0XC_T7RDAHZskuzcGqI66"
        },
        {
          "text": "",
          "id": "QBwZIQtKKMZnAZPpl58cY"
        },
        {
          "text": "\nmyTokenToStoreInTheDb = user.getCurrentToken()",
          "id": "WvekZFB8KIPXMLHMk0K0B"
        },
        {
          "text": "",
          "id": "Lsq3c9oifjU4Nr7gyjitM"
        },
        {
          "text": "\nsendPayloadToBeSigned(...)",
          "id": "dipZEFspRKCzHiwupuV2Y"
        },
        {
          "text": "",
          "id": "Thvug1tD3C3Wf2T4jLEB7"
        },
        {
          "text": "\n.....",
          "id": "pPgu2wuSnR5ZX0XXC-veL"
        },
        {
          "text": "",
          "id": "K2oUbk81fAj5r8IJSeFMm"
        },
        {
          "text": "\nuser.getTransactionByToken(myTokenToStoreInTheDb,\"BTC\")",
          "id": "EjVk0hBGZrmumNjkiNjQL"
        }
      ]
    }
  ]
}