Start buying a prepaid document bundle (embedded SDK, like subscriptions)
const url = 'https://api.emite.cr/v1/billing/prepaid';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"documents":100}'};
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/prepaid \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "documents": 100 }'Creates a payment intent and returns the ids + publishable key for the Onvo SDK (paymentType=one_time). The client calls /prepaid/sync on success; the credit lot is minted idempotently there and by the payment-intent.succeeded webhook.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Prepaid bundle size (50 | 100 | 250 | 500 documents).
Example
100Responses
Section titled “Responses”object
Onvo payment intent id (status requires_payment_method).
Onvo customer id.
Onvo publishable key for the client-side SDK.
Present when the customer already started an asynchronous payment (SINPE Móvil) for THIS bundle on an earlier checkout and Onvo is still waiting for the transfer: a processing intent started within the last 24 hours. It is neither reused nor canceled — tell the customer to wait if they already sent it (the webhook credits the lot when it lands) instead of paying the bundle a second time on paymentIntentId.
object
The Onvo payment intent still waiting for that transfer.
ISO instant the customer started it.
Examplegenerated
{ "paymentIntentId": "example", "customerId": "example", "publishableKey": "example", "pendingPayment": { "paymentIntentId": "example", "startedAt": "example" }}