Introduction

Generate Virtual Accounts from Multiple Banks with Our API. Simplify fund acceptance with our efficient API solution. Streamline your payment processes and expand your options for accepting funds seamlessly.


Bank List

List of supported banks in virtual account:

Bank CodeBankCapability
008MandiriOne-off / Persistent - Open Amount, Closed Amount
014BCAOne-off / Persistent - Open Amount, Closed Amount
002BRIOne-off / Persistent - Open Amount, Closed Amount
009BNIOne-off - Closed Amount
013PermataOne-off / Persistent - Open Amount, Closed Amount
011DanamonPersistent - Open Amount
022CIMBOne-off - Closed Amount
153Sahabat SampoernaOne-off / Persistent - Open Amount, Closed Amount

POST{{HOST}}/virtual-account

Request

You need to authenticate your requests to access any endpoint in the SenGo API.

Request Parameters

  • Name
    bankCode
    Type
    mandatory
    Description

    The code representing the bank to be used for the transaction. you can find the list of bank codes above the table.

  • Name
    singleUse
    Type
    mandatory
    Description

    A boolean value indicates whether the generated API parameter can be used for a single transaction only. true / false

  • Name
    type
    Type
    mandatory
    Description

    ClosedAmount/OpenAmount

  • Name
    reference
    Type
    mandatory
    Description

    A unique reference number or identifier for the transaction. all transaction references should be unique.

  • Name
    amount
    Type
    mandatory
    Description

    Amount your user should paid to complete the transaction

  • Name
    expiryMinutes
    Type
    opsional
    Description

    If you want the transaction to last for 1 hour, you would set the value of the expiryMinutes parameter to 60.

  • Name
    viewName
    Type
    mandatory
    Description

    The name or identifier of the receiver for the transaction.

  • Name
    additionalInfo.callback
    Type
    mandatory
    Description

    The callback URL where notifications or updates related to the transaction will be sent.

Request Json

POST
{{HOST}}/virtual-account
<?php
    $curl = curl_init();
    curl_setopt_array($curl, array(
    CURLOPT_URL => '{{HOST}}/virtual-account',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => '',
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 0,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_POSTFIELDS =>'{
        "bankCode": "014",
        "singleUse": true,
        "type": "ClosedAmount",
        "reference": "REFF012",
        "amount": 10000,
        "expiryMinutes": 30,
        "viewName": "Merchant Name",
        "additionalInfo": {
        "callback": "http://your-site-callback.com/notify"
    }
    }',
    CURLOPT_HTTPHEADER => array(
        'X-Client-Key: ',
        'X-Client-Token: ',
        'X-Signature: '
    ),
    ));

    $response = curl_exec($curl);

    curl_close($curl);
    echo $response;

Response

Response Json

POST
{{HOST}}/virtual-account
{
    "responseCode": 200,
    "responseMessage": "success",
    "responseData": {
        "id": "66e934f6-f5d6-4f1c-bb3d-450ec2873782",
        "merchantRef": "REFF012",
        "status": "pending",
        "feePayer": "customer",
        "amount": 10000,
        "fee": 4000,
        "totalAmount": 14000,
        "expiredDate": "2025-03-23T10:24:58+07:00",
        "additionalInfo": {
            "callback": "http://your-site-callback.com/notify"
        },
        "virtualAccount": {
            "bankCode": "014",
            "vaNumber": "666555440021",
            "viewName": "Merchant Name"
        }
    }
}

Response Parameters

ParameterDescription
responseCodeThe HTTP response code indicating the status of the request. See the Error Codes section for details.
responseMessageA descriptive message indicating the status of the request.
responseDataAn object containing the data related to the transaction response.
responseData.idSenGo unique identifier for the transaction.
responseData.statusThe current status of the transaction. success, pending, expired, failed.
responseData.feePayerThe party responsible for paying the transaction fee. customer or merchant.
responseData.amountThe original amount associated with the transaction.
responseData.feeThe fee charged for the transaction.
responseData.totalAmountThe total amount (original amount + fee) for the transaction.
responseData.expiredDateThe date and time when the transaction will expire.
responseData.additionalInfo.callbackThe callback URL where notifications or updates related to the transaction will be sent.
responseData.virtualAccount.bankCodeThe code representing the bank associated with the virtual account.
responseData.virtualAccount.vaNumberThe virtual account number for the transaction.
responseData.virtualAccount.viewNameThe name or identifier associated with the virtual account.

Was this page helpful?