Menu

Submit Billing Data

POSThttps://api.vercel.com/v1/installations/{integrationConfigurationId}/billing
Sends the billing and usage data. The partner should do this at least once a day and ideally once per hour.
Use the credentials.access_token we provided in the Upsert Installation body to authorize this request.
https://api.vercel.com/v1/installations/{integrationConfigurationId}/billing
const response = await fetch('https://api.vercel.com/v1/installations/string/billing', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"timestamp": "string",
"eod": "string",
"period": {
"start": "string",
"end": "string"
},
"billing": "value",
"usage": []
}),
});
const data = await response.json();
console.log(data);
Response
{}
AuthorizationbearerToken

Default authentication mechanism

integrationConfigurationIdstringRequired

This endpoint expects an object.

timestampstringRequired
Server time of your integration, used to determine the most recent data for race conditions & updates. Only the latest usage data for a given day, week, and month will be kept.
eodstringRequired
End of Day, the UTC datetime for when the end of the billing/usage day is in UTC time. This tells us which day the usage data is for, and also allows for your "end of day" to be different from UTC 00:00:00. eod must be within the period dates, and cannot be older than 24h earlier from our server's current time.
periodobjectRequired
Period for the billing cycle. The period end date cannot be older than 24 hours earlier than our current server's time.
billingobjectRequired
Billing data (interim invoicing data).
usagearrayRequired

No response body

400One of the provided values in the request body is invalid. One of the provided values in the request query is invalid.
401The request is not authorized.
403You do not have permission to access this resource.
404Error
Submit Billing Data | Vercel API