Invoice API

Last modified by stevensurowiec on Wed, August 13, 2008 12:55
Source|Old Revisions  

This is an old revision of the document!


Allows create/export order invoices

Module: Mage_Sales

Resource: sales_order_invoice

Aliases:

  • order_invoice

Methods

sales_order_invoice.list

Retrieve list of invoices by filters

Return: array Arguments:

  • array filters - filters for invoices list (optional)

Aliases:

  • order_invoice.list

sales_order_invoice.info

Retrieve invoice information

Return: array

Arguments:

  • string invoiceIncrementId - invoice increment id

Aliases:

  • order_invoice.info

sales_order_invoice.create

Create new invoice for order

Return: string

Arguments:

  • string orderIncrementId - order increment id
  • array itemsQty - items qty to invoice
  • string comment - invoice comment (optional)
  • boolean email - send invoice on e-mail (optional)
  • boolean includeComment - include comments in e-mail (optional)

Aliases:

  • order_invoice.create

sales_order_invoice.addComment

Add new comment to shipment

Arguments:

  • string invoiceIncrementId - invoice increment id
  • string comment - invoice comment
  • boolean email - send invoice on e-mail (optional)
  • boolean includeComment - include comments in e-mail (optional)

Aliases:

  • order_invoice.addComment

sales_order_invoice.capture

Capture invoice

Return: boolean

Arguments:

  • string invoiceIncrementId - invoice increment id

Aliases:

  • order_invoice.capture

sales_order_invoice.void

Void invoice

Return: boolean

Arguments:

  • string invoiceIncrementId - invoice increment id

Aliases:

  • order_invoice.void

sales_order_invoice.cancel

Cancel invoice

Return: boolean

Arguments:

  • string invoiceIncrementId - invoice increment id

Aliases:

  • order_invoice.cancel

Faults

Fault Code Fault Message
100 Requested shipment does not exists.
101 Invalid filters given. Details in error message.
102 Invalid data given. Details in error message.
103 Requested order does not exists
104 Invoice status not changed.

Examples

Example 1. Basic working with invoices.

  1. $proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
  2. $sessionId = $proxy->login('apiUser', 'apiKey');
  3.  
  4. $notInvoicedOrderId  = '100000003';
  5.  
  6. // Create new invoice
  7. $newInvoiceId = $proxy->call($sessionId, 'sales_order_invoice.create', array($notInvoicedOrderId, array(), 'Invoice Created', true, true));
  8.  
  9. // View new invoice
  10. $invoice = $proxy->call($sessionId, 'sales_order_invoice.info', $newInvoiceId);
  11.  
  12. var_dump($invoice);
  13.  
  14. // Add Comment
  15. $proxy->call($sessionId, 'sales_order_invoice.addComment', array($newInvoiceId, 'Invoice comment, some text', true, false));
  16.  
  17. // View invoice with new comment
  18. $invoice = $proxy->call($sessionId, 'sales_order_invoice.info', $newInvoiceId);
  19.  
  20. var_dump($invoice);
  21.  
  22. $proxy->call($sessionId, 'sales_order_invoice.capture', $newInvoiceId);
  23.  
  24. // View captured invoice
  25. $invoice = $proxy->call($sessionId, 'sales_order_invoice.info', $newInvoiceId);
  26. var_dump($invoice);



 

Magento 2 GitHub Repository

Magento Job Board - Some sort of tag line goes here

Latest Posts| View all Jobs