Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

GetInvoices()

hitmanpt edited this page Feb 9, 2017 · 1 revision

Through this explanation we assume that you have using WHMCS_API; on the begining of the file
And the API() class initialized as _api
If needed check the Getting Started page

Contents


Function Overview

Prototype: GetInvoices.GetInvoices GetInvoices(int LimitStart = 0, int LimitNumber = 25, int UserID = -1, string Status = "")

Input:

  • LimitStart: The offset for the returned invoice data (optional [default: 0])
  • LimitNumber: The number of records to return (optional [default: 25])
  • UserID: Find invoices for a specific client id (optional)
  • Status: Find invoices for a specific status. Standard Invoice statuses plus Overdue (optional)

Output: GetInvoices Model


Function Details

To call it just use GetInvoices.GetInvoices gi = _api.GetInvoices();

This way we get the first 25 invoices generated by the WHMCS platform

The GetTransactions model is inside it's own namespace (more info)

View all details about GetInvoices Model

https://developers.whmcs.com/api-reference/getinvoices/

Donate


Full example

using WHMCS_API;

namespace YourApp
{
  class YourClass
  {
    public void YourFunction()
    {
       API _api = new API("username", "password", "accesskey", "url");
       GetInvoices.GetInvoices gi = _api.GetInvoices();      
       foreach(GetInvoices.Invoice i in gi.Invoices.Invoice)
       {
         Console.WriteLine("The User: {0} has the invoice id {1} with status {2}", i.Firstname, i.ID, i.Status);
       }
    }
  }
}