> For the complete documentation index, see [llms.txt](https://help.alternativepayments.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.alternativepayments.io/getting-started/accounts-payable-api/webhooks.md).

# Webhooks

The Accounts Payable API adds 14 new webhook topics to the existing webhook infrastructure. Partners subscribe using the same `POST /webhooks` endpoint with new topic values. No new webhook endpoints are needed.

## Subscribing to Acc Payable Webhooks

Use the existing webhook subscription endpoint:

```
POST /webhooks
```

```json
{
  "topic": "vendor_created",
  "endpoint_url": "https://your-server.com/webhooks",
  "secret_key": "your-webhook-secret"
}
```

## New Webhook Topics

### Vendor Events

| Topic                | Trigger                                           |
| -------------------- | ------------------------------------------------- |
| `vendor_created`     | Vendor created (manual, OCR, or integration sync) |
| `vendor_updated`     | Vendor details changed                            |
| `vendor_deactivated` | Vendor deactivated                                |
| `vendor_reactivated` | Vendor reactivated                                |

### Bill Events

| Topic            | Trigger                                         |
| ---------------- | ----------------------------------------------- |
| `bill_created`   | Bill created (manual, OCR, or integration sync) |
| `bill_updated`   | Bill details changed                            |
| `bill_submitted` | Bill submitted for approval                     |
| `bill_rejected`  | Bill rejected                                   |
| `bill_deleted`   | Bill soft-deleted                               |

### Vendor Payment Events

| Topic                       | Trigger                                           |
| --------------------------- | ------------------------------------------------- |
| `vendor_payment_processing` | Vendor payment initiated, funds being transferred |
| `vendor_payment_succeeded`  | Vendor payment completed successfully             |
| `vendor_payment_failed`     | Vendor payment failed                             |
| `vendor_payment_canceled`   | Vendor payment canceled                           |

### Vendor Data Request Events

| Topic                           | Trigger                                                |
| ------------------------------- | ------------------------------------------------------ |
| `vendor_data_request_submitted` | Vendor completed the self-service data collection form |

## Webhook Payload Format

Webhook payloads follow the same format as existing AR webhooks. The `topic` field indicates the event type, and the `data` field contains the resource details.

```json
{
  "id": "event-uuid",
  "topic": "vendor_payment_succeeded",
  "created_at": "2026-04-15T14:30:00Z",
  "data": {
    "vendor_payment_id": "aa0e8400-e29b-41d4-a716-446655440000",
    "bill_id": "660e8400-e29b-41d4-a716-446655440000",
    "vendor_id": "550e8400-e29b-41d4-a716-446655440000",
    "payment_id": "990e8400-e29b-41d4-a716-446655440000",
    "partner_id": "bb0e8400-e29b-41d4-a716-446655440000",
    "amount": 1500.00,
    "payment_date": "2026-04-15T14:30:00Z"
  }
}
```

## Managing Webhook Subscriptions

All existing webhook management endpoints work with the new topics:

| Method | Path                    | Description                     |
| ------ | ----------------------- | ------------------------------- |
| POST   | `/webhooks`             | Subscribe to a topic            |
| GET    | `/webhooks`             | List subscriptions              |
| DELETE | `/webhooks/{id}`        | Unsubscribe                     |
| GET    | `/webhooks/{id}/events` | List events for a subscription  |
| POST   | `/webhooks/{id}/retry`  | Retry failed webhook deliveries |

## Webhook Delivery

* Webhooks are delivered via HTTP POST to the configured `endpoint_url`
* If a `secret_key` was provided, the payload is signed using HMAC-SHA256
* Failed deliveries are retried with exponential backoff
* Event history is retained for 30 days


---

# 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://help.alternativepayments.io/getting-started/accounts-payable-api/webhooks.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.
