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
  • Getorders()

Getorders()

Last edited by hitmanpt Feb 08, 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 GetOrders.GetOrders GetOrders(int LimitStart = 0, int LimitNumber = 25, int OrderID = -1, int UserID = -1, string Status = "")

Input:

  • LimitStart: The offset for the returned log data (optional [default: 0])
  • LimitNumber: The number of records to return (optional [default: 25])
  • OrderID: The specific order id to obtain the details for (optional)
  • UserID: The client id to obtain the details for (optional)
  • Status: Find orders for a specific status (optional)

Output: GetOrders Model


Function Details

To call it just use GetOrders.GetOrders orders = _api.GetOrders(UserID: 1);

This call to the function will ignore all arguments except ClientID

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

GetOrders Model

WHMCS API Reference: https://developers.whmcs.com/api-reference/getorders/

Donate


Full example

using WHMCS_API;

namespace YourApp
{
  class YourClass
  {
    public void YourFunction()
    {
       API _api = new API("username", "password", "accesskey", "url");
       GetOrders.GetOrders orders = _api.GetOrders(OrderID: 1);
       Console.WriteLine("There are {0} items in this order", orders.Orders.Order.FirstOrDefault().LineItems.LineItems.Count());
       foreach(GetOrders.Lineitem item in orders.Orders.Order.FirstOrDefault().LineItems.LineItem)
       {
         Console.WriteLine("Item Name: {0}", item.Product);
       }
    }
  }
}
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.