The list of supported payout outlets, can be obtained through the payout-outlets endpoint.
import requests
TOKEN = 'YOUR TOKEN' #OAuth2
url = 'https://coins.ph/d/api/payout-outlets'
headers = {
'Authorization': 'Bearer {}'.format(TOKEN),
'Content-Type': 'application/json;charset=UTF-8',
'Accept': 'application/json'
}
requests.get(url, {'region': 'PH'}, headers=headers)
As an example, the response would look like this:
{
"meta": {
"total_count": 74,
"next_page": 2,
"previous_page": null
},
"payout-outlets": [
{
"id": "egivecash",
"outlet_category": "atm_pickup",
"name": "Security Bank eGiveCash",
"region": "PH",
"help_text": "",
"help_link": "",
"instructions": "Cash-out from any ATM"
},
{
"id": "bdo",
"outlet_category": "bank",
"name": "BDO",
"region": "PH",
"help_text": "",
"help_link": "",
"instructions": "Cash-out to your BDO account"
}
]
}
Once you have selected a payout outlet of your choice, you can retrieve its category to get the list of required fields to fill up. For example, let's get egivecash
's category, atm_pickup
:
import requests
TOKEN = 'YOUR TOKEN' #OAuth2
url = 'https://coins.ph/d/api/payout-outlet-categories/atm_pickup'
headers = {
'Authorization': 'Bearer {}'.format(TOKEN),
'Content-Type': 'application/json;charset=UTF-8',
'Accept': 'application/json'
}
requests.get(url, headers=headers)
You would then get a response that looks like this:
{
"payout-outlet-category": {
"id": "atm_pickup",
"name": "ATM Pickup",
"fields": [
{
"payment_outlet_type_field_id": "recipient_full_name",
"name": "Recipient Full Name",
"help_text": "Recipient Full Name",
"help_link": ""
},
{
"payment_outlet_type_field_id": "recipient_mobile",
"name": "Recipient Mobile Phone",
"help_text": "Recipient Mobile Phone Number (e.g. 09171234567)",
"help_link": ""
}
],
"outlets": [
"egivecash"
],
"fee_info": "No fees",
"payout_duration": "Same day payout",
"outlet_names_subset": [
"EGiveCash"
]
}
}
This means that to cash out using the egivecash
payout outlet, the sender will have to provide a recipient_full_name
and a recipient_mobile
.
The same flow is used for cash ins with payin-outlets and payin-outlet-categories as the endpoints.