GetInvoice
Get full details of the specified invoice.
Method / Endpoint
GET/ {{API_URL}} Billing/GetInvoice/ {{ID}}
Request Parameters
Parameter Name | Type | Description |
---|---|---|
{{ID}} | Integer | Invoice ID number |
External Sample
curl --location 'https://example.com/api/Billing/GetInvoice/123' \
--header 'Apikey: [YOUR_API_KEY]'
Internal Sample
Helper::Load("Api");
try {
$result = Api::Billing()->GetInvoice(123);
print_r($result);
}
catch (Exception $e)
{
echo 'Error: '.$e->getMessage();
}
Sample JSON Response
{
"status": "successful",
"data": {
"id": 367,
"number": "#367",
"user": {
"id": 2,
"lang": "en",
"identity": null,
"type": "corporate",
"name": "James",
"surname": "Roddy",
"full_name": "James Roddy",
"email": "[email protected]",
"phone": "16055762309",
"company_name": "TEST1 LLC",
"company_tax_number": "659898989",
"company_tax_office": "testoffice",
"address": {
"country_code": "US",
"country_name": "United States",
"city": "Anchorage",
"state": "Alaska",
"detail": "test example123",
"zipcode": "1234"
}
},
"taxation_type": "exclusive",
"notes": "Invoice note test123",
"created_at": "2023-03-11 19:49:00",
"due_date": "2023-03-11 23:59:00",
"payment_date": "2023-03-11 19:53:49",
"refund_date": "0000-00-00 00:00:00",
"status": "paid",
"formalize": true,
"local": true,
"taxfree": false,
"formalize_file": "https://example.com/resources/uploads/invoices/aa2f3fasd3fa3f4ed.pdf",
"exchange_rate": 1,
"currency": "USD",
"tax_rate": 18,
"subtotal": 21,
"tax": 3.779999999999999804600747665972448885440826416015625,
"total": 24.780000000000001136868377216160297393798828125,
"payment_method": "Credit Card (Stripe)",
"payment_method_data": {
"Transaction ID": "PM12345"
},
"payment_method_commission": 1,
"payment_method_commission_rate": 5,
"send_bill_to_address": 0,
"share": {
"token": "VCsxZWZPQkI0bDFhdDNqV0RWZHdyQllGbmN5cGkzcGhRd09tWEc0VTIyMD0=",
"link": "https://example.com/invoice?token=VCsxZWZPQkI0bDFhdDNqV0RWZHdyQllGbmN5cGkzcGhRd09tWEc0VTIyMD0="
},
"discounts": [],
"items": [
{
"id": 458,
"description": "Lorem Ipsum Dolor",
"quantity": 1,
"tax_exempt": false,
"amount": 20,
"total": 20,
"order_id": 0,
"due_date": "0000-00-00 00:00:00",
"attributes" : []
}
]
}
}
Response Parameters
Parameter Name | Type | Description |
---|---|---|
status | String | Action Status "successful" or "error" |
message | String | Error message if action status is "error" |
data.id | Integer | Invoice ID Number |
data.number | String | If the invoice serial number is enabled, it can change while the invoice is in proforma type or after it is paid. |
data.user.id | Integer | Customer's ID Number |
data.user.lang | String | Customer's language according to ISO 639-1 format. for example: "en", "de", "fr" etc. |
data.user.type | String | The customer's account type. "individual", "corporate" |
data.user.name | String | Customer's Name |
data.user.surname | String | Customer's Last Name |
data.user.full_name | String | Customer's Full Name |
data.user.email | String | Customer's Email Address |
data.user.phone | Integer | The customer's phone number. (Country area code included) For example: if the number is: +1 (123) 456-7890 it should be like this: 11234567890 |
data.user.company_name | String | Customer's Company Name |
data.user.company_tax_number | String | Customer's Company Tax Number |
data.user.company_tax_office | String | Customer's Company Tax Office |
data.user.custom_fields | Object | Custom fields belonging to the customer on the invoice |
data.user.custom_fields.field_id | Integer | Custom field ID Number |
data.user.custom_fields.name | String | Custom Field Name |
data.user.custom_fields.value | String | Custom Field Content |
data.user.address.country_code | String | Customer's Country Code. (ISO 3166-1 Alpha-2) Ex: US, FR, DE |
data.user.address.country_name | String | Customer's Country Name. Ex: United States, Germany, France |
data.user.city | String | Customer's City |
data.user.state | String | Customer's State |
data.user.detail | String | Customer's Address Details |
data.user.zipcode | String | Customer's Zip Code |
data.taxation_type | String | Tax type of the invoice: "exclusive": Tax Excluded. "inclusive": Tax included. |
data.notes | String | Notes on the invoice |
data.created_at | String | Invoice Creation Date. Format: YYYY-MM-DD HH:ii:ss |
data.due_date | String | Invoice Payment Due Date. Format: YYYY-MM-DD HH:ii:ss |
data.payment_date | Sstring | Invoice Paid Date. Format: YYYY-MM-DD HH:ii:ss |
data.refund_date | String | Invoice Refund Date. Format: YYYY-MM-DD HH:ii:ss |
data.status | String | Invoice Status: "unpaid", "pending", "paid", "refunded", "cancelled" |
data.formalize | Boolean | Invoice Formalization Status. "true" : Formalised. "false": Not-Formalised. |
data.local | Boolean | Invoice Locality Status. "true": A local invoice. "false": A non-local invoice. This information is local, if any, to the tax rate based on the customer's address. If there is no tax rate, it is not local. |
data.taxfree | Boolean | The status of applying tax to the invoice. "true" : tax can be applied. "false" : Tax cannot be applied. |
data.formalize_file | String | The invoice PDF file is specified as URL. |
data.exchange_rate | Double | Exchange rate of the invoice |
data.currency | String | The currency of the invoice. Format: ISO 4217. For example: USD, EUR, GBP |
data.tax_rate | Double | Invoice Tax Rate |
data.subtotal | Double | Invoice Subtotal Amount |
data.tax | Double | Invoice Total Tax Amount |
data.total | Double | Invoice Total Amount Including Tax |
data.payment_method | String | Payment Method Appearing on the Invoice |
data.payment_method_data | Object | Payment Method Details |
data.payment_method_commission | Double | Payment Method Commission Amount |
data.payment_method_commission_rate | Double | Payment Method Commission Rate |
data.send_bill_to_address | Double | Cost of Sending Invoices to the Address |
data.share | Object | Information About Invoice Sharing |
data.share.token | String | Invoice Sharing Token |
data.share.link | String | Invoice Sharing Link |
data.discounts | Object | Discounts Applied to the Invoice |
data.discounts.type | String | Discount Type. ("promotion", "coupon", "dealership") |
data.discounts.item_id | Integer | Invoice item ID number to which the discount applies |
data.discounts.rate | Double | Discount Percentage |
data.discounts.description | String | Discount Name: Coupon code, Promotion name, etc. |
data.discounts.amount | Double | Applied Discount Amount |
data.discounts.dkey | String | The product or product group from which the reseller discount is derived. |
data.items | Object | Items of the Invoice |
data.items.id | Integer | Invoice item ID Number |
data.items.owner_id | Integer | Invoice ID Number |
data.items.description | String | Invoice Item Description |
data.items.quantity | Integer | Invoice Item Quantity |
data.items.tax_exempt | Boolean | Invoice item tax exemption status. "true": Exempt. "false": Not exempt. |
data.items.amount | Double | Invoice Item Unit Amount |
data.items.total | Double | Invoice Item Total Amount |
data.items.order_id | Integer | The product/service ID number to which the invoice item is linked. This information can be obtained from the "id" field in the "users_products" table in the database. |
data.items.due_date | String | If the invoice item is linked to a product/service, it must have the same end date as the product/service. Format: YYYY-MM-DD HH:ii:ss |
data.items.attributes | Object | If the invoice item is linked to a product/service, it contains information about the purchase or renewal of the linked product/service. |