Language

2Checkout Documentation

Retrieve

Twocheckout_Sale class provides methods to retrieve and update sales and will return an Array or JSON response depending on your format specification.

Method

retrieve

Use to retrieve sale or invoice information.

Arguments

  • Array containing list_sale parameters or sale_id/invoice_id. Parameters -> API List Sales

Returns

Returns an Array or JSON depending on your format specification.

Example Usage:

Twocheckout::username('APIuser1817037');
Twocheckout::password('APIpass1817037');

$args = array(
    'sale_id' => 4753371371
);

$result = Twocheckout_Sale::retrieve($args);

Example Response:

Array
(
    [response_code] => OK
    [response_message] => Sale detail retrieved
    [sale] => Array
        (
            [comments] => Array
                (
                    [0] => Array
                        (
                            [changed_by_ip] => 76.181.170.90
                            [comment] => Refund Issued On Invoice: Order never sent.
                            [timestamp] => 2012-10-23 20:35:21
                            [username] => APIuser1817037
                        )

                    [1] => Array
                        (
                            [changed_by_ip] => 76.181.170.90
                            [comment] => [* Sent: Customer *] Your order will be shipped soon.
                            [timestamp] => 2012-10-23 20:30:52
                            [username] => APIuser1817037
                        )

                    [2] => Array
                        (
                            [changed_by_ip] => 76.181.170.90
                            [comment] => Recurring billing stopped for Subscription
                            [timestamp] => 2012-10-23 20:26:35
                            [username] => APIuser1817037
                        )

                )

            [customer] => Array
                (
                    [address_1] => 123 Test St
                    [address_2] => dddsdsc
                    [address_id] => 4837725758
                    [cardholder_name] => Craig P Christenson
                    [city] => Columbus
                    [country_code] => USA
                    [country_name] => United States
                    [customer_id] => 4837725734
                    [email_address] => christensoncraig@gmail.com
                    [first_name] => Craig
                    [lang] => en
                    [last_name] => Christenson
                    [middle_initial] => P
                    [pay_method] => Array
                        (
                            [avs] => 
                            [cvv] => 
                            [first_six_digits] => 
                            [last_two_digits] => 
                            [method] => paypal ec
                        )

                    [phone] => 555-555-5555
                    [phone_ext] => 
                    [postal_code] => 43123
                    [prefix] => 
                    [state] => OH
                )

            [date_placed] => 2012-10-23 09:48:13
            [detail_ip] => Array
                (
                    [address] => 76.181.170.90
                    [area_code] => 614
                    [city] => Columbus
                    [country] => United States
                    [country_code] => US
                    [region] => OH
                    [zip] => 43204
                )

            [invoices] => Array
                (
                    [0] => Array
                        (
                            [customer_total] => 1.00
                            [date_placed] => 2012-10-23 09:48:13
                            [date_shipped] => 
                            [date_vendor_paid] => 
                            [fees_2co] => 0.49
                            [invoice_id] => 4837725737
                            [lineitems] => Array
                                (
                                    [0] => Array
                                        (
                                            [affiliate_vendor_id] => 
                                            [billing] => Array
                                                (
                                                    [amount] => 1.00
                                                    [bill_method] => paypal_int
                                                    [billing_id] => 4837725755
                                                    [customer_amount] => 1.00
                                                    [customer_id] => 4837725734
                                                    [date_deposited] => 
                                                    [date_end] => 1999-01-01
                                                    [date_fail] => 2012-10-30
                                                    [date_next] => 2012-11-23
                                                    [date_pending] => 2012-10-23
                                                    [date_start] => 2012-10-25
                                                    [lineitem_id] => 4837725749
                                                    [recurring_status] => stopped
                                                    [status] => bill
                                                    [usd_amount] => 1.00
                                                    [vendor_amount] => 1.00
                                                )

                                            [commission] => 
                                            [commission_affiliate_vendor_id] => 
                                            [commission_flat_rate] => 
                                            [commission_percentage] => 
                                            [commission_type] => 
                                            [commission_usd_amount] => 
                                            [customer_amount] => 1.00
                                            [flat_rate] => 
                                            [installment] => 1
                                            [invoice_id] => 4837725737
                                            [lc_affiliate_vendor_id] => 
                                            [lc_usd_amount] => 
                                            [lineitem_id] => 4837725749
                                            [linked_id] => 
                                            [options] => Array
                                                (
                                                )

                                            [percentage] => 
                                            [product_description] => 
                                            [product_duration] => Forever
                                            [product_handling] => 
                                            [product_id] => 
                                            [product_is_cart] => 0
                                            [product_name] => Subscription
                                            [product_price] => 1.00
                                            [product_recurrence] => 1 Month
                                            [product_startup_fee] => 
                                            [product_tangible] => 
                                            [sale_id] => 4837725728
                                            [status] => bill
                                            [type] => product
                                            [usd_amount] => 1.00
                                            [usd_commission] => 
                                            [vendor_amount] => 1.00
                                            [vendor_product_id] => 
                                        )

                                    [1] => Array
                                        (
                                            [affiliate_vendor_id] => 
                                            [billing] => Array
                                                (
                                                    [amount] => 1.00
                                                    [bill_method] => paypal_int
                                                    [billing_id] => 4838136047
                                                    [customer_amount] => 1.00
                                                    [customer_id] => 4837725734
                                                    [date_deposited] => 
                                                    [date_end] => 
                                                    [date_fail] => 2012-10-28
                                                    [date_next] => 
                                                    [date_pending] => 
                                                    [date_start] => 2012-10-23
                                                    [lineitem_id] => 4838136044
                                                    [recurring_status] => 
                                                    [status] => refund
                                                    [usd_amount] => 1.00
                                                    [vendor_amount] => 1.00
                                                )

                                            [commission] => 
                                            [commission_affiliate_vendor_id] => 
                                            [commission_flat_rate] => 
                                            [commission_percentage] => 
                                            [commission_type] => 
                                            [commission_usd_amount] => 
                                            [customer_amount] => 1.00
                                            [flat_rate] => 
                                            [installment] => 1
                                            [invoice_id] => 4837725737
                                            [lc_affiliate_vendor_id] => 
                                            [lc_usd_amount] => 
                                            [lineitem_id] => 4838136044
                                            [linked_id] => 4837725749
                                            [options] => Array
                                                (
                                                )

                                            [percentage] => 
                                            [product_description] => 
                                            [product_duration] => Forever
                                            [product_handling] => 
                                            [product_id] => 
                                            [product_is_cart] => 0
                                            [product_name] => Subscription
                                            [product_price] => 1.00
                                            [product_recurrence] => 1 Month
                                            [product_startup_fee] => 
                                            [product_tangible] => 
                                            [sale_id] => 4837725728
                                            [status] => refund
                                            [type] => product
                                            [usd_amount] => 1.00
                                            [usd_commission] => 
                                            [vendor_amount] => 1.00
                                            [vendor_product_id] => 
                                        )

                                )

                            [recurring] => 1
                            [referrer] => http://localhost:8080/register
                            [sale_id] => 4837725728
                            [shipping] => 
                            [status] => pending
                            [usd_total] => 1.00
                            [vendor_id] => 1817037
                            [vendor_order_id] => test2
                            [vendor_total] => 1.00
                        )

                )

            [ip_address] => 76.181.170.90
            [ip_country] => United States
            [recurring_decline] => 
            [sale_id] => 4837725728
        )

)