Creating a Currency
Endpoint: POST /admin/currencies
Purpose
The /admin/currencies
endpoint is used to create a new currency in the system. It requires details such as the currency name, ISO code, associated country, symbol, rounding method, precision, and activation status. Upon successful creation, the response returns the newly added currency with a unique ID and associated metadata.
Path Parameters
No path parameters for this endpoint.
Query Parameters
This endpoint does not have any query parameters.
Use Case
This endpoint is useful when adding a new currency to the system for financial operations, pricing, or transaction processing. Businesses operating in multiple countries can use this to configure currency settings dynamically. The API ensures that all necessary currency attributes are stored correctly and can be retrieved later for financial transactions and reporting.
Request Body
Parameter | Type | Description |
---|---|---|
name
|
string | The full name of the currency |
code
|
string | Three-letter ISO currency code. |
country
|
string | The name of the country associated with the currency. |
countryCode
|
string | Two-letter country code. |
symbol
|
string | The symbol representing the currency. |
active
|
boolean |
Determines if the currency is active (true ) or inactive (false ).
|
rounding
|
string | Specifies the rounding rule. |
precision
|
integer |
Number of decimal places for transactions. |
{
"NAME": "CURRENCY_NAME",
"CODE": "CURRENCY_CODE",
"COUNTRY": "COUNTRY_NAME",
"COUNTRYCODE": "COUNTRY_CODE",
"SYMBOL": "CURRENCY_SYMBOL",
"ACTIVE": "IS_ACTIVE",
"ROUNDING": "ROUNDING_TYPE",
"PRECISION": "DECIMAL_PRECISION"
}
Response
The response contains a currency object that includes the newly created currency's details, such as its ID, name, code, symbol, country, and last update timestamp.
{
"CURRENCY": {
"ID": "CURRENCY_ID",
"NAME": "CURRENCY_NAME",
"CODE": "CURRENCY_CODE",
"COUNTRY": {
"ID": "COUNTRY_ID",
"NAME": "COUNTRY_NAME",
"CODE": "COUNTRY_CODE"
},
"SYMBOL": "CURRENCY_SYMBOL",
"ACTIVE": "IS_ACTIVE",
"ROUNDING": "ROUNDING_TYPE",
"PRECISION": "DECIMAL_PRECISION",
"UPDATED_AT": "LAST_UPDATED_TIMESTAMP"
}
}