Provision Purchase
POST
/v1/installations/{installationId}/billing/provisionOptional endpoint, only required if your integration supports billing plans with type
prepayment./v1/installations/{installationId}/billing/provision
const response = await fetch('/v1/installations/installationId/billing/provision', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "invoiceId": "example_id" }),});
const data = await response.json();console.log(data);Response
{ "timestamp": "2024-01-01T00:00:00Z", "balances": [ { "resourceId": "example_id", "credit": "string", "nameLabel": "Example Name", "currencyValueInCents": "123" } ]}Errors
{ "error": { "code": "validation_error", "message": "string", "user": { "message": "string", "url": "https://example.com" }, "fields": [ { "key": "string", "message": "string" } ] }}AuthorizationUser Authentication
Default authentication mechanism
AuthorizationSystem Authentication
Default authentication mechanism
installationIdstringRequired
X-Vercel-AuthstringOptional
The auth style used in the request (system, user, etc)
Idempotency-KeystringOptional
A unique key to identify a request across multiple retries
This endpoint expects an object.
invoiceIdstringRequired
ID of the invoice in Vercel proving the purchase of credits
200Return a timestamp alongside a list of balances for the installation with the most up-to-date values
timestampstringRequired
Server time of your integration, used to determine the most recent data for race conditions & updates. Format is ISO 8601 YYYY-MM-DDTHH:mm:ss.SSSZ
balancesarrayRequired
400Input has failed validation
errorobjectRequired
403Operation failed because the authentication is not allowed to perform this operation
errorobjectRequired
409Operation failed because of a conflict with the current state of the resource
errorobjectRequired
422Operation is well-formed, but cannot be executed due to semantic errors
errorobjectRequired