• Resolved cxtinac

    (@cxtinac)


    We use a nodejs back end to pull orders from a Woocommerce front end, using the nodejs woocommerce-api V2 package.
    I’m using a rest API query like the below, and the intent is to retrieve the most recent 20 orders, and sort them by ID, with the highest ID order at the end of the list for processing by other systems:
    orders?status=processing&filter[limit]=20&orderby=id&order=asc

    This query is working without errors, but here’s my logic question:
    Is the following the actual sequence of applying these parameters in Woocommerce?:
    orders > status=processing > filter[limit]=20 > orderby=id > order=asc
    This also assumes that the default sort order (date descending I believe from the API documentation) applies for the 20 limit, and subsequently the orderby and direction are applied.

    The reason for doing it this way is to avoid unnecessary traffic, especially since this runs fairly frequently to capture orders within a few minutes of being completed in the Woocommerce front end.

    Thanks for any clarification!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘REST API: sequence of applying query parameters’ is closed to new replies.