Cash out funds from your wallet to a specified recipient
Using the coins API, you can send money to anyone through the sellorder endpoint. Funds from the sender may come from one of their coins wallets (PHP, BTC).
Prerequisites
- Your account must be business verified. For more information, you may contact [email protected].
- A properly set up key
- An Authentication method
- Sender must have either BTC or PHP balance
- A selected payout outlet
Cash out
For 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 to send the funds. This payout-outlet requires the sender to provide a target_address
which is the registered Coins email or mobile number (in +639XXXXXXXXX format) of the recipient.
Please take note that sending funds to an invalid target_address (non-existent Coins email or mobile number) will result to a failed transfer.
import requests
TOKEN = 'YOUR TOKEN' #OAuth2
url = 'https://api.coins.asia/v1/sellorder'
headers = {
'Authorization': 'Bearer {}'.format(TOKEN),
'Content-Type': 'application/json;charset=UTF-8',
'Accept': 'application/json'
}
body = {
'amount': 1000,
'currency': 'PHP',
'payment_outlet': 'coins_transfer',
'pay_with_wallet': 'PBTC',
'target_address': '[email protected]',
'external_transaction_id': '001'
}
requests.post(url, headers=headers, data=body)
A successful request would yield the following result:
{
"order": {
"amount": "5",
"created_time": "1594617992",
"currency": "PHP",
"delivery_status": "pending_payment",
"external_transaction_id": "001",
"fields": {
"target_address": "xxxxxxxxxxxxxxxs.ph"
},
"id": "194f60b3f5a1429ebbd75a8b6803135f",
"payment_outlet": {
"id": "coins_transfer",
"name": "Coins Transfer",
"payment_outlet_provider_id": null
},
"required_fields": [
{
"legend": "Target Address",
"name": "target_address",
"value": "xxxxxxxxxxxxxxxs.ph"
}
]
},
"success": true
}
Here 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:
import requests
TOKEN = 'YOUR TOKEN' #OAuth2
url = 'https://api.coins.asia/v1/sellorder'
headers = {
'Authorization': 'Bearer {}'.format(TOKEN),
'Content-Type': 'application/json;charset=UTF-8',
'Accept': 'application/json'
}
body = {
'amount': 10000,
'currency': 'PHP',
'payment_outlet': 'union_bank_pesonet',
'pay_with_wallet': 'PBTC',
'bank_account_name': 'Bob Alice',
'bank_account_number': '10092820210'
}
requests.post(url, headers=headers, data=body)
Finally, 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
.
import requests
TOKEN = 'YOUR TOKEN' #OAuth2
url = 'https://api.coins.asia/v1/sellorder'
headers = {
'Authorization': 'Bearer {}'.format(TOKEN),
'Content-Type': 'application/json;charset=UTF-8',
'Accept': 'application/json'
}
body = {
'amount': 10000,
'currency': 'PHP',
'payment_outlet': 'sterlingx',
'pay_with_wallet': 'PBTC',
'bank_account_name': 'Bob Alice',
'bank_account_number': '10092820210',
'recipient_bank_code': '0053'
}
requests.post(url, headers=headers, data=body)
A successful transfer would yield the following result:
{
"order": {
"btc_amount": 1,
"confirmation_code": "89hju02",
"expires_epoch": "1402483365",
"fields": {
"bank_account_name": "Bob Alice",
"bank_account_number": '10092820210',
"recipient_bank_code": '0053',
},
"id": "78ughb8f98b754cd7aa9d8d930089ji09m",
"payment_outlet_id": "sterlingx",
"qr_img_uri": "https://some.url",
"user_uri": "78ughb8f98b754cd7aa9d8d930089ji09m",
"wallet_address": "1234fasdf134"
},
"success": true
}
Please see here for a full list of the available banks you can cash-out to.
Sender Details
API integrators who are using HMAC authentication to send funds for their users are required to submit sender details. Please see this guide for adding sender details to your API requests.