For the complete documentation index, see llms.txt. This page is also available as Markdown.

Fraud and Chargeback Notifications

This reference describes the webhook notifications Coda sends to keep your backend informed of chargeback lifecycle changes and early fraud warnings on your transactions.

Note: Chargeback and Fraud updates requires POST notifications to be enabled for your account. Contact your Codapay account manager to enable them.

Overview

Codapay uses webhooks to notify your "Complete Notification URL" whenever a chargeback progresses through its lifecycle, or an early fraud warning is received on one of your transactions.

Ensure your "Complete Notification URL" is configured in the Publisher Portal. Refer to the Set up payments guide for detailed instructions.

Event Types

Chargeback Events

For chargeback lifecycle events, your endpoint should be prepared to handle the following eventType values:

Event Type
Description

chargeback_created

A chargeback has been raised against a transaction

dispute_sent

The chargeback has been escalated and a dispute submitted to the gateway

dispute_lost

The dispute was resolved in the customer's favour

dispute_won

The dispute was resolved in the merchant's favour

Fraud Events

For fraud events, your endpoint should be prepared to handle the following eventType values:

Event Type
Description

fraud_notification

An early fraud warning has been received for a transaction

Notification Payload Structure

Notifications are sent as a POST request with a JSON body.

Field
Type
Description

eventType

string

The specific event type being reported (e.g., chargeback_created)

timestamp

string

Notification timestamp

data.chargebackId

string

Coda's internal chargeback identifier

data.stage

string

Lifecycle stage of the chargeback. See Stage Values below

data.txnId

string

Coda's internal transaction ID

data.reason

string

Chargeback reason as provided by the Issuing Bank (e.g. Other Fraud-Card Absent Environment)

data.outcome

string | null

Final outcome of a dispute: WON, LOST, or null if not yet resolved.

data.amountValue

decimal

Transaction amount

data.amountCurrency

string

ISO 4217 currency code (e.g. CHF, USD)

data.orderId

string

Your order ID (if provided)

Stage Values

Stage
Meaning

CHARGEBACK

Chargeback has been created

DISPUTE_SENT

Dispute submitted to gateway

DISPUTE_LOST

Dispute closed — outcome: lost

DISPUTE_WON

Dispute closed — outcome: won

EARLY_FRAUD_WARNING

Fraud signal received before chargeback is raised

Chargeback Notification Examples

chargeback_created

dispute_sent

dispute_lost

dispute_won

Fraud Notification Example

fraud_notification

Notification Signature Verification

Every POST notification includes two headers that allow you to verify the request originated from Codapay and has not been tampered with:

Header
Description

X-Request-Time

The timestamp of the request, represented as epoch milliseconds (string of digits)

X-Signature

HMAC-SHA512 hex digest computed by Codapay using your merchant API key

How It Works

Codapay and your server both agree on a single UTF-8 string to sign:

The HMAC-SHA512 algorithm is applied to this string using your merchant API key, producing a 128-character lowercase hexadecimal digest.

Codapay sends this digest in the X-Signature header. Your server must recompute the same hex digest and compare it to the received value.

Validation Steps

  1. Read the X-Request-Time and X-Signature headers from the incoming request.

  2. Read the raw body bytes of the request.

  3. Build the signed string: requestTime + "." + body (interpreted as UTF-8).

  4. Compute the expected signature: HMAC-SHA512(secretKey, signedString) → lowercase hex.

  5. Compare expectedHex to the X-Signature header value using a constant-time comparison to prevent timing attacks. The comparison is case-insensitive.

If the values do not match, reject the request.

Example — Java

Responding to Notifications

To acknowledge receipt of the notification, your server must respond with a 200 OK and the following JSON body:

Retry Policy: If no valid response is received, Codapay will re-send the notification 3 times at 5-minute intervals. If all attempts fail, an email alert will be triggered to your technical contact.

Last updated

Was this helpful?