Service to obtain the exchange Rate
Intro
This API allows you to directly obtain the exchange rate from the Diario Oficial de la Federación (DOF) system.
Important points
Required parameters
The field type is required to determine which fields are required. The field can have the following possible values:
- daily, to obtain the exchange rate of the day the operation is executed
- date, to obtain the exchange rate from a specific date
- indicator, to obtain the exchange rate of a specific indicator in a period of time
Daily
This query does not require any other parameters to be applied.
{
"type":"daily"
}
Date
For this type of query, it is required to add the startDate field to the request. The format must be YYYY-MM-DD.
{
"type":"date",
"startDate":"2023-04-27"
}
Indicator
For this type of query, the following parameters are required:
- startDate, the format must be YYYY-MM-DD.
- endField, the format must be YYYY-MM-DD.
- indicator, the indicator to consult.
{
"type":"indicator",
"startDate": "2023-04-27",
"endDate": "2023-04-27",
"indicator": "158"
}
The next elements are the possible indicators:
Value | Description |
---|---|
159 | UDIS |
160 | CCP |
161 | CCP-UDIS |
162 | CPP |
163 | CPP-DOLARES |
165 | TIIE 28 DIAS |
166 | TIIE 91 DIAS |
167 | TIIC DEPOSITOS 60 DIAS |
168 | TIIC DEPOSITOS 90 DIAS |
169 | TIIC DEPOSITOS 180 DIAS |
170 | TIIC PAGARES 28 DIAS |
171 | TIIC PAGARES 91 DIAS |
172 | TIIC PAGARES 182 DIAS |
174 | TIIE 182 DIAS |
175 | TIIE DE FONDEO |
176 | TIIE 90 DIAS |
177 | TIIE 29 DIAS |
178 | TIIE 27 DIAS |
179 | TIIE 26 DIAS |
180 | TIIE 181 DIAS |
181 | TIIE 92 DIAS |
182 | TIIE 89 DIAS |
Successful response
To learn about the fields of a successful response, refer to the different examples in the response section.
Test the service (test cases)
We have included a query parameter in Sandbox to enable you to query the test cases that we created for running tests. To get a response, fill the testCaseId parameter with any of the following cases:
Num | Id | Name | Description |
---|---|---|---|
1 | 663567bb713cf2110a1106b8 | No encontrado por fecha | Indicates that no information was found for the date provided |
2 | 663567bb713cf2110a1106ba | No encontrado por indicador | Indicates that no information was found for the given indicator |
3 | 663567bb713cf2110a1106b6 | Respuesta exitosa por día | Indicates that the CURP entered is not valid |
4 | 663567bb713cf2110a1106b7 | Respuesta exitosa por fecha | Indicates one successful response for the date provided |
5 | 663567bb713cf2110a1106b9 | Respuesta exitosa por indicador | Indicates one successful response for the given indicator |
6 | 663567bb713cf2110a1106bb | Servicio no disponible | Indicates that the service is not available |
Test your own test case
In case you want to test your own test case created in link, you can send in the testCaseId parameter the identifier of the test case you want to use.
For more information visit our knowledge center to know more about test cases
Possible Errors
Type required
You will receive a 400 bad request if the type field is not provided to the request.
{
"type": "Invalid type, valid options are: daily, date, indicator"
}
Required fields
You will get a 400 bad request error when any of the parameters are not provided in the body request.
{
"endDate": "missing field",
"indicator": "missing field",
"startDate": "missing field"
}
Invalid format
You will get a 400 bad request error when any of the parameters do not conform the specific length or format
{
"startDate": "Invalid format, expected format is: yyyy-MM-dd"
}
Test case not found
If a test case parameter is not sent or a value other than those mentioned above is sent, the service will return the following error 400 bad request
{
"testCase": "EMPTY_ERROR; test case not found"
}