Order Created WebHook

is there is away to capture “order created” via a webhook?

Hello @ahmadMamdouh!

Unfortunately, there is no webhook for new orders.

How is your workflow today? Where are your orders coming from?

Kind regards,
TomasFD

Hi Tomas,

I had the same question. I need to record each new order that enters shiphero. My orders are coming from Shopify. Is there another webhook that can achieve this, or do you have any workarounds for this?

Yash

Hello @Yash!

As there is no webhook, my recommendation would be to use a query like this:

query{
  orders(order_date_from:"ISODateTime"){
    request_id
    complexity
    data(first:100){
      pageInfo{
        endCursor
        hasNextPage
      }
      edges{
        node{
          id
          order_number
          line_items(first:3){
            pageInfo{
              endCursor
              hasNextPage
            }
            edges{
              node{
                id
                sku
              }
            }
          }
        }
      }
    }
  }
}
  • You use the order date, which is the date-time of creation
  • You could run it every set time, 15min, an hour, etc. Filtering using date-time from the last time you ran the query. So at 11 PM, you would run it with "2022-06-16 22:45:00" and at 11:15 PM with "2022-06-16 23:00:00" if you are doing it in 15min increments.
  • Using first:100 in orders and first:3 in line items will cost 301 credits. You will be full again in 10 seconds.
  • Use pageInfo to paginate in case there are some more orders or if some orders have more than 3 line items. You could also play with those numbers, pull more orders, or more line items per order. For example, if 90% of your orders have 2 or fewer line items, I would save credits and use only first:2 for line items. You can find more about pagination here.
  • I used a few fields on each object to shorten the post. You can check the rest of them in our schema.

Have a nice day!
TomasFD