Enable or disable the audit-module add-on
const url = 'https://api.emite.cr/v1/billing/audit-addon';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"enabled":true,"expectedChargeCentimos":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.emite.cr/v1/billing/audit-addon \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "enabled": true, "expectedChargeCentimos": 1 }'Unlocks GET /v1/audit* (the audit trail viewer and its exports) on a subscribed tier. The upper step of each plan ladder already includes the feature, so enabling it there is rejected. Enabling CHARGES the saved card now for the whole days that remain to the plan's next monthly anniversary (GET /billing/addon-quote says how much), and from then on it renews every month as its own Onvo subscription; disabling stops the renewal and the add-on runs to the end of the period already paid for. Off by default. Note the trail is WRITTEN unconditionally on every plan — the add-on only unlocks reading it, so a tenant who enables it later still sees their full history.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Enable (true) or disable (false) the add-on.
Only when ENABLING: what the customer was told the card would be charged, in céntimos — chargeCentimos of GET /billing/addon-quote. If the purchase would charge anything else (the quote moves when a day boundary is crossed) it is refused with 409 ADDON_QUOTE_CHANGED and nothing is collected; ask for the quote again. Omit it to buy at whatever the quote is at that instant.
Examplegenerated
{ "enabled": true, "expectedChargeCentimos": 1}Responses
Section titled “Responses”object
The resulting add-on state.
Examplegenerated
{ "auditAddon": true}