A3ERP API
English
English
  • Quick Start
    • Initial configuration
    • Installation
  • Versions
  • Documentation
    • API Reference
      • Api
      • Validation
      • Email
      • Master
        • Parameters
      • Document
        • Parameters
      • Various
      • Stock movements
      • Stock Reserves
      • Expeditions
      • Links
      • Stock
      • Portfolio
      • Prices
      • Stored Procedures
      • View
      • Listing
      • FastReport
      • Download Files
      • List Linked Folders
Con tecnología de GitBook
En esta página

¿Te fue útil?

  1. Documentation
  2. API Reference

Document

Access to data from all a3ERP documents (purchases, sales and stocks).

AnteriorParametersSiguienteParameters

Última actualización hace 2 años

¿Te fue útil?

Parameters

You can consult all types of documents in the link below.

GET calls

Filtering

In the following link you can consult how to filter this call.

POST calls

Body of PDF document sending by email

Send a sales invoice by email

https://servidor:5555/api/documento/FV/email/5767

{
    "para": "rperez@jnc.es",
    "cc": "charyperez1@gmail.com",
    "cco": "fsaez@jnc.es",
    "titulo": "Envio con documento adjunto",
    "asunto": "Envio documento",
    "texto": "Adjunto envío su documento en pdf",
    "cuerpo": "<HTML><HEAD></HEAD><BODY lang=ES> Estimado cliente,<p> Adjunto archivo con documento en formato pdf.<p> La mercanc&#237;a, antes de su salida, ha sido fotografiada. <p> Un saludo,<p> <b> Rosario Pérez<p> rpérez@jnc.es<p> JNC Sistemas Inform&#225;ticos<p> </b></font> </BODY></HTML>"
}
Document Serving Body

Serve a delivery note

https://servidor:5555/api/documento/AV/servirafactura/55

{
 "fecha": "21/04/2022",
 "codigo": " 1",
 "tipo": "C",
 "lineas":
        [
          {
           "tipo": "O",
           "iddocumento": "166",
           "numlin": "3", 
           "unidades": "3",
           "lote": "L145"
          },
          {
           "tipo": "O",
           "iddocumento": "164",
           "numlin": "4",
           "unidades": "10",
           "feccaduc": "22/04/2022",
           "numserie": "14528798"
          },
          {
           "tipo": "O",
           "iddocumento": "165",
           "numlin": "4",
           "unidades": "2",
           "ubicacion": "A2P3L8"
          }
        ]
}
Body of Link files to a document

Link a contract to an invoice

https://servidor:5555/api/documento/FV/vincular/89

{
    "nombre": "contrato.pdf",
    "documento": "Contrato de compra venta"
}
New document registration body

Registration of a transfer

https://servidor:5555/api/documento/TR

[
{
  "codalment": "       2",
  "codalmsal": "       1",
  "fecha": "15/07/2022",
  "motivo": "Alta de traspaso 1",
  "lineas": [
    {
      "codalment": "       2",
      "codalmsal": "       1",
      "codart": "RF",
      "unidades": 2,
      "detalle": [
        {
          "unidades": "1",
          "feccaduc": "30/12/1899",
          "ubicacionsal": "P1E1A2",
          "ubicacionent": "T4",
          "numserie": "RMNU73HKNV"
        },
        {
          "unidades": "1",
          "feccaduc": "30/12/1899",
          "ubicacionsal": "P1E1A2",
          "ubicacioneent": "T4",
          "numserie": "3332KBG5GH"
        }
      ]
    },
    {
      "codalment": "       2",
      "codalmsal": "       1",
      "codart": "LR",
      "unidades": 4,
      "detalle": [
        {
          "unidades": "4",
          "feccaduc": "30/12/1899",
          "ubicacionsal": "P1E1A1",
          "ubicacionent": "T4"
        }
      ]
    },
    {
      "codalment": "       2",
      "codalmsal": "       1",
      "codart": "              1",
      "unidades": 1,
      "detalle": [
        {
          "unidades": "1",
          "feccaduc": "30/12/1899",
          "ubicacionsal": "P1E2A2",
          "ubicacionent": "T4",
          "numserie": "R8E5J4T8MC"
        }
      ]
    }
  ]
}
]

PUT calls

Body of Modify a document

Modify an order

https://servidor:5555/api/documento/PV/65

[
    {
    "fecha": "01/09/2021",
     "codcli": "12",
     "serie": "2022",
     "codalm": " 1",
     "fecentrega": "02/09/2021",
     "lineas":[
            { "numlinped": "1",
              "codart": "3",
              "unidades": "4",
              "prcmoneda": "33",
              "desc1": "10"
            },
            { "numlinped": "2",
              "codart": "4C",
              "unidades": "5",
              "prcmoneda": "24",
              "desc1": "15"
            }
            ]
    }
]

DELETE calls

Parameters

Retrieve all document data

get

It returns all the data of the indicated document (see parameters to see the available documents).

Example:

https://server:5555/api/documento/PV

Parámetros de ruta
tipostringRequerido

The type of document

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Respuestas
200
Returns an Array Objects with all the data of the document
get
GET /api/documento/{tipo} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
200

Returns an Array Objects with all the data of the document

Sin contenido

PDF printing

get

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:

https://server:5555/api/documento/PV/impresion/50

Parámetros de ruta
tipostringRequerido

The type of document

idstringRequerido

The document identifier

modelostringRequerido

The model of the document

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Respuestas
200
Return an Array Object with the base64 document
application/json
get
GET /api/documento/{tipo}/impresion/{id}/modelo/{modelo} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
200

Return an Array Object with the base64 document

[
  {
    "documento": "Base64 code"
  }
]

Cancellation of document

get

A document can be completely overridden or one of its lines can be overridden.

Example:

https://server:5555/api/documento/PV/anular/50/linea/13

Parámetros de ruta
tipostringRequerido

The type of document

idstringRequerido

The identifier of the document to be cancelled

numlinstringRequerido

The line of the document to be cancelled

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Respuestas
200
The document has been successfully reversed
get
GET /api/documento/{tipo}/anular/{id}/linea/{numlin} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
200

The document has been successfully reversed

Sin contenido

Document headers

get

Adding to the /{id} path allows you to choose a specific document header and not the list of all document headers.

Example:

https://server:5555/api/cabeceradocumento/PV/50

Parámetros de ruta
tipostringRequerido

The type of document

idstringRequerido

The identifier of the document to be cancelled

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Respuestas
200
Returns the header of a particular document.
get
GET /api/cabeceradocumento/{tipo}/{id} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
200

Returns the header of a particular document.

Sin contenido

Deleting a document

delete

Example:

https://server:5555/api/documento/PV/50

Parámetros de ruta
tipostringRequerido

The type of document

idstringRequerido

The identifier of the document you want to modify

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Respuestas
200
Successful document deletion
delete
DELETE /api/documento/{tipo}/{id} HTTP/1.1
Host: server:<port>
Authorization: text
Accept: */*
200

Successful document deletion

Sin contenido

  • Parameters
  • GET calls
  • GETRetrieve all document data
  • GETPDF printing
  • GETCancellation of document
  • GETDocument headers
  • POST calls
  • POSTSend document by email in PDF
  • POSTServing documents
  • POSTLinking files to a document
  • POSTRegistration of a new document
  • PUT calls
  • PUTModify a document
  • DELETE calls
  • DELETEDeleting a document

Send document by email in PDF

post

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.

Parámetros de ruta
tipostringRequerido

The type of document

idstringRequerido

The document identifier

modelostringRequerido

The model of the document

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Cuerpo
Respuestas
200
Mail sent successfully
post
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"
  }
}
200

Mail sent successfully

Sin contenido

Serving documents

post

It can be served to order, delivery note or invoice and also lines to order or delivery note.

Parámetros de ruta
tipostringRequerido

The type of document

servirstringRequerido

servirapedido, serviraalbaran, servirafactura, servirlineasapedido, servirlineasaalbaran

idstringRequerido

The document to be served, if they are lines, do not enter it

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Cuerpo
Respuestas
200
Document served
post
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"
      }
    ]
  }
}
200

Document served

Sin contenido

Linking files to a document

post

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.

Parámetros de ruta
tipostringRequerido

The type of document

idstringRequerido

The identifier of the document you want to link a file to

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Cuerpo
Respuestas
200
Correctly linked {Type of document}
post
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"
  }
}
200

Correctly linked {Type of document}

Sin contenido

Registration of a new document

post

We can create a new document by adding a JSON with all the parameters of the selected document type.

Parámetros de ruta
tipostringRequerido

The type of document

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Cuerpo
Respuestas
200
The {document type} has been created
application/json
post
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"
          }
        ]
      }
    ]
  }
}
200

The {document type} has been created

{
  "nombre codigo documento": "document code"
}

Modify a document

put

We can modify a document by adding a JSON with the corresponding parameters, there are no parameters required.

Parámetros de ruta
tipostringRequerido

The type of document

idstringRequerido

The identifier of the document you want to modify

Parámetros de encabezado
AuthorizationstringRequerido

Bearer + JWT_token

Cuerpo
Respuestas
200
The {document} has been updated
application/json
put
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"
      }
    ]
  }
}
200

The {document} has been updated

{
  "nombre codigo de documento": "Document code"
}