Webhook - Payment Voided #
1. Webhook Overview #
Purpose #
This Webhook event is sent from the EBP system to the store when a payment void (full cancellation before capture) for an authorized payment is successfully processed.
Through this event, the store can verify the void result in real-time and proceed with subsequent processes such as order cancellation and inventory recovery.
Note: A registered URL is required to receive Webhooks. (Contact: ebp-server@lge.com)
Details #
| Item | Value |
|---|---|
| Webhook Name | Payment Voided |
| Event Type | PAYMENT_VOIDED |
| HTTP Method | POST |
| Region | Global |
2. Authentication #
All Webhook requests sent by the EBP system include the following headers for integrity verification. The store must validate these values to ensure the request is legitimate.
| Header Name | Description |
|---|---|
x-webhook-signature | HMAC-SHA256 signature used to verify the integrity of the Webhook message |
x-webhook-signature-timestamp | Timestamp when the Webhook event was sent (Unix Epoch, seconds) |
Signature Generation and Verification Rules #
The store should generate its own signature by combining the received Webhook body data and the timestamp header value, then compare it with the received x-webhook-signature value.
- Input Message Composition:
x-webhook-signature-timestamp header value + "." + original Request Body (JSON String) - Hashing: Hash the composed message using the HMAC-SHA256 algorithm and the Webhook Secret Key issued by EBP.
- Encoding: Convert the hashing result into a Hex string (Hexadecimal).
- Verification: Check if the generated Hex string matches the value in the
x-webhook-signatureheader.
Verification Example (Java) #
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.HexFormat;
public class WebhookVerifier {
private static final String HMAC_SHA256 = "HmacSHA256";
/**
* Webhook signature verification method
*
* @param secretKey Webhook Secret Key issued by EBP
* @param timestamp Value of x-webhook-signature-timestamp header
* @param requestBody Received HTTP Request Body (JSON string)
* @param receivedSig Value of x-webhook-signature header
* @return Whether the verification was successful
*/
public boolean verifySignature(String secretKey, String timestamp, String requestBody, String receivedSig) {
if (timestamp == null || receivedSig == null || secretKey == null || secretKey.isEmpty()) {
return false;
}
try {
String inputMessage = timestamp + "." + requestBody;
Mac mac = Mac.getInstance(HMAC_SHA256);
SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), HMAC_SHA256);
mac.init(secretKeySpec);
byte[] hashBytes = mac.doFinal(inputMessage.getBytes(StandardCharsets.UTF_8));
String generatedSig = HexFormat.of().formatHex(hashBytes);
return generatedSig.equalsIgnoreCase(receivedSig);
} catch (NoSuchAlgorithmException | InvalidKeyException e) {
// log.error("Failed to verify EBP webhook signature", e);
return false;
}
}
}
[!IMPORTANT]
The Webhook Secret Key must be issued through EBP. For inquiries, please contact ebp-server@lge.com. If signature verification fails, the request should be considered untrusted and ignored.
3. Data Schema #
3.1. Payload Data Schema #
| depth | Field | Details & Description |
|---|---|---|
| -1 | eventType |
🔴 Required Event type e.g., PAYMENT_VOIDED |
| -1 | eventTime |
🔴 Required Timestamp when the event occurred e.g., 2025-12-30T10:00:00Z |
| -1 | data |
🔴 Required Detailed void data |
| 0 | orderNo |
🔴 Required Order number issued by EBP e.g., ORD_7202603277730794 |
| 0 | paymentStatus |
🔴 Required Payment status code e.g., VOIDED |
| 0 | voidedAmount |
🔴 Required Voided amount e.g., 50000 |
| 0 | currencyCode |
🔴 Required Currency code. ISO 4217 e.g., USD |
| 0 | exponent |
🔴 Required Currency decimal exponent e.g., 2 |
| 0 | resultCode |
🔴 Required EBP result code ('0' for success) e.g., 0 |
| 0 | resultMessage |
⚪ Optional Result message e.g., SUCCESS |
| 0 | voidedAt |
🔴 Required Timestamp when the void was completed e.g., 2025-12-30T10:00:00Z |
| 0 | pgProvider |
🔴 Required Payment Gateway provider code e.g., WORLDPAY, OMISE |
3.2. Payload Example #
HTTP Request #
POST /your-webhook-endpoint HTTP/1.1
Content-Type: application/json
x-webhook-signature: 25f0e... (HMAC-SHA256 Hex String)
x-webhook-signature-timestamp: 1735552800 (Unix Epoch Seconds)
{
"eventType": "PAYMENT_VOIDED",
"eventTime": "2025-12-30T10:00:00Z",
"data": {
"orderNo": "ORD_7202603277730794",
"paymentStatus": "VOIDED",
"voidedAmount": 50000,
"currencyCode": "USD",
"exponent": 2,
"resultCode": "0",
"resultMessage": "SUCCESS",
"voidedAt": "2025-12-30T10:00:00Z",
"pgProvider": "WORLDPAY"
}
}