1

I'm currently using PowerShell's Invoke-RestMethod to access Magento APIs. My problem is I'm trying to pass some searchCriteria in a $body variable to look for a specific 'increment_id'. Here is the code:

    $body = @{
'searchCriteria' = @{
         'filterGroups' = @{
                 'filters' = @{
                         'field' = 'increment_id'
                         'value' = '878'
                         'condition_type' = 'eq'
                     }
                }
            }
        }

Invoke-RestMethod -Uri $uri -Headers $header -Body $body -OutFile "C:\order.txt"

When this command is run, I get a response that contains all of the orders on our site. At this point, I'm just trying to learn my way through using the Invoke-RestMethod command, but my end goal is to use this command to retrieve the latest order that was placed on the Magento site.

Thanks, Trevor

Your Answer

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

Browse other questions tagged or ask your own question.