Appearance
Invoice Types
Overview
The Invoice Types API enables the creation, retrieval, updating, and deletion of invoice types records. This documentation provides detailed information on the endpoints, request and response formats, and field descriptions.
Create
Endpoint: /api/message/e_inv_types/{ Company }
This API will create a new Invoice type.
- Method: POST
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body:
json
{
"data_set": "<Data-set>", //string
"src_doc_type":"<Source-Document-Type>" //string
}Fields Details:
| Field Name | Description | Data Type | Length |
|---|---|---|---|
| data_set | Data Set | String | 10 |
| src_doc_type | Source Document Types | String | 3 |
Response Body: (Status: 200)
json
{
"data_set": "<Data-set>",
"src_doc_type":"<Source-Document-Type>"
}Fields Details:
| Field | Description | Datatype | Example |
|---|---|---|---|
| data_set | Data Set | String | "Dataset1" |
| src_doc_type | Source Document Types | String | "007" |
Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When invalid or wrong E-invoice code is passed:
json
{
"message": "Reference Error: E-Invoice Types ."
}Response Body: (Status: 400 - Bad Request)
When invalid or wrong Data set is passed:
json
{
"message": "Reference Error"
}Response Body: (Status: 400 - Bad Request)
When both the Data set and Source document type is already present in the database:
json
{
"message": "Record already exists!"
}Response Body: (Status: 500 - Internal Server Error)
When the mandatory are passed as an empty field:
json
{
"message": "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'|Validation 'isNotEmpty' failed for field 'src_doc_type'"
}Update
Endpoint:
Endpoint: /api/message/e_inv_types/{ Company }
This API will update a Invoice type.
- Method: PUT
- Content-Type: application/json
- Authentication: Bearer
<token>
Request Body
json
{
"data_set": "<Data-set>", //string
"src_doc_type":"<Source-Document-Type>" //string
}Response Body: (Status: 200)
json
{
"data_set": "<Data-set>",
"src_doc_type":"<Source-Document-Type>"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 400 - Bad Request)
When invalid or wrong E-invoice code is passed:
json
{
"message": "Reference Error: E-Invoice Types ."
}Response Body: (Status: 400 - Bad Request)
When you are trying to update both the Data Set and Source document type field:
json
{
"message": "Record not found!"
}Response Body: (Status: 500 - Internal Server Error)
When the mandatory are passed as an empty field:
json
{
"message": "Validation Errors|Validation 'isNotEmpty' failed for field 'data_set'|Validation 'isNotEmpty' failed for field 'src_doc_type'"
}Delete
Endpoint: /api/message/e_inv_types/{ Company }/{ record_id }
This API will delete a Invoice type.
- Method: DELETE
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
{
"Message": "Message Deleted Sucessfully!"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Response Body: (Status: 500 - Internal Server Error)
When invalid or wrong Invoice type id is paased:
json
{
"Message": "Unable to Delete Record - Invalid Data Type"
}Get
Endpoint: /api/message/e_inv_types/{ Company }/{ record_id }
This API will get a Invoice type.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
{
"data_set": "<Data-set>",
"einv_code": "<E-Invoice-Code>",
"einv_dsca": "<E-Invoice-Description>",
"src_doc_type": "<Source-Document-Type>",
}Response Body: (Status: 200)
When invalid or wrong Invoice type id is paased:
json
{
"message": "null"
}Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}Get All
Endpoint: /api/messages/e_inv_types/{ Company }/{ PageSize }/{ PageNumber }
This API will get all Invoice types.
- Method: GET
- Authentication: Bearer
<token>
Response Body: (Status: 200)
json
[
{
"data_set": "<Data-set>",
"einv_code": "<E-Invoice-Code>",
"einv_dsca": "<E-Invoice-Description>",
"src_doc_type": "<Source-Document-Type>",
}
.
.
.
]Response Body: (Status: 401 - Unauthorized)
When there is no token or invalid token passed:
json
{
"message": "Unauthorized!"
}