{"_id":"56326e9edf556c0d00cd08db","project":"544fc17e698ab40800b4f891","user":"544fc065698ab40800b4f888","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"},"__v":5,"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"},"githubsync":"","parentDoc":null,"updatedAt":"2019-07-04T07:56:23.195Z","metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-06T11:22:10.917Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"Using the coins api [transfers](doc:transfers) endpoint, It is possible to send funds to any phone # or email address. The receiving end does not need not to have a coins account or bitcoin address beforehand.\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* You have already [created your API keys](doc:creating-your-api-keys) \n* You will need to have sufficient [balance](doc:checking-your-account-balance) in your wallet to send.\n\n## Authentication\n\nIn this example, we'll be using HMAC as the authentication method.  The functions **get_nonce **and **sign_request** are further explained in the [HMAC authentication tutorial](doc:hmac). \n\n\n## Setting up the request\n\n**account** is the ID of the source wallet from which the funds will be deducted from. It can be a PHP or BTC denominated wallet.  To get a list of your accounts and balances, see [this tutorial](doc:checking-your-account-balance).\n\nThe **target_address** can be any phone number, email address, or bitcoin address. \n\nThe **amount** is denominated in the currency of the **account** wallet. for example, if you are sending out of a PHP denominated wallet, the amount will be denominated in peso.  If the target address is a bitcoin wallet, the funds will be automatically converted.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"import requests\\nimport hmac_example\\n\\nurl = 'https://coins.ph/api/v3/transfers'\\n\\nnonce = hmac_example.get_nonce()\\n\\nbody = {\\n  \\t# The source account to send from (this is your coins wallet)\\n  \\t'account': '2r45ab4123ebb298an201',\\n  \\t# the amount to send, denominated in the currency of \\n    # the source account\\n  \\t'amount': 25,\\n    # Where the funds will be sent to (Phone #, Email, or Bitcoin address)\\n  \\t'target_address': 'receipient@example.com'\\n}\\nsignature = hmac_example.sign_request(url, nonce, request_body=body)\\n\\nheaders = {\\n    'ACCESS_SIGNATURE': signature,\\n    'ACCESS_KEY': hmac_example.API_KEY,\\n    'ACCESS_NONCE': nonce,\\n    'Content-Type': 'application/json',\\n    'Accept': 'application/json'\\n}\\ndata = json.dumps(body, separators=(',', ':'))\\n\\nrequests.post(url, headers=headers, data=data)\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nThis request should return the following response:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n    \\\"transfer\\\": {\\n        \\\"id\\\":\\\"1bbq2393nbn01nba01abebl\\\",\\n        \\\"account\\\":\\\"2r45ab4123ebb298an201\\\",\\n        \\\"amount\\\":\\\"25\\\",\\n        \\\"target_address\\\":\\\"receipient@example.com\\\",\\n        \\\"payment\\\": null,\\n        \\\"status\\\":\\\"pending\\\",\\n        \\\"created_at\\\":\\\"2015-05-01T12:11:36.938Z\\\"\\n    }\\n}\",\n      \"language\": \"python\"\n    }\n  ]\n}\n[/block]\nThis means that the transfer has been made from your account to `recipient@example.com`.\n\nIf the destination email/phone # is not associated with a coins.ph user, the recipient will receive a message with instructions for collecting their funds. funds that are not collected within 14 days are credited back to the sender.","excerpt":"","slug":"transfer-funds-api-tutorial","type":"basic","title":"Send funds to any email or phone #"}

Send funds to any email or phone #


Using the coins api [transfers](doc:transfers) endpoint, It is possible to send funds to any phone # or email address. The receiving end does not need not to have a coins account or bitcoin address beforehand. ## Prerequisites * Your account must be business verified. For more information, you may contact [business@coins.ph](mailto:business@coins.ph). * You have already [created your API keys](doc:creating-your-api-keys) * You will need to have sufficient [balance](doc:checking-your-account-balance) in your wallet to send. ## Authentication In this example, we'll be using HMAC as the authentication method. The functions **get_nonce **and **sign_request** are further explained in the [HMAC authentication tutorial](doc:hmac). ## Setting up the request **account** is the ID of the source wallet from which the funds will be deducted from. It can be a PHP or BTC denominated wallet. To get a list of your accounts and balances, see [this tutorial](doc:checking-your-account-balance). The **target_address** can be any phone number, email address, or bitcoin address. The **amount** is denominated in the currency of the **account** wallet. for example, if you are sending out of a PHP denominated wallet, the amount will be denominated in peso. If the target address is a bitcoin wallet, the funds will be automatically converted. [block:code] { "codes": [ { "code": "import requests\nimport hmac_example\n\nurl = 'https://coins.ph/api/v3/transfers'\n\nnonce = hmac_example.get_nonce()\n\nbody = {\n \t# The source account to send from (this is your coins wallet)\n \t'account': '2r45ab4123ebb298an201',\n \t# the amount to send, denominated in the currency of \n # the source account\n \t'amount': 25,\n # Where the funds will be sent to (Phone #, Email, or Bitcoin address)\n \t'target_address': 'receipient@example.com'\n}\nsignature = hmac_example.sign_request(url, nonce, request_body=body)\n\nheaders = {\n 'ACCESS_SIGNATURE': signature,\n 'ACCESS_KEY': hmac_example.API_KEY,\n 'ACCESS_NONCE': nonce,\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n}\ndata = json.dumps(body, separators=(',', ':'))\n\nrequests.post(url, headers=headers, data=data)", "language": "python" } ] } [/block] This request should return the following response: [block:code] { "codes": [ { "code": "{\n \"transfer\": {\n \"id\":\"1bbq2393nbn01nba01abebl\",\n \"account\":\"2r45ab4123ebb298an201\",\n \"amount\":\"25\",\n \"target_address\":\"receipient@example.com\",\n \"payment\": null,\n \"status\":\"pending\",\n \"created_at\":\"2015-05-01T12:11:36.938Z\"\n }\n}", "language": "python" } ] } [/block] This means that the transfer has been made from your account to `recipient@example.com`. If the destination email/phone # is not associated with a coins.ph user, the recipient will receive a message with instructions for collecting their funds. funds that are not collected within 14 days are credited back to the sender.