API Generate an invoice
On this page, you will learn to generate an invoice for a customer.
Step 1: Generate an OAuth token
See Create an OAuth token for details.
Step 2: Generate the invoice
Example below will generate an invoice on all open items on the selected Billing account:
Billing account is
OPENSOFT-00
Invoice date is
2023-12-05
LAst usage to be put on the invoice is
2023-12-06
CODE
POST https://sandbox.opencell.net/opencell/api/rest/v2/billing/invoices/generate
{
"billingAccountCode":"OPENSOFT-00",
"skipValidation":true,
"applyBillingRules": false
"invoicingDate":"2023-12-05",
"lastTransactionDate":"2023-12-06"
}
Answer: HTTP Code 200
CODE
{
"id": 44,
"invoiceDate": 1701730800000,
"status": "VALIDATED",
"dueDate": 1704322800000,
"amountWithoutTax": 12500.000000000000,
"amountTax": 625.000000000000,
"amountWithTax": 625.000000000000,
"netToPay": 917439.110000000000,
"paymentMethodType": "WIRETRANSFER",
"initialCollectionDate": 1704326400000,
"statusDate": 1701774731331,
"paymentStatus": "NONE",
"rawAmount": 0,
"discountAmount": 0,
"temporaryInvoiceNumber": "",
"invoiceTypeCode": "COM",
"amount": 0,
"prepaid": false,
"alreadyAppliedMinimum": false,
"alreadyAddedDiscount": false,
"detailedInvoice": true,
"alreadySent": false,
"dontSend": true
}