Get Invoice
GET
/__remote/api.vercel.com/v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}Get Invoice details and status for a given invoice ID.
See Billing Events with Webhooks documentation on how to receive invoice events. This endpoint is used to retrieve the invoice details.
See Billing Events with Webhooks documentation on how to receive invoice events. This endpoint is used to retrieve the invoice details.
/__remote/api.vercel.com/v1/installations/{integrationConfigurationId}/billing/invoices/{invoiceId}
const response = await fetch('/__remote/api.vercel.com/v1/installations/integrationConfigurationId/billing/invoices/invoiceId', { method: 'GET', headers: { 'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json', },});
const data = await response.json();console.log(data);Response
{ "created": "string", "discounts": [ { "amount": "100.00", "billingPlanId": "example_id", "details": "Example details", "end": "string", "name": "Example Name", "resourceId": "example_id", "start": "string" } ], "externalId": "example_id", "invoiceDate": "string", "invoiceId": "example_id", "invoiceNumber": "string", "items": [ { "billingPlanId": "example_id", "details": "Example details", "end": "string", "name": "Example Name", "price": "100.00", "quantity": "1", "resourceId": "example_id", "start": "string", "total": "100.00", "units": "units" } ], "memo": "string", "outstandingTotal": "100.00", "paidAt": "example_id", "paidTotal": "100.00", "pendingRefundTotal": "100.00", "period": { "end": "string", "start": "string" }, "refundedAt": "string", "refundedTotal": "100.00", "refundReason": "Customer requested refund", "refundTotal": "100.00", "state": "draft", "test": "false", "total": "100.00", "updated": "string"}AuthorizationbearerToken
Default authentication mechanism
200Success
Amount still owed on the invoice, per the payment processor. Can be positive even for states "refunded" or "refund_requested", since a refund does not settle an unpaid remainder. A dollar-based decimal string. Absent when no payment data is available yet.
Total amount paid and retained: payments received minus refunds applied. A dollar-based decimal string. Absent when no payment data is available yet.
Requested refund amount not yet applied by the payment processor: "refundTotal" minus "refundedTotal". A dollar-based decimal string. Only present when a refund was requested or applied.
Total refund amount applied by the payment processor, on the same pre-tax basis as "refundTotal". Counts both money returned and debt cancelled on unpaid invoices. May be lower than "refundTotal", which is the requested amount. A dollar-based decimal string. Only present when a refund was requested or applied.
Total refund amount requested. Only present when a refund has been requested. A dollar-based decimal string.
Invoice state. Reports the payment state of the invoice; refund progress is reported separately via "refundedTotal" and "pendingRefundTotal". The states "refunded" and "refund_requested" only appear when the payment state cannot be determined.
400One 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
410Error
429Error