The "Purchase Callback" is a communication method where a server sends a notification to a client's specified endpoint (callback URL) to update them on the result of a purchase transaction. This notification includes important information about the purchase, empowering the client to update its records or initiate any necessary follow-up actions.
A. Sample Request
| HTTP Method | POST |
|---|---|
| Callback URL | https://client.com/callback |
curl -X 'POST' -d
{
"response_code": "2000200",
"response_message": "Success",
"partner_reference_id": "9d37f9ad-a7d0-41c7-92a6-285e2c8f845f",
"transaction_id": "14430374",
"amount": "15000",
"transaction_time": "2024-10-11T09:02:57.241732Z",
"transaction_status": "SUCCESS",
"reason": "",
"product_name": "Tsel 10.000",
"sn": "02617700018017005627",
"value": "081000000002",
"customer_name": "",
"current_balance": 1890248,
"beginning_balance": 1905248,
"product_code": "S10"
}
-H 'Content-Type: application/json' 'https://client.com/callback.'
B. Request Body
| Field | Type | Description | Example |
|---|---|---|---|
| response_code | string | Contains the OpenAPI response code | “2000200” |
| response_message | string | Contains the value of OpenAPI response message | “Success” |
| partner_reference_id | string | The unique reference identifier provided by the partner or service invoking the transaction, recommended value is UUID v4 | “9d37f9ad-a7d0-41c7-92a6-285e2c8f845f” |
| transaction_id | string | The value of transaction’s id | “14430374” |
| amount | string | The buy price from the partner to Klikoo. The amount will deduct the partner’s balance on Klikoo when the transaction status is success | “15000” |
| transaction_time | string | Timestamp indicating when the transaction occurred | “2024-10-11T09:02:57.241732Z” |
| transaction_status | string | The status of the transaction | “SUCCESS” |
| reason | string | The information about the reason of failed transaction, occur when transaction is failed | “” |
| product_name | string | The name of the product | “Tsel 10.000” |
| sn | string | The value of transaction’s serial number | “02617700018017005627” |
| value | string | Representing a value associated with a mobile device or user | “081000000002” |
| customer_name | string | Name of the customer involved in the transaction | “” |
| current_balance | int | Current balance associated with the customer | 1890248 |
| beginning_balance | int | Balance before the transaction occurred | 1890248 |
| product_code | string | Unique identifier for the product | "S10" |
C. Sample Callback for Success Status
{
"response_code": "200022000",
"response_message": "Sukses",
"partner_reference_id": "45596",
"transaction_id": "14429004",
"amount": "15083",
"transaction_time": "2024-02-07T06:50:56.260863959Z",
"transaction_status": "SUCCESS",
"reason": "",
"product_code": "DNOPENDENOM",
"product_name": "DANA OPEN DENOM",
"sn": "2024020710121481030100166434400746263",
"value": "08996647676",
"customer_name": "ady dana",
"current_balance": 50000,
"beginning_balance": 34917
}
D. Sample Callback for Failed Status
{
"response_code": "200022000",
"response_message": "Sukses",
"partner_reference_id": "45594",
"transaction_id": "14429004",
"amount": "15083",
"transaction_time": "2024-02-07T06:49:39.156394068Z",
"transaction_status": "FAILED",
"reason": "FR_NOT_SELECTED",
"product_code": "DNOPENDENOM",
"product_name": "DANA OPEN DENOM",
"sn": "223752",
"value": "087877144691",
"customer_name": "",
"current_balance": 50000,
"beginning_balance": 50000
}