Sign UpLog In

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 ParametersData TypeDescriptionLimitation
nameStringName of the user that send the money1. Alpha Numeric
2. Space Allowed
3. Max 40 Characters
identityTypeStringAllowed Value only KTP/SIM/KITAS/NPWPAllowed Value only KTP/SIM/KITAS/NPWP
identityNumberStringIdentity Number of the User1. Alpha Numeric
2. Min 10 characters
3. Max 16 Characters
countryCodeStringCountry Code based on the userAllowed Value are 2 all caps characters
provinceCodeStringProvince Code based on the userAllowed Value are 2 all caps characters
cityCodeStringCity Code based on the userAllowed Value are 4 all caps characters
jobCodeStringJob Code based on the userAllowed Value are 4 all caps characters
addressStringAddress of the user1. Alpha Numeric
2. Space Allowed
3. Max 40 Characters
placeOfBirthStringPlace of the user birth1. Alpha Numeric
2. Space allowed
3. Max 40 Characters
dateOfBirthStringDate of Birth of the userYYYY-MM-DD Format

What’s Next

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.