Get Bank Account

Get Bank Account Token:

Integration NeededDetails
Mini App FrontendAvailable since: TDB

Sample Request:

miniAppSdk.getBankAccountToken() 
  .then((result) => { 
     if(result.success) {
         console.log('Token code:', result.data?.token);
     }
     else {
         console.log('Error fetching code:', result.error, result.error?.message);
     }
  });

Sample Response:

type BankAccountTokenResponse = {
  success: boolean,
  error?: string,
  data?: {
    token: string
  }
}

This API can be called by the Mini App backend to obtain the bank account token.

  • After you receive a bank account token from Mini App frontend, you use this Token API to request the access token for the user
  • This token is required to call API such as reminder API
Integration NeededDetails
Mini App BackendMini App backend will call GoPay backend to fetch bank account tokens.
Path/v1/mini-apps/bank-details?account_token=
Hosthttps://public-mini-app-merchants.gopayapi.com
Http MethodPOST

Request Headers:

PropertyData typeRequiredDescription
Request-IdstringNoThis is an identifier that is used for maintaining idempotency
AuthorizationstringYesThis is a Basic Auth header. Please use the shared credentials that you received from the team as stated
Format: Basic <credential-received>

Query Parameters:

PropertyData typeRequiredDescription
account_tokenstringYesThe code obtained using getBankAccountToken() interface

Response:

PropertyData typeDescription
successbooleanIt will be true if API call is successful and false in case of failure
errorobjectThis object will be non null only in case of failures
error.codestringThe code of the error
error.descriptionstringThe description of the error
dataobjectThe object containing the token and account details
data.bank_codestringBank code of user's bank account
data.bank_account_namestringBank account name of user's bank account
data.bank_account_numberstringBank account number of user's bank account

Sample Response:

Success Response:

{
  "success": true,
  "data": {
    "bank_code": "jago",
    "bank_account_name": "Rafa refa",
    "bank_account_number": "11223344456"
  }
}

Error Response: With appropriate HTTP status codes. Only 5xx would be retriable

{
  "success": false,
  "error": {
    "code": 900,
    "description": "Token Not Found"
  }
}