Retrieving orders placed using the bogus gateway with GraphQL

Solved
Milkbottlelough
Tourist
6 0 5

I've been working on a custom app that processes orders and manipulates the data for a 3PL I'm working with.

In my store I have placed a number of test orders using the Shopify bogus payments gateway but I notice when running this query:

{
  orders(first: 25) {
    edges {
      node {
        id
        name
        totalPriceSet {
          shopMoney {
            amount
          }
        }
      }
    }
  }
}

I only get back the orders that were created as a draft and then marked as paid or else actual real orders using Shopify Payments.  I can't see anywhere in the docs that orders placed with the bogus gateway are not returned.  Has anyone come across this before?  I wanted to seed my store with multiple orders using the bogus gateway for stress testing but it appears this may not be the best course of action considering these orders won't be available via GraphQL.

Just curious if anyone in Shopify or the community can confirm if (and why) orders created using the bogus gateway do not show up in the query above?

thanks

L.

0 Likes
CalD
Shopify Staff
Shopify Staff
128 15 18

Hey @Milkbottlelough,

Using a similar query on my test store:

{
  orders(first: 25) {
    edges {
      node {
        id
        name
        totalPriceSet {
          shopMoney {
            amount
          }
        }
        transactions {
          gateway
        }
      }
    }
  }
}

 The following order data is returned (with "gateway":"bogus")

{
  "data": {
    "orders": {
      "edges": [
        {
          "node": {
            "id": "gid:\/\/shopify\/Order\/1938821349398",
            "name": "#1001",
            "totalPriceSet": {
              "shopMoney": {
                "amount": "13.91"
              }
            },
            "transactions": [
              {
                "gateway": "bogus"
              }
            ]
          }
        },

Are those orders Paid and Fulfilled? If so, they may be automatically Archived, which prevents them from being returned in a response, unless you specify query:"status:any".

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Milkbottlelough
Tourist
6 0 5

Hi CalD,

Thanks for taking the time to check that and replying.

All my test orders placed using the bogus gateway are paid and fulfilled but not archived.  Explicitly setting the query to "status:any" (or any of the other order states) doesn't help either, unfortunately.

Just to double-check we're on the same page this is the payment gateway I have configured in the store:

Milkbottlelough_0-1620112397099.png

Are you using the same?

I'll try this in a second dev store to see do I get the same results (or lack thereof!).  Just to note there are no issues when using the REST API to retrieve these orders.

thanks

L.

 

 

 

 

0 Likes
CalD
Shopify Staff
Shopify Staff
128 15 18

I was using the same gateway, yes.

If you're also seeing the same behaviour on the second dev store, send the shop_id where the orders are and I can take a look further.

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

Milkbottlelough
Tourist
6 0 5

Awesome, I just DMd you.  

Thanks!

L.

0 Likes
CalD
Shopify Staff
Shopify Staff
128 15 18

This is an accepted solution.

Hey @Milkbottlelough,

It looks like the orders in question are older than 60 days old. From here:

As of June 6th, 2018, only the last 60 days' worth of orders from a store will be accessible from the Order resource by default. If you want to access older orders, then you need to request access to all orders. If your app is granted access, then you can add the read_all_orders scope to your app along with read_orders or write_ordersPrivate apps are not affected by this change and are automatically granted the scope.

You'll need to request the read_all_orders scope for the app installed on the store that you're using to pull orders, and then update the OAuth scopes.

Hope that helps,

CalD | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
Milkbottlelough
Tourist
6 0 5

Thank you!  That really does help.

I feel like quite the dufus for not realising that early batch of orders was older than 60 days.  I'm developing a custom app and as you rightly pointed out I have not requested full access to the Orders resource so hence not seeing those old bogus gateway orders.

Thanks for your expert sleuthing!

L.

 

0 Likes