Skip to content

Mint the prepaid credit lot after the SDK confirmed payment

POST
/v1/billing/prepaid/sync
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.

Media typeapplication/json
object
paymentIntentId
required

The payment intent id returned by POST /billing/prepaid.

string
Examplegenerated
{
"paymentIntentId": "example"
}
Media typeapplication/json
object
status
required

Reconciled subscription status after the SDK confirmed payment.

string
Examplegenerated
{
"status": "example"
}