Developer Center

GetInvoices

Get details of invoices according to specified criteria.

Method / Endpoint

GET/ {{API_URL}} Billing/GetInvoices?page=1&limit=10

Request Parameters

Parameter Name Type Description
page Integer Current Page Number
limit Integer Number of invoices to list per page. minimum:1, maximum value: 50. Default:10
sort String Sort Field. Values it can take: "id", "number", "created_at", "due_date", "payment_date", "total". Default: "id"
sort_type String Sort Type. Values it can take: "ASC", "DESC". Default: "DESC"
filter[status] String Invoice Status. Acceptable values: "all", "pending", "unpaid", "paid", "cancelled", "refunded". Default: "all"
filter[local] Boolean Invoice Localization Status. Values it can take: "none", "true", "false". Default: "none"
filter[taxfree] Boolean Invoice Tax Exemption Status. Values it can take: "none", "true", "false". Default: "none"
filter[formalized] Boolean Invoice Formality Status. Values it can take: "none", "true", "false". Default: "none"
filter[id] Integer Invoice ID Number
filter[number] String Invoice Serial Number

External Sample

curl --location 'https://example.com/api/Billing/GetInvoices?page=1&limit=10' \
--header 'Apikey: [YOUR_API_KEY]'

Internal Sample

try {
    $result = Api::Billing()->GetInvoices([
        'page' => 1,
        'limit' => 10,
        'filter' => [
            'status' => "unpaid",
        ]
    ]);
    print_r($result);
}
catch (Exception $e)
{
    echo 'Error: '.$e->getMessage();
}

Sample JSON Response

{
    "status": "successful",
    "total": 2,
    "page": 1,
    "limit": 10,
    "next_page": 0,
    "data": [
        {
            "id": 327,
            "number": "#327",
            "user": {
                "id": "2",
                "lang": "en",
                "type": "corporate",
                "identity": null,
                "company_name": "Smith LLC",
                "company_tax_number": "551244",
                "company_tax_office": "SaintXV2rf",
                "name": "Micheal",
                "surname": "Smith",
                "full_name": "Micheal Smith",
                "email": "[email protected]",
                "phone": "12025550109",
                "address": {
                    "country_code": "FR",
                    "country_name": "France",
                    "city": "Paris",
                    "state": "ageagae",
                    "detail": "asdsafaeg",
                    "zipcode": "1234"
                }
            },
            "taxation_type": "exclusive",
            "notes": "Invoice note test123",
            "created_at": "2022-11-23 16:06:00",
            "due_date": "2022-11-23 16:06:00",
            "payment_date": "2022-11-23 16:09:46",
            "refund_date": "0000-00-00 00:00:00",
            "status": "paid",
            "formalize": false,
            "local": false,
            "taxfree": false,
            "formalize_file": null,
            "exchange_rate": 1,
            "currency": "USD",
            "tax_rate": 0,
            "subtotal": 0.68859999999999998987476601541857235133647918701171875,
            "tax": 0,
            "total": 0.550899999999999945288209346472285687923431396484375,
            "payment_method": "PayPal",
            "payment_method_data": {
                "capture_id": "P123456"
            },
            "payment_method_commission":0,
            "payment_method_commission_rate":0,
            "share": {
                "token": "VCsxZWZPQkI0bDFhdDNqV0RWZHdyQllGbmN5cGkzcGhRd09tWEc0VTIyMD0=",
                "link": "https://example.com/invoice?token=VCsxZWZPQkI0bDFhdDNqV0RWZHdyQllGbmN5cGkzcGhRd09tWEc0VTIyMD0="
            },
            "discounts": [
                {
                    "type": "promotion",
                    "item_id": 408,
                    "rate": 20,
                    "description": "Promotion 1",
                    "amount": 0.137699999999999989075405437688459642231464385986328125
                }
            ],
            "items": [
                {
                    "id": 408,
                    "owner_id": 327,
                    "description": "blamydomain.com (#125) (Domain Name Registration) | Yearly\r\nWhois Protection: I want",
                    "quantity": 1,
                    "tax_exempt": false,
                    "amount": 0.68859999999999998987476601541857235133647918701171875,
                    "total": 0.68859999999999998987476601541857235133647918701171875,
                    "order_id": 125,
                    "due_date": "2022-11-23 16:06:07",
                    "attributes" : {
                        "event":"DomainNameRegisterOrder"
                    }
                }
            ]
        },
        {
            "id": 367,
            "number": "#367",
            "user": {
                "id": 2,
                "lang": "en",
                "identity": null,
                "type": "corporate",
                "name": "Glen",
                "surname": "Daigle",
                "full_name": "Glen Daigle",
                "email": "[email protected]",
                "phone": "16055762309",
                "company_name": "TEST1 LLC",
                "company_tax_number": "659898989",
                "company_tax_office": "gdsgs",
                "address": {
                    "country_code": "US",
                    "country_name": "United States",
                    "city": "Alaska",
                    "state": "Test",
                    "detail": "test testsdsdsf",
                    "zipcode": "1234"
                }
            },
            "taxation_type": "exclusive",
            "notes": null,
            "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,
                    "owner_id":367,
                    "description": "test description",
                    "quantity": 1,
                    "tax_exempt": false,
                    "amount": 20,
                    "total": 20,
                    "order_id": 0,
                    "due_date": "0000-00-00 00:00:00",
                    "attributes":[]
                }
            ]
        }
    ]
}

Response Parameters

It is exactly the same as the response parameters in the "GetInvoice" document.

GetInvoice CreateInvoice

Do you have any questions?

Feel free to contact us
Contact Us
Copyright © 2024. All Rights Reserved.
Join Our Discord Channel
Top