Skip to navigation

Buy Prepaid Usage Credit

View as Markdown

Buy a pack or 500 through 100000 USD cents with HOSTED_CHECKOUT or ATTACHED_CARD. Delegated callers need assistant purchasing permission, the user’s exact authorization quote, and an explicit monthly usage cap decision. Retrying the same Idempotency-Key and exact terms resumes the same payment, including bank authentication; an unknown provider outcome never authorizes another charge. No subscription is required; payment does not change plan entitlements.

Authentication

AuthorizationBearer

Your aVenture API key (https://aventure.vc/settings/api-keys) or OAuth access token

Headers

Idempotency-KeystringRequired1-255 characters

Caller-chosen key, 1 to 255 characters, that makes a retry return the same Checkout Session instead of a second purchase.

Request

This endpoint expects an object.
amountCentslong or nullOptional500-100000

USD integer cents, 500 through 100000; supply exactly one of pack or amountCents.

authorizationQuotestring or nullOptional0-4000 characters

Exact human authorization quotation; required for delegated API-key/OAuth purchases, preserved verbatim.

autoTopUpCardRevisionstring or nullOptional

Displayed default card revision when a first-party session changes an active automatic top-up limit with SET_CAP.

capDecisionenum or nullOptional

Explicit monthly usage cap decision; not a purchase budget. Required for delegated purchases.

Allowed values:
packenum or nullOptional

Credit pack to buy; its amount becomes prepaid credit.

Allowed values:
purchaseModeenumOptional

HOSTED_CHECKOUT opens an explicit-pay page; ATTACHED_CARD charges the existing default saved card.

Allowed values:
savePaymentMethodbooleanOptionalDefaults to false

Explicitly save this hosted payment’s card for future payments you authorize. Choose the billing default separately in payment settings. Defaults to false; available only for hosted Checkout and never enables assistant purchasing.

spendCapCentslong or nullOptional

Positive monthly usage cap in USD cents; supply only with SET_CAP. One-time purchases are outside this limit.

Response headers

X-RateLimit-LimitintegerOptional

Requests allowed per client IP in the current rate-limit window.

X-RateLimit-RemainingintegerOptional

Requests left before the tightest applicable rate-limit bucket rejects.

X-RateLimit-ResetintegerOptional

Seconds until the exhausted rate-limit bucket admits another request; 0 when none is exhausted.

Response

The current state of a custom-amount or attached-card purchase.

amountCentslong
idstringformat: "uuid"
closedAtdatetime or nullOptional
currencystring or nullOptional
expiresAtdatetime or nullOptional
Expiry of the open hosted Checkout, not of purchased credit.
grantedAtdatetime or nullOptional
paymentClientSecretstring or nullOptional
publishableKeystring or nullOptional
statusstring or nullOptional

Current purchase payment state; grant confirmation remains grantedAt.

urlstring or nullOptionalformat: "uri"
Hosted payment destination, only while its Checkout remains open.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
406
Not Acceptable Error
409
Conflict Error
415
Unsupported Media Type Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error