Create Tokens Transaction Request from Address

Through this endpoint users can make a single token transaction.

This applies only to fungible tokens, not NFTs (non-fungible tokens).

To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks here.

Crypto APIs will notify the user only when the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification will not be sent if the event does not or cannot occur, or will take long time to occur.

Supports Callback Functionality Single Result - This endpoint returns only one single result. POST /wallet-as-a-service/wallets/{walletId}/{blockchain}/{network}/addresses/{senderAddress}/token-transaction-requests

Path Parameters

  • Required
    blockchain string

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

    Default : ethereum
    Example : ethereum
    Possible Values : ethereum
  • Required
    network string

    Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten" are test networks.

    Default : mainnet
    Example : mainnet
    Possible Values : mainnet ropsten
  • Required
    senderAddress string

    Defines the specific source address for the transaction.

    Example : 0x6f61e3c2fbb8c8be698bd0907ba6c04b62800fe5
  • Required
    walletId string

    Defines the unique ID of the Wallet.

    Example : 609e221675d04500068718dc

Query parameters

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

Request body schema application/json

  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

  • Required
    data object
    • Required
      item object
      • Required
        amount string

        Represents the specific amount of the transaction.

        Example : 0.2
      • Optional
        callbackSecretKey string

        Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our Documentation.

        Example : yourSecretString
      • Optional
        callbackUrl string

        Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs.

        Example : https://example.com
      • Required
        feePriority string

        Represents the fee priority of the automation, whether it is "slow", "standard" or "fast".

        Example : standard
        Possible Values : slow standard fast
      • Optional
        note string

        Represents an optional note to add a free text in, explaining or providing additional detail on the transaction request.

        Example : yourAdditionalInformationhere
      • Required
        recipientAddress string

        Defines the specific recipient address for the transaction.

        Example : 0xc065b539490f81b6c297c37b1925c3be2f190732
      • Required
        tokenIdentifier string

        Defines the specific token identifier. For Bitcoin-based transactions it should be the propertyId and for Ethereum-based transactions - the contract.

        Example : 0xdac17f958d2ee523a2206206994597c13d831ec7

Response schema

201 400 401 402 403 409 415 422 429 500
HTTP Status Code: 201
Content-Type: application/json

The resource has been successfully created.

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • Required
    requestId string

    Defines the ID of the request. The requestId is generated by Crypto APIs and it's unique for every request.

    Example : 601c1710034ed6d407996b30
  • Optional
    context string

    In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. context is specified by the user.

    Example : You can add any text here
  • Required
    data object
    • Required
      item object
      • Required
        callbackSecretKey string

        Represents the Secret Key value provided by the customer. This field is used for security purposes during the callback notification, in order to prove the sender of the callback as Crypto APIs. For more information please see our Documentation.

        Example : yourSecretString
      • Required
        callbackUrl string

        Represents the URL that is set by the customer where the callback will be received at. The callback notification will be received only if and when the event occurs.

        Example : https://example.com
      • Required
        feePriority string

        Represents the fee priority of the automation, whether it is "slow", "standard" or "fast".

        Example : fast
        Possible Values : slow standard fast
      • Optional
        note string

        Represents an optional note to add a free text in, explaining or providing additional detail on the transaction request.

        Example : yourAdditionalInformationhere
      • Required
        recipients array

        Defines the destination for the transaction, i.e. the recipient(s).

        Example : 0x1316bea88fb7cd4ccc4a57e2f9f4f43d1a86ee59
        • Required
          address string

          Defines the destination address.

          Example : 0x1316bea88fb7cd4ccc4a57e2f9f4f43d1a86ee59
        • Required
          amount string

          Defines the amount sent to the destination address.

          Example : 1
      • Required
        senders object

        Defines details about the source, i.e. the sender.

        Example : 0x8798d11a96a2822ae60275f3a0798a2542912a10
        • Required
          address string

          Defines the sender's public address.

          Example : 0x8798d11a96a2822ae60275f3a0798a2542912a10
      • Required
        tokenTypeSpecificData object One Of
        object
        • Required
          contractAddress string

          Defines the contract address in the blockchain for an ERC20 token.

          Example : 0x092de782a7e1e0a92991ad829a0a33aef3c7545e
      • Required
        transactionRequestId string

        Represents a unique identifier of the transaction request (the request sent to make a transaction), which helps in identifying which callback and which referenceId concern that specific transaction request.

        Example : 6038d09050653d1f0e40584c

Callback parameters Method : POST

TRANSACTION_REQUEST_APPROVAL TRANSACTION_REQUEST_REJECTION TRANSACTION_REQUEST_BROADCASTED TRANSACTION_REQUEST_MINED TRANSACTION_REQUEST_FAIL

Content-Type : application/json

  • Object :

  • Required
    apiVersion string

    Specifies the version of the API that incorporates this endpoint.

    Example : 2.0
  • Required
    referenceId string

    Represents a unique identifier that serves as reference to the specific request which prompts a callback, e.g. Blockchain Events Subscription, Blockchain Automation, etc.

    Example : 6038d09050653d1f0e40584c
  • Required
    idempotencyKey string

    Specifies a unique ID generated by the system and attached to each callback. It is used by the server to recognize consecutive requests with the same data with the purpose not to perform the same operation twice.

    Example : e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c
  • Required
    data object

    Specifies all data, as attributes, included into the callback notification, which depends on the event.

    • Required
      product string

      Represents the Crypto APIs 2.0 product which sends the callback.

      Example : WALLET_AS_A_SERVICE
    • Required
      event string

      Defines the specific event, for which a callback subscription is set.

      Example : TRANSACTION_REQUEST_APPROVAL
    • Required
      item object

      Defines an item as one result.

      • Required
        blockchain string

        Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

        Example : ethereum
      • Required
        network string

        Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks.

        Example : ropsten
      • Required
        requiredApprovals integer

        The required number of approvals needed to approve the transaction.

        Example : 2
      • Required
        requiredRejections integer

        The required number of rejections needed to reject the transaction.

        Example : 2
      • Required
        currentApprovals integer

        The current number of approvals given for the transaction.

        Example : 1
      • Required
        currentRejections integer

        The current number of rejections given for the transaction.

        Example : 0

Credits Cost : 5 Credits For 1 Result(s)

Try it out

Request Example

POST
https://rest.cryptoapis.io/v2/wallet-as-a-service/wallets/609e221675d04500068718dc/ethereum/mainnet/addresses/0x6f61e3c2fbb8c8be698bd0907ba6c04b62800fe5/token-transaction-requests
Headers
Host: https://rest.cryptoapis.io/v2
Content-Type: application/json
X-API-Key: my-api-key

Request Body
{
    "context": "",
    "data": {
        "item": {
            "amount": "0.2",
            "callbackSecretKey": "yourSecretString",
            "callbackUrl": "https://example.com",
            "feePriority": "standard",
            "note": "yourAdditionalInformationhere",
            "recipientAddress": "0xc065b539490f81b6c297c37b1925c3be2f190732",
            "tokenIdentifier": "0xdac17f958d2ee523a2206206994597c13d831ec7"
        }
    }
}

Response Example

{
    "apiVersion": "2.0",
    "requestId": "601c1710034ed6d407996b30",
    "context": "You can add any text here",
    "data": {
        "item": {
            "callbackSecretKey": "yourSecretString",
            "callbackUrl": "https://example.com",
            "feePriority": "fast",
            "note": "yourAdditionalInformationhere",
            "recipients": [
                {
                    "address": "0x1316bea88fb7cd4ccc4a57e2f9f4f43d1a86ee59",
                    "amount": "1"
                }
            ],
            "senders": {
                "address": "0x8798d11a96a2822ae60275f3a0798a2542912a10"
            },
            "tokenTypeSpecificData": {
                "contractAddress": "0x092de782a7e1e0a92991ad829a0a33aef3c7545e"
            }
        }
    }
}

Callback Example

{
    "apiVersion": "2.0",
    "referenceId": "6038d09050653d1f0e40584c",
    "idempotencyKey": "e55bf7a4a7188855f1c27541a6c387d04cc3b22ee34d1304b0e6ecad61c9906c",
    "data": {
        "product": "WALLET_AS_A_SERVICE",
        "event": "TRANSACTION_REQUEST_APPROVAL",
        "item": {
            "blockchain": "ethereum",
            "network": "ropsten",
            "requiredApprovals": 2,
            "requiredRejections": 2,
            "currentApprovals": 1,
            "currentRejections": 0
        }
    }
}