Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JReyna217/AutoLog/llms.txt

Use this file to discover all available pages before exploring further.

The External Rates API is a thin proxy that reaches out to Mexico’s SIDOF/SEGOB service — the digital platform of the Diario Oficial de la Federación — and returns the official USD/MXN exchange rate published for a given date. The frontend uses this endpoint to pre-fill the exchange rate field when a user is creating or editing a fuel log, removing the need to look up the rate manually. A valid Authorization: Bearer token is required.
The DOF publishes official exchange rates on business days only. Rates are not published on weekends or public holidays in Mexico. Querying one of those dates returns 204 No Content — the frontend should detect this and prompt the user to enter the rate manually or select the nearest available business day.

GET /api/externalrates/dof/

GET /api/externalrates/dof/{date} Queries the SIDOF/SEGOB external service for the official USD-to-MXN exchange rate on the specified date. Returns the rate if one was published, or 204 No Content if the DOF did not publish a rate for that day (weekends, public holidays, or dates before the service’s data window).
This endpoint makes a live HTTP call to the SEGOB/DOF external API. Response times may be higher than internal endpoints and are subject to the availability of the upstream service. AutoLog does not cache external rate responses.

Auth

Authorization: Bearer <accessToken> — required.

Path parameters

date
string (DateTime, YYYY-MM-DD)
required
The date for which to retrieve the official exchange rate, formatted as YYYY-MM-DD. Example: 2024-06-14.

Response fields

When a rate is available (200 OK):
rateValue
number (decimal)
The official USD-to-MXN exchange rate published by the DOF for the requested date. Example: 17.3512.
When no rate is available for the date, the response is 204 No Content with an empty body.

Response codes

CodeMeaning
200 OKDOF published a rate for the requested date. rateValue is returned in the body.
204 No ContentThe DOF has no rate for this date (weekend, public holiday, or out-of-range date).
401 UnauthorizedMissing or invalid Bearer token.

Example — business day (rate available)

curl -X GET https://api.autolog.app/api/externalrates/dof/2024-06-14 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
{
  "rateValue": 17.3512
}

Example — weekend (no rate published)

curl -X GET https://api.autolog.app/api/externalrates/dof/2024-06-15 \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
HTTP/1.1 204 No Content
When you receive a 204, consider calling the endpoint for the preceding Friday or using the most recent exchange rate stored in GET /api/exchangerates as a fallback. The user should always be given the opportunity to confirm or override the rate before saving a fill-up.

Build docs developers (and LLMs) love