Mint the prepaid credit lot after the SDK confirmed payment
const url = 'https://api.emite.cr/v1/billing/prepaid/sync';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"paymentIntentId":"example"}'};
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/sync \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "paymentIntentId": "example" }'Call it when the Onvo SDK reports success on the payment intent POST /billing/prepaid returned. The intent is read back from Onvo and must be a prepaid purchase of THIS company (404 PAYMENT_INTENT_NOT_FOUND otherwise). Once its status is succeeded the credit lot is minted — its size comes from the intent's own metadata, never from the request — valid for 365 days from the purchase. Idempotent per intent: this call, the payment-intent.succeeded webhook and the reconcile mint the lot exactly once, so a lost call never loses credits. Answers the intent's status as Onvo reports it: succeeded, or processing while an asynchronous payment (SINPE Móvil) is still on its way — the webhook credits the lot when the transfer lands.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The payment intent id returned by POST /billing/prepaid.
Examplegenerated
{ "paymentIntentId": "example"}Responses
Section titled “Responses”object
Reconciled subscription status after the SDK confirmed payment.
Examplegenerated
{ "status": "example"}