#Get Invoices API.

The following endpoint enables merchants to access information about their invoices, facilitating management and retrieval of invoice-related data. It supports filtering and pagination options, making it a valuable tool for managing invoice information efficiently.

https://api.fatora.io/v1/invoices
curl --location --request GET 'https://api.fatora.io/v1/invoices?keyword=YourKeyword&page=1&page_size=20&from=01-01-2024&to=31-12-2024&status=paid&type=detailed&client_email=@[email protected][email protected]' \
--header "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjcyOTEyLTpyYW1pcmVzc2xhbkBnbWFpbC5jb20iLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9oYXNoIjoiOTExM2Y2OWEtMTYzMi00Nzg2LWE4NTctYmEzNWQ5YmEwMDc0IiwibmJmIjoxNzE5OTI0NDkzLCJleHAiOjE3NTEwMjg0OTMsImlhdCI6MTcxOTkyNDQ5M30.-rP1DT8LKk5jvBT_PpvaqFuUf_H6FhFiqAq9FM-34cw" \
--header 'Content-Type: application/json' \
$curl = curl_init(); curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.fatora.io/v1/invoices?keyword=YourKeyword&page=1&page_size=20&from=01-01-2024&to=31-12-2024&status=paid&type=detailed&client_email=@[email protected][email protected]',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_HTTPHEADER => array(
    'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjcyOTEyLTpyYW1pcmVzc2xhbkBnbWFpbC5jb20iLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9oYXNoIjoiOTExM2Y2OWEtMTYzMi00Nzg2LWE4NTctYmEzNWQ5YmEwMDc0IiwibmJmIjoxNzE5OTI0NDkzLCJleHAiOjE3NTEwMjg0OTMsImlhdCI6MTcxOTkyNDQ5M30.-rP1DT8LKk5jvBT_PpvaqFuUf_H6FhFiqAq9FM-34cw',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
// Define the API endpoint URL.
string apiUrl = "https://api.fatora.io/v1/invoices?keyword=YourKeyword&page=1&page_size=20&from=01-01-2024&to=31-12-2024&status=paid&type=detailed&client_email=@[email protected][email protected]";

// Create a WebRequest.
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(apiUrl);

// Set the request method to GET.
request.Method = "GET";

request.AddHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6IjcyOTEyLTpyYW1pcmVzc2xhbkBnbWFpbC5jb20iLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9oYXNoIjoiOTExM2Y2OWEtMTYzMi00Nzg2LWE4NTctYmEzNWQ5YmEwMDc0IiwibmJmIjoxNzE5OTI0NDkzLCJleHAiOjE3NTEwMjg0OTMsImlhdCI6MTcxOTkyNDQ5M30.-rP1DT8LKk5jvBT_PpvaqFuUf_H6FhFiqAq9FM-34cw");


// Set the request content type.
request.ContentType = "application/json";

try
{
    // Get the response.
    using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
    {
        if (response.StatusCode == HttpStatusCode.OK)
        {
            // Read the response data.
            using (var responseStream = response.GetResponseStream())
            using (var reader = new StreamReader(responseStream))
            {
                string responseContent = reader.ReadToEnd();
                Console.WriteLine("API Response: " + responseContent);
            }
        }
        else
        {
            Console.WriteLine("API Request failed with status code: " + response.StatusCode);
        }
    }
}
catch (WebException ex)
{
    Console.WriteLine("API Request failed with an exception: " + ex.Message);
}
{
    "status": "SUCCESS",
    "invoices": [
        {
            "id": 2075,
            "number": "INV567",
            "currency": "QAR",
            "terms_conditions": "Sample terms and conditions",
            "note": null,          
            "date": "2023-10-24T10:21:00.9047758+02:00",
            "status": "paid",
            "type": "Detailed invoice",
            "client": {
                "id": 1307,
                "name": "Client name",
                "address": "Client address",
                "phone": "Phone number",
                "email": "[email protected]",
                "notes": null
            },
            "title": "Sample Invoice",           
            "link": "https://example.com/sample-link",
            "items": [
                {
                    "id": 2376,
                    "description": "Sample invoice description",
                    "type": "Service Item",                  
                    "qty": 1.0,
                    "amount": 100.0
                }
            ],
            "payments": [
                {
                    "id": 942,
                    "payment_date": "2023-10-10T00:00:00",
                    "transaction_id": "TXN123",
                    "amount": 100.0,
                    "note": "external",
                    "payment_type": "Credit",
                    "status": "Paid"
                },
                {
                    "id": 943,
                    "payment_date": "2023-10-10T00:00:00",
                    "transaction_id": "TXN456",
                    "amount": 50.0,
                    "note": "external",
                    "payment_type": "PayPal",
                    "status": "Paid"
                }
            ],
            "setting": {
                "tax": false,
                "discount": 0.0,
                "discount_type": "",
                "language": "ar",
                "accepted_payment_methods": {
                    "card": true,
                    "bank_transfer": true,
                    "cash": true,
                    "paypal": true,
                    "e_signature": true
                }
            }
        },
        {
            "id": 2076,
            "number": "INV789",
            "currency": "QAR",
            "terms_conditions": "Sample terms and conditions",
            "note": null,           
            "date": "2023-10-24T10:21:00.9047758+02:00",
            "status": "paid",
            "type": "Detailed invoice",
            "client": {
                "id": 1307,
                "name": "Client name",
                "address": "Client address",
                "phone": "Phone number",
                "email": "[email protected]",
                "notes": null
            },
            "title": "Sample Invoice",           
            "link": "https://example.com/sample-link",
            "items": [
                {
                    "id": 2376,
                    "description": "Sample invoice description",
                    "type": "Service Item",                   
                    "qty": 1.0,
                    "amount": 100.0
                }
            ],
            "payments": [
                {
                    "id": 942,
                    "payment_date": "2023-10-10T00:00:00",
                    "transaction_id": "TXN123",
                    "amount": 100.0,
                    "note": "external",
                    "payment_type": "Credit",
                    "status": "Paid"
                },
                {
                    "id": 943,
                    "payment_date": "2023-10-10T00:00:00",
                    "transaction_id": "TXN456",
                    "amount": 50.0,
                    "note": "external",
                    "payment_type": "PayPal",
                    "status": "Paid"
                }
            ],
            "setting": {
                "tax": false,
                "discount": 0.0,
                "discount_type": "",
                "language": "ar",
                "accepted_payment_methods": {
                    "card": true,
                    "bank_transfer": true,
                    "cash": true,
                    "paypal": true,
                    "e_signature": true
                }
            }
        }
    ],
    "total": 47,
    "page_size": 20,
    "page": 1
}

Try it now: Get Invoice API

Header Parameters

Header Value
Authorization: Bearer bearer_token REQUIRED obtain the bearer token from the Authorize endpoin. Read more information about Authentication.
Content-Type REQUIRED application/json

Query Parameters

Parameter Description
keyword OPTIONAL string The keyword you want to use for filtering (if needed).
page OPTIONAL int The page number parameter must be between 1 and 1000.
page_size OPTIONAL int The page_size for pagination parameter must be between 1 and 100.
from OPTIONAL date The start date in format (yyyy-mm-dd) for filtering invoices created on or after this date.
to OPTIONAL date The end date in format (yyyy-mm-dd) for filtering invoices created on or before this date.
status OPTIONAL string The status of the invoice, The possible values are:" ["sent", "paid", "void", or "refund."].
type OPTIONAL string The value for the type of the invoice: ["detailed", "repeated", "express", "pos", "item", "cashier", "payLink", "paymentGateway"]

Response

HTTP Status Code: 200 OK - The invoices information has been successfully retrieved.

Response Schema: application/json
status string the status of response.
SUCCESS
invoices array of objects:
  • id: int the id of the invoice
  • number: string the invoice number
  • currency: string the currency code
  • terms_conditions: string the invoice terms and conditions
  • note: string Additional notes (can be null)
  • date: string the date of the invoice
  • status: string the status of the invoice
  • type: string the type of the invoice
  • client: object the client information:
    • id: int the id of the client
    • name: string the client's name
    • address: string the client's address
    • phone: string the client's phone number
    • email: string the client's email address
    • notes: string Additional notes about the client (can be null)
  • title: string the title of the invoice
  • sid: string the invoice SID
  • link: string the invoice link URL
  • items: array of objects an array of invoice items:
    • id: int the id of the item
    • description: string the item description
    • type: string the item type
    • qty: float the quantity of the item
    • amount: float the item amount
  • payments: array of objects an array of payments related to the invoice:
    • id: int the id of the payment
    • payment_date: string the payment date
    • transaction_id: string the transaction ID
    • amount: float the payment amount
    • note: string Additional notes about the payment (can be null)
    • payment_type: string the payment type
    • status: string the payment status
  • setting: object the invoice settings:
    • tax: boolean indicates if tax applies
    • discount: float the discount amount
    • discount_type: string the discount type
    • language: string the language code
    • accepted_payment_methods: object the accepted payment methods:
      • card: boolean indicates if card payments are accepted
      • bank_transfer: boolean indicates if bank account payments are accepted
      • cash: boolean indicates if cash payments are accepted
      • paypal: boolean indicates if PayPal payments are accepted
      • e_signature: boolean indicates if electronic signatures are accepted
total int the total number of invoices.
47
page_size int the number of items per page.
20
page int the current page number.
1

Otherwise if there was a problem with your request, you'll receive an error response such as 400 status code, and the response will include an error object describing why this request failed.

Response Schema: application/json
status string The status of response.
error object:
  • error_code string, the naumber of error: e.g: 400, For more information
    see Response Code
  • description string, the description of error: e.g: bad request
technical-support

🛠️ Technical Support