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

Payment Method Webhook Events

This reference describes how to receive and process server-to-server webhook notifications from Codapay. These notifications keep your backend synchronized with the transaction status as a user progresses through the payment flow.

Overview

Codapay uses webhooks to notify your "Complete Notification URL" whenever a transaction reaches a final state or a critical milestone.

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

Event Types

For Codapay integrations, your endpoint should be prepared to handle the following eventType values:

Event Type
Type
Description

PAYMENT_METHOD_ADDED

The shopper successfully saved a new payment method.

PAYMENT_METHOD_REMOVED

The shopper removed a saved payment method.

Notification Payload Structure

Notifications are sent as a POST request with a JSON body. Each type of notification has a specific structure and content.

Payment Method Notifications

Field
Type
Description

eventType

string

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

timestamp

string

The timestamp of when the event occurred

shopper

object

An object containing shopper details such as ID, email, or partner-specific identifiers.

paymentMethod

object

Information regarding the payment instrument used (e.g., token, card type, last four digits).

PAYMENT_METHOD_ADDED

This notification is sent when a new card is successfully saved and linked to the shopper profile.

Notification Payload

Request headers

Header
Example
Description

Content-Type

application/json; charset=UTF8

JSON body

User-Agent

Coda HTTP Invoker v1.0

Identifies Coda as the sender

x-signature

7d7aabef617f8764093c7e1507a81317

Signature to verify the notification

Verify the notification

The signature is not in the JSON body and is not an HMAC. It is an MD5 hash sent in the x-signature header.

  1. Build one string by joining these values in this order, with no separators (UTF-8):

    eventType + apiKey + shopper.id + paymentMethod.id + shopper.partnerShopperId

    Use your v2 Global API key (the same key as apiKey in Init).

  2. Calculate the MD5 of that string, as 32-character lowercase hex.

  3. Compare it with the x-signature header. If they match, the notification is from Coda.

Example:

Node.js:

Handling tips

  • Store paymentMethod.id as soon as verification passes. Inquiry does not return it, so this webhook is the only way to get it.

  • If verification fails, do not just reject and forget it. Log the full request (headers and body) and alert your team.

  • Handle the same event more than once safely (idempotent): use paymentMethod.id as the key.

Responding to Notifications

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

Last updated

Was this helpful?