Language

2Checkout Documentation

Retrieve

The SaleService class provides methods to retrieve and update sales.

Method

Retrieve

Use to retrieve a Sale object.

Arguments

  • TwoCheckoutConfig - Set your ApiUsername and ApiPassword.
  • SaleRetrieveServiceOptions - Object containing detail sale parameters.

Returns

Returns a Sale object.

Example Usage:

var ServiceObject = new SaleService();
var ArgsObject = new SaleRetrieveServiceOptions();
ArgsObject.sale_id = sale_id;

var result = ServiceObject.Retrieve(ArgsObject);

Example Response:

{TwoCheckout.Sale}
  date_placed: 10/14/2012
  ip_address: "76.181.170.90"
  ip_country: "United States"
  recurring_decline: null
  sale_id: 4831145362
  invoices: ...
    {TwoCheckout.Invoice}
      invoice_id: 4831145371
      customer_total: 0.01
      date_placed: 10/14/2012
      date_shipped: null
      date_vendor_paid: null
      fees_2co: 0.46
      recurring: 0
      referrer: null
      sale_id: 4831145362
      status: "pending"
      usd_total: 0.01
      vendor_id: 1817037
      vendor_order_id: null
      vendor_total: 0.01
      lineitems: ...
        {TwoCheckout.Lineitems}
          commission: null
          commission_affiliate_vendor_id: null
          commission_flat_rate: null
          commission_percentage: null
          commission_type: null
          commission_usd_amount: null
          customer_amount: 0.01
          flat_rate: null
          installment: null
          invoice_id: 4831145371
          lc_affiliate_vendor_id: null
          lc_usd_amount: null
          lineitem_id: 4831145380
          linked_id: null
          options: ...
          billing: { }
            {TwoCheckout.Billing}
              amount: 0.01
              bill_method: "paypal_int"
              billing_id: 4831145383
              customer_amount: 0.01
              customer_id: 4831145368
              date_deposited: null
              date_end: 10/21/2012
              date_fail: 10/21/2012
              date_next: null
              date_pending: 10/14/2012
              date_start: 10/16/2012
              lineitem_id: 4831145380
              recurring_status: null
              status: "bill"
              usd_amount: 0.01
              vendor_amount: 0.01
          percentage: null
          product_description: "Test Description"
          product_duration: null
          product_handling: "0.00"
          product_id: 4774387610
          product_is_cart: "0"
          product_name: "Test Product"
          product_price: 0.01
          product_recurrence: null
          product_startup_fee: null
          product_tangible: "1"
          sale_id: 4831145362
          status: "bill"
          type: null
          usd_amount: 0.01
          usd_commission: null
          vendor_amount: 0.01
          vendor_product_id: "test"
        {TwoCheckout.Lineitems}
          commission: null
          commission_affiliate_vendor_id: null
          commission_flat_rate: null
          commission_percentage: null
          commission_type: null
          commission_usd_amount: null
          customer_amount: 0.00
          flat_rate: null
          installment: null
          invoice_id: 4831145371
          lc_affiliate_vendor_id: null
          lc_usd_amount: null
          lineitem_id: 4831145386
          linked_id: null
          options: ...
          billing: { }
            {TwoCheckout.Billing}
              amount: 0.00
              bill_method: "paypal_int"
              billing_id: 4831145389
              customer_amount: 0.00
              customer_id: 4831145368
              date_deposited: null
              date_end: 10/21/2012
              date_fail: 10/21/2012
              date_next: null
              date_pending: 10/14/2012
              date_start: 10/16/2012
              lineitem_id: 4831145386
              recurring_status: null
              status: "bill"
              usd_amount: 0.00
              vendor_amount: 0.00
          percentage: null
          product_description: null
          product_duration: null
          product_handling: null
          product_id: null
          product_is_cart: "0"
          product_name: "Shipping: TestShipping"
          product_price: 0.00
          product_recurrence: null
          product_startup_fee: null
          product_tangible: "0"
          sale_id: 4831145362
          status: "bill"
          type: "shipping"
          usd_amount: 0.00
          usd_commission: null
          vendor_amount: 0.00
          vendor_product_id: null
      shipping: { }
        {TwoCheckout.Shipping}
          address_1: "​855 Grandview Avenue"
          address_2: "Suite 11"
          city: "Columbus"
          country_code: "USA"
          country_name: "United States"
          date_shipped: null
          invoice_id: 4831145371
          postal_code: "43215"
          shipping_address_id: 4831145401
          shipping_id: 4831145377
          shipping_method_id: 4830041274
          shipping_method_name: "TestShipping"
          shipping_name: "Tester"
          state: "OH"
          tracking_number: null
          tracking_url: null
  comments: ...
  customer: { }
    {TwoCheckout.Customer}
      address_1: "​855 Grandview Avenue"
      address_2: "Suite 11"
      address_id: "4831145392"
      cardholder_name: "Testing T Tester"
      city: "Columbus"
      country_code: "USA"
      country_name: "United States"
      customer_id: 4831145368
      email_address: "no-reply@2checkout.com"
      first_name: "Testing"
      lang: "en"
      last_name: "Tester"
      middle_initial: "T"
      pay_method: { }
        {TwoCheckout.PayMethod}
          avs: null
          cvv: null
          first_six_digits: null
          last_two_digits: null
          method: "paypal ec"
  detail_ip: { }
    {TwoCheckout.DetailIP}
      address: "76.181.170.90"
      area_code: "614"
      city: "Columbus"
      country: "United States"
      country_code: "US"
      zip: "43215"