Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
W
whmcs-api
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Pedro Cavaleiro
  • whmcs-api
  • Wiki
  • Gettransactions()

Gettransactions()

Last edited by hitmanpt Feb 09, 2017
Page history

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
  • Function Details
  • Full Example

Function Overview

Prototype: public GetTransactions.GetTransactions GetTransactions(int InvoiceID = -1, int ClientID = -1, string TransactionID = "")

Input:

  • InvoiceID: Obtain transactions for a specific invoice id (optional)
  • ClientID: Find transactions for a specific client id (optional)
  • TransactionID: Find transactions for a specific transaction id (optional)

Output: GetTransactions Model


Function Details

To call it just use GetTransactions.GetTransactions tr = _api.GetTransactions(ClientID: 1);

This call to the function will ignore all arguments except ClientID

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

GetTransactions Model

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

Donate


Full example

using WHMCS_API;

namespace YourApp
{
  class YourClass
  {
    public void YourFunction()
    {
       API _api = new API("username", "password", "accesskey", "url");
       GetTransactions.GetTransactions tr = _api.GetTransactions(ClientID: 1);      
       Console.WriteLine("This client has {0} products", cp.NumberReturned);
       foreach(GetTransactions.Transaction t in tr.Transactions.Transaction)
       {
         Console.WriteLine("This transaction matches the invoice: {0}", t.InvoiceID);
       }
    }
  }
}
Clone repository
  • Addclient()
  • Addclient model
  • Advanced usage
  • Contrubute to the project
  • Domainwhois()
  • Domainwhois model
  • Getclientsdetails()
  • Getclientsdetails model
  • Getclientsdomains()
  • Getclientsdomains model
  • Getclientsproducts()
  • Getclientsproducts model
  • Getinvoice()
  • Getinvoice model
  • Getinvoices()
More Pages
×

New Wiki Page

Tip: You can specify the full path for the new file. We will automatically create any missing directories.