Update WhatsApp notification toggles
const url = 'https://api.emite.cr/v1/auth/me/whatsapp/prefs';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"notifyAccepted":true,"notifyRejected":true,"notifyError":true,"notifyPurchaseDue":true,"notifyImportCompleted":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.emite.cr/v1/auth/me/whatsapp/prefs \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "notifyAccepted": true, "notifyRejected": true, "notifyError": true, "notifyPurchaseDue": true, "notifyImportCompleted": true }'Turns on or off the notifications the person receives on the linked number; only the toggles sent change. They are per person and opt-in (a new link starts with all of them off), and cover the company the number acts for, while the person is still a member of it. Nothing is sent while the company has its WhatsApp notifications switched off (whatsappEnabled in its notification settings). 400 WHATSAPP_LINK_NOT_VERIFIED before the code is confirmed; 404 WHATSAPP_LINK_NOT_FOUND without a link. For a person’s session (JWT) only: an API key answers 403.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Notify when Hacienda accepts an invoice
Notify when Hacienda rejects an invoice
Notify when a document ends in error instead of a verdict: sending it or checking its status failed for good, or Hacienda gave no verdict within 24 hours
Notify when pending purchase acceptances approach their DGT deadline
Notify when the documents that arrived in the company's inbound mailbox finish importing: how many were saved, out of how many files.
Examplegenerated
{ "notifyAccepted": true, "notifyRejected": true, "notifyError": true, "notifyPurchaseDue": true, "notifyImportCompleted": true}