Payment Method Events

Payment Method Events are webhook notifications from GETTRX One that provide real-time updates about changes to a customer's saved payment methods. These events enable you to track the addition, modification, or removal of payment methods, ensuring your system stays synchronized with customer preferences and payment capabilities.

By subscribing to these events, you can automate workflows, enhance customer experiences, and maintain accurate records of payment methods.

Key Payment Method Webhook Events

Payment Method Attached (payment_method.attached)

Triggered when a new payment method is added to a customer's account. This event can be used to notify customers of the addition or update account details in your system.

{
    account: "acm_65f48b068b8d6912fe07f000",
    attemptId: "wha_6751e4a5fc33b772f0389b3f",
    created: "1733344225",
    "data": {
        "object": {
            id: "pm_6750bbdb1b260933080d8662",
            mandate: null,
            "card": {
                brand: "visa",
                "checks": {
                    addressLine1Check: "fail",
                    addressPostalCodeCheck: "fail",
                    cvcCheck: "unchecked"
                },
                expMonth: "10",
                expYear: "2026",
                fingerprint: null,
                last4: "1667",
                "wallet": {
                    type: null,
                    applePayData: null,
                    googlePayData: null
                }
            },
            usBankAccount: null,
            type: "card",
            metadata: null,
            "billingDetails": {
                "address": {
                    city: "West Alexandre",
                    country: "LC",
                    line1: "165 McKenzie Harbor Suite 700",
                    line2: "17187 Division Street Apt. 830",
                    postalCode: "40321",
                    state: "AZ"
                },
                email: "[email protected]",
                name: "John Doe",
                phone: "+529068417325"
            },
            customer: "cus_66e34169c4cbbf37be2f3997",
            setupBy: "setr_6750bbdd1b260933080d8664",
            object: "payment_method"
        }
    },
    id: "evt_6750bbe1891a560145e25978",
    object: "event",
    "request": {},
    type: "payment_method.attached"
}

Payment Method Updated (payment_method.updated)

Indicates that an existing payment method has been updated. This event ensures your records remain accurate when customers modify details, such as expiration dates or billing information.

{
    account: "acm_65f48b068b8d6912fe07f000",
    attemptId: "wha_6793de2858fb340a9a6934a5",
    created: "1737743911",
    "data": {
        "object": {
            id: "pm_6793de249f28dc3241736276",
            "card": {
                brand: "visa",
                "checks": {
                    addressLine1Check: "fail",
                    addressPostalCodeCheck: "fail",
                    cvcCheck: "pass"
                },
                expMonth: "11",
                expYear: "2028",
                last4: "5439",
                "wallet": {}
            },
            type: "card",
            _object: "payment_method",
            "billingDetails": {
                "address": {
                    city: "Daly City",
                    country: "SG",
                    line1: "10429 Kamille Lock Apt. 259",
                    line2: "699 Peter Harbor Apt. 813",
                    postalCode: "77243",
                    state: "WV"
                },
                email: "[email protected]",
                name: "",
                phone: "+523853425351"
            },
            customer: "cus_66e34169c4cbbf37be2f3997",
            setupBy: "setr_6793de249f28dc3241736277"
        },
        "previousAttributes": {
            "billingDetails": {
                "address": {
                    country: "ST",
                    city: "Buckridgefield",
                    postalCode: "45878",
                    state: "LA",
                    line2: "2249 Satterfield Crossing Apt. 357",
                    line1: "8227 Adonis Lock Apt. 318"
                },
                phone: "+523848601339",
                name: "Queen",
                email: "[email protected]"
            },
            "card": {
                expMonth: "10"
            }
        }
    },
    id: "evt_6793de2708af0b41b6d3b4c1",
    object: "event",
    "request": {},
    type: "payment_method.updated"
}

Payment Method Deleted (payment_method.deleted)

Sent when a payment method is removed from a customer's account. Use this event to clean up records, notify customers, or prevent attempts to charge a removed payment method.

{
    account: "acm_673cad763c541000016e6000",
    attemptId: "wha_679aab1a91fc3756890560c9",
    created: "1738189591",
    "data": {
        "object": {
            id: "pm_6799fbae4699b67581ecd84b",
            "mandate": {
                "customerAcceptance": {
                    "online": {
                        ipAddress: "27.109.19.18",
                        userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
                    },
                    acceptedAt: "1738144652",
                    type: "ONLINE"
                },
                status: "active",
                type: "SINGLE_USE",
                displayedBySdk: false
            },
            "card": {
                brand: "visa",
                "checks": {
                    addressLine1Check: "fail",
                    addressPostalCodeCheck: "fail",
                    cvcCheck: "pass"
                },
                expMonth: "01",
                expYear: "2026",
                last4: "5439",
                "wallet": {}
            },
            type: "card",
            _object: "payment_method",
            "billingDetails": {
                "address": {
                    city: "Torrance",
                    country: "US",
                    line1: "Test Line 1 ",
                    line2: "Test Line 2",
                    postalCode: "12345",
                    state: "CA"
                },
                email: "[email protected]",
                name: "John Smith",
                phone: "+18887751500"
            },
            customer: "cus_6799f845fa47c02065b8f161",
            setupBy: "pr_6799fbaa4699b67581ecd849"
        }
    },
    id: "evt_679aab176d376e4af8d4e376",
    object: "event",
    "request": {},
    type: "payment_method.deleted"
}

Best Practices for Payment Method Events

Keep Records Updated:

Use payment_method.attached to automatically add new payment methods to customer profiles in your system.
Update your records promptly when payment_method.updated is received.

Enhance Customer Communication:

Notify customers of changes to their payment methods, such as when payment_method.attached or payment_method.deleted events occur. Provide confirmation or additional actions (e.g., "Set as Default") for newly attached payment methods.

Improve Security and Compliance:

Validate changes to payment methods using secure processes and notify customers of unauthorized updates. Use payment_method.deleted to ensure sensitive payment data is properly handled and removed from your system if necessary.

Automate Billing Workflows:

Use these events to adjust billing preferences dynamically when payment methods are added, updated, or removed. Prevent billing interruptions by prompting customers to add new payment methods when receiving a payment_method.deleted event.

By integrating Payment Method Events into your workflows, you can ensure your system is always aligned with customer payment preferences, improving operational efficiency and customer satisfaction.