1

i try to get orderl list with this API :salesOrderList (SOAP V2) i use this code :

env = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        env.dotNet = false;
        env.xsd = SoapSerializationEnvelope.XSD;
        env.enc = SoapSerializationEnvelope.ENC;
        SoapObject request = new SoapObject(NAMESPACE,
                "salesOrderList");
        request.addProperty("sessionId", sessionId);
        //request.addProperty("customerId", id.toString());
        env.setOutputSoapObject(request);
        androidHttpTransport = new HttpTransportSE(URL);
        androidHttpTransport.debug = true;
        androidHttpTransport.call("", env);
        result = env.getResponse();
        Log.d("order result", result.toString());

and result :

increment_id=100000001;
                store_id=1; 
                created_at=2013-12-12 07:36:52; 
                updated_at=2013-12-12 07:36:57; 
                tax_amount=0.0000; 
                shipping_amount=0.0000; 
                discount_amount=0.0000; 
                subtotal=246.0000; 
                grand_total=246.0000; 
                total_qty_ordered=2.0000; 
                base_tax_amount=0.0000; 
                base_shipping_amount=0.0000; 
                base_discount_amount=0.0000; 
                base_subtotal=246.0000; 
                base_grand_total=246.0000; 
                billing_address_id=1; 
                billing_firstname=?????; 
                billing_lastname=????; 
                billing_name=????? ????; 
                store_to_base_rate=1.0000; 
                store_to_order_rate=1.0000; 
                base_to_global_rate=1.0000;
                base_to_order_rate=1.0000; 
                weight=0.0000; 
                store_name=Main Website

i have big problam ! there is no "customer_id" in result ! how can i get order list with id of order customer ?

  • 1
    Does this happen for all orders? Maybe the order you check is a guest order and the customer_id is null – Marius May 28 '14 at 13:17
1

Yes, I'm confirming that NOT LOGGED IN orders will assign those customers a customer_id of NULL Our site briefly allowed people to place orders without being logged in.

This query gets all the sales lines, so has redundant "order level" information:

SELECT 
      sfi.updated_at as 'date'
    , sfo.increment_id as 'order'
    , sfo.entity_id as 'sfo.entity_id'
    , sfo.customer_id as 'sfo.customer_id'
    , sfo.customer_firstname as 'sfo.first'
    , sfo.customer_lastname as 'sfo.last'
    , sfo.customer_email as 'sfo.customer_email'
    , sfii.sku as 'sku'
    , sfii.qty as 'qty'
    , sfii.base_row_total as 'row sales'
    , sfi.grand_total as 'order total'
    , LEFT(sfop.additional_information,20) as 'sfop.pmt_details'
    , sfi.shipping_amount as 'shipping'
    , sfii.tax_amount as 'tax_amount'
    , LEFT(sfii.name,20) as 'desc'
FROM 
    sales_flat_invoice_item sfii 
LEFT JOIN 
    sales_flat_invoice sfi ON sfii.parent_id = sfi.entity_id 
LEFT JOIN 
    sales_flat_order sfo ON sfi.order_id = sfo.entity_id 
LEFT JOIN 
    sales_flat_order_payment sfop ON sfop.parent_id = sfo.entity_id 
WHERE 
    sfo.status = 'complete' 
AND
    sfo.customer_id IS NULL
ORDER BY 
    sfo.increment_id DESC 

In my case there were 596 rows in set (0.47 sec).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.