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

# Vendor Payments

## Initiate vendor payment

> Initiate payment for one or more bills. Bills must have pay\_date set (422 if null).

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["accounts_payable:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"read":"Read access","write":"Write access"}}}}},"schemas":{"CreateVendorPaymentReply":{"description":"Vendor payment creation results","properties":{"results":{"items":{"$ref":"#/components/schemas/CreateVendorPaymentResultReply"},"type":"array"}},"type":"object"},"CreateVendorPaymentResultReply":{"description":"Vendor payment creation per-item result","properties":{"bill_id":{"type":"string"},"success":{"type":"boolean"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"CreateVendorPaymentInput":{"description":"Vendor payment creation request","properties":{"idempotency_key":{"type":"string"},"items":{"items":{"$ref":"#/components/schemas/PaymentItemInput"},"type":"array"}},"type":"object"},"PaymentItemInput":{"description":"Payment item for vendor payment creation","properties":{"bill_id":{"type":"string"},"payment_method_id":{"type":"string"},"payment_speed":{"$ref":"#/components/schemas/PaymentSpeedInput"}},"type":"object"},"PaymentSpeedInput":{"description":"Payment speed enum: standard, next_day, same_day, instant","enum":["standard","next_day","same_day","instant"],"type":"string"}}},"paths":{"/vendor-payments":{"post":{"description":"Initiate payment for one or more bills. Bills must have pay_date set (422 if null).","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVendorPaymentReply"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"422":{"description":"Unprocessable Entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Initiate vendor payment","tags":["Vendor Payments"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateVendorPaymentInput"}}},"description":"Payment items","required":true}}}}}
```

## Retry failed vendor payment

> Retry the last failed funding attempt for a bill

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["accounts_payable:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"read":"Read access","write":"Write access"}}}}},"schemas":{"RetryVendorPaymentReply":{"description":"Vendor payment retry result","properties":{"bill_id":{"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"}}},"paths":{"/vendor-payments/{bill_id}/retry":{"post":{"description":"Retry the last failed funding attempt for a bill","parameters":[{"schema":{"type":"string"},"description":"Bill ID","in":"path","name":"bill_id","required":true}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RetryVendorPaymentReply"}}}},"404":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Retry failed vendor payment","tags":["Vendor Payments"]}}}}
```

## Bulk cancel vendor payments

> Cancel multiple vendor payments in a single request

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["accounts_payable:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"read":"Read access","write":"Write access"}}}}},"schemas":{"BulkCancelVendorPaymentsReply":{"description":"Bulk vendor payment cancellation results","properties":{"results":{"items":{"$ref":"#/components/schemas/BulkCancelResultReply"},"type":"array"}},"type":"object"},"BulkCancelResultReply":{"description":"Bulk cancel per-item result","properties":{"bill_id":{"type":"string"},"error_reason":{"type":"string"},"success":{"type":"boolean"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"BulkCancelVendorPaymentsInput":{"description":"Bulk vendor payment cancellation request","properties":{"items":{"items":{"$ref":"#/components/schemas/BulkCancelItemInput"},"type":"array"}},"type":"object"},"BulkCancelItemInput":{"description":"Bulk cancel item","properties":{"bill_id":{"type":"string"},"payment_id":{"type":"string"}},"type":"object"}}},"paths":{"/vendor-payments/bulk-cancel":{"post":{"description":"Cancel multiple vendor payments in a single request","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCancelVendorPaymentsReply"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Bulk cancel vendor payments","tags":["Vendor Payments"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkCancelVendorPaymentsInput"}}},"description":"Payments to cancel","required":true}}}}}
```

## Cancel vendor payment

> Cancel a single vendor payment

```json
{"openapi":"3.1.1","info":{"title":"Alternative Payments","version":"1.2.0"},"servers":[{"url":"http://public-api.alternativepayments.io"}],"security":[{"OAuth2ClientCredentials":["accounts_payable:write"]}],"components":{"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"read":"Read access","write":"Write access"}}}}},"schemas":{"CancelVendorPaymentReply":{"description":"Vendor payment cancellation result","properties":{"payment_id":{"type":"string"},"status":{"type":"string"}},"type":"object"},"HttpError":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"validation_errors":{"additionalProperties":{"type":"string"},"type":"object"}},"type":"object"},"CancelVendorPaymentInput":{"description":"Vendor payment cancellation request","properties":{"bill_id":{"type":"string"},"payment_id":{"type":"string"}},"type":"object"}}},"paths":{"/vendor-payments/cancel":{"post":{"description":"Cancel a single vendor payment","responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelVendorPaymentReply"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HttpError"}}}}},"summary":"Cancel vendor payment","tags":["Vendor Payments"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelVendorPaymentInput"}}},"description":"Payment to cancel","required":true}}}}}
```


---

# 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.alternativepayments.io/api-reference/vendor-payments.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.
