Developer Center

Currencies API

Last Updated: Feb 20, 2017 04:30PM CET

URL

/api/currencies
/api/currencies/{currencyCode}
/api/currencies/{currencyCode}/rates

Description

Retrieve the currencies information which the organization is using for its accounts. Can retrieve a list of currencies or a specific one by code.

Methods

GET Currencies

Retrieves currencies used by the organization.

Usage examples

//get the organization currency
GET /api/currencies

//get all the currencies(organization currency and foreign currencies
GET /api/currencies?includeForeign=true

//get single currency
GET /api/currencies/USD

Samples responses:

//sample response of a US Dollar currency
[
	{
		"code":"USD",
		"name":"United States dollar",
		"symbol":"$",
		"digitsAfterDecimal":2,
		"currencySymbolPosition":"BEFORE_NUMBER",
		"isBaseCurrency":true,
		"creationDate":"2014-07-04T13:08:04+0000",
		"lastModifiedDate":"2014-07-04T13:08:04+0000"
	}
]
//sample response for all currencies retrieval
[
   {
      "code":"USD",
      "name":"United States dollar",
      "symbol":"$",
      "digitsAfterDecimal":2,
      "currencySymbolPosition":"BEFORE_NUMBER",
      "isBaseCurrency":true,
      "creationDate":"2016-05-24T16:51:12+0000",
      "lastModifiedDate":"2016-05-24T16:51:12+0000"
   },
   {
      "code":"RON",
      "name":"Romanian new leu",
      "symbol":"lei",
      "digitsAfterDecimal":2,
      "currencySymbolPosition":"BEFORE_NUMBER",
      "isBaseCurrency":false,
      "creationDate":"2016-05-24T14:20:41+0000",
      "lastModifiedDate":"2016-05-24T14:20:41+0000"
   }
]

GET Currency Exchange Rates

Retrieves currency's exchange rates. If both from and to parameters are specified, it returns the list of exchange rates that start in/after from date or before(exclusive) to date.
from From (start) date to retrieve the exchange rates.Optional
to To (end) date to retrieve the exchange rates.Optional
offset The start index of the returned exchange rates list.Optional
limit The number of elements to be returned.Optional

Usage examples

//get all exchange rates for currency
GET /api/currencies/EUR/rates

//get first 2 exchange rates for currency
GET /api/currencies/EUR/rates?offset=0&limit=2

//get first 2 exchange rates for currency from 2016-05-14 to 2016-05-16
GET /api/currencies/EUR/rates?from=2016-05-14&to=2016-05-16&offset=0&limit=2

Samples responses:

//sample response of a US Dollar currency
[
	{
		"encodedKey":"8a33ae49441c4fe101441c71581203a6",
		"userKey":"8a33ae49441c4fe101441c5fe42f0005",
		"fromCurrencyCode":"RON",
		"toCurrencyCode":"USD",
		"buyRate":"3.41231232",
		"sellRate":"3.4256546",
		"startDate":"2016-05-14T00:01:00+0000"
	}
]

POST Currency Exchange Rates

Stores a new exchange rate for a given currency.
sellRate The amount the currency will be sold to base currency. Mandatory.
buyRate The amount the currency will be bought from base currency. Mandatory.
startDate The date when the exchange rate will be valid from. Must not be in future or before the latest exchange rate(for that currency) start date. If not provided the organization current date and time will be used.

Usage examples

//post new currency exchange rate with given start date
POST	{
	"buyRate":"3.41231232",
	"sellRate":"3.4256546",
	"startDate":"2016-05-14T00:01:00+0000"
} /api/currency/EUR/rates

//post new currency exchange rate
POST	{
	"buyRate":"3.41231232",
	"sellRate":"3.4256546"
} /api/currency/EUR/rates

Samples responses:


//sample response of a US Dollar currency
[
	{
		"encodedKey":"8a33ae49441c4fe101441c71581203a6",
		"userKey":"8a33ae49441c4fe101441c5fe42f0005",
		"fromCurrencyCode":"USD",
		"toCurrencyCode":"EUR",
		"buyRate":"3.41231232",
		"sellRate":"3.4256546",
		"startDate":"2016-05-14T00:01:00+0000"
	}
]
support@mambu.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete