`{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/v3/crypto-exchanges/","auth":"required","apiSetting":"5d1d8bb82d46d1004a02581d","examples":{"codes":[{"language":"python","code":"import json\nimport requests\n\nTOKEN = 'YOUR TOKEN'\nurl = 'https://api.coins.asia/v3/crypto-exchanges/'\n\nheaders = {\n    'Authorization': 'Bearer {}'.format(TOKEN),\n    'Content-Type': 'application/json;charset=UTF-8',\n    'Accept': 'application/json'\n}\n\nbody = json.dumps({\n    'source_account': '35ba3',\n    'target_account': '1355a',\n    'source_amount': 1\n})\n\nrequests.post(url, headers=headers, data=body)"}]},"results":{"codes":[{"status":201,"language":"json","code":"{\n    \"crypto-exchange\": {\n\t\t    \"id\": \"1a2dgr4\",\n    \t\t\"source_account\": \"35ba3\",\n    \t\t\"target_account\": \"1355a\",\n\t\t    \"rate\": 10501,\n    \t\t\"source_amount\": 1,\n\t\t    \"target_amount\": 10501,\n        \"status\": \"pending\",\n\t\t    \"created_at\": \"2014-08-28T12:11:36.938Z\"\n    }\n}","name":""}]},"params":[{"name":"source_account","type":"string","default":"","desc":"The [account](doc:crypto-accounts) ID where the funds would be taken from","required":true,"in":"body","ref":"","_id":"5d1d9bafe0b027013fce399d"},{"name":"target_account","type":"string","default":"","desc":"The [account](doc:crypto-accounts) ID where the funds would be transferred to","required":true,"in":"body","ref":"","_id":"5d1d9bafe0b027013fce399c"},{"name":"source_amount","type":"string","default":"","desc":"Deduct the specified amount from the `source_account`, and transfer it to the `target_account` using the current exchange rate. `target_amount` should be present if this is not provided.","required":false,"in":"body","ref":"","_id":"5d1d9bafe0b027013fce399b"},{"name":"target_amount","type":"string","default":"","desc":"Transfer the specified amount to the `target_account`, and deduct from the `source_account` using the current exchange rate. `source_amount` should be present if this is not provided.","required":false,"in":"body","ref":"","_id":"5d1d9bafe0b027013fce399a"}],"method":"post","settings":"5d2c16e9ab606a0056359c3c"},"next":{"description":"","pages":[]},"title":"crypto-exchanges","type":"endpoint","slug":"crypto-exchanges-create","excerpt":"Convert funds between a user's accounts","body":"An exchange transfers funds between the same user's accounts. It uses the current exchange rate to convert the amount being transferred into the `target_account`.\n\n## Properties\n\n* **id** - Unique identifier for the exchange record.\n* **source_account** - The [account](doc:crypto-accounts) where the funds are taken from.\n* **target_account** - The [account](doc:crypto-accounts) where the funds are transferred to.\n* **rate** - The current exchange rate.\n* **source_amount** - The amount transferred from the `source_account`.\n* **target_amount** - The amount transferred to the `target_account`.\n* **status** - Specifies whether the transaction is `pending`, `success`, or `failed`.","updates":["5ea1b7e2eacb21024b9d8ffd","5ea1b7eaed28ac005dc8b6d3"],"order":3,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5d1d9bafe0b027013fce3999","version":{"version":"2.1","version_clean":"2.1.0","codename":"collector","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["56326e9ddf556c0d00cd08cb","56326e9ddf556c0d00cd08cc","56326e9ddf556c0d00cd08cd","56326e9ddf556c0d00cd08ce","56326e9ddf556c0d00cd08cf","56326e9ddf556c0d00cd08d0","56326e9ddf556c0d00cd08d1","56326e9ddf556c0d00cd08d2","56326e9ddf556c0d00cd08d3","56326e9ddf556c0d00cd08d4","56d942ac337fd11300d6a251","5ab2fcf66a1d77001230b47e","5afc2943bd2ef4000330bca7","5d1d87419a969a00141c6b4c","5d1d8948ef26b2002c6468d1","5d1d8afe7b2b24005bec7de0","5d1d8b24f5cfcb00201490bb","5d1d8bb82d46d1004a02581f","5d1d8de1e4edb0019ed63acd","5d1d8f6b613fb90050d0d3e0","5d1d934ed377870191039d28","5d1d99810b2e4600500eb5ff","5d1da14e613fb90050d0d491","5d229a846cf323005a7fa998","5d229a8c8abf65001cc4768d","5d229a9494b856002e26b6e1","5d229a9bf77bb900507ccb04","5d229aa88abf65001cc4768e","5d24310a9ca8c80054786177","5d24359101cc3a00508e7482","5d24418fa791b20050733b32"],"_id":"56326e9cdf556c0d00cd08ca","project":"544fc17e698ab40800b4f891","releaseDate":"2015-10-29T19:08:12.724Z","__v":22,"createdAt":"2015-10-29T19:08:12.724Z"},"updatedAt":"2019-07-04T07:56:23.231Z","createdAt":"2019-07-04T06:24:47.372Z","project":"544fc17e698ab40800b4f891","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Wallets","slug":"wallets-1","order":11,"from_sync":false,"reference":true,"_id":"5d1d99810b2e4600500eb5ff","project":"544fc17e698ab40800b4f891","version":"56326e9cdf556c0d00cd08ca","isAPI":false,"createdAt":"2019-07-04T06:15:29.680Z","__v":0},"user":"5d19a189b4596f0072f571d4","__v":5,"parentDoc":null}`

# postcrypto-exchanges

Convert funds between a user's accounts

### Definition

{{ api_url }}{{ page_api_url }}

### Parameters

#### Body Params

source_account:
required
string
The [account](doc:crypto-accounts) ID where the funds would be taken from
target_account:
required
string
The [account](doc:crypto-accounts) ID where the funds would be transferred to
source_amount:
string
Deduct the specified amount from the `source_account`, and transfer it to the `target_account` using the current exchange rate. `target_amount` should be present if this is not provided.
target_amount:
string
Transfer the specified amount to the `target_account`, and deduct from the `source_account` using the current exchange rate. `source_amount` should be present if this is not provided.

### Documentation

An exchange transfers funds between the same user's accounts. It uses the current exchange rate to convert the amount being transferred into the `target_account`. ## Properties * **id** - Unique identifier for the exchange record. * **source_account** - The [account](doc:crypto-accounts) where the funds are taken from. * **target_account** - The [account](doc:crypto-accounts) where the funds are transferred to. * **rate** - The current exchange rate. * **source_amount** - The amount transferred from the `source_account`. * **target_amount** - The amount transferred to the `target_account`. * **status** - Specifies whether the transaction is `pending`, `success`, or `failed`.