2

salesOrderInvoiceList gives me a list of the invoices:

object(stdClass)[5]
  public 'complexObjectArray' => 
    array (size=9)
      0 => 
        object(stdClass)[6]
          public 'increment_id' => string '100000001' (length=9)
          public 'created_at' => string '2014-12-02 04:05:47' (length=19)
          public 'order_currency_code' => string 'AUD' (length=3)
          public 'order_id' => string '688' (length=3)
          public 'state' => string '2' (length=1)
          public 'grand_total' => string '70.0000' (length=7)
          public 'invoice_id' => string '448' (length=3)
      1 => 
        object(stdClass)[7]
          public 'increment_id' => string '100000002' (length=9)
          public 'created_at' => string '2014-12-02 04:08:49' (length=19)
          public 'order_currency_code' => string 'AUD' (length=3)
          public 'order_id' => string '687' (length=3)
          public 'state' => string '2' (length=1)
          public 'grand_total' => string '60.0000' (length=7)
          public 'invoice_id' => string '449' (length=3)

Is there a way to retrieve invoices based on the customer ID and/or email? Do I need to create my own API?

1 Answer 1

1

The Magento documentation on salesOrderInvoiceList states that you can apply "complex filters"

Reading from the example, I think you can achieve this doing:

$client = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$session = $client->login('apiUser', 'apiKey');
$complexFilter = array(
    'complex_filter' => array(
        array(
            'key' => 'customer_id',
            'value' => array('key' => 'eq', 'value' => '1234')
        )
    )
);
$result = $client->salesOrderInvoiceList($session, $complexFilter);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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