Invoices
Create Invoice
API Reference
- Customers
- Products
- Plans
- Contracts
- Invoices
- Measurements
- Auth
- Events
- Reports
- Integrations
- Credits
- Webhooks
Invoices
Create Invoice
Create a new Invoice.
POST
/
invoices
curl --request POST \
--url https://connect.withvayu.com/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customerId": "<string>",
"contractId": "<string>",
"name": "<string>",
"billingCycle": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"lineItems": [
{
"invoiceId": "<string>",
"revenueBreakdown": {
"total": 123,
"subtotal": 123,
"overage": 123,
"discount": 123,
"creditsUsed": 123,
"tax": 1
}
}
],
"amount": 123
}'
{
"invoice": {
"customerId": "<string>",
"contractId": "<string>",
"name": "<string>",
"billingCycle": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"lineItems": [
{
"invoiceId": "<string>",
"revenueBreakdown": {
"total": 123,
"subtotal": 123,
"overage": 123,
"discount": 123,
"creditsUsed": 123,
"tax": 1
}
}
],
"amount": 123,
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Body
application/json
The id of the customer that the invoice is associated with
The name of the invoice, usually a description of the billing period
Minimum length:
1
The id of the invoice that the line item is a part of
The revenue breakdown of the line item
Required range:
x >= 0
The total amount of the invoice
The id of the contract that the invoice is associated with
Response
200
application/json
RequestSuccess
The id of the customer that the invoice is associated with
The name of the invoice, usually a description of the billing period
Minimum length:
1
The id of the invoice that the line item is a part of
The revenue breakdown of the line item
Required range:
x >= 0
The total amount of the invoice
The id of the contract that the invoice is associated with
curl --request POST \
--url https://connect.withvayu.com/invoices \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"customerId": "<string>",
"contractId": "<string>",
"name": "<string>",
"billingCycle": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"lineItems": [
{
"invoiceId": "<string>",
"revenueBreakdown": {
"total": 123,
"subtotal": 123,
"overage": 123,
"discount": 123,
"creditsUsed": 123,
"tax": 1
}
}
],
"amount": 123
}'
{
"invoice": {
"customerId": "<string>",
"contractId": "<string>",
"name": "<string>",
"billingCycle": {
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z"
},
"lineItems": [
{
"invoiceId": "<string>",
"revenueBreakdown": {
"total": 123,
"subtotal": 123,
"overage": 123,
"discount": 123,
"creditsUsed": 123,
"tax": 1
}
}
],
"amount": 123,
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
}