{"_id":"56326e9edf556c0d00cd08dc","project":"544fc17e698ab40800b4f891","__v":2,"user":"544fc065698ab40800b4f888","parentDoc":null,"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"},"category":{"_id":"56326e9ddf556c0d00cd08cd","pages":["56326e9edf556c0d00cd08da","56326e9edf556c0d00cd08db","56326e9edf556c0d00cd08dc","56326e9edf556c0d00cd08dd","56326e9edf556c0d00cd08de","56326e9edf556c0d00cd08df","5632e61862c48a0d00334ddc","5637210ec75f5d0d00ec5d4a","563750380704070d00f06c4b","56ecf98c7f94882900591955"],"version":"56326e9cdf556c0d00cd08ca","__v":5,"project":"544fc17e698ab40800b4f891","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-05-01T09:13:02.297Z","from_sync":false,"order":2,"slug":"tutorials","title":"Tutorials"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-01T09:14:11.457Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"Using the coins API, you can send money to anyone through the [sellorder](doc:sellorder) endpoint. Funds from the sender may come from one of their coins wallets (PHP, BTC), or from an external bitcoin wallet.\n\n## Prerequisites\n\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 this example, we would be cashing out funds from our PHP wallet and use the `egivecash` [outlet](doc:getting-the-supported-payment-outlets) to receive the funds. This [payout-outlet](doc:payout-outlet-categories) requires the sender to provide a `recipient_full_name` and `recipient_mobile`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\n\\nTOKEN = 'YOUR TOKEN'  #OAuth2\\nurl = 'https://coins.ph/api/v2/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': 'egivecash',\\n    'pay_with_wallet': 'PBTC',\\n    'recipient_full_name': 'Bob Alice',\\n    'recipient_mobile': '+639981234567'\\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    \\\"btc_amount\\\": 1,\\n    \\\"confirmation_code\\\": \\\"9d6eb\\\",\\n    \\\"expires_epoch\\\": \\\"1402483355\\\",\\n    \\\"fields\\\": {\\n      \\\"recipient_full_name\\\": \\\"Bob Alice\\\",\\n      \\\"recipient_mobile\\\": \\\"+639981234567\\\"\\n    },\\n    \\\"id\\\": \\\"9d6eb8f98b754cd7aa9d8d930054cda1\\\",\\n    \\\"payment_outlet_id\\\": \\\"egivecash\\\",\\n    \\\"qr_img_uri\\\": \\\"https://some.url\\\",\\n    \\\"user_uri\\\": \\\"https://coins.ph/sellorder/9d6eb8f98b754cd7aa9d8d930054cda1\\\",\\n    \\\"wallet_address\\\": \\\"1234fasdf134\\\"\\n  },\\n  \\\"success\\\": true\\n}\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\ncoins will now proceed to send the payout to the recipient. Payout duration may vary for each [outlet category](doc:payout-outlet-categories).\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.","excerpt":"Cash out funds from your wallet to a specified recipient","slug":"cash-out-api-tutorial","type":"basic","title":"Cash disbursements"}

Cash disbursements

Cash out funds from your wallet to a specified recipient

Using the coins API, you can send money to anyone through the [sellorder](doc:sellorder) endpoint. Funds from the sender may come from one of their coins wallets (PHP, BTC), or from an external bitcoin wallet. ## Prerequisites * A properly set up [key](doc:creating-your-api-keys) * An [Authentication method](doc:choosing-an-authentication-method) * Sender must have either BTC or PHP balance * A selected [payout outlet](doc:getting-the-supported-payment-outlets) ## Cash out For this example, we would be cashing out funds from our PHP wallet and use the `egivecash` [outlet](doc:getting-the-supported-payment-outlets) to receive the funds. This [payout-outlet](doc:payout-outlet-categories) requires the sender to provide a `recipient_full_name` and `recipient_mobile`. [block:code] { "codes": [ { "code": "import requests\n\nTOKEN = 'YOUR TOKEN' #OAuth2\nurl = 'https://coins.ph/api/v2/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': 'egivecash',\n 'pay_with_wallet': 'PBTC',\n 'recipient_full_name': 'Bob Alice',\n 'recipient_mobile': '+639981234567'\n}\n\nrequests.post(url, headers=headers, data=body)", "language": "python" } ] } [/block] A successful request would yield the following result: [block:code] { "codes": [ { "code": "{\n \"order\": {\n \"btc_amount\": 1,\n \"confirmation_code\": \"9d6eb\",\n \"expires_epoch\": \"1402483355\",\n \"fields\": {\n \"recipient_full_name\": \"Bob Alice\",\n \"recipient_mobile\": \"+639981234567\"\n },\n \"id\": \"9d6eb8f98b754cd7aa9d8d930054cda1\",\n \"payment_outlet_id\": \"egivecash\",\n \"qr_img_uri\": \"https://some.url\",\n \"user_uri\": \"https://coins.ph/sellorder/9d6eb8f98b754cd7aa9d8d930054cda1\",\n \"wallet_address\": \"1234fasdf134\"\n },\n \"success\": true\n}", "language": "python" } ] } [/block] coins will now proceed to send the payout to the recipient. Payout duration may vary for each [outlet category](doc:payout-outlet-categories). ## Sender Details API 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.