Callbacks
A callback to the merchant will be sent:
- After the merchant's customer makes a successful payment on a created Virtual Account number
As a merchant, you need to provide callback URLs to the Ayoconnect Virtual Account team during the onboarding process.
Only POST requests are allowed and a 201 HTTP response code is expected for all the callbacks.
If a 40X or 50X HTTP response code is returned, the process won't continue.
In case of any other error, Ayoconnect will try to send the callback 3 more times after 5, 10, and 30 seconds. After this, no further attempt will be made.
Callback headers
The following headers are included in all the callbacks received from Ayoconnect:
| Header | Value | Description | 
|---|---|---|
| Accept | application/json | Accept type of the response body | 
| Content-Type | application/json | Content type of the request body | 
Callback fields
The following parameters are included in the callbacks received from Ayoconnect:
| Name | Type | Required | Example | Description | 
|---|---|---|---|---|
| code | int | Y | 200 | Product response code | 
| message | string | Y | ok | Response message | 
| virtualAccountData | JSON Object | Y | Details of the Virtual Account | 
This is the structure of the 'virtualAccountData' field:
| Name | Type | Required | Example | Description | 
|---|---|---|---|---|
| virtualAccountId | string | Y | cwr4gmbiihdh2yk7cveah1p7loe | Unique identifier (27 alphanumeric characters) to identify the associated Virtual Account | 
| virtualAccountNumber | string | Y | 8888800145536217 | Unique identifier (16 numeric characters) to do transactions on a Virtual Account | 
| virtualAccountStatus | string | Y | PAID | Status of the Virtual Account number | 
| virtualAccountName | string | Y | Ayoconnect | Returned by the 'Create Virtual Account' API. Name of the customer | 
| virtualAccountPhone | string | Y | 62796335646 | Returned by the 'Create Virtual Account' API. Phone number of the customer | 
| correlationId | string | Y | 1j7grzo76qx7lnihy5fctk563petjk45 | Unique identifier used while generating the Virtual Account | 
| customerId | string | Y | AYOAPP-559PAC23 | Ayoconnect's CustomerId. AlphaNumeric. | 
| totalAmount | JSON Object | Y | {"value": "25000.00", "currency": "IDR"} | Total amount the customer has paid successfully historically through this Virtual Account number | 
| billAmount | JSON Object | Y | {"value": "12500.00", "currency": "IDR"} | The amount received by the client from this transaction after the fees | 
| adminFee | JSON Object | Y | {"value": "2500.00", "currency": "IDR"} | The total fees charged to the client for this transaction | 
| billDetails | array | Y | [] | The breakdown of the transaction details including item name, item value, and description given to Ayoconnect by the client. A list with one item only | 
| paymentDetails | JSON Object | Y | {"value": "12500.00", "currency": "IDR"} | The amount paid by the customer for this transaction | 
List of 'billDetails' contains JSON Object with fields:
| Name | Type | Required | Example | Description | 
|---|---|---|---|---|
| billName | string | Y | API Product | Returned by the 'Create a Virtual Account' API | 
| billAmount | JSON Object | Y | {"value": "12500.00", "currency": "IDR"} | Returned by the 'Create a Virtual Account' API | 
| billDescription | JSON Object | N | {"english": "Va trx", "indonesia": "Transaksi va"} | 
Callback sample request
{
  "code": 200,
  "message": "ok",
  "virtualAccountData": {
    "virtualAccountId": "2405121557574135743HROOUVXY",
    "virtualAccountNumber": "1896520138004558",
    "virtualAccountStatus": "PAID",
    "virtualAccountName": "AyoconnectTest",
    "virtualAccountPhone": "62988484815",
    "correlationId": "1237000000001000123456789024475k",
    "customerId": "AYOPOP-GCINRJ2946",
    "totalAmount": {
      "value": "25000.00",
      "currency": "IDR"
    },
    "billAmount": {
      "value": "12500.00",
      "currency": "IDR"
    },
    "adminFee": {
      "value": "2500.00",
      "currency": "IDR"
    },
    "billDetails": [
      {
        "billName": "API Product",
        "billAmount": {
          "value": "12500.00",
          "currency": "IDR"
        },
        "billDescription": {
          "english": "Virtual account transaction",
          "indonesia": "Transaksi akun virtual"
        }
      }
    ],
    "paymentDetails": {
      "trxRefID": "2362",
      "amount": "12500.00"
    }
  }
}Updated 8 months ago