Webhook Notifications for Offline Payments in Chargebee

Introduction

Chargebee provides a versatile solution for managing customer payments, but sometimes it lacks native integrations with specific payment gateways like Post finance, DataTrans, Ogone, Six payment, Swisscom, and others. When using such payment gateways, Chargebee may not automatically process payments upon invoice generation or offer automatic payment retries for failed transactions. To address this, we've introduced a custom webhook feature, allowing merchants to receive notifications for new invoice generation and payment retry attempts. With this information, you can manually initiate transactions with your payment gateway and update Chargebee once the payments are successful, ensuring invoices are marked as "Paid."

Configuring Webhook Notifications

Follow the steps below to complete the configurations for Offline Payments.

  1. Enabling Custom Webhook
    To enable the custom webhook notification for offline payments contact support.

  2. Configuring the Webhook
    To configure the webhook, log in to the Chargebee app, and go to https://<your domain>.chargebee.com/custom_offline_dunning url to open the webhook configuration page.

  3. Enter the following details in the webhook configuration page.
    Rate Frequency: The interval after which a webhook is triggered from the invoice due date.
    Webhook Url: This is the URL where Chargebee will send notifications for payment retry attempts.
    Username: Username of the webhook URL.
    Password: Password of the webhook URL.



  4. Click Publish to complete setting up the webhook notification.

 

Sample Webhook Response

{ "method": "POST", "path": "/", "query": {}, "headers": { "x-forwarded-for": "157.51.13.25", "x-forwarded-proto": "https", "x-forwarded-port": "443", "host": "8f57f7eb32c6983d1da868ba0a4d1f56.m.pipedream.net", "x-amzn-trace-id": "Root=1-5faa7f75-743195976942b6237f0ae683", "content-length": "2280", "content-type": "application/json; charset=utf-8", "user-agent": "ChargeBee", "accept-encoding": "gzip,deflate" }, "body": { "event_type": "offline_dunning_retry_webhook", "id": "ev___demo_inv__28_2", "object": "event", "occurred_at": 1589800981882, "content": { "offline_dunning": { "attempt": 2, "occurred_at": 1589800981882 }, "customer": { "id": "__dev__5SK2lYTrSFwA6jt3", "first_name": "adda", "auto_collection": "off", "net_term_days": 0, "allow_direct_debit": false, "created_at": 1589628144, "taxability": "taxable", "updated_at": 1589628144, "pii_cleared": "active", "resource_version": 1589628144000, "deleted": false, "object": "customer", "db_id": "customer_191000000026", "card_status": "no_card", "promotional_credits": 0, "refundable_credits": 0, "excess_payments": 0, "unbilled_charges": 0, "preferred_currency_code": "USD" }, "invoice": { "id": "__demo_inv__28", "customer_id": "__dev__5SK2lYTrSFwA6jt3", "subscription_id": "__dev__5SK2lYTrSFwA9L8D", "recurring": true, "status": "payment_due", "price_type": "tax_exclusive", "date": 1589628154, "due_date": 1589628154, "net_term_days": 0, "exchange_rate": 1, "total": 20000, "amount_paid": 0, "amount_adjusted": 0, "write_off_amount": 0, "credits_applied": 0, "amount_due": 20000, "dunning_status": "in_progress", "next_retry_at": 1589972960, "updated_at": 1589628154, "resource_version": 1589628154000, "deleted": false, "object": "invoice", "db_id": "invoice_235000000062", "first_invoice": true, "amount_to_collect": 20000, "round_off_amount": 0, "new_sales_amount": 20000, "has_advance_charges": false, "currency_code": "USD", "base_currency_code": "USD", "is_gifted": false, "term_finalized": true, "tax": 0, "line_items": [ { "id": "li___dev__5SK2lYTrSFwA9M7F", "date_from": 1589628154, "date_to": 1592306554, "unit_amount": 20000, "quantity": 1, "amount": 20000, "pricing_model": "flat_fee", "is_taxed": false, "tax_amount": 0, "object": "line_item", "db_id": "line_item_244000000039", "subscription_id": "__dev__5SK2lYTrSFwA9L8D", "customer_id": "__dev__5SK2lYTrSFwA6jt3", "description": "gold", "entity_type": "plan", "entity_id": "gold", "tax_exempt_reason": "tax_not_configured", "discount_amount": 0, "item_level_discount_amount": 0 } ], "sub_total": 20000, "linked_payments": [], "dunning_attempts": [ { "created_at": 1589713760, "attempt": 1, "dunning_type": "offline" } ], "applied_credits": [], "adjustment_credit_notes": [], "issued_credit_notes": [], "linked_orders": [], "billing_address": { "first_name": "adda", "validation_status": "not_validated", "object": "billing_address", "db_id": "billing_address_null" } } } } }