Stamping Service Balance Consultation API

Sovos Mexico has a REST API to consult your balance in the Stamping webservice.

Content

What do I need?

  • Have the Stamping service enabled in your Sovos Mexico account.
  • To generate an API key on your Sovos account, this is an identifier that authenticates the user on the platform web services. To generate an API key, please review this article: Generating an API Key for web services (Spanish only).

Balance Stamping Service Consultation API

You need to send to the REST API the following URL:

Environment URL
UAT https://oat.reachcore.com/api/rest/Timbre/saldos
Production https://go.reachcore.com/api/rest/Timbre/saldos


All requests must be done through a safe communication channel https. The connections performed through http will be rejected.

HTTP: POST

HTTP Header

Parameter Value Usage Description
RCApiKey API Key Required Service authentication through an API Key generated on the Sovos Mexico platform.
Content-Type application/json Required The REST API only processes JSON structures.

Body

You can only use a JSON structure in the body of the request

Atribute Use Description
MesConsulta Required Establishes the month and year of consultation to generate the balance account. Date format yyyy-mm.
RFCConsulta Optional RFC you want to use to consult the balance. If you don't specify this parameter, you will obtain the information of every RFC registered in your account.

Request for Consultation of all RFCs Balance example

{
  "MesConsulta" : "2019-01"
}

Request for Consultation of an specific RFC Balance example

{ 
  "MesConsulta" : "2019-12",
  "RFCConsulta" : "A&D061009TY8" 
}

Response Codes

As a response to the REST service, you will get a code indicating the result of the request. All the responses will be in JSON format (application/json).

HTTP Code Error code Meaning Description
200 - OK The consultation was performed correctly.
400 400-001 Bad Request MesConsulta format is not valid.
400 400-002 Bad Request The given RFC does not belong to the registered RFCs in the account of the API KEY.
401 - Unauthorized The API Key is not valid.
404 - Not found The URL does not exist.
500 - Internal Server Error Sovos platform error.


Example of the Response from Balance Consultation of the RFCs in the account

{
  "TipoConsumo" : "Postpago",
  "FechaActual" : "2019-11-19T13:53:41"
  "Registrados" : 0,
  "Autorizados" : 0,
  "GeneraronTimbre" : 0,
  "Transacciones" : 2,
  "Detalle" : [
    {
      "RFC" : "A&D061009TY8",
      "Fecha" : "2019-11-02T00:00:00",
      "TipoMovimiento" : "Consumo de timbre",
      "Monto" : 1
    },
    {
      "RFC" : "AAA010101AAA",
      "Fecha" : "2019-11-03T00:00:00",
      "TipoMovimiento" : "Consumo de timbre",
      "Monto" : 1
    }
  ]
}

Example of the Response from Balance Consultation for an specific RFC

{
  "TipoConsumo" : "Postpago",
  "FechaActual" : "2019-11-19T13:55:49"
  "Registrados" : 0,
  "Autorizados" : 0,
  "GeneraronTimbre" : 0,
  "Transacciones" : 1,
  "Detalle" : [
    {
      "RFC" : "A&D061009TY8",
      "Fecha" : "2019-11-02T00:00:00",
      "TipoMovimiento" : "Consumo de timbre",
      "Monto" : 1
    }
  ]
}

Response indicating an error in the request Example

{
  "errors": [
    {
      "Code": "400-001",
      "Message": "'MesConsulta' se encuentra en un formato inválido."
    }
  ]
}


Where:

Atribute Description
TipoConsumo Type of consumption of the account: Prepago (prepaid), o Postpago (postpaid).
FechaActual Timestamp in format yyyy-mm-ddThh:MM:ss.
Registrados Number of registered RFCs in the API KEY account.
Autorizados Number of authorized RFCs for stamping in the Sovos platform.
GeneraronTimbre Number of RFCs that generated at least one successful UUID.
Transacciones Total quantity of all stamping of the authorized RFCs generated in a successful way.
Detalle Detail of the requests in the specified period for an specific RFC. It has the following elements:
  • RFC: consulted RFC.
  • Fecha: the date you performed a transaction in the account.
  • TipoMovimiento: the type of movement registered in the account.
  • Monto: quantity of procedures of TipoMovimiento in the consulted period for the RFC.

Consume Report Downloading in PDF or CSV

You can consult the consumption report in PDF or CSV format (which can be interpreted by Excel) with this resource. The links to download those reports are:

For PDF format:

Environment URL
UAT https://oat.reachcore.com/api/rest/Timbre/saldos/pdf
Production https://go.reachcore.com/api/rest/Timbre/saldos/pdf


All requests must be done through a safe communication channel (https). The connections performed through http will be rejected.

For CSV format:

Environment URL
UAT https://oat.reachcore.com/api/rest/Timbre/saldos/csv
Production https://go.reachcore.com/api/rest/Timbre/saldos/csv


All requests must be done through a safe communication channel (https). The connections performed through http will be rejected.

In both URLs you must have the following parameters:

HTTP: POST

HTTP Header

Parameter Value Use Description
RCApiKey API Key Required Service authentication through an API Key generated on the Sovos Mexico platform
Content-Type application/json Required The REST API only processes JSON structures.

Body

You can only use a JSON structure in the body of the request

Atribute Uso Description
MesConsulta Required Establishes the month and year of consultation to generate the balance report. Date format yyyy-mm.

Report Consultation Request example

{
  "MesConsulta" : "2019-10"
}

Response codes

As a response from the REST service, you will get a code indicating the result of the request. All the responses will be in JSON format (application/json).

HTTP Code Error core Meaning Description
200 - OK The consultation was performed correctly.
400 400-001 Bad Request MesConsulta format is not valid.
400 400-002 Bad Request It is not necessary to send the RFCCOnsulta.
400 400-003 Bad Request The format (formatoSolicitado) is not supported.
401 - Unauthorized API Key is not valid.
404 - Not found The URL does not exist.
500 - Internal Server Error Sovos platform error.


Example of a download report response (CSV or PDF)

If you can generate a file with the report, the HTTP code will be 200 and it will have an attachment with the requested report. For a CSV report the content of the attachment will be as follows:


Cuenta,TipoConsumo,FechaInicioConsulta,FechaFinConsulta,FechaActual
Pruebas,Postpago,2019-10-01T00:00:00,2019-10-31T00:00:00,2019-11-20T16:57:53

Estado de los RFC
Registrados,0
Autorizados,1
Generaron Timbre,1

Transacciones
Consumo de todos los RFC:,3

RFC,Fecha,Tipo movimiento,Monto
AAA010101AAA ,10/17/2019 12:00:00 AM,Consumo de timbre,3

Example of a response indicating an error in the request

{
  "errors": [
    {
      "Code": "400-002",
      "Message": "No es necesario mandar el 'RFCConsulta'"
    }
  ]
}


For more information or any doubt related to this guide, please send an email to MEX-soporte@sovos.com


Regresar