Create Crypto Transactions

Create transactions to purchase/sell crytpocurrency from the wallet

General Description and Resource

Purchasing cryptocurrency is easy with Synapse. All you have to do is create a transaction from a DDA or Subaccount into the Crypto account and the cryptocurrency will automatically be purchased based on the current market exchange rate.

Note: You will have to have a Synapse native account in your flow set up to move funds to and from the crypto wallet account. See the acceptable types below and here for more information. Intro to Direct Deposit Accounts

See below for the full list of transaction methods available:

Transaction Nodes
Fund
Withdraw

DEPOSIT-US

YES

YES

SUBACCOUNT-US

YES

YES

Supported Crypto Currency Types

Type
Currency

Bitcoin

BTC

Ethereum

ETH

Transactions with CRYPTO-US Accounts

Synapse's Crypto wallet is a portfolio of various cryptocurrencies. So the way you can buy or sell these assets is by supplying extra.asset value in the transaction JSON while creating it.

  • If you are creating a transaction from DEPOSIT-US to CRYPTO-US, you will need to supply extra.asset as BTC or ETH, then the transaction amount will go towards making a cryptocurrency purchase.

  • If you are creating a transaction from CRYPTO-US to DEPOSIT-US and you supply extra.asset as BTC of ETH, then the transaction amount will go towards selling the cryptocurrency out of the user portfolio.

  • If no extra.asset is supplied, the transaction would fail and the transaction status will go to RETURNED.

All buy and sell happens in USD. Before creating a transaction, we recommend calling the crypto quote API to show the current market to users and having them agree to the rate before creating a transaction. Once completed you can complete a GET on the CRYPTO-US node to return the trade and current portfolio to the user.

Below is an example transaction of buying and selling for your convenience.

API Endpoint

https://uat-api.synapsefi.com/v3.1/users/:user_id/nodes/:node_id/trans

PATH PARAMETER

user_id :
required
string

ID of sender (user)

node_id :
required
string

ID of sending node

BODY PARAMETER

to.type :
required
string

Receiving node type

to.id :
required
string

Receiving node ID

amount.amount :
required
double

Amount user wishes to send

amount.currency :
required
string

Currency of the transaction amount

extra.ip :
required
string

IP address of the user device while creating transaction

extra.asset :
string

Assign this value only in case of making a transaction to or from CRYPTO-US. Acceptable values are BTC and ETH

extra.same_day :
boolean false

Set this to true if you wish to settle the ACH on same day. Please note this would only work, if same day ACH has been enabled for your platform

extra.supp_id :
string

ID supplied to the transaction. Allows clients to track transactions based on specific events.

extra.group_id :
string

Group ID supplied to the transaction. Allows clients to track transactions based on specific events.

extra.note :
string

Memo tagged with the transaction

extra.process_on :
integer 0

When the transaction should be processed. The value is the delta value. Which means when 1 is supplied it means that the transaction will be processed tomorrow.

extra.other.attachments :
array of strings

Array of padded base64 of attachments

fees[fee ] :
double

Fee associated with the transaction

fees[note ] :
string

Reason for the fee

fees[to].id :
string

Node ID where the fee would be credited when the transaction settled. Fee node has to be DEPOSIT-US type always

Example Request

POST /v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81dc3854118009a1b35e1/trans HTTP/1.1
Host: uat-api.synapsefi.com
X-SP-USER-IP: 127.0.0.1
X-SP-USER: oauth_BcV9rmzTRKvDix8Ge32uN1qdkhfblgo7CtXQnJsZ|n38dj3h8NE393bv24ovoRY34kd62
Content-Type: application/json


{
  "to": {
    "type": "CRYPTO-US",
    "id": "5bb81e3085411800991b3b57"
  },
  "amount": {
    "amount": 500,
    "currency": "USD"
  },
  "extra": {
    "ip": "127.0.0.1",
    "note": "Test transaction",
    "asset":"BTC"
  }
}
POST /v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81e3085411800991b3b57/trans HTTP/1.1
Host: uat-api.synapsefi.com
X-SP-USER-IP: 127.0.0.1
X-SP-USER: oauth_BcV9rmzTRKvDix8Ge32uN1qdkhfblgo7CtXQnJsZ|n38dj3h8NE393bv24ovoRY34kd62
Content-Type: application/json


{
  "to": {
    "type": "DEPOSIT-US",
    "id": "5bb81dc3854118009a1b35e1"
  },
  "amount": {
    "amount": 300,
    "currency": "USD"
  },
  "extra": {
    "ip": "127.0.0.1",
    "note": "Test transaction",
    "asset":"BTC"
  }
}
from_node= "5bb81dc3854118009a1b35e1"
body ={
  "to": {
    "type": "CRYPTO-US",
    "id": "5bb81e3085411800991b3b57"
  },
  "amount": {
    "amount": 500,
    "currency": "USD"
  },
  "extra": {
    "ip": "127.0.0.1",
    "note": "Test transaction",
    "asset":"BTC"
  }
}

user.create_trans(from_node, body)
user.createTransaction('<NODE_ID>', {
  to: {
    type: 'CRYPTO-US',
    id: '<CRYPTO-US_NODE_ID>'
  },
  amount: {
    amount: 100.1,
    currency: 'USD'
  },
  extra: {
    ip: '127.0.0.1',
    note: 'Test transaction',
    asset: ‘BTC’
  }
});
from_node= "5bb81dc3854118009a1b35e1"
body ={
  "to": {
    "type": "CRYPTO-US",
    "id": "5bb81e3085411800991b3b57"
  },
  "amount": {
    "amount": 500,
    "currency": "USD"
  },
  "extra": {
    "ip": "127.0.0.1",
    "note": "Test transaction",
    "asset":"BTC"
  }
}

user.create_transaction(node_id: from_node, payload: body)
$to = (object)[
   "type" => "CRYPTO-US",
   "id" => '5bb81e3085411800991b3b57'
];
$amount = (object)[
   "amount" => 22.1,
   "currency" => "USD"
];
$extra = (object)[
   "ip" => "::1",
   "asset":"BTC"
];
$body = (object)[
   "to" => $to,
   "amount" => $amount,
   "extra" => $extra
];
$nodeid = '5bb81dc3854118009a1b35e1';
$user->create_trans($nodeid, $body);
nodeID := "5bb81dc3854118009a1b35e1"
body := `{
  "to": {
    "type": "CRYPTO-US",
    "id": "5bb81e3085411800991b3b57"
  },
  "amount": {
    "amount": 500,
    "currency": "USD"
  },
  "extra": {
    "ip": "127.0.0.1",
    "note": "Test transaction",
    "asset":"BTC"
  }
}`

data, err := user.CreateTransaction(nodeID, body)

Example Successful 200 Response

{
    "_id": "5bb81e4daab23600cd67e1c6",
    "_links": {
        "self": {
            "href": "https://uat-api.synapsefi.com/v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81dc3854118009a1b35e1/trans/5bb81e4daab23600cd67e1c6"
        }
    },
    "_v": 2,
    "amount": {
        "amount": 500,
        "currency": "USD"
    },
    "client": {
        "id": "5ade26b4567a900029e2afd2",
        "name": "* YY Test Account"
    },
    "extra": {
        "asset": "BTC",
        "created_on": 1538793036435,
        "encrypted_note": "",
        "group_id": null,
        "ip": "127.0.0.1",
        "latlon": "0,0",
        "note": "Test transaction",
        "process_on": 1538793036435,
        "same_day": false,
        "supp_id": ""
    },
    "fees": [
        {
            "fee": 0,
            "note": "Facilitator Fee",
            "to": {
                "id": "None"
            }
        }
    ],
    "from": {
        "id": "5bb81dc3854118009a1b35e1",
        "nickname": "My Deposit Account",
        "type": "DEPOSIT-US",
        "user": {
            "_id": "5bb6ab05472e2500adffad5a",
            "legal_names": [
                "Test User"
            ]
        }
    },
    "recent_status": {
        "date": 1538793036435,
        "note": "Transaction Created.",
        "status": "CREATED",
        "status_id": "1"
    },
    "timeline": [
        {
            "date": 1538793036435,
            "note": "Transaction Created.",
            "status": "CREATED",
            "status_id": "1"
        }
    ],
    "to": {
        "id": "5bb81e3085411800991b3b57",
        "nickname": "My CRYPTO Wallet",
        "type": "CRYPTO-US",
        "user": {
            "_id": "5bb6ab05472e2500adffad5a",
            "legal_names": [
                "Test User"
            ]
        }
    }
}
{
    "_id": "5bb821623d2c8200ddf3a297",
    "_links": {
        "self": {
            "href": "https://uat-api.synapsefi.com/v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81e3085411800991b3b57/trans/5bb821623d2c8200ddf3a297"
        }
    },
    "_v": 2,
    "amount": {
        "amount": 300,
        "currency": "USD"
    },
    "client": {
        "id": "5ade26b4567a900029e2afd2",
        "name": "* YY Test Account"
    },
    "extra": {
        "asset": "BTC",
        "created_on": 1538793825812,
        "encrypted_note": "",
        "group_id": null,
        "ip": "127.0.0.1",
        "latlon": "0,0",
        "note": "Test transaction",
        "process_on": 1538793825812,
        "same_day": false,
        "supp_id": ""
    },
    "fees": [
        {
            "fee": 0,
            "note": "Facilitator Fee",
            "to": {
                "id": "None"
            }
        }
    ],
    "from": {
        "id": "5bb81e3085411800991b3b57",
        "nickname": "My CRYPTO Wallet",
        "type": "CRYPTO-US",
        "user": {
            "_id": "5bb6ab05472e2500adffad5a",
            "legal_names": [
                "Test User"
            ]
        }
    },
    "recent_status": {
        "date": 1538793825812,
        "note": "Transaction Created.",
        "status": "CREATED",
        "status_id": "1"
    },
    "timeline": [
        {
            "date": 1538793825812,
            "note": "Transaction Created.",
            "status": "CREATED",
            "status_id": "1"
        }
    ],
    "to": {
        "id": "5bb81dc3854118009a1b35e1",
        "nickname": "My Deposit Account",
        "type": "DEPOSIT-US",
        "user": {
            "_id": "5bb6ab05472e2500adffad5a",
            "legal_names": [
                "Test User"
            ]
        }
    }
}

A successful response will return the standard transaction object. The response will have the asset purchased in the extra field. To view how many cryptocurrencies were purchased, complete a GET Node call on your crypto account. More information can be found here .

Note: When viewing the transaction on the dashboard, a note appended on the processing credit or processing debit status of the transaction tells you the amount of USD converted to your selected asset or how much of the asset was converted to USD.

Transaction Status

Status
Comment

CREATED

The transaction was created.

PROCESSING-CREDIT

Funds are being credited for the cryptocurrency purchase

PROCESSING-DEBIT

Funds are being debited to purchase the cryptocurrency at the current market exchange rate

SETTLED

The transaction is completed and the amount of crypto is in your portfolio.

RETURNED

No asset was supplied when creating the transaction.

Subscribe to Webhooks

We recommend that you subscribe to webhooks to stay updated on the status of nodes.

Transaction Fees

By default, we deduct transaction fees from the transaction. To send the recipient 100% of the funds, designate the account you want to debit fees from.

Or take an additional fee for yourself and designate the DEPOSIT-US node you want to send fees to.

Idempotent Requests

POST calls support idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create a transaction fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single charge is created.

To perform an idempotent request, attach a unique key to any POST request made to the API via the X-SP-IDEMPOTENCY-KEY: <key> header.

Idempotency keys expire after 24 hours.

Create Crypto Transactions


Create transactions to purchase/sell crytpocurrency from the wallet

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.