Answered

How can I change the request body of webhook

I want to have the webhook request body like below inside some key:


{

    "/my-service-builder-portlet.my-extension/service-details": {

    "id": "ev_1mkVvy8RDvXTSkGnu",

    "occurred_at": 1546366316,

    "source": "hosted_page",

    "object": "event",

    "api_version": "v2",

    "content": {

        "subscription": {

            "id": "1mbDWfKRDvX9nuFvn",

            "customer_id": "1mbDWfKRDvX9nuFvn",

            "plan_id": "cbdemo_grow",

            "plan_quantity": 1,

            "plan_unit_price": 8900,

            "plan_amount": 8900,

            "billing_period": 3,

            "billing_period_unit": "month",

            "plan_free_quantity": 0,

            "status": "in_trial",

            "trial_start": 1546366316,

            "trial_end": 1547575916,

            "next_billing_at": 1547575916,

            "created_at": 1546366316,

            "started_at": 1546366316,

            "created_from_ip": "157.32.206.43",

            "updated_at": 1546366316,

            "has_scheduled_changes": false,

            "resource_version": 1546366316757,

            "deleted": false,

            "object": "subscription",

            "currency_code": "USD",

            "addons": [{

                "id": "cbdemo_customreports",

                "quantity": 1,

                "unit_price": 2000,

                "amount": 2000,

                "object": "addon"

            }],

            "due_invoices_count": 0,

            "shipping_address": {

                "first_name": "Ravi",

                "last_name": "Rupapara",

                "line1": "Sola Road",

                "line2": "C.P. Nagar-1",

                "city": "Ahmedabad",

                "state_code": "GJ",

                "state": "Gujarat",

                "country": "IN",

                "validation_status": "not_validated",

                "object": "shipping_address"

            }

        },

       

    "event_type": "subscription_created",

    "webhook_status": "not_configured"

}

}


Is it possible to do?


Best Answer

Hello Ravi,


Chargebee's Web-hook request format cannot be altered, but however your can alter the format as per your need once you have received our web-hook response.


Hope this helps.


1 Comment

Answer

Hello Ravi,


Chargebee's Web-hook request format cannot be altered, but however your can alter the format as per your need once you have received our web-hook response.


Hope this helps.


×