{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"results":{"codes":[]},"settings":""},"next":{"description":"","pages":[]},"title":"Cash disbursements","type":"basic","slug":"cash-out-api-tutorial","excerpt":"Cash out funds from your wallet to a specified recipient","body":"Using the coins API, you can send money to anyone through the [sellorder](doc:sellorder-create) endpoint. Funds from the sender may come from one of their coins wallets (PHP, BTC).\n\n## Prerequisites\n\n* Your account must be business verified. For more information, you may contact [business:::at:::coins.ph](mailto:[email protected]).\n* A properly set up [key](doc:creating-your-api-keys)\n* An [Authentication method](doc:choosing-an-authentication-method)\n* Sender must have either BTC or PHP balance\n* A selected [payout outlet](doc:getting-the-supported-payment-outlets) \n\n## Cash out\n\nFor the first example, we would be cashing out from our PHP wallet and transferring it **to another Coins account/wallet**. We will be using the `coins_transfer` [outlet](doc:getting-the-supported-payment-outlets) to send the funds. This [payout-outlet](doc:payout-outlet-categories) requires the sender to provide a `target_address` which is the registered Coins email or mobile number (in +639XXXXXXXXX format) of the recipient.\n[block:callout]\n{\n \"type\": \"warning\",\n \"body\": \"Please take note that sending funds to an invalid target_address (non-existent Coins email or mobile number) will result to a failed transfer.\"\n}\n[/block]\n\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"import requests\\n\\nTOKEN = 'YOUR TOKEN' #OAuth2\\nurl = 'https://api.coins.asia/v1/sellorder'\\n\\nheaders = {\\n 'Authorization': 'Bearer {}'.format(TOKEN),\\n 'Content-Type': 'application/json;charset=UTF-8',\\n 'Accept': 'application/json'\\n}\\n\\nbody = {\\n 'amount': 1000,\\n 'currency': 'PHP',\\n 'payment_outlet': 'coins_transfer',\\n 'pay_with_wallet': 'PBTC',\\n 'target_address': '[email protected]',\\n 'external_transaction_id': '001'\\n}\\n\\nrequests.post(url, headers=headers, data=body)\",\n \"language\": \"python\"\n }\n ]\n}\n[/block]\nA successful request would yield the following result:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"order\\\": {\\n \\\"amount\\\": \\\"5\\\",\\n \\\"created_time\\\": \\\"1594617992\\\",\\n \\\"currency\\\": \\\"PHP\\\",\\n \\\"delivery_status\\\": \\\"pending_payment\\\",\\n \\\"external_transaction_id\\\": \\\"001\\\",\\n \\\"fields\\\": {\\n \\\"target_address\\\": \\\"xxxxxxxxxxxxxxxs.ph\\\"\\n },\\n \\\"id\\\": \\\"194f60b3f5a1429ebbd75a8b6803135f\\\",\\n \\\"payment_outlet\\\": {\\n \\\"id\\\": \\\"coins_transfer\\\",\\n \\\"name\\\": \\\"Coins Transfer\\\",\\n \\\"payment_outlet_provider_id\\\": null\\n },\\n \\\"required_fields\\\": [\\n {\\n \\\"legend\\\": \\\"Target Address\\\",\\n \\\"name\\\": \\\"target_address\\\",\\n \\\"value\\\": \\\"xxxxxxxxxxxxxxxs.ph\\\"\\n }\\n ]\\n },\\n \\\"success\\\": true\\n}\",\n \"language\": \"json\"\n }\n ]\n}\n[/block]\nHere in the second example, we will be cashing out using the **PESONet service**, specifically to Union Bank of the Philippines by using the outlet id `union_bank_pesonet`. This payout outlet requires the sender to provide the `bank_account_name`, and `bank_account_number`. A sample request can be seen below:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"import requests\\n\\nTOKEN = 'YOUR TOKEN' #OAuth2\\nurl = 'https://api.coins.asia/v1/sellorder'\\n\\nheaders = {\\n 'Authorization': 'Bearer {}'.format(TOKEN),\\n 'Content-Type': 'application/json;charset=UTF-8',\\n 'Accept': 'application/json'\\n}\\n\\nbody = {\\n 'amount': 10000,\\n 'currency': 'PHP',\\n 'payment_outlet': 'union_bank_pesonet',\\n 'pay_with_wallet': 'PBTC',\\n 'bank_account_name': 'Bob Alice',\\n 'bank_account_number': '10092820210'\\n}\\n\\nrequests.post(url, headers=headers, data=body)\",\n \"language\": \"python\"\n }\n ]\n}\n[/block]\nFinally, we will be cashing out using **Instapay**, to Sterling Bank again by using the outlet id `sterlingx`. This payout outlet requires the sender to provide the `bank_account_name`, `bank_account_number`, and `recipient_bank_code`.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"import requests\\n\\nTOKEN = 'YOUR TOKEN' #OAuth2\\nurl = 'https://api.coins.asia/v1/sellorder'\\n\\nheaders = {\\n 'Authorization': 'Bearer {}'.format(TOKEN),\\n 'Content-Type': 'application/json;charset=UTF-8',\\n 'Accept': 'application/json'\\n}\\n\\nbody = {\\n 'amount': 10000,\\n 'currency': 'PHP',\\n 'payment_outlet': 'sterlingx',\\n 'pay_with_wallet': 'PBTC',\\n 'bank_account_name': 'Bob Alice',\\n 'bank_account_number': '10092820210',\\n 'recipient_bank_code': '0053'\\n}\\n\\nrequests.post(url, headers=headers, data=body)\",\n \"language\": \"python\"\n }\n ]\n}\n[/block]\nA successful transfer would yield the following result:\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"order\\\": {\\n \\\"btc_amount\\\": 1,\\n \\\"confirmation_code\\\": \\\"89hju02\\\",\\n \\\"expires_epoch\\\": \\\"1402483365\\\",\\n \\\"fields\\\": {\\n \\\"bank_account_name\\\": \\\"Bob Alice\\\",\\n \\\"bank_account_number\\\": '10092820210',\\n \\\"recipient_bank_code\\\": '0053',\\n },\\n \\\"id\\\": \\\"78ughb8f98b754cd7aa9d8d930089ji09m\\\",\\n \\\"payment_outlet_id\\\": \\\"sterlingx\\\",\\n \\\"qr_img_uri\\\": \\\"https://some.url\\\",\\n \\\"user_uri\\\": \\\"78ughb8f98b754cd7aa9d8d930089ji09m\\\",\\n \\\"wallet_address\\\": \\\"1234fasdf134\\\"\\n },\\n \\\"success\\\": true\\n}\",\n \"language\": \"json\"\n }\n ]\n}\n[/block]\nPlease see [here](doc:bank-cash-out-outlet-ids) for a full list of the available banks you can cash-out to.\n\n## Sender Details\n\nAPI integrators who are using HMAC authentication to send funds for their users are required to submit sender details. Please see [this](http://docs.coins.asia/docs/cash-out-for-business-account) guide for adding sender details to your API requests.","updates":["5c2b60ffafb8dc0057f5eae6","5d0a05c9eb749501fdb5163e","5d0a06bda14e51016e9edba3","5ed9d7e56f4ab60050c52c26"],"order":4,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"56326e9edf556c0d00cd08dc","project":"544fc17e698ab40800b4f891","__v":6,"user":"544fc065698ab40800b4f888","githubsync":"","parentDoc":null,"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"},"category":{"sync":{"isSync":false,"url":""},"pages":["56326e9edf556c0d00cd08da","56326e9edf556c0d00cd08db","56326e9edf556c0d00cd08dc","56326e9edf556c0d00cd08dd","56326e9edf556c0d00cd08de","56326e9edf556c0d00cd08df","5632e61862c48a0d00334ddc","5637210ec75f5d0d00ec5d4a","563750380704070d00f06c4b","56ecf98c7f94882900591955"],"title":"Tutorials","slug":"tutorials","order":3,"from_sync":false,"reference":false,"_id":"56326e9ddf556c0d00cd08cd","version":"56326e9cdf556c0d00cd08ca","__v":5,"createdAt":"2015-05-01T09:13:02.297Z","project":"544fc17e698ab40800b4f891"},"createdAt":"2015-05-01T09:14:11.457Z","updatedAt":"2019-07-04T07:56:23.195Z"}
Cash disbursements
Cash out funds from your wallet to a specified recipient