Announcement

Collapse
No announcement yet.

Help with JSON API OrderList_Load_Query question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help with JSON API OrderList_Load_Query question

    I am trying to automate orders from Miva to our accounting system and I want to pull orders using the JSON API OrderList_Load_Query. I only want to pull orders from a certain date and time say orders submitted from todays date. I seem to be having trouble in returning the orders for the current date. My results are from 2016 year.

    Here is my JSON Request in Powershell, I would like it to return orders from just the current date:

    $Date = Get-Date
    $Date = ([DateTimeOffset]$Date).ToUnixTimeSeconds()

    $body = @{
    Store_Code = $storeCode
    Function = 'OrderList_Load_Query'
    Count = '0'
    Offset = '0'
    Filter = @(
    @{
    name = "search"
    value = @(
    @{
    field = "orderdate"
    operator = "EQ"
    value = "$Date"
    }
    )
    }
    )
    }

    if ( $includeTimestamp )
    {
    $body["Miva_Request_Timestamp"] = [DateTimeOffset]::Now.ToUnixTimeSeconds()
    }

    $body = $body | ConvertTo-Json

    #2
    So you're getting results, just not the filtered results you expect? Your overall request structure looks fine. Do you have a way to log the actual request to see if the timestamp is accurate?
    Brennan Heyde
    VP Product
    Miva, Inc.
    [email protected]
    https://www.miva.com

    Comment


      #3
      I got it figured it, my JSON formatting was correct. It was a powershell function with the Convertto-Json depth on a default only set to 2

      Comment

      Working...
      X