Transaction Callback (Webhook)
When a transaction is successfully processed through Zipay, Zipay will automatically send a callback to the URL registered by the merchant. This allows the merchant’s system to receive real-time updates on the transaction status, such as when a payment is confirmed as successful.
Callback Flow
- A customer makes a payment through Zipay.
- Once the payment is confirmed, Zipay sends a callback to the merchant’s registered callback URL.
- The merchant’s server receives the callback and processes the payment status accordingly (e.g., updating the order status, notifying the customer).
Callback Payload
Once a transaction is successfully paid, Zipay will send a callback request to the URL you registered. Make sure your server is ready to handle and respond to this callback appropriately. Zipay sends a POST request to the registered callback URL with a payload that includes details about the transaction.
Example Callback Request
{
"uuid": "b063757a-fdeb-411c-a1a5-2dd1cdb84xxx",
"type": "STATIC",
"amount": "10000",
"invoiceNumber": "13h35dblkH13h35dblkL",
"mpan": "9360082500812547376",
"customerName": "AGUNG MAULANA",
"externalId": "QRST-621713",
"mdrPercentage": 0.7,
"mdrAmount": 70,
"status": "PAID",
"issuerName": "Zipay",
"merchantId": "1",
"merchantName": "TOKO SEPATU",
"transactionTime": "2025-01-06 20:59:32",
"paidAt": "2025-01-06"
}
Fields Explanation
Field | Description |
---|---|
uuid | A unique identifier for the transaction. |
type | The type of transaction, e.g., STATIC . |
amount | The amount paid for the transaction (in the smallest currency unit, e.g., cents). |
invoiceNumber | The invoice number generated for the transaction. |
mpan | The Merchant PAN (Primary Account Number) assigned to the merchant. |
customerName | The name of the customer who made the payment. |
externalId | An external identifier associated with the transaction, useful for linking to your internal system. |
mdrPercentage | MDR expressed as a percentage, based on merchant criteria. |
mdrAmount | The fee deducted from the transaction, calculated using the MDR percentage. |
status | The payment status of the transaction (e.g., PAID , FAILED , etc.). |
issuerName | The name of the payment issuer (in this case, Zipay ). |
merchantId | The unique identifier of the merchant who received the payment. |
merchantName | The name of the merchant who received the payment. |
transactionTime | The date and time when the transaction was created. This timestamp indicates when the transaction was initiated or recorded in the system. Format: YYYY-MM-DD HH:mm:ss (e.g., 2024-08-15 20:59:32 ). |
paidAt | The date and time when the payment for the transaction was successfully completed. This timestamp represents when the transaction was marked as paid. Format: YYYY-MM-DD HH:mm:ss (e.g., 2024-09-10 ). |
Example Callback Response
Once your system receives and processes the callback request, it should respond with a 200 OK status code to acknowledge receipt of the callback.
Handling the Callback
-
Verify the Payment Status: Ensure that the status field in the callback payload is PAID before proceeding with any business logic, such as updating the order system or notifying the customer.
-
Check for Matching Invoice: Compare the invoiceNumber and externalId with your system’s records to ensure that the callback corresponds to the correct transaction.
-
Acknowledge the Callback: Once you have successfully processed the callback, your server should respond with a 200 OK status code. If any issues occur, respond with an appropriate error message.