Submit Billing Data
POST
https://api.vercel.com/v1/installations/{integrationConfigurationId}/billingSends the billing and usage data. The partner should do this at least once a day and ideally once per hour.
Use the
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/integrationConfigurationId/billing', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', }, body: JSON.stringify({ "timestamp": "2024-01-01T00:00:00Z", "eod": "2024-01-01T00:00:00Z", "period": { "start": "2024-01-01T00:00:00Z", "end": "2024-01-01T00:00:00Z" }, "billing": [ { "billingPlanId": "example_id", "resourceId": "example_id", "start": "2024-01-01T00:00:00Z", "end": "2024-01-01T00:00:00Z", "name": "Example Name", "details": "Example details", "price": "100.00", "quantity": "1", "units": "units", "total": "100.00" } ], "usage": [ { "resourceId": "example_id", "name": "Example Name", "type": "total", "units": "units", "dayValue": "123", "periodValue": "123", "planValue": "123" } ] }),});
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
usagearrayRequired