Skip to content

Start buying a prepaid document bundle (embedded SDK, like subscriptions)

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

Media typeapplication/json
object
documents
required

Prepaid bundle size (50 | 100 | 250 | 500 documents).

number
Example
100
Media typeapplication/json
object
paymentIntentId
required

Onvo payment intent id (status requires_payment_method).

string
customerId
required

Onvo customer id.

string
publishableKey
required

Onvo publishable key for the client-side SDK.

string
pendingPayment

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
paymentIntentId
required

The Onvo payment intent still waiting for that transfer.

string
startedAt
required

ISO instant the customer started it.

string
Examplegenerated
{
"paymentIntentId": "example",
"customerId": "example",
"publishableKey": "example",
"pendingPayment": {
"paymentIntentId": "example",
"startedAt": "example"
}
}