Event Payload Reference
Payment notification payload fields and event types.
All webhook notifications are JSON payloads sent via HTTP POST. Your handler must parse the JSON payload and return
200 OKquickly after accepting the event. A webhook is a notification: confirm the final payment status with the Transaction Status API before acting on it.
Common fields
| Field | Description | Example |
|---|---|---|
transactionId | Gateway transaction UUID | 2232e99b-0257-47d5-bbfd-022c8951767f |
orderId | Merchant order reference | PAY-1781872369616 |
amount | Transaction amount | 0.2 |
currencyCode | Transaction currency using an ISO 4217 currency code | 682 |
status | Current transaction status | Approved |
type | Webhook event type | Sale |
cardScheme | Card scheme/brand used for the transaction | Mada |
channel | Transaction channel | Payment Gateway |
rrn | Retrieval Reference Number returned for the transaction when available | 609211307265 |
declineReason | Reason associated with a declined transaction, when available | Insufficient funds |
Important: Not every field is present in every event. Fields such as
rrnanddeclineReasonmay only be included when they are applicable to the transaction or event.
Important: Always store
transactionIdandorderIdtogether for reconciliation and idempotent processing.
Event types
The type field identifies the operation that generated the webhook notification.
| Type | Description |
|---|---|
Sale | Sale/payment transaction |
Capture | Capture of a previously authorized transaction |
CreditVoid | Void of an authorization |
Refund | Refund transaction |
Status values
The status field represents the current result of the transaction or event.
| Status | Description |
|---|---|
Approved | The transaction or requested operation was successfully approved |
Declined | The transaction or requested operation was declined |
Confirm the transaction status with the Transaction Status API when determining whether an order should be fulfilled. Do not treat the webhook event type or status alone as proof of a successful payment. The webhook
statusvalues above and the Status API fields (transactionStatus,paymentStatus) are documented separately, so compare them using the values each API documents.
Currency codes
currencyCode follows the ISO 4217 currency-code standard.
For example:
| Numeric Code | Alpha Code | Currency |
|---|---|---|
682 | SAR | Saudi Riyal |
For transactions processed in Saudi Riyal, DigetPay webhook payloads use:
{
"currencyCode": "682"
}
682is the ISO 4217 numeric code for Saudi Riyal (SAR). Use the numeric currency code returned in the webhook when reconciling transaction data.
Example payloads
{
"transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
"orderId": "PAY-1781872369616",
"amount": 0.2,
"currencyCode": "682",
"status": "Approved",
"type": "Sale",
"cardScheme": "Mada",
"channel": "Payment Gateway",
"rrn": "609211307265"
}{
"transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
"orderId": "PAY-1781872369616",
"amount": 0.2,
"currencyCode": "682",
"status": "Declined",
"type": "Sale",
"cardScheme": "Mada",
"channel": "Payment Gateway",
"declineReason": "Insufficient funds"
}{
"transactionId": "e4a43f2e-bd1a-43de-8a53-cd849a32480d",
"orderId": "817922228",
"amount": 100,
"currencyCode": "682",
"status": "Approved",
"type": "Capture",
"rrn": "609211307265"
}{
"transactionId": "2232e99b-0257-47d5-bbfd-022c8951767f",
"orderId": "PAY-1781872369616",
"amount": 0.2,
"currencyCode": "682",
"status": "Approved",
"type": "Refund",
"rrn": "609211307265"
}{
"transactionId": "e4a43f2e-bd1a-43de-8a53-cd849a32480d",
"orderId": "817922228",
"amount": 100,
"currencyCode": "682",
"status": "Approved",
"type": "CreditVoid"
}Processing events
Your webhook handler should use both type and status when determining what action to take, and then confirm the result with the Transaction Status API.
For example:
Sale+Approved→ the payment was reported as approved. Confirm with the Status API, then consider it for fulfillment after idempotency checks.Sale+Declined→ payment was not approved; do not fulfill the order.Capture+Approved→ the previously authorized amount was reported as captured.Refund+Approved→ the refund operation was reported as approved.CreditVoid+Approved→ the authorization was reported as voided.
Approved sale: When
typeisSaleandstatusisApproved, confirm the payment with the Transaction Status API. You may fulfill the order once that check and your idempotency check pass.
Declined payments: Do not fulfill orders when
statusisDeclined. Cross-check the transaction status using the status API if the webhook result is unclear.
Idempotent processing
Webhook notifications may be delivered more than once. Your handler must be able to process duplicate notifications without creating duplicate business actions.
Use the transaction identifiers to maintain an idempotency record.
A recommended key is:
transactionId + typeAlways retain the associated orderId for reconciliation and merchant-side order mapping.
Handler requirements
Your webhook endpoint must:
- Be reachable over HTTPS from DigetPay.
- Parse the incoming JSON payload defensively.
- Treat the payload as a notification and confirm the final transaction status with the Status API before acting on it.
- Use
transactionIdandorderIdto identify the transaction and merchant order. - Handle duplicate events idempotently.
- Return
200 OKquickly after accepting a valid event. - Process heavy business operations asynchronously where possible.
See Webhook Security for how to treat and verify webhook notifications and Receiving Webhooks for complete handler implementation guidance.
Field handling notes
transactionId
transactionIdUse the gateway transaction ID to identify the DigetPay transaction when querying transaction status or performing supported follow-up operations.
orderId
orderIdUse the merchant order reference to map the webhook notification to the corresponding order in your system.
rrn
rrnThe Retrieval Reference Number may be returned for applicable card transactions. Store it when present if it is required for reconciliation or transaction investigation.
declineReason
declineReasondeclineReason provides additional information for a declined transaction when available. Do not assume that every declined transaction will contain this field.
currencyCode
currencyCodeThe currency code identifies the currency used for the transaction. DigetPay currently documents 682 as the numeric ISO 4217 code for SAR.
channel
channelThe channel field identifies the DigetPay channel through which the transaction was processed, such as Payment Gateway.
Do not hard-code assumptions about optional fields. Your webhook parser should safely handle fields that are absent from a particular event payload.
Related guides
Updated about 2 months ago

