Integration Process
Prepare your account first
Before you begin this process, please ensure you have checked theΒ prepare your account sectionΒ first.
Generate Public Access Token
The public access token serves as an authentication token for subsequent API calls in the payment out and accept payment APIs. This token is generated using your API credentials, specifically the Client ID
and Client Secret
obtained from the preparation section.
To generate the public access token, include your Client ID
and Client Secret
in the header of the authentication API request, as demonstrated below:
Example:
curl -u client ID:client Secret https://sandbox.onebrick.io/v2/payments/auth/token
Upon successfully executing the process outlined above, you will receive a response containing your public access token. This token is now ready to be utilized in the subsequent processes.
{
"status": 200,
"error": null,
"metaData": {
"source": "API",
"entity": "Payment"
},
"data": {
"message": "Access token is valid for 5 minutes and can use one time only",
"accessToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxODQ3IiwiY29sb3VyIjoiIzMzMzMzMyIsInJvbGUiOlsiVVNFUiJdLCJuYW1lIjoiQnJpY2siLCJpc3MiOiJCcmljayIsImV4cCI6MTY1NzA4ODgzOSwiaWF0IjoxNjU3MDg4NTM5LCJqdGkiOiIyZTZmZTIwOS0yN2ZiLTQ0MjctOTI5Mi1lNThiYzMyMDUyMzkiLCJ0cyI6MTY1NzA4ODUzOTg1N30.gexikMhPVvS8z2j9muHhSAZb_TrkUAn4BDWIvOJLZDE",
"issuedAt": "2022-07-06T13:22:19.857147",
"expiresAt": "2022-07-06T13:27:19.857147"
}
}
Limitation of public access token
The public access token generated by this API is only valid for a single use and remains active for the next 5 minutes. If the token expires, you will need to generate a new public access token.
Verify Recipient Account
To ensure seamless payment processing and prevent errors resulting from invalid account data, such as incorrect bank account codes or numbers, and to verify that the recipient account belongs to the intended recipient, you need to utilize the verify recipient account API.
Here's how to call the verified recipient account API using the public access token:
curl --request GET \
--url 'https://sandbox.onebrick.io/v2/payments/gs/bank-account-validation?accountNumber=accountNumber&bankShortCode=bankShortCode' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'publicAccessToken: Bearer {{publicAccessToken}}'
After calling the API above, you will receive the name of the account owner associated with the provided account details. If the retrieved name matches the intended recipient, you can proceed with the further payment out process. Below is a sample result showing the owner's name for the given account:
{
"status": 200,
"data": {
"message": "We are successfully able to verify the account",
"accountNo": "4124668005",
"accountName": "M.HIBBAN IRSYAD",
"bankShortCode": "PERMATA"
},
"metaData": {
"source": "API",
"entity": "Payment"
},
"error": null
}
Once you confirm that the owner's name corresponds to the intended recipient, you can proceed confidently with the payment out process.
List Bank Account Destination
If you need to verify the list of banks covered by the Brick system, you can access it throughΒ this link.
Create Payment Out with BIFAST
This API serves as the final step in the process to send money to the recipient account. To initiate this step, you must generate a new public access token as outlined in step 1. Subsequently, utilize the newly generated public access token to call the payment out API.
When using the BIFAST API, you must provide data for both the payment and recipient. Below is an example of the API call structure:
The Body request are the same with our regular disbursement APIs.
But it needed additional sender details on the APIs per Transaction such as
{
"referenceId": "transfertoBrick",
"description": "brick-transfer-feb24",
"amount": 100000000,
"disbursementMethod": {
"type": "bank_transfer",
"bankShortCode": "MANDIRI",
"bankAccountNo": "12345678",
"bankAccountHolderName": "ORCHIDEA"
},
},
"sender": {
"name": "Daviga Teguh",
"identityType": "KTP",
"identityNumber": "3501041001820003",
"countryCode": "ID",
"provinceCode": "35",
"cityCode": "1226",
"jobCode": "89",
"address": "Tulodong Bawah No 4",
"placeOfBirth": "Jakarta",
"dateOfBirth": "1998-04-23""
}
}
Please ensure to fill in the required payment data and recipient data according to your specific transaction details.
To obtain the Job Code, Country Code, Province Code, and City Code, users must access the designated APIs provided upon authorization by BRICK.
Upon successfully validating the payment out process, you will receive a response indicating the payment out status as "processing".
{
"status": 200,
"data": {
"message": "We have received your request and are processing it, please check your callback URL for transaction status",
"id": "asdasd123123asdasdasd",
"type": "disbursement",
"attributes": {
"referenceId": "test-disbursement-1",
"description": "test-disbursement-1",
"amount": "10000",
"status": "processing",
"settlementStatus": "null",
"createdAt": "2022-07-21T13:49:39.752+07:00",
"disbursementMethod": {
"type": "bank_transfer",
"bankAccountNo": "12345678",
"bankShortCode": "BCA",
"bankAccountHolderName": "PROD ONLY"
},
"sender": {
"name": "Daviga Teguh",
"identityType": "KTP",
"identityNumber": "3501041001820003",
"countryCode": "ID",
"provinceCode": "35",
"cityCode": "1226",
"jobCode": "89",
"address": "Tulodong Bawah No 4",
"placeOfBirth": "Jakarta",
"dateOfBirth": "1998-04-23"
}
},
"metaData": {
"source": "API",
"entity": "Payment"
},
"error": null
}
The payment system is intricately linked with the bank system, and its processing is contingent upon the bank's operations.
Once the payment process is completed, we will send an updated status notification to the callback URL that you have previously set up in step 4. This ensures that you receive timely updates regarding the status of your payments.
Request Parameters
Key Parameters | Data Type | Description | Limitation |
---|---|---|---|
name | String | Name of the user that send the money | 1. Alpha Numeric 2. Space Allowed 3. Max 40 Characters |
identityType | String | Allowed Value only KTP/SIM/KITAS/NPWP | Allowed Value only KTP/SIM/KITAS/NPWP |
identityNumber | String | Identity Number of the User | 1. Alpha Numeric 2. Min 10 characters 3. Max 16 Characters |
countryCode | String | Country Code based on the user | Allowed Value are 2 all caps characters |
provinceCode | String | Province Code based on the user | Allowed Value are 2 all caps characters |
cityCode | String | City Code based on the user | Allowed Value are 4 all caps characters |
jobCode | String | Job Code based on the user | Allowed Value are 4 all caps characters |
address | String | Address of the user | 1. Alpha Numeric 2. Space Allowed 3. Max 40 Characters |
placeOfBirth | String | Place of the user birth | 1. Alpha Numeric 2. Space allowed 3. Max 40 Characters |
dateOfBirth | String | Date of Birth of the user | YYYY-MM-DD Format |
Updated 8 months ago
During the integration process, one essential step is to retrieve crucial information such as country code, province code, city code, and job code from Brick's API. These codes are vital for accurately processing transactions and ensuring data consistency within your system.