Skip to content

Preflight check before disabling a currency

GET
/v1/tenants/me/settings/disable-currency-impact
curl --request GET \
--url 'https://api.emite.cr/v1/tenants/me/settings/disable-currency-impact?currency=USD' \
--header 'Authorization: Bearer <token>'

Returns what disabling a currency would block or affect, counted across both environments: draftsCount and draftsSample (drafts in it — while any exists, the disable answers 409 CURRENCY_HAS_DRAFTS), productsLosingAllPrices (active items left with no price in any enabled currency; nothing is archived), affectsDefaultCurrency and suggestedNewDefault (a new default must be chosen in the same update), and historicalInvoicesCount (informational). Changes nothing. The web uses it to gate the disable action with a confirmation modal.

currency
required
string
Example
USD

ISO 4217 code to evaluate.

Media typeapplication/json
object
currency
required

The currency evaluated (the currency of the request).

string
Allowed values: AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYR BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XCD XDR XOF XPF XSU XUA YER ZAR ZMW ZWL
draftsCount
required

Draft documents in that currency, in both environments. While above 0, disabling it answers 409 CURRENCY_HAS_DRAFTS.

number
draftsSample
required

Up to 5 of those drafts, to show which ones to issue or delete first.

Array<object>
object
id
required

Id of the draft document.

string format: uuid
clave
required

Its 50-digit clave, when a number was already allocated to it; else null.

string
nullable
consecutivo
required

Its 20-digit consecutivo, when a number was already allocated; else null.

string
nullable
productsLosingAllPrices
required

Active items whose only prices are in that currency: with it disabled they could not be sold in any currency. Their prices are kept, and come back if it is enabled again.

number
affectsDefaultCurrency
required

Whether it is the company's defaultCurrency — then the same update must choose another default (400 DEFAULT_CURRENCY_NOT_ENABLED otherwise).

boolean
suggestedNewDefault
required

When it is the default: the first of the other enabled currencies, to propose as the new default. null when it is not the default, or when no other currency is enabled.

string
nullable
Allowed values: AED AFN ALL AMD ANG AOA ARS AUD AWG AZN BAM BBD BDT BGN BHD BIF BMD BND BOB BOV BRL BSD BTN BWP BYR BZD CAD CDF CHE CHF CHW CLF CLP CNY COP COU CRC CUC CUP CVE CZK DJF DKK DOP DZD EGP ERN ETB EUR FJD FKP GBP GEL GHS GIP GMD GNF GTQ GYD HKD HNL HRK HTG HUF IDR ILS INR IQD IRR ISK JMD JOD JPY KES KGS KHR KMF KPW KRW KWD KYD KZT LAK LBP LKR LRD LSL LYD MAD MDL MGA MKD MMK MNT MOP MRO MUR MVR MWK MXN MXV MYR MZN NAD NGN NIO NOK NPR NZD OMR PAB PEN PGK PHP PKR PLN PYG QAR RON RSD RUB RWF SAR SBD SCR SDG SEK SGD SHP SLL SOS SRD SSP STD SVC SYP SZL THB TJS TMT TND TOP TRY TTD TWD TZS UAH UGX USD USN UYI UYU UZS VEF VND VUV WST XAF XCD XDR XOF XPF XSU XUA YER ZAR ZMW ZWL
historicalInvoicesCount
required

Every document ever created in that currency, in both environments and whatever its status (drafts and deleted ones included). Informational: documents keep their currency.

number
Example
{
"currency": "AED",
"suggestedNewDefault": "AED"
}

Currency code not in ISO 4217 catalog.

Missing or invalid JWT / API key.