{"_id":"56326e9fdf556c0d00cd08e3","editedParams2":true,"user":"544fc065698ab40800b4f888","__v":0,"category":{"_id":"56326e9ddf556c0d00cd08d2","project":"544fc17e698ab40800b4f891","version":"56326e9cdf556c0d00cd08ca","pages":["56326e9fdf556c0d00cd08e0","56326e9fdf556c0d00cd08e1","56326e9fdf556c0d00cd08e2","56326e9fdf556c0d00cd08e3","56326e9fdf556c0d00cd08e4","56326e9fdf556c0d00cd08e5","56326e9fdf556c0d00cd08e6","56326e9fdf556c0d00cd08e7","56326e9fdf556c0d00cd08e8"],"__v":1,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-01T08:07:30.539Z","from_sync":false,"order":8,"slug":"wallets","title":"Wallets"},"project":"544fc17e698ab40800b4f891","version":{"_id":"56326e9cdf556c0d00cd08ca","project":"544fc17e698ab40800b4f891","__v":2,"createdAt":"2015-10-29T19:08:12.724Z","releaseDate":"2015-10-29T19:08:12.724Z","categories":["56326e9ddf556c0d00cd08cb","56326e9ddf556c0d00cd08cc","56326e9ddf556c0d00cd08cd","56326e9ddf556c0d00cd08ce","56326e9ddf556c0d00cd08cf","56326e9ddf556c0d00cd08d0","56326e9ddf556c0d00cd08d1","56326e9ddf556c0d00cd08d2","56326e9ddf556c0d00cd08d3","56326e9ddf556c0d00cd08d4","56d942ac337fd11300d6a251"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"collector","version_clean":"2.1.0","version":"2.1"},"editedParams":true,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-05T14:03:49.298Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"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":""}]},"settings":"","examples":{"codes":[{"language":"python","code":"import json\nimport requests\n\nTOKEN = 'YOUR TOKEN'\nurl = 'https://coins.ph/api/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)","name":""}]},"method":"post","auth":"required","params":[{"_id":"5548cdc5d2c8410d006c2276","ref":"","in":"body","required":true,"desc":"The [account](doc:crypto-accounts) ID where the funds would be taken from","default":"","type":"string","name":"source_account"},{"_id":"5548cdc5d2c8410d006c2275","ref":"","in":"body","required":true,"desc":"The [account](doc:crypto-accounts) ID where the funds would be transferred to","default":"","type":"string","name":"target_account"},{"_id":"5548cdc5d2c8410d006c2274","ref":"","in":"body","required":false,"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.","default":"","type":"double","name":"source_amount"},{"_id":"5548cdc5d2c8410d006c2273","ref":"","in":"body","required":false,"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.","default":"","type":"double","name":"target_amount"}],"url":"/api/v3/crypto-exchanges/"},"isReference":false,"order":3,"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`.","excerpt":"Convert funds between a user's accounts","slug":"crypto-exchange","type":"endpoint","title":"crypto-exchanges"}

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:
double
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:
double
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.

Examples


Result Format


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`.