With webhooks, you can specify an endpoint URL to receive invoice objects on your server in real-time. This is triggered upon each automatic invoice generation. The invoice object you'll receive on your end looks as following:
{
"user_id": 6,
"doc_id": 38,
"doc_type": "invoice",
"doc_title": "INVOICE",
"doc_number": "I-006",
"invoice_type": "manual",
"auto_payment_provider": null,
"auto_charge_id": null,
"attempted": false,
"attempt_count": 0,
"next_payment_attempt": null,
"subscription": null,
"recurring_installment": 0,
"statement_desc": null,
"email_status": "viewed",
"files": [],
"status": "unpaid",
"date_paid": null,
"amount_paid": 0.0,
"paypal_enabled": false,
"credit_card_enabled": null,
"partial_payments": false,
"amount_total": 547.63,
"document_custom_fields": [],
"link_protected": "http://invoicebus.com/?su=iKHO4ye5rL",
"link_unprotected": "http://invoicebus.com/?su=iKHO4ye5rL&pin_code=itICQk",
"url_id": "iKHO4ye5rL",
"url_code": "itICQk",
"memo": {
"logo_url": null,
"company_name": "Dino Store",
"address": "227 Cobblestone Road",
"city_zip_state_country": "30000 Bedrock, Cobblestone County",
"phone_fax": "+1 100 500 5000",
"web_email": "http://dinostore.bed; hello@dinostore.bed",
"other_info1": "Payments:",
"other_info2": "Gravelpit Bank",
"other_info3": "Acc: 200-78005-444",
"other_info4": null,
"other_info5": null
},
"amount_subtotal": 477.5,
"items": [
{
"name": "Frozen Brontosaurus Ribs",
"quantity": 10.0,
"price": 50.0,
"discount": 7.5,
"tax_name": "Tax B",
"tax_percentage": 15.0,
"tax_value": 69.38,
"line_total": 462.5
},
{
"name": "Green Fern Salad",
"quantity": 1.0,
"price": 15.0,
"discount": null,
"tax_name": "Tax A",
"tax_percentage": 5.0,
"tax_value": 0.75,
"line_total": 15.0
}
],
"taxes": [
{
"name": "Tax B",
"percentage": 15.0,
"value": 69.38
},
{
"name": "Tax A",
"percentage": 5.0,
"value": 0.75
}
],
"client": {
"id": "11",
"name": "Fred Flintstone",
"address": "222 Rocky Way",
"city_zip_state_country": "30000 Bedrock, Cobblestone County",
"phone": "+1 100 799 4040",
"email": "fred@flintstone.rock",
"other": null,
"custom_fields": [
{
"name": "tax_number",
"value": "VAT123u9005i34"
}
]
},
"terms": {
"po_number": null,
"issue_date": 1507097100,
"due_date": 1508911500,
"net_valid": 21,
"currency": "USD",
"symbol": "$",
"description": null,
"notes": "Fred, thank you very much.\nWe really appreciate your business.\nPlease send payment within {net_terms} of receiving this invoice."
}
}