POST
Create a payment for a purchase
Scope:
accounting:purchases.writehttps://api.holded.com/api/v2/purchases/{purchaseId}/paymentsRecords a payment against the purchase invoice. The payment amount is deducted from the pending balance. You can record partial payments by specifying an amount less than the total outstanding. The purchase status is automatically updated to paid when the pending balance reaches zero.
Parameters
Path parameters
purchaseId
stringrequiredPurchase ID (24-char hex ObjectId)
Request body
object
amountstringrequired
Payment amount
treasury_idstring | nulloptional
Identifier of the treasury account. If omitted, the account default treasury is used.
datestring<date>optional
Payment date in ISO 8601 format
descriptionstring | nulloptional
Free-text description of the payment
Request
python
import requests
url = "https://api.holded.com/api/v2/purchases/{purchaseId}/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
Response
json
{
"id": "507f1f77bcf86cd799439011"
}Success responses
201Payment createdapplication/jsonobject
idstring
Error responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Purchase not foundapplication/json429Rate limit exceededapplication/json