> For the complete documentation index, see [llms.txt](https://docs.cashramp.co/cashramp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cashramp.co/cashramp/cashramp-bot-api/webhook.md).

# Webhooks

Accrue sends webhook events to your configured `webhook_url` whenever a P2P payment changes state. You set this URL on your API key.

## Event Payload

Every webhook is an HTTPS **POST** to your `webhook_url` with a JSON body shaped like:

| Field        | Type     | Description                                          |
| ------------ | -------- | ---------------------------------------------------- |
| `event_type` | `string` | Machine-readable name of the event (see list below). |
| `data`       | `object` | Event-specific payload.                              |

***

## Events

| Event                        | Description                              |
| ---------------------------- | ---------------------------------------- |
| `payment.assigned`           | A payment has been assigned to your bot. |
| `payment.paid`               | A payment has been marked as paid.       |
| `payment.canceled`           | A payment has been canceled.             |
| `p2p_payment.status.updated` | A P2P payment status has changed.        |

***

## Verifying Webhooks

Every request includes two headers for verification:

| Header                 | Description                                                                    |
| ---------------------- | ------------------------------------------------------------------------------ |
| `X-CASHRAMP-TOKEN`     | Your webhook token from the API key.                                           |
| `X-CASHRAMP-SIGNATURE` | HMAC-SHA256 signature of the raw request body, signed with your webhook token. |

Always verify both before processing the payload.

***

## Responding to Webhooks

{% hint style="danger" %}
Return **`200 OK` immediately**. Any non-2xx or timeout is treated as a delivery failure and the event will be retried.
{% endhint %}

Offload any heavy processing to a background job — keep your webhook handler fast.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.cashramp.co/cashramp/cashramp-bot-api/webhook.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
