Create Currency

View as Markdown
Creates a currency. Requires role `4`. Required body fields: `code`, `symbol`, `exchangeRates[].code`, `exchangeRates[].value`. Optional: `base`, `active`, `paymentDescription`, `taxTitle`, `taxPercentage`, `onlinePaymentMethod`, `paymentMethods[]`. Valid payment method names: `paystack`, `Paypal`, `authorize.net`. Response fields: created currency document. Possible errors: - 401: Unauthorized - authenticated admin is not role `4`. - 400: Only one currency can be base - another base currency exists. - 400: Invalid Update - unsupported field or invalid currency id. - 404: Not Found - currency id does not exist. - 400: Can't disable base - base currency cannot be disabled. - 400: Currency requires an active payment method - active currency has no active payment method. - 400: Payment method is disabled - configured method is not allowed for currency. - 400: Missing One or More Required Parameters - required body/query fields were not supplied. - 401: Unauthorized - token is missing, expired, invalid, or the account/token pair was not found. - 403: Access denied - gateway traffic guard/rate policy blocked the request. - 429: Too many requests - gateway rate limit exceeded. - 500: Unexpected Error - unhandled gateway or downstream service failure.

Request

This endpoint expects an object.
basebooleanRequired
codestringRequired
activebooleanRequired
symbolstringRequired
taxTitlestringRequired
exchangeRateslist of objectsRequired
taxPercentageintegerRequired
paymentMethodslist of objectsRequired
paymentDescriptionstringRequired
onlinePaymentMethodstringRequired

Response

Created
key_0integer
key_1string
key_2double
key_3string
key_4boolean

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error