Skip to content

Accept a plan quote («Contratar»)

POST
/v1/billing/quotes/{id}/accept
curl --request POST \
--url https://api.emite.cr/v1/billing/quotes/example/accept \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "authority": true, "capacity": "holder" }'

Requires BOTH billing:manage and legal:accept: accepting a quote binds the company to its terms, as accepting the Terms does. The body carries the same declaration — authority (true) and the capacity it is made in — which is recorded on the quote with the IP and the browser. With no live subscription, or one in dunning, the answer is mode='checkout' with paymentType='subscription': render the Onvo SDK with the returned ids and call /billing/subscription/sync on success; the quote becomes accepted when the money is in, and expiresAt is the quote's validity. Over a LIVE list plan the answer is mode='scheduled': the change is enacted at the period end with the saved card, and the quote waits as scheduled. 409 QUOTE_EXPIRED / QUOTE_NOT_OPEN when it cannot be accepted today; 404 QUOTE_NOT_FOUND for a quote that is not this company's.

id
required
string
Media typeapplication/json
object
authority
required

The declaration that the person has the authority to bind the company to the quote — the same declaration the company makes when it accepts the Terms. Must be true: false answers 400 LEGAL_AUTHORITY_REQUIRED, and a missing or non-boolean value 400 VALIDATION_ERROR.

boolean
capacity
required

In which capacity the declaration is made: the holder of the cédula, the legal representative, or a person they authorized. Recorded on the quote with the acceptance.

string
Allowed values: holder legal_representative authorized
Media typeapplication/json
object
mode
required

'checkout' → a subscription at the quote's price, paid in the Onvo SDK with the returned ids (paymentType='subscription'); call /billing/subscription/sync on success — the quote becomes accepted when the money is in. 'scheduled' → the company has a live list plan: the change is enacted at the period end with the saved card, nothing is charged now, and the quote waits as scheduled.

string
Allowed values: checkout scheduled
quoteId
required

The quote accepted.

string format: uuid
planCode
required

The quoted plan (pf_custom Águila, pj_custom Jaguar).

string
interval
required

The quote's cadence.

string
Allowed values: month year
paymentType

What the Onvo SDK confirms (checkout mode only): always subscription, a subscription at the quote's price. Absent in scheduled mode, where nothing is paid now.

string
Allowed values: subscription
subscriptionId

Onvo subscription id to pay (checkout mode).

string
customerId

Onvo customer id (checkout mode).

string
publishableKey

Onvo publishable key for the SDK (checkout mode).

string
firstChargeCentimos

What the card will be charged, in céntimos (checkout mode): the quote's fee for one period, IVA included, read back from the subscription Onvo created.

number
firstChargeNetCentimos

Base imponible of that charge, in céntimos (checkout mode). The IVA is the remainder.

number
expiresAt

ISO instant past which the checkout must not be paid (checkout mode): the quote's validity — or the recovery window, when the quote is accepted over a plan in dunning and that ends first. Past it the acceptance is late and the payment is refused.

string
effectiveAt

ISO instant the scheduled change applies (scheduled mode) — the current period end.

string
nullable
Example
{
"mode": "checkout",
"interval": "month",
"paymentType": "subscription"
}