Obtain Exchange Rate

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:

ValueDescription
159UDIS
160CCP
161CCP-UDIS
162CPP
163CPP-DOLARES
165TIIE 28 DIAS
166TIIE 91 DIAS
167TIIC DEPOSITOS 60 DIAS
168TIIC DEPOSITOS 90 DIAS
169TIIC DEPOSITOS 180 DIAS
170TIIC PAGARES 28 DIAS
171TIIC PAGARES 91 DIAS
172TIIC PAGARES 182 DIAS
174TIIE 182 DIAS
175TIIE DE FONDEO
176TIIE 90 DIAS
177TIIE 29 DIAS
178TIIE 27 DIAS
179TIIE 26 DIAS
180TIIE 181 DIAS
181TIIE 92 DIAS
182TIIE 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:

NumIdNameDescription
1663567bb713cf2110a1106b8No encontrado por fechaIndicates that no information was found for the date provided
2663567bb713cf2110a1106baNo encontrado por indicadorIndicates that no information was found for the given indicator
3663567bb713cf2110a1106b6Respuesta exitosa por díaIndicates that the CURP entered is not valid
4663567bb713cf2110a1106b7Respuesta exitosa por fechaIndicates one successful response for the date provided
5663567bb713cf2110a1106b9Respuesta exitosa por indicadorIndicates one successful response for the given indicator
6663567bb713cf2110a1106bbServicio no disponibleIndicates 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"
}
Language
Authorization
Header
Click Try It! to start a request and see the response here!