POST
Attach incoming document to a document
Scope:
inbox:inbox.writehttps://api.holded.com/api/v2/inbox/{incomingDocumentId}/attachAttaches an incoming document to an existing purchase document (purchase, purchase order, purchase refund, or receipt). Use this to link an invoice or receipt scanned through the inbox to a corresponding document in your accounting records.
Parameters
Path parameters
incomingDocumentId
stringrequiredIncoming document identifier (24-char hex ObjectId)
Request body
object
documentIdstringrequired
Document identifier
documentTypestringrequired
Document type
Enum:
purchaseorderpurchaserefundreceiptRequest
python
import requests
url = "https://api.holded.com/api/v2/inbox/507f1f77bcf86cd799439011/attach"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
payload = {
"documentId": "507f1f77bcf86cd799439011",
"documentType": "purchase"
}
response = requests.post(url, headers=headers, json=payload)
print(response.json())Responses
Success responses
204Document attached successfullyError responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Incoming document or target document not foundapplication/json422Accounting period locked, or the incoming document cannot be attached (for example, a Holded-to-Holded document without a linked contact)429Rate limit exceededapplication/json