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.
Event Types
For Codapay integrations, your endpoint should be prepared to handle the following eventType values:
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
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
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.
Build one string by joining these values in this order, with no separators (UTF-8):
eventType+apiKey+shopper.id+paymentMethod.id+shopper.partnerShopperIdUse your v2 Global API key (the same key as
apiKeyin Init).Calculate the MD5 of that string, as 32-character lowercase hex.
Compare it with the
x-signatureheader. If they match, the notification is from Coda.
Example:
Node.js:
Handling tips
Store
paymentMethod.idas 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.idas 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?