Pay API v1.2.0
Bank transfer is still the main mode of payment in Southeast Asia. In fact, 94% of online merchants in Indonesia alone offer it as a payment option with Vietnam and Philippines at 80% and Thailand at 79%.
Brankas Pay provides SMEs with an API-driven payment solution that allows them to have one-click payable invoices. By leveraging Brankas Pay, SMEs are able to execute fund transfer based transactions over a growing basket of banks via a single set of APIs.
Home businesses are now common. Covid-19 has moved brick and mortar stores online and at home. Payments are manually made via bank transfers where merchants share their bank account details (may contain more than 10 numbers). Customers who do not use online or mobile banking need to go to a bank or ATM and manually transfer funds to the merchant’s account. Merchants also require a proof of payment (photos of deposit slip or pictures of online fund transfers) which they verify by logging into their bank portals.
The process is tedious, and as with any manual task, is prone to human error. Pay allows merchants to generate a unique URL that allows end-users to make payments via the Brankas Direct IdP flow. Micro and small businesses can conveniently take payments via bank transfers.
Another key feature is a Transaction List page that gives merchants the visibility on all of the Pay invoice status and transactions that went through via the unique Direct IdP URL enabling merchants to reconcile payments.
Retrieve Merchant
Retrieve Merchant
returns business info and the set of destination accounts. An HTTP request is considered a success if its status code is not 4xx
or 5xx
.
HTTP Request
GET https://api.pay.bnk.to/v1/merchant
Headers |
---|
Content-Type: application/json |
Query Parameters
Name | Type | Description |
---|
merchant_id | string | A unique merchant account ID, profile ID or the bank account number depending on the type. |
Responses
Response body
Name | Type | Description |
---|
business_name | string | The business name of the account. |
active_url_count | integer | Currently unused |
accounts | []PayAccount | Array of destination accounts. Deprecated |
summary | PayValueSummary | Amount values earned on the account |
merchant_id | string | A unique merchant account Id. |
default_account_id | string | The default destination account Id which will be used for fund transfers unless overridden. |
destination_accounts | PayAccount | The destination account object. |
country | string | The country of merchant. |
business_email | string | The business email of merchant, this can be different from the user registration email. |
mobile_country_code | string | Mobile country code of merchant. |
mobile_number | string | Mobile number of merchant. |
url_expiry | string | The default expiry time of invoice in hours. |
Objects
PayAccount
Name | Type | Description |
---|
id | string | A unique account Id, profile Id or the bank account number depending on the type. |
bank | string | Bank type. |
account_number | string | The account number of the bank account |
biller_id | string | The biller id of the merchant (only for Thailand). |
first_name | string | The First Name of the bank account. |
last_name | string | The Last Name of the bank account. |
PayValueSummary
Name | Type | Description |
---|
year | PayAmount | Amount generated for the current year to date |
prev_year | PayAmount | Amount generated for the previous year |
month | PayAmount | Amount generated for the current month to date |
PayAmount
Name | Type | Description |
---|
cur | string | The currency value. |
amt | string | The amount value. |
Example:
{
"business_name": "string",
"active_url_count": 0,
"summary": {
"year": [
{
"cur": "string",
"amt": "string"
}
],
"prev_year": [
{
"cur": "string",
"amt": "string"
}
],
"month": [
{
"cur": "string",
"amt": "string"
}
]
},
"merchant_id": "string",
"default_account_id": "string",
"destination_accounts": {
"additionalProp1": {
"id": "string",
"bank": "string",
"account_number": "string",
"biller_id": "string", //optional
"first_name": "string",
"last_name": "string"
},
"additionalProp2": {
"id": "string",
"bank": "string",
"account_number": "string",
"biller_id": "string", //optional
"first_name": "string",
"last_name": "string"
},
"additionalProp3": {
"id": "string",
"bank": "string",
"account_number": "string",
"biller_id": "string", //optional
"first_name": "string",
"last_name": "string"
}
},
"country": "string",
"business_email":"string",
"mobile_country_code":"string",
"mobile_number": "string",
"url_expiry": 0
}
Response codes
Status | Description |
---|
200 | Request executed successfully. |
Create Merchant
Create Merchant
will store business info related to a merchant. A HTTP request is considered a success if its status code is not 4xx
or 5xx
.
curl -X POST \
https://api.pay.bnk.to/v1/merchant \
-H 'Authorization: Bearer USE_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"address_line1": "string",
"address_line2": "string",
"city": "string",
"state_province": "string",
"country": "string",
"email_address": "string",
"mobile_country_code": "string",
"mobile_number": "string",
"url_expiry": 0
}'
HTTP Request
POST https://api.pay.bnk.to/v1/merchant
Headers |
---|
Content-Type: application/json |
Body Parameters
Name | Type | Description |
---|
name | string | The name of the merchant account holder. |
address_line1 | string | The address of the merchant line 1. |
address_line2 | string | The address of the merchant line 2. |
city | string | The city of the merchant location. |
state_province | string | The state of the merchant location. |
country | string | The country of the merchant location. |
email_address | string | The email address of the merchant. |
mobile_country_code | string | The mobile country code of the merchant. |
mobile_number | string | The mobile number of the merchant. |
url_expiry | integer | Number of expiry hours for the requested url. |
Responses
Example:
Response codes
Status | Description |
---|
200 | Request executed successfully. |
Update Merchant
Update Merchant
update its business information. An HTTP request is considered a success if its status code is not 4xx
or 5xx
.
curl -X PUT \
https://api.pay.bnk.to/v1/merchant/{merchant_id} \
-H 'Authorization: Bearer USE_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"url_expiry": 0,
"merchant_id": "string",
"name": "string",
"email": "string",
"mobile_country_code": "string",
"mobile_number": "string"
}'
HTTP Request
PUT https://api.pay.bnk.to/v1/merchant/{merchant_id}
Headers |
---|
Content-Type: application/json |
Query Parameters
Name | Type | Description |
---|
merchant_id | string | A unique merchant account ID, profile ID or the bank account number depending on the type. |
Body Parameters
Name | Type | Description |
---|
url_expiry | integer | Number of expiry hours for the requested url |
merchant_id | string | A unique merchant Id. |
name | string | The business name of the merchant. |
email | string | The business email of the merchant. |
mobile_country_code | string | The mobile country code of the merchant. |
Responses
Example:
Response codes
Status | Description |
---|
200 | Request executed successfully. |
Create Invoice
Create Invoice
initializes a single-use URL for a payment. A HTTP request is considered a success if its status code is not 4xx
or 5xx
.
curl -X PUT \
https://api.pay.bnk.to/v1/invoice \
-H 'Authorization: Bearer USE_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"merchant_id": "string",
"account_id": "string",
"amount": {
"cur": "string",
"amt": "string"
},
"item_id": "string",
"description": "string",
"remarks": "string",
"customer_name": "string",
"expiry": 0
}'
HTTP Request
POST https://api.pay.bnk.to/v1/invoice
Headers |
---|
Content-Type: application/json |
Body Parameters
Name | Type | Description |
---|
merchant_id | string | A unique merchant account ID, profile ID or the bank account number depending on the type. |
account_id | string | The destination account ID to use in the fund transfer. |
amount | PayAmount | The amount of the fund transfer. |
item_id | string | The name of the ordered item. |
description | string | The description of the ordered item. |
remarks | string | Additional remarks of the invoice. |
customer_name | string | The customer name. |
expiry | integer | Number of expiry hours for the requested url. |
Objects
PayAmount
Name | Type | Description |
---|
cur | string | The currency value. |
amt | string | The amount value. |
Responses
Example:
{
"url": "string",
"expiry": "2020-10-27T03:40:19.749Z",
"message": "string",
"invoice_id": "string"
}
Response codes
Status | Description |
---|
200 | Request executed successfully. |
Retrieve Invoice
Retrieve Invoice
returns a set of objects containing invoice details and the current payment status. A HTTP request is considered a success if its status code is not 4xx
or 5xx
.
HTTP Request
GET https://api.pay.bnk.to/v1/invoice
Headers |
---|
Content-Type: application/json |
Query Parameters
Name | Type | Description |
---|
merchant_id | string | A unique merchant account ID, profile ID or the bank account number depending on the type. |
start | string | Timestamp to start pulling invoice details from |
end | string | Timestamp to stop pulling invoice details from |
limit | integer | Limit the number of invoice details returned |
Responses
Response body
Name | Type | Description |
---|
start | string | Timestamp to start pulling invoice details from |
end | string | Timestamp to stop pulling invoice details from |
next | string | The invoice id of the next batch of invoice details, if a limit was reached |
urls | []PayURLStatus | An array of Invoice details |
Objects
PayURLStatus
Name | Type | Description |
---|
invoice_id | string | The invoice unique ID. |
url | string | The url created for the payment. |
status | PayPaymentStatus | The status object of the payment. |
amount | string | The amount of the fund transfer. |
item_id | string | The name of the ordered item. |
description | string | The description of the ordered item. |
remarks | string | Additional remarks of the invoice. |
created | string | Timestamp of when the invoice entry was created. |
paid_date | string | The date time of when the payment is completed. |
customer_name | string | The customer name. |
| | |
Enums
PayPaymentStatus
Value | Description |
---|
CREATED | The payment url is created |
FAILED | The payment url has been accessed by the customer and failed to complete the payment. |
SUCCESS | The payment url has been accessed by the customer and successfully completed the payment. |
EXPIRED | The payment url is expired and the payment has not been completed. |
Example:
{
"start": "2020-10-27T03:45:35.055Z",
"end": "2020-10-27T03:45:35.055Z",
"next": "string",
"urls": [
{
"invoice_id": "string",
"url": "string",
"status": "Created",
"amount": {
"cur": "string",
"amt": "string"
},
"item_id": "string",
"description": "string",
"remarks": "string",
"created": "2020-10-27T03:45:35.055Z",
"paid_date": "2020-10-27T03:45:35.055Z",
"customer_name": "string"
}
]
}
Response codes
Status | Description |
---|
200 | Request executed successfully. |
Create Deposit Account
Create Deposit Account
will store merchant destination account info, returning our internal account id. A HTTP request is considered a success if its status code is not 4xx
or 5xx
.
curl -X POST \
https://api.pay.bnk.to/v1/deposit-account \
-H 'Authorization: Bearer USE_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"bank_code": 0,
"account_number": "string",
"account_first_name": "string",
"account_middle_name": "string",
"account_last_name": "string",
"set_default": true,
"biller_id" : "string" //optional
}'
HTTP Request
POST https://api.pay.bnk.to/v1/deposit-account
Headers |
---|
Content-Type: application/json |
Body Parameters
Name | Type | Description |
---|
bank_code | integer | Brankas bank code. |
account_number | string | The account number of the bank account. |
account_number_first_name | string | The first name of the account holder name of the bank account. |
account_number_middle_name | string | The middle name of the account holder name of the bank account. |
account_last_name | string | The last name of the account holder name of the bank account. |
set_default | boolean | TRUE for the bank account selected as default bank account. FALSE for other bank account options. |
biller_id | string | The biller ID of the merchant that provided by the bank ( only for Thailand ) |
Responses
Response body
Name | Type | Description |
---|
account_id | string | A unique account ID, profile ID, or the bank account number depending on the type. |
Example:
{
"account_id": "string"
}
Response codes
Status | Description |
---|
200 | Request executed successfully. |
Update Deposit Account
Update Deposit Account
will update a matching merchant destination account with new account info. A HTTP request is considered a success if its status code is not4xx
or 5xx
.
curl -X PUT \
https://api.pay.bnk.to/v1/deposit-account/{account_id} \
-H 'Authorization: Bearer USE_YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"account_id": "string",
"bank_code": 0,
"account_number": "string",
"account_first_name": "string",
"account_middle_name": "string",
"account_last_name": "string",
"set_default": true,
"biller_id" : "string" //optional
}'
HTTP Request
PUT https://api.pay.bnk.to/v1/deposit-account/{account_id}
Headers |
---|
Content-Type: application/json |
Query Parameters
Name | Type | Description |
---|
account_id | string | A unique account ID, profile ID, or the bank account number depending on the type. |
Body Parameters
Name | Type | Description |
---|
account_id | string | A unique account ID, profile ID, or the bank account number depending on the type. |
bank_code | integer | Brankas bank code. |
account_number | string | The account number of the bank account. |
account_first_name | string | The first name of the account holder name of the bank account. |
account_middle_name | string | The middle name of the account holder name of the bank account. |
account_last_name | string | The last name of the account holder name of the bank account. |
set_default | boolean | TRUE for the bank account selected as default bank account. FALSE for other bank account options. |
biller_id | string | The biller ID of merchant that provided by the bank ( only for Thailand ) |
Responses
Example:
Response codes
Status | Description |
---|
200 | Request executed successfully. |
Retrieve Supported Banks
Retrieve Supported Banks
will return a map of supported bank codes. A HTTP request is considered a success if its status code is not 4xx
or 5xx
.
HTTP Request
GET https://api.pay.bnk.to/v1/supported-banks
Headers |
---|
Content-Type: application/json |
Responses
Example:
{
"banks": {
"additionalProp1": "string",
"additionalProp2": "string",
"additionalProp3": "string"
}
}
Response codes
Status | Description |
---|
200 | Request executed successfully. |