How to Filter webhook event body and use it to route

Hello I have a webhook response coming from Paystack as shown bellow, I want in a case where “event.type=success” and/or referrer is say “website A” and another route when referrer is “Website B”. I used custom webhooks then added a router for 2 routes based on the referrer but the filter is not working. Please how best can I do the filter.

Thank you.

{
  "event": "charge.success",
  "data": {
    "id": 4869633276,
    "domain": "test",
    "status": "success",
    "reference": "T887606184945302",
    "amount": 12000,
    "message": null,
    "gateway_response": "Successful",
    "paid_at": "2025-04-13T11:25:17.000Z",
    "created_at": "2025-04-13T11:24:51.000Z",
    "channel": "card",
    "currency": "NGN",
    "ip_address": "13.40.30.197",
    "metadata": {
      "custom_fields": [
        {
          "display_name": "Transaction Id",
          "variable_name": "67fb9sssssss2081a",
          "value": "67fb9sssssss2081a"
        },
        {
          "display_name": "Currency",
          "variable_name": "currency",
          "value": "NGN"
        },
        {
          "display_name": "Customer Name",
          "variable_name": "customerName",
          "value": "Jedidiah Onwubiko"
        },
        {
          "display_name": "Order Id",
          "variable_name": "orderId",
          "value": "67fb9ef50f2d440e9759f992"
        },
        {
          "display_name": "Invoice Id",
          "variable_name": "invoiceId",
          "value": ""
        },
        {
          "display_name": "Location Id",
          "variable_name": "locationId",
          "value": "fdgdgdgdgdgdgd"
        }
      ],
      "referrer": "https://website-a.com/api/paystack/initiate-payment,https://link.fastpaydirect.com"
    },
    "fees_breakdown": null,
    "log": null,
    "fees": 180,
    "fees_split": null,
    "authorization": {
      "authorization_code": "AUTH_7u86ye3shm",
      "bin": "408408",
      "last4": "4081",
      "exp_month": "12",
      "exp_year": "2030",
      "channel": "card",
      "card_type": "visa ",
      "bank": "TEST BANK",
      "country_code": "NG",
      "brand": "visa",
      "reusable": true,
      "signature": "SIG_Prccccccc5JG9zqZo",
      "account_name": null,
      "receiver_bank_account_number": null,
      "receiver_bank": null
    },
    "customer": {
      "id": 183186583,
      "first_name": null,
      "last_name": null,
      "email": "johndoe@gmail.com",
      "customer_code": "CUS_htsluzfy3xfxk9n",
      "phone": null,
      "metadata": null,
      "risk_action": "default",
      "international_format_phone": null
    },
    "plan": {},
    "subaccount": {},
    "split": {},
    "order_id": null,
    "paidAt": "2025-04-13T11:25:17.000Z",
    "requested_amount": 12000,
    "pos_transaction_data": null,
    "source": {
      "type": "web",
      "source": "checkout",
      "entry_point": "request_inline",
      "identifier": null
    }
  }
}

Welcome to the Make community!

The above output bundle is not valid JSON. You can verify this by copy-pasting into jsonformatter.org

These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Thank you so much. Have corrected that

Hey Jadidiah,

can you share screenshots of how your filters are currently setup?

sure, kindly see the images



The things you wrote there are free text at the moment, those are not formulas. To use formulas you can select them from the box, you can use {{ }} to write them your self, or you can use slash commands / and pick them from the menu.

Second, you can just put the variables directly and check them. Why complicate it with formulas?

Thank you. Let me check it out


This solved the problem. It was because there was no payload.

3 Likes