POST
Create a payment for an invoice
Scope:
sales:invoices.writehttps://api.holded.com/api/v2/invoices/{invoiceId}/paymentsRecords a payment against the invoice. The payment amount is deducted from the pending balance. You can record partial payments by specifying an amount less than the total outstanding. A payment can be linked to a treasury account (`treasury_id`) for cash-flow tracking; if omitted, the account's default treasury is used. The invoice status is automatically updated to paid when the pending balance reaches zero.
Parameters
Path parameters
invoiceId
stringrequiredInvoice ID (24-char hex ObjectId)
Request body
object
amountstring | null
treasury_idstring | null
Identifier of the treasury account. If omitted, the account default treasury is used.
datestring<date>
Payment date in ISO 8601 format
descriptionstring | null
Free-text description of the payment
Request
python
import requests
url = "https://api.holded.com/api/v2/invoices/{invoiceId}/payments"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"amount": "100.00",
"treasury_id": "string",
"date": "2024-01-15",
"description": "string"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Responses
Success responses
201Payment createdError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Invoice not foundapplication/json429Rate limit exceededapplication/json