sync_orders

Retrieve a list of orders that have changed.

Arguments

content_hashes ([String!]!)

An array of content hashes for orders the client has previously retrieved. The server will return order content hashes that do not match the client's content hashes.

include_descendant_organizations (Boolean)

List orders on organizations that are descended from the organization provided. Defaults to false.

organization_sentera_id (ID!)

The ID of the organization containing the orders to be synced.

Return fields

deleted ([SyncItem!]!)

Items that have been deleted.

failed ([SyncError!])

A list describing errors that occurred during the syncing process.

remaining_count (Int!)

The number of items remaining to be synced.

upserted ([SyncItem!]!)

Items that have been inserted or updated.

Examples

Sync Orders for an Organization

This query is used by a client to sync orders for a specific organization with orders stored on the server. This query will return up to the first 2,000 orders in the organization. To retrieve the remaining orders, a client should call this query repeatedly, passing in the full set of content hashes for orders it holds, until no more orders are returned, or the remaining count returned is 0.

Try this example in GraphiQL
query SyncOrganizationOrders {
  sync_orders(
  organization_sentera_id: "ezpt0wj_OR_8brhbkSentera_CV_deve_877281e47_210503_085333",
  content_hashes: [
    "xdNDk/aet07YA1pi"
    "/h9Kp8h1wLAR77g6"
    "pZCIzimW+sJQ1tPP"
    "zShxQoCpBmIvKQzg"
    "qYcc+5d0r6xXrJ+B"
    "1RUHdRg7eewn5Ytc"
    "jut/CTgwHV4nPhHU"
    "3mT/9ITHMbrufod3"
    "Frw7c/jWXG0DGhDp"
    "szY6ppzZ4mJKUK//"
    "szOWioO7aPh41tns"
    "aHhl10uJY5pP8x5Y"
    "s8O1QwaYex8nMGIt"
    "2iZuIOjIq9GToC1k"
    "nZ21khXOu5k96QNW"
  ]
  ) {
  remaining_count
  upserted {
    sentera_id
    content_hash
    ... on Order {
      status
    }
  }
  deleted {
    sentera_id
    content_hash
  }
  }
}

{
  "data": {
  "sync_orders": {
    "remaining_count": 102,
    "upserted": [
      {
        "sentera_id": "w9n9629_OD_8t8cAcme_CV_stag_877281e47_210503_085336",
        "content_hash": "XWbX2szIhrApOpVW",
        "status": "PROCESSING"
      }
    ],
    "deleted": [
      {
        "sentera_id": "dfaxv57_OD_SHORT1_CV_stag_dc0d87d_170907_235328",
        "content_hash": "DwnxuWkm8Lo6bC5R"
      }
    ]
  }
  }
}