Update one of your own obligations
const url = 'https://api.emite.cr/v1/fiscal/custom-obligations/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"Planilla CCSS","periodicity":"mensual","dueDay":1,"dueDayKind":"calendar","monthOffset":1,"anchorMonth":1,"notes":"example"}'};
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/fiscal/custom-obligations/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "Planilla CCSS", "periodicity": "mensual", "dueDay": 1, "dueDayKind": "calendar", "monthOffset": 1, "anchorMonth": 1, "notes": "example" }'Replaces the whole rule with the body, as on creation: an omitted monthOffset goes back to 1, and an omitted anchorMonth or notes is cleared. A non-monthly obligation needs anchorMonth (400 CUSTOM_OBLIGATION_ANCHOR_REQUIRED); an id that is not the company's, or was removed, is 404 CUSTOM_OBLIGATION_NOT_FOUND. Periods already marked keep their marks, keyed by period label: after a change of periodicity or anchor, a mark on a period the new rule no longer produces stops showing. Requires fiscal:write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Name the obligation is shown with in the calendar (stored trimmed).
Example
Planilla CCSSHow often it falls due: mensual (monthly), trimestral (every three months), cuatrimestral (every four), semestral (every six) or anual (yearly). Any but mensual needs anchorMonth (400 CUSTOM_OBLIGATION_ANCHOR_REQUIRED).
The day it falls due. With dueDayKind: calendar, a day of the month: the last day when the month is shorter, moved to the next business day when it falls on a weekend or holiday. With business, the Nth business day of the month: the last business day when the month has fewer.
How dueDay counts: calendar days, or Costa Rica business days — the CCSS falls due on the 4th business day of the following month, which is not the 4th. Must be sent: the API applies no default.
How many months after the end of the period the due date falls, from 0 to 12: 0 is the same month, 1 (the default) the following one.
For a non-monthly obligation, a month in which one of its periods ends: it sets the phase of the cycle (a quarterly one anchored at 2 has periods ending in February, May, August and November) and, for an annual one, the month its year ends. Required unless periodicity is mensual, for which it is ignored.
Free-text notes; omitting them on an update clears the stored ones.
Responses
Section titled “Responses”object
Id of the obligation: the customObligationId of its occurrences.
Name the obligation is shown with.
How often it falls due (see the request body).
The day it falls due, counted as dueDayKind says.
Whether dueDay counts calendar or business days.
Months after the end of the period the due date falls.
The month that sets the cycle of a non-monthly obligation; null when none was given.
Free-text notes, or null.
Example
{ "periodicity": "mensual", "dueDayKind": "calendar"}