Search code examples
magentogetmagento2

Magento - How Do I Get All The Invoices Of A Sales Order With A HTTP GET Request To The API?


Requirements:

To obtain all the invoice information of a sales order, by using only the sales order id.

Problem:

Looking at the Magento 2 API Documentation, I cannot see a method that allows a HTTP GET request. Also, when viewing the response for the sales order, I cannot see a reference to the invoice id. /orders/{order_id}


Solution

  • Go to the API documentation, and find "invoices".

    The request should look something like this:

    /V1/invoices
    searchCriteria[filterGroups][0][filters][0][eq]
    searchCriteria[filterGroups][0][filters][0][id]
    searchCriteria[filterGroups][0][filters][0][invoice_id]
    

    Invoices Screen Grab