API Documentation
Add Document
This API endpoint allows you to add a new document such as an invoice, estimate, or purchase order.
Endpoint
POST /api/document/add
Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| year | String | The accounting year of the document. | No |
| doc_type | String | The type of document (invoice, estimate, purchase_order). | Yes |
| customer_id | Integer | ID of the customer linked to the document. | Yes |
| due_date | String | Due date of the document. | Yes |
| payement_method | String | Payment method for the document. | No |
| doc_number | String | Number of the document. | Yes |
| doc_date | String | Date of the document (Format YYYY-MM-DD). | Yes |
| remark | String | General remark of the document. | No |
Example Request
GET /api/document/add?year=2023&doc_type=invoice&customer_id=123&due_date=2023-12-31&payement_method=Cash&doc_number=1001&doc_date=2023-06-15&remark=This%20is%20a%20remark
Response
{
"success": true,
"message": "Document added successfully",
"result": {
"guid": "your-document-guid"
}
}
Error Response
{
"success": false,
"message": "Error message detailing what went wrong"
}