Document
Access to data from all a3ERP documents (purchases, sales and stocks).
Última actualización
¿Te fue útil?
Access to data from all a3ERP documents (purchases, sales and stocks).
Última actualización
¿Te fue útil?
You can consult all types of documents in the link below.
Filtering
In the following link you can consult how to filter this call.
It returns all the data of the indicated document (see parameters to see the available documents).
Example:
The type of document
Bearer + JWT_token
GET /api/documento/{tipo} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Returns an Array Objects with all the data of the document
Sin contenido
You can request the printing of a PDF document by means of this call, the model is not obligatory but if you do not indicate it, it will take the client's or supplier's model by default.
Example:
The type of document
The document identifier
The model of the document
Bearer + JWT_token
GET /api/documento/{tipo}/impresion/{id}/modelo/{modelo} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Return an Array Object with the base64 document
[
{
"documento": "Base64 code"
}
]
A document can be completely overridden or one of its lines can be overridden.
Example:
The type of document
The identifier of the document to be cancelled
The line of the document to be cancelled
Bearer + JWT_token
GET /api/documento/{tipo}/anular/{id}/linea/{numlin} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
The document has been successfully reversed
Sin contenido
Adding to the /{id} path allows you to choose a specific document header and not the list of all document headers.
Example:
The type of document
The identifier of the document to be cancelled
Bearer + JWT_token
GET /api/cabeceradocumento/{tipo}/{id} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Returns the header of a particular document.
Sin contenido
The type of document
The identifier of the document you want to modify
Bearer + JWT_token
DELETE /api/documento/{tipo}/{id} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
Successful document deletion
Sin contenido
You can send a document to an email with the data provided in a JSON, the model is not obligatory but if you do not indicate it, it will take by default the client's or the supplier's model.
The type of document
The document identifier
The model of the document
Bearer + JWT_token
POST /api/documento/{tipo}/email/{id}/modelo/{modelo} HTTP/1.1
Host: server:<port>
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 113
{
"json": {
"para": "text",
"cc": "text",
"ccoo": "text",
"titulo": "text",
"asunto": "text",
"texto": "text",
"cuerpo": "text"
}
}
Mail sent successfully
Sin contenido
It can be served to order, delivery note or invoice and also lines to order or delivery note.
The type of document
servirapedido, serviraalbaran, servirafactura, servirlineasapedido, servirlineasaalbaran
The document to be served, if they are lines, do not enter it
Bearer + JWT_token
POST /api/documento/{tipo}/{servir}/{id} HTTP/1.1
Host: server:<port>
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 151
{
"json": {
"fecha": "text",
"codigo": "text",
"tipo": "text",
"lineas": [
{
"tipo": "text",
"iddocumento": "text",
"numlin": "text",
"unidades": "text",
"lote": "text"
}
]
}
}
Document served
Sin contenido
We can link a file passed to us in a JSON to a buy or sell document. The file will be saved in the link folder specified in the config.ini with the name and extension we pass in the name field, which will determine the file type.
The type of document
The identifier of the document you want to link a file to
Bearer + JWT_token
POST /api/documento/{tipo}/vincular/{id} HTTP/1.1
Host: server:<port>
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 45
{
"json": {
"nombre": "text",
"documento": "text"
}
}
Correctly linked {Type of document}
Sin contenido
We can create a new document by adding a JSON with all the parameters of the selected document type.
The type of document
Bearer + JWT_token
POST /api/documento/{tipo} HTTP/1.1
Host: server:<port>
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 343
{
"json": {
"codalment": "text",
"codalmsal": "text",
"fecha": "text",
"motivo": "text",
"ico_codcli": "text",
"ico_centro_coste": "text",
"ico_envuelo": "text",
"lineas": [
{
"codalment": "text",
"codalmsal": "text",
"codart": "text",
"unidades": "text",
"detalle": [
{
"unidades": "text",
"feccaduc": "text",
"ubicacionSal": "text",
"ubicacionent": "text",
"numserie": "text"
}
]
}
]
}
}
The {document type} has been created
{
"nombre codigo documento": "document code"
}
We can modify a document by adding a JSON with the corresponding parameters, there are no parameters required.
The type of document
The identifier of the document you want to modify
Bearer + JWT_token
PUT /api/documento/{tipo}/{id} HTTP/1.1
Host: server:<port>
Authorization: text
Content-Type: application/json
Accept: */*
Content-Length: 192
{
"json": {
"fecha": "text",
"codcli": "text",
"serie": "text",
"codalm": "text",
"fecentrega": "text",
"lineas": [
{
"numlinped": "text",
"codart": "text",
"unidades": "text",
"prcmoneda": "text",
"desc1": "text"
}
]
}
}
The {document} has been updated
{
"nombre codigo de documento": "Document code"
}