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

# Bind payment to invoice

## Description

In most cases, buyers pay exactly the amount specified in the invoice to your crypto wallet. But there are also cases when the buyer may make a mistake and pay not exactly the amount reserved. In this case, the service will not be able to automatically bind the payment and the invoice, and mark the invoice as paid. If this happens, you, as the seller, can manually bind the payment to the invoice if you are sure exactly what payment you are expecting. This operation can be done through your personal account on the site, or through the API.

## Request

```bash
curl -X POST https://api.bitsby.app/invoices/bindPayment \
  -H "Authorization: Token MSvL2ltaDZdWVjmZURURMVWhqSJLT2NURjhL2Fla1Z1T1IxQTltKs1T3Ay" \
	-F "invoiceId=ade9550d-3dc7-4fd3-b94e-3b4c12aaaa0c" \
	-F "paymentId=a4c9e2ee-9a03-43e5-a1a1-00caf679d16a"
```

## Request parameters

<table data-full-width="true"><thead><tr><th>Parameter</th><th>Data type</th><th>Description</th><th>Example</th><th>Mandatory?</th></tr></thead><tbody><tr><td><code>invoiceId</code></td><td>UUID</td><td>Invoice ID in UUID format</td><td>ade9550d-3dc7-4fd3-b94e-3b4c12aaaa0c</td><td>yes</td></tr><tr><td><code>paymentId</code></td><td>UUID</td><td>Payment ID in UUID format</td><td>a4c9e2ee-9a03-43e5-a1a1-00caf679d16a</td><td>yes</td></tr></tbody></table>

## Example answer

```json
{
   "result":"success",
   "data":"Invoice binded to payment"
}
```


---

# 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.bitsby.app/api-documentation/bind-payment-to-invoice.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.
