{"_id":"5bb7fd84488cd90003255d29","project":"59f79e3c584eb200345ceafc","version":{"_id":"5ba178b00a916500030c6a21","project":"59f79e3c584eb200345ceafc","__v":24,"forked_from":"59f79e3c584eb200345ceaff","createdAt":"2015-09-17T03:47:20.956Z","releaseDate":"2015-09-17T03:47:20.956Z","categories":["5ba178b00a916500030c69a2","5ba178b00a916500030c69a3","5ba178b00a916500030c69a4","5ba178b00a916500030c69a5","5ba178b00a916500030c69a6","5ba178b00a916500030c69a7","5ba178b00a916500030c69a8","5ba178b00a916500030c69a9","5ba178b00a916500030c69aa","5ba178b00a916500030c69ab","5ba178b00a916500030c69ac","5afb6888212c690003ae3d3b","5ba178b00a916500030c69ad","5ba178b00a916500030c69ae","5ba2dcbc99f53f0003b97e2c","5babd73fa0ab3e0003ead030","5bb4038be7222e000334dd97","5bb55954478c1300031a44c2","5bb665a1607307000327c81e","5bb6f90229a7fb0003a0650d","5bb7f9bc29a7fb0003a07ac1","5bba58bd7ba7710003bd901d","5bba6dac7ba7710003bd908d","5bba6e257ba7710003bd9090","5bbac87810189c0003e619ea","5bbb9d02b5862c00036266b2","5bbbadb6219c3e000376c2de","5bc417751d1b0000182bf7f6","5bc59e3b2a5b4f0044db5b97","5bc7bbce2262cc0041f6eff2","5bce6a3580a7250031199f34","5bcfac2c4082510019f2d91b","5bcfac3757bed90030e45d68","5bcfac45d305bc0049941539","5bd2a43548bb6f00289c8fad","5bd3a42a026ebe001f66259e","5bd9d5afffe003005b02f97b","5becb7ee85c6b300557662b6"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":false,"codename":"","version_clean":"3.2.0","version":"3.2"},"category":{"_id":"5bb7f9bc29a7fb0003a07ac1","project":"59f79e3c584eb200345ceafc","version":"5ba178b00a916500030c6a21","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2018-10-05T23:54:36.106Z","from_sync":false,"order":14,"slug":"cryptocurrency-wallet","title":"Crypto Wallet"},"user":"5a68eb6970ea610012bfb924","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-10-06T00:10:44.856Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[]},"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"## General Description and Resource ##\nPurchasing 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. \n\n**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](doc:intro-to-direct-deposit-accounts) \n\nSee below for the full list of transaction methods available:\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Transaction Nodes\",\n    \"h-1\": \"Fund\",\n    \"h-2\": \"Withdraw\",\n    \"0-2\": \"YES\",\n    \"1-2\": \"YES\",\n    \"2-2\": \"YES\",\n    \"3-2\": \"YES\",\n    \"4-2\": \"YES\",\n    \"5-2\": \"YES\",\n    \"6-2\": \"YES\",\n    \"7-2\": \"YES\",\n    \"0-1\": \"YES\",\n    \"1-1\": \"YES\",\n    \"2-1\": \"---\",\n    \"3-1\": \"---\",\n    \"4-1\": \"YES\",\n    \"5-1\": \"YES\",\n    \"6-1\": \"YES\",\n    \"7-1\": \"YES\",\n    \"0-0\": \"DEPOSIT-US\",\n    \"1-0\": \"SUBACCOUNT-US\",\n    \"2-0\": \"WIRE\",\n    \"3-0\": \"CHECKS\",\n    \"4-0\": \"CARD PROCESSING\",\n    \"5-0\": \"CARD ISSUANCE\",\n    \"6-0\": \"TRANSFER TO OTHER SYNAPSE ACCOUNTS\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\n##Supported Crypto Currency Types\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Type\",\n    \"h-1\": \"Currency\",\n    \"0-1\": \"BTC\",\n    \"1-1\": \"ETH\",\n    \"0-0\": \"Bitcoin\",\n    \"1-0\": \"Ethereum\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n##Transactions with CRYPTO-US Accounts \nSynapseFI'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.\n\n* 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.\n\n* 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.\n\n* If no extra.asset is supplied, the transaction would fail and the transaction status will go to `RETURNED`.\n\nAll buy and sell happens in `USD`. Before creating a transaction, we recommend calling the [crypto quote API](doc:get-the-crypto-quote) 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.\n\nBelow is an example transaction of buying and selling for your convenience. \n\n##API Endpoint\nhttps://uat-api.synapsefi.com/v3.1/users/:user_id/nodes/:node_id/trans\n\n##PATH PARAMETER##\n[block:html]\n{\n  \"html\": \"<div class=\\\"api-manager\\\"><div class=\\\"param-table\\\"><div class=\\\"table\\\"><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong>user_id <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>ID of sender (user)</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong>node_id <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>ID of sending node</p></div></div></div></div></div></div>\"\n}\n[/block]\n##BODY PARAMETER##\n[block:html]\n{\n  \"html\": \"<div class=\\\"api-manager\\\"><div class=\\\"param-table\\\"><div class=\\\"table\\\"><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">to.</span>type <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Receiving node type</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">to.</span>id <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Receiving node ID</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">amount.</span>amount <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">double</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Amount user wishes to send</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">amount.</span>currency <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Currency of the transaction amount</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.</span>ip <span class=\\\"colon\\\">:</span> </strong><div class=\\\"required\\\">required</div></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>IP address of the user device while creating transaction</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.</span>asset <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Assign this value only in case of making a transaction to or from <code>CRYPTO-US</code>. Acceptable values are <code>BTC</code> and <code>ETH</code></p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.</span>same_day <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">boolean</strong> <span class=\\\"param-default text-muted\\\">false</span><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Set this to <code>true</code> 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</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.</span>supp_id <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>ID supplied to the transaction</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.</span>group_id <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Group ID supplied to the transaction</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.</span>note <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Memo tagged with the transaction</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.</span>process_on <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">integer</strong> <span class=\\\"param-default text-muted\\\">0</span><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>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.</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">extra.other.</span>attachments <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">array of strings</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Array of padded base64 of attachments</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">fees[</span>fee <span class=\\\"text-muted\\\">]</span> <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">double</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Fee associated with the transaction</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">fees[</span>note <span class=\\\"text-muted\\\">]</span> <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Reason for the fee</p></div></div></div><div class=\\\"tr\\\"><div class=\\\"td param\\\"> <strong> <span class=\\\"text-muted\\\">fees[to].</span>id <span class=\\\"colon\\\">:</span> </strong></div><div class=\\\"td\\\"> <strong class=\\\"param-type\\\">string</strong><div marked=\\\"\\\" class=\\\"ng-isolate-scope\\\"><p>Node ID where the fee would be credited when the transaction settled. Fee node has to be DEPOSIT-US type always</p></div></div></div></div></div></div>\"\n}\n[/block]\n## Example Request\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"POST /v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81dc3854118009a1b35e1/trans HTTP/1.1\\nHost: uat-api.synapsefi.com\\nX-SP-USER-IP: 127.0.0.1\\nX-SP-USER: oauth_BcV9rmzTRKvDix8Ge32uN1qdkhfblgo7CtXQnJsZ|n38dj3h8NE393bv24ovoRY34kd62\\nContent-Type: application/json\\n\\n\\n{\\n  \\\"to\\\": {\\n    \\\"type\\\": \\\"CRYPTO-US\\\",\\n    \\\"id\\\": \\\"5bb81e3085411800991b3b57\\\"\\n  },\\n  \\\"amount\\\": {\\n    \\\"amount\\\": 500,\\n    \\\"currency\\\": \\\"USD\\\"\\n  },\\n  \\\"extra\\\": {\\n    \\\"ip\\\": \\\"127.0.0.1\\\",\\n    \\\"note\\\": \\\"Test transaction\\\",\\n    \\\"asset\\\":\\\"BTC\\\"\\n  }\\n}\",\n      \"language\": \"http\",\n      \"name\": \"Buying Crypto\"\n    },\n    {\n      \"code\": \"POST /v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81e3085411800991b3b57/trans HTTP/1.1\\nHost: uat-api.synapsefi.com\\nX-SP-USER-IP: 127.0.0.1\\nX-SP-USER: oauth_BcV9rmzTRKvDix8Ge32uN1qdkhfblgo7CtXQnJsZ|n38dj3h8NE393bv24ovoRY34kd62\\nContent-Type: application/json\\n\\n\\n{\\n  \\\"to\\\": {\\n    \\\"type\\\": \\\"DEPOSIT-US\\\",\\n    \\\"id\\\": \\\"5bb81dc3854118009a1b35e1\\\"\\n  },\\n  \\\"amount\\\": {\\n    \\\"amount\\\": 300,\\n    \\\"currency\\\": \\\"USD\\\"\\n  },\\n  \\\"extra\\\": {\\n    \\\"ip\\\": \\\"127.0.0.1\\\",\\n    \\\"note\\\": \\\"Test transaction\\\",\\n    \\\"asset\\\":\\\"BTC\\\"\\n  }\\n}\",\n      \"language\": \"http\",\n      \"name\": \"Selling Crypto\"\n    }\n  ]\n}\n[/block]\n## Example Successful 200 Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"_id\\\": \\\"5bb81e4daab23600cd67e1c6\\\",\\n    \\\"_links\\\": {\\n        \\\"self\\\": {\\n            \\\"href\\\": \\\"https://uat-api.synapsefi.com/v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81dc3854118009a1b35e1/trans/5bb81e4daab23600cd67e1c6\\\"\\n        }\\n    },\\n    \\\"_v\\\": 2,\\n    \\\"amount\\\": {\\n        \\\"amount\\\": 500,\\n        \\\"currency\\\": \\\"USD\\\"\\n    },\\n    \\\"client\\\": {\\n        \\\"id\\\": \\\"5ade26b4567a900029e2afd2\\\",\\n        \\\"name\\\": \\\"* YY Test Account\\\"\\n    },\\n    \\\"extra\\\": {\\n        \\\"asset\\\": \\\"BTC\\\",\\n        \\\"created_on\\\": 1538793036435,\\n        \\\"encrypted_note\\\": \\\"\\\",\\n        \\\"group_id\\\": null,\\n        \\\"ip\\\": \\\"127.0.0.1\\\",\\n        \\\"latlon\\\": \\\"0,0\\\",\\n        \\\"note\\\": \\\"Test transaction\\\",\\n        \\\"process_on\\\": 1538793036435,\\n        \\\"same_day\\\": false,\\n        \\\"supp_id\\\": \\\"\\\"\\n    },\\n    \\\"fees\\\": [\\n        {\\n            \\\"fee\\\": 0,\\n            \\\"note\\\": \\\"Facilitator Fee\\\",\\n            \\\"to\\\": {\\n                \\\"id\\\": \\\"None\\\"\\n            }\\n        }\\n    ],\\n    \\\"from\\\": {\\n        \\\"id\\\": \\\"5bb81dc3854118009a1b35e1\\\",\\n        \\\"nickname\\\": \\\"My Deposit Account\\\",\\n        \\\"type\\\": \\\"DEPOSIT-US\\\",\\n        \\\"user\\\": {\\n            \\\"_id\\\": \\\"5bb6ab05472e2500adffad5a\\\",\\n            \\\"legal_names\\\": [\\n                \\\"Test User\\\"\\n            ]\\n        }\\n    },\\n    \\\"recent_status\\\": {\\n        \\\"date\\\": 1538793036435,\\n        \\\"note\\\": \\\"Transaction Created.\\\",\\n        \\\"status\\\": \\\"CREATED\\\",\\n        \\\"status_id\\\": \\\"1\\\"\\n    },\\n    \\\"timeline\\\": [\\n        {\\n            \\\"date\\\": 1538793036435,\\n            \\\"note\\\": \\\"Transaction Created.\\\",\\n            \\\"status\\\": \\\"CREATED\\\",\\n            \\\"status_id\\\": \\\"1\\\"\\n        }\\n    ],\\n    \\\"to\\\": {\\n        \\\"id\\\": \\\"5bb81e3085411800991b3b57\\\",\\n        \\\"nickname\\\": \\\"My CRYPTO Wallet\\\",\\n        \\\"type\\\": \\\"CRYPTO-US\\\",\\n        \\\"user\\\": {\\n            \\\"_id\\\": \\\"5bb6ab05472e2500adffad5a\\\",\\n            \\\"legal_names\\\": [\\n                \\\"Test User\\\"\\n            ]\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 Buying Crypto\"\n    },\n    {\n      \"code\": \"{\\n    \\\"_id\\\": \\\"5bb821623d2c8200ddf3a297\\\",\\n    \\\"_links\\\": {\\n        \\\"self\\\": {\\n            \\\"href\\\": \\\"https://uat-api.synapsefi.com/v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81e3085411800991b3b57/trans/5bb821623d2c8200ddf3a297\\\"\\n        }\\n    },\\n    \\\"_v\\\": 2,\\n    \\\"amount\\\": {\\n        \\\"amount\\\": 300,\\n        \\\"currency\\\": \\\"USD\\\"\\n    },\\n    \\\"client\\\": {\\n        \\\"id\\\": \\\"5ade26b4567a900029e2afd2\\\",\\n        \\\"name\\\": \\\"* YY Test Account\\\"\\n    },\\n    \\\"extra\\\": {\\n        \\\"asset\\\": \\\"BTC\\\",\\n        \\\"created_on\\\": 1538793825812,\\n        \\\"encrypted_note\\\": \\\"\\\",\\n        \\\"group_id\\\": null,\\n        \\\"ip\\\": \\\"127.0.0.1\\\",\\n        \\\"latlon\\\": \\\"0,0\\\",\\n        \\\"note\\\": \\\"Test transaction\\\",\\n        \\\"process_on\\\": 1538793825812,\\n        \\\"same_day\\\": false,\\n        \\\"supp_id\\\": \\\"\\\"\\n    },\\n    \\\"fees\\\": [\\n        {\\n            \\\"fee\\\": 0,\\n            \\\"note\\\": \\\"Facilitator Fee\\\",\\n            \\\"to\\\": {\\n                \\\"id\\\": \\\"None\\\"\\n            }\\n        }\\n    ],\\n    \\\"from\\\": {\\n        \\\"id\\\": \\\"5bb81e3085411800991b3b57\\\",\\n        \\\"nickname\\\": \\\"My CRYPTO Wallet\\\",\\n        \\\"type\\\": \\\"CRYPTO-US\\\",\\n        \\\"user\\\": {\\n            \\\"_id\\\": \\\"5bb6ab05472e2500adffad5a\\\",\\n            \\\"legal_names\\\": [\\n                \\\"Test User\\\"\\n            ]\\n        }\\n    },\\n    \\\"recent_status\\\": {\\n        \\\"date\\\": 1538793825812,\\n        \\\"note\\\": \\\"Transaction Created.\\\",\\n        \\\"status\\\": \\\"CREATED\\\",\\n        \\\"status_id\\\": \\\"1\\\"\\n    },\\n    \\\"timeline\\\": [\\n        {\\n            \\\"date\\\": 1538793825812,\\n            \\\"note\\\": \\\"Transaction Created.\\\",\\n            \\\"status\\\": \\\"CREATED\\\",\\n            \\\"status_id\\\": \\\"1\\\"\\n        }\\n    ],\\n    \\\"to\\\": {\\n        \\\"id\\\": \\\"5bb81dc3854118009a1b35e1\\\",\\n        \\\"nickname\\\": \\\"My Deposit Account\\\",\\n        \\\"type\\\": \\\"DEPOSIT-US\\\",\\n        \\\"user\\\": {\\n            \\\"_id\\\": \\\"5bb6ab05472e2500adffad5a\\\",\\n            \\\"legal_names\\\": [\\n                \\\"Test User\\\"\\n            ]\\n        }\\n    }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 Selling Crypto\"\n    }\n  ]\n}\n[/block]\nA 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](doc:nodes) .\n\n**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. \n\n##Transaction Status\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Status\",\n    \"h-1\": \"Comment\",\n    \"0-0\": \"CREATED\",\n    \"0-1\": \"The transaction was created.\",\n    \"1-0\": \"PROCESSING-CREDIT\",\n    \"1-1\": \"Funds are being credited for the cryptocurrency purchase\",\n    \"2-0\": \"PROCESSING-DEBIT\",\n    \"2-1\": \"Funds are being debited to purchase the cryptocurrency at the current market exchange rate\",\n    \"3-0\": \"SETTLED\",\n    \"3-1\": \"The transaction is completed and the amount of crypto is in your portfolio.\",\n    \"4-0\": \"RETURNED\",\n    \"4-1\": \"No asset was supplied when creating the transaction.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Subscribe to Webhooks\",\n  \"body\": \"We recommend that you [subscribe to webhooks](https://docs.synapsefi.com/v3.2/docs/subscribe-to-webhooks) to stay updated on the status of nodes.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Transaction Fees\",\n  \"body\": \"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](https://docs.synapsefi.com/v3.2/docs/facilitator-fees-for-transactions).\\n\\nOr take an additional `fee` for yourself and designate the DEPOSIT-US node you want to send fees to.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"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.\\n\\nTo perform an idempotent request, attach a unique key to any POST request made to the API via the X-SP-IDEMPOTENCY-KEY: <key> header.\\n\\nIdempotency keys expire after 24 hours.\",\n  \"title\": \"Idempotent Requests\"\n}\n[/block]","excerpt":"Create transactions to purchase/sell crytpocurrency from the wallet","slug":"buying-and-selling-cryptocurrency","type":"basic","title":"Create Crypto Transactions"}

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](doc:intro-to-direct-deposit-accounts) See below for the full list of transaction methods available: [block:parameters] { "data": { "h-0": "Transaction Nodes", "h-1": "Fund", "h-2": "Withdraw", "0-2": "YES", "1-2": "YES", "2-2": "YES", "3-2": "YES", "4-2": "YES", "5-2": "YES", "6-2": "YES", "7-2": "YES", "0-1": "YES", "1-1": "YES", "2-1": "---", "3-1": "---", "4-1": "YES", "5-1": "YES", "6-1": "YES", "7-1": "YES", "0-0": "DEPOSIT-US", "1-0": "SUBACCOUNT-US", "2-0": "WIRE", "3-0": "CHECKS", "4-0": "CARD PROCESSING", "5-0": "CARD ISSUANCE", "6-0": "TRANSFER TO OTHER SYNAPSE ACCOUNTS" }, "cols": 3, "rows": 2 } [/block] ##Supported Crypto Currency Types [block:parameters] { "data": { "h-0": "Type", "h-1": "Currency", "0-1": "BTC", "1-1": "ETH", "0-0": "Bitcoin", "1-0": "Ethereum" }, "cols": 2, "rows": 2 } [/block] ##Transactions with CRYPTO-US Accounts SynapseFI'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](doc:get-the-crypto-quote) 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## [block:html] { "html": "<div class=\"api-manager\"><div class=\"param-table\"><div class=\"table\"><div class=\"tr\"><div class=\"td param\"> <strong>user_id <span class=\"colon\">:</span> </strong><div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>ID of sender (user)</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong>node_id <span class=\"colon\">:</span> </strong><div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>ID of sending node</p></div></div></div></div></div></div>" } [/block] ##BODY PARAMETER## [block:html] { "html": "<div class=\"api-manager\"><div class=\"param-table\"><div class=\"table\"><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">to.</span>type <span class=\"colon\">:</span> </strong><div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Receiving node type</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">to.</span>id <span class=\"colon\">:</span> </strong><div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Receiving node ID</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">amount.</span>amount <span class=\"colon\">:</span> </strong><div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">double</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Amount user wishes to send</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">amount.</span>currency <span class=\"colon\">:</span> </strong><div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Currency of the transaction amount</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.</span>ip <span class=\"colon\">:</span> </strong><div class=\"required\">required</div></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>IP address of the user device while creating transaction</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.</span>asset <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Assign this value only in case of making a transaction to or from <code>CRYPTO-US</code>. Acceptable values are <code>BTC</code> and <code>ETH</code></p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.</span>same_day <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">boolean</strong> <span class=\"param-default text-muted\">false</span><div marked=\"\" class=\"ng-isolate-scope\"><p>Set this to <code>true</code> 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</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.</span>supp_id <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>ID supplied to the transaction</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.</span>group_id <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Group ID supplied to the transaction</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.</span>note <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Memo tagged with the transaction</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.</span>process_on <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">integer</strong> <span class=\"param-default text-muted\">0</span><div marked=\"\" class=\"ng-isolate-scope\"><p>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.</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">extra.other.</span>attachments <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">array of strings</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Array of padded base64 of attachments</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">fees[</span>fee <span class=\"text-muted\">]</span> <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">double</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Fee associated with the transaction</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">fees[</span>note <span class=\"text-muted\">]</span> <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Reason for the fee</p></div></div></div><div class=\"tr\"><div class=\"td param\"> <strong> <span class=\"text-muted\">fees[to].</span>id <span class=\"colon\">:</span> </strong></div><div class=\"td\"> <strong class=\"param-type\">string</strong><div marked=\"\" class=\"ng-isolate-scope\"><p>Node ID where the fee would be credited when the transaction settled. Fee node has to be DEPOSIT-US type always</p></div></div></div></div></div></div>" } [/block] ## Example Request [block:code] { "codes": [ { "code": "POST /v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81dc3854118009a1b35e1/trans HTTP/1.1\nHost: uat-api.synapsefi.com\nX-SP-USER-IP: 127.0.0.1\nX-SP-USER: oauth_BcV9rmzTRKvDix8Ge32uN1qdkhfblgo7CtXQnJsZ|n38dj3h8NE393bv24ovoRY34kd62\nContent-Type: application/json\n\n\n{\n \"to\": {\n \"type\": \"CRYPTO-US\",\n \"id\": \"5bb81e3085411800991b3b57\"\n },\n \"amount\": {\n \"amount\": 500,\n \"currency\": \"USD\"\n },\n \"extra\": {\n \"ip\": \"127.0.0.1\",\n \"note\": \"Test transaction\",\n \"asset\":\"BTC\"\n }\n}", "language": "http", "name": "Buying Crypto" }, { "code": "POST /v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81e3085411800991b3b57/trans HTTP/1.1\nHost: uat-api.synapsefi.com\nX-SP-USER-IP: 127.0.0.1\nX-SP-USER: oauth_BcV9rmzTRKvDix8Ge32uN1qdkhfblgo7CtXQnJsZ|n38dj3h8NE393bv24ovoRY34kd62\nContent-Type: application/json\n\n\n{\n \"to\": {\n \"type\": \"DEPOSIT-US\",\n \"id\": \"5bb81dc3854118009a1b35e1\"\n },\n \"amount\": {\n \"amount\": 300,\n \"currency\": \"USD\"\n },\n \"extra\": {\n \"ip\": \"127.0.0.1\",\n \"note\": \"Test transaction\",\n \"asset\":\"BTC\"\n }\n}", "language": "http", "name": "Selling Crypto" } ] } [/block] ## Example Successful 200 Response [block:code] { "codes": [ { "code": "{\n \"_id\": \"5bb81e4daab23600cd67e1c6\",\n \"_links\": {\n \"self\": {\n \"href\": \"https://uat-api.synapsefi.com/v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81dc3854118009a1b35e1/trans/5bb81e4daab23600cd67e1c6\"\n }\n },\n \"_v\": 2,\n \"amount\": {\n \"amount\": 500,\n \"currency\": \"USD\"\n },\n \"client\": {\n \"id\": \"5ade26b4567a900029e2afd2\",\n \"name\": \"* YY Test Account\"\n },\n \"extra\": {\n \"asset\": \"BTC\",\n \"created_on\": 1538793036435,\n \"encrypted_note\": \"\",\n \"group_id\": null,\n \"ip\": \"127.0.0.1\",\n \"latlon\": \"0,0\",\n \"note\": \"Test transaction\",\n \"process_on\": 1538793036435,\n \"same_day\": false,\n \"supp_id\": \"\"\n },\n \"fees\": [\n {\n \"fee\": 0,\n \"note\": \"Facilitator Fee\",\n \"to\": {\n \"id\": \"None\"\n }\n }\n ],\n \"from\": {\n \"id\": \"5bb81dc3854118009a1b35e1\",\n \"nickname\": \"My Deposit Account\",\n \"type\": \"DEPOSIT-US\",\n \"user\": {\n \"_id\": \"5bb6ab05472e2500adffad5a\",\n \"legal_names\": [\n \"Test User\"\n ]\n }\n },\n \"recent_status\": {\n \"date\": 1538793036435,\n \"note\": \"Transaction Created.\",\n \"status\": \"CREATED\",\n \"status_id\": \"1\"\n },\n \"timeline\": [\n {\n \"date\": 1538793036435,\n \"note\": \"Transaction Created.\",\n \"status\": \"CREATED\",\n \"status_id\": \"1\"\n }\n ],\n \"to\": {\n \"id\": \"5bb81e3085411800991b3b57\",\n \"nickname\": \"My CRYPTO Wallet\",\n \"type\": \"CRYPTO-US\",\n \"user\": {\n \"_id\": \"5bb6ab05472e2500adffad5a\",\n \"legal_names\": [\n \"Test User\"\n ]\n }\n }\n}", "language": "json", "name": "200 Buying Crypto" }, { "code": "{\n \"_id\": \"5bb821623d2c8200ddf3a297\",\n \"_links\": {\n \"self\": {\n \"href\": \"https://uat-api.synapsefi.com/v3.1/users/5bb6ab05472e2500adffad5a/nodes/5bb81e3085411800991b3b57/trans/5bb821623d2c8200ddf3a297\"\n }\n },\n \"_v\": 2,\n \"amount\": {\n \"amount\": 300,\n \"currency\": \"USD\"\n },\n \"client\": {\n \"id\": \"5ade26b4567a900029e2afd2\",\n \"name\": \"* YY Test Account\"\n },\n \"extra\": {\n \"asset\": \"BTC\",\n \"created_on\": 1538793825812,\n \"encrypted_note\": \"\",\n \"group_id\": null,\n \"ip\": \"127.0.0.1\",\n \"latlon\": \"0,0\",\n \"note\": \"Test transaction\",\n \"process_on\": 1538793825812,\n \"same_day\": false,\n \"supp_id\": \"\"\n },\n \"fees\": [\n {\n \"fee\": 0,\n \"note\": \"Facilitator Fee\",\n \"to\": {\n \"id\": \"None\"\n }\n }\n ],\n \"from\": {\n \"id\": \"5bb81e3085411800991b3b57\",\n \"nickname\": \"My CRYPTO Wallet\",\n \"type\": \"CRYPTO-US\",\n \"user\": {\n \"_id\": \"5bb6ab05472e2500adffad5a\",\n \"legal_names\": [\n \"Test User\"\n ]\n }\n },\n \"recent_status\": {\n \"date\": 1538793825812,\n \"note\": \"Transaction Created.\",\n \"status\": \"CREATED\",\n \"status_id\": \"1\"\n },\n \"timeline\": [\n {\n \"date\": 1538793825812,\n \"note\": \"Transaction Created.\",\n \"status\": \"CREATED\",\n \"status_id\": \"1\"\n }\n ],\n \"to\": {\n \"id\": \"5bb81dc3854118009a1b35e1\",\n \"nickname\": \"My Deposit Account\",\n \"type\": \"DEPOSIT-US\",\n \"user\": {\n \"_id\": \"5bb6ab05472e2500adffad5a\",\n \"legal_names\": [\n \"Test User\"\n ]\n }\n }\n}", "language": "json", "name": "200 Selling Crypto" } ] } [/block] 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](doc:nodes) . **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 [block:parameters] { "data": { "h-0": "Status", "h-1": "Comment", "0-0": "CREATED", "0-1": "The transaction was created.", "1-0": "PROCESSING-CREDIT", "1-1": "Funds are being credited for the cryptocurrency purchase", "2-0": "PROCESSING-DEBIT", "2-1": "Funds are being debited to purchase the cryptocurrency at the current market exchange rate", "3-0": "SETTLED", "3-1": "The transaction is completed and the amount of crypto is in your portfolio.", "4-0": "RETURNED", "4-1": "No asset was supplied when creating the transaction." }, "cols": 2, "rows": 5 } [/block] [block:callout] { "type": "info", "title": "Subscribe to Webhooks", "body": "We recommend that you [subscribe to webhooks](https://docs.synapsefi.com/v3.2/docs/subscribe-to-webhooks) to stay updated on the status of nodes." } [/block] [block:callout] { "type": "info", "title": "Transaction Fees", "body": "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](https://docs.synapsefi.com/v3.2/docs/facilitator-fees-for-transactions).\n\nOr take an additional `fee` for yourself and designate the DEPOSIT-US node you want to send fees to." } [/block] [block:callout] { "type": "info", "body": "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.\n\nTo perform an idempotent request, attach a unique key to any POST request made to the API via the X-SP-IDEMPOTENCY-KEY: <key> header.\n\nIdempotency keys expire after 24 hours.", "title": "Idempotent Requests" } [/block]