Skip to content

Sale_List

Jacob McConnell edited this page Jun 6, 2014 · 4 revisions

The SaleService class provides methods to retrieve and update sales.

##Method

###List

Use to retrieve a list of all sales or only those matching a variety of sale attributes.

####Arguments

  • TwoCheckoutConfig - Set your ApiUsername and ApiPassword.
  • SaleListServiceOptions Object containing list sales parameters

####Returns

Returns a SaleList object.

####Example Usage:

var ServiceObject = new SaleService();
var ArgsObject = new SaleListServiceOptions();
ArgsObject.customer_email = "[email protected]";

var result = ServiceObject.List(ArgsObject);

####Example Response:

{TwoCheckout.SaleList}
  page_info: { }
    {TwoCheckout.PageInfo}
      cur_page: 1
      first_entry: 1
      first_page: 1
      first_page_url: "https://www.2checkout.com/api/sales/list_sales?cur_page=1"
      last_entry: 20
      last_page: 2
      last_page_url: "https://www.2checkout.com/api/sales/list_sales?cur_page=2"
      next_page: 2
      pagesize: 20
      previous_page: null
      total_entries: 36
  sale_summary: ...
    {TwoCheckout.Sales}
      sale_id: 4831145848
      date_placed: 10/14/2012
      customer_name: "Craig P Christenson"
      recurring: 1
      recurring_declined: null
      customer_total: null
      sale_url: "https://www.2checkout.com/api/sales/detail_sale?sale_id=4831145848"
    {TwoCheckout.Sales}
      sale_id: 4831145362
      date_placed: 10/14/2012
      customer_name: "Testing T Tester"
      recurring: 0
      recurring_declined: null
      customer_total: null
      sale_url: "https://www.2checkout.com/api/sales/detail_sale?sale_id=4831145362"
    {TwoCheckout.Sales}
      sale_id: 4831096515
      date_placed: 10/14/2012
      customer_name: "Craig P Christenson"
      recurring: 0
      recurring_declined: null
      customer_total: null
...
Clone this wiki locally