> ## Documentation Index
> Fetch the complete documentation index at: https://docs.peere.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Bank Intent Response Webhook

Sent to merchants when a customer responds to a billing intent through their bank.

**Webhook type:** `billing.intent.response`\
**Recipient:** Merchants and Providers

## Payload

```json theme={null}
{
  "entityId": "merchant_001",
  "entityType": "merchant",
  "webhookType": "billing.intent.response",
  "timestamp": "2024-01-15T10:35:00.000Z",
  "batchId": "batch_response_456",
  "data": [
    {
      "customerId": "customer_123",
      "paymentID": "customer-agreement-phrase-abc123",
      "entityId": "merchant_001",
      "lookupID": "customer-lookup-phrase-xyz789",
      "customerDecision": "approve_recurring",
      "spendingLimits": {
        "single": 5000,
        "daily": 10000,
        "weekly": 50000,
        "monthly": 200000
      },
      "bankId": "bank_456",
      "blockMerchant": false,
      "reference": "intent_response_ref_789"
    }
  ],
  "itemCount": 1,
  "signature": "webhook_signature_hash"
}
```

The `customerDecision` field will be one of `approve_once`, `approve_recurring`, `deny`, or `suspended`. Store the `paymentID` from approved responses — you will need it to bill the customer.

## Handler

```javascript theme={null}
app.post("/webhooks/peere/intent-response", (req, res) => {
  const signature = req.headers["x-peere-signature"];
  if (!verifySignature(req.body, signature)) {
    return res.status(401).send("Invalid signature");
  }

  const { webhookType, data } = req.body;

  if (webhookType === "billing.intent.response") {
    for (const response of data) {
      const { customerDecision, paymentID, customerId, spendingLimits } = response;
      // store paymentID and spendingLimits for future billing
    }
  }

  res.status(200).send("OK");
});
```
