{"_id":"56326e9edf556c0d00cd08dc","project":"544fc17e698ab40800b4f891","__v":5,"user":"544fc065698ab40800b4f888","githubsync":"","parentDoc":null,"version":{"_id":"56326e9cdf556c0d00cd08ca","project":"544fc17e698ab40800b4f891","__v":22,"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","5ab2fcf66a1d77001230b47e","5afc2943bd2ef4000330bca7","5d1d87419a969a00141c6b4c","5d1d8948ef26b2002c6468d1","5d1d8afe7b2b24005bec7de0","5d1d8b24f5cfcb00201490bb","5d1d8bb82d46d1004a02581f","5d1d8de1e4edb0019ed63acd","5d1d8f6b613fb90050d0d3e0","5d1d934ed377870191039d28","5d1d99810b2e4600500eb5ff","5d1da14e613fb90050d0d491","5d229a846cf323005a7fa998","5d229a8c8abf65001cc4768d","5d229a9494b856002e26b6e1","5d229a9bf77bb900507ccb04","5d229aa88abf65001cc4768e","5d24310a9ca8c80054786177","5d24359101cc3a00508e7482","5d24418fa791b20050733b32"],"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"},"updatedAt":"2019-07-04T07:56:23.195Z","updates":["5c2b60ffafb8dc0057f5eae6","5d0a05c9eb749501fdb5163e","5d0a06bda14e51016e9edba3"],"next":{"pages":[],"description":""},"createdAt":"2015-05-01T09:14:11.457Z","link_external":false,"link_url":"","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* Your account must be business verified. For more information, you may contact [business:::at:::coins.ph](mailto:business@coins.ph).\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\": \"json\"\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 * Your account must be business verified. For more information, you may contact [business@coins.ph](mailto:business@coins.ph). * 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": "json" } ] } [/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.