> 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.md).

# Accounts Payable API Reference

API Version: v1.2.0

The Accounts Payable API extends the existing Alternative Payments Partner API with endpoints for managing vendors, bills, and outbound payments. Partners can programmatically create vendors, submit bills for approval, initiate payments to vendors, and track the full bill-to-payment lifecycle.

All endpoints follow the same conventions as the existing Accounts Receivable API: OAuth2 client credentials authentication, cursor-based pagination, snake\_case JSON, idempotency keys on mutating operations, and standard error responses.

## Base URL

```
https://public-api.alternativepayments.io
```

## Authentication

Same OAuth2 client credentials flow as the AR API. Authenticate with your API key and secret to `/oauth/token`, then use the returned Bearer token for all requests.

## Resource Groups

| Group                                                                       | Endpoints     | Description                                       |
| --------------------------------------------------------------------------- | ------------- | ------------------------------------------------- |
| [Vendors](/getting-started/accounts-payable-api/vendors.md)                 | 11            | Vendor CRUD, bank accounts, data requests         |
| [Bills](/getting-started/accounts-payable-api/bills.md)                     | 12            | Bill CRUD, approval workflow, OCR upload          |
| [Vendor Payments](/getting-started/accounts-payable-api/vendor-payments.md) | 4             | Payment initiation, cancellation, retry           |
| [Webhooks](/getting-started/accounts-payable-api/webhooks.md)               | 14 new topics | Event notifications for all Acc Payable resources |

## Pagination

All list endpoints use cursor-based pagination:

| Parameter | Type    | Description                  |
| --------- | ------- | ---------------------------- |
| `limit`   | integer | Items per page (default 100) |
| `after`   | string  | Forward pagination cursor    |
| `before`  | string  | Backward pagination cursor   |

Response includes:

```json
{
  "data": [...],
  "has_next_page": true,
  "has_previous_page": false,
  "start_cursor": "abc123",
  "end_cursor": "xyz789"
}
```

## Error Format

```json
{
  "code": "BILL_NOT_FOUND",
  "message": "Bill with ID xyz not found",
  "validation_errors": {}
}
```

## Idempotency

Include an `Idempotency-Key` header on POST requests that create resources or initiate payments. The key must be a UUID. Duplicate requests with the same key return the original response.

## Naming Conventions

* All JSON fields use `snake_case`
* All IDs are UUID strings
* All dates use RFC3339 format
* All monetary amounts are decimal strings (e.g., `"1500.00"`)


---

# 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.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.
