Send Documents
Description
This endpoint is used to send documents to the customer on CamInvoice.
POST {BaseURL}/api/v1/document/send
Content-Type: application/json
Authorization: Bearer {access_token}
{
"documents": [
"df5dcf78-e78b-4396-87bb-2d2a44c1302e",
"33444323-e78b-4396-87bb-234232344423",
"24442432-e78b-4396-87bb-334553344533"
]
}
Method
POST
Headers
- Content-Type:
application/json
- Authorization:
Bearer {access_token}
Request Parameters
Field | Type | Description | Required |
---|---|---|---|
documents | string[] | List of CamInvoice Document IDs to be sent. | Yes |
Example Request Body
{
"documents": [
"df5dcf78-e78b-4396-87bb-2d2a44c1302e",
"33444323-e78b-4396-87bb-234232344423",
"24442432-e78b-4396-87bb-334553344533"
]
}
Response
HTTP Status 200 (OK)
{
"sent_documents": [
"df5dcf78-e78b-4396-87bb-2d2a44c1302e",
"33444323-e78b-4396-87bb-234232344423"
],
"failed_documents": [
{
"document_id": "24442432-e78b-4396-87bb-334553344533",
"message": "Document not found"
}
]
}
Response Fields
Field | Description |
---|---|
sent_documents | List of documents IDs that were successfully sent. |
failed_documents | List of documents that failed to send with error message. |
HTTP Status 422 (Unprocessable Entity)
This response occurs when the provided data is missing or invalid.
Notes
- The response will include separate lists for successfully sent documents (sent_documents) and those that failed (failed_documents) with detailed error messages.
- If a document fails to be sent (e.g., due to invalid or missing document ID), it will appear in the failed_documents list, but the rest of the documents in the request will still be processed.
- Ensure all document IDs exist and are valid within the CamInvoice system before making the request to avoid unnecessary failures.
- This endpoint is synchronous; the response immediately indicates the result of the operation for each document.