Accounting day rates
Rate of a currency to the store currency on a date, used by the money journal for foreign-currency accounts; for revaluation and reconciliation.
Accounting day rates
Objects
ExchangeRate
currencystringrequiredRate currency — ISO 4217 or asset code (USDT): 1 unit of this currency = rate units of the store currency.
store_currencystringrequiredStore currency, ISO 4217 code.
datestringrequiredRequested accounting date, YYYY-MM-DD in the store time zone.
ratestring or nullrequiredAccounting day rate as a decimal string: 1 currency = rate of the store currency — the money journal converts transactions on an account in this currency on this date with it. null — the day rate is not fixed yet (the first foreign-currency transaction of the day fixes it) or no source quotes the pair. "1" for the store currency.
rate_datestring or nullrequiredDay the rate was fixed: for a date without its own rate the journal takes the closest previous one, for a date before the first fixing — the first one. null — no rate.
sourcestring or nullrequiredMarket rate source from the store rule: coingecko, criptoya_p2p, ar_oficial, ar_blue, ar_mep, ar_ccl, ar_mayorista, cbr. null — no source quotes the pair (the store accepts it only at a manual rate) or it is the store currency.
- Values:
coingeckocriptoya_p2par_oficialar_bluear_mepar_cclar_mayoristacbrnull
Endpoints
Get the accounting day rate of a currency on a date: the rate the money journal uses to convert transactions on foreign-currency accounts
get/exchange-rates/{currency}
Scope: finance:read
Parameters
Path
currencystringrequiredISO 4217 currency or asset code (USDT, USDC) from the set of money account currencies.
Query
datestring (date)Accounting date YYYY-MM-DD in the store time zone; today by default.
Responses
200Success
application/json
Returns ExchangeRate
401The token is missing, invalid, expired or revoked
Headers
WWW-AuthenticatestringrequiredAuthentication scheme (RFC 6750).
- Example:
Bearer
application/problem+json
Returns Problem
403The plan, the IP address or the token scopes do not allow the request
Headers
WWW-AuthenticatestringAuthentication scheme (RFC 6750).
- Example:
Bearer error="insufficient_scope", scope="locations:read"
application/problem+json
Returns ForbiddenProblem
404The object does not exist or is not available to the app
application/problem+json
Returns Problem
422A parameter is invalid or unknown
application/problem+json
Returns ValidationProblem
429The rate limit is exhausted
Headers
Retry-AfterintegerrequiredSeconds to wait before retrying.
- Minimum:
- 0
application/problem+json
Returns RateLimitProblem
503The store is temporarily unavailable
Headers
Retry-AfterintegerSeconds to wait before retrying.
- Minimum:
- 0
application/problem+json
Returns Problem
Common errors such as token, access, input validation and rate limit can come from any endpoint; they are listed in the catalog: Errors
curl "https://api.saleya.app/v1/exchange-rates/{currency}" \
-H "Authorization: Bearer $SALEYA_API_TOKEN"{
"currency": "string",
"store_currency": "string",
"date": "string",
"rate": "string",
"rate_date": "string",
"source": "coingecko"
}