Parameters broken at REST API 2022-10 orders.json

Parameters broken at REST API 2022-10 orders.json

cottton
Shopify Partner
11 0 13

Since this morning around 8am we receive

empty response

HTTP/1.1 200 OK
{"orders":[]}

on requests

path: 
/admin/api/2022-10/orders.json

options: array( 'name' => 'EXAMPLE', 'ids' => null, 'since_id' => null, 'status' => 'any', 'fulfillment_status' => 'any', 'financial_status' => 'any', 'created_at_max' => null, 'created_at_min' => null, 'updated_at_max' => null, 'updated_at_min' => null, 'processed_at_max' => null, 'processed_at_min' => null, 'fields' => null, 'limit' => 50, )

final url:
/admin/api/2022-10/orders.json?name=EXAMPLE&status=any&fulfillment_status=any&financial_status=any&limit=50

header
'Accept: application/json'
'Accept-Charset: utf-8'
'Content-Type: application/json'
'X-Shopify-Access-Token: ***'
'User-Agent: rest-api-test-dev'
'Expect:'

where the orders definitely exists.

 

Weird:

- when i remove the options `financial_status` AND `fulfillment_status`
then it works.

- using null on both does not work

- using random (wrong) strings like "sasas" does not work and does not trigger an error

- using any other parameter value than "any" on both works. So it looks like the option "any" is no more existing for both parameters. 

 

Still testing.

Anybody got the same problem and|or an explanation?

Replies 10 (10)

AlexanderPashuk
Visitor
2 0 7

The same problem with other versions of API (older and newer). Yesterday it worked.

 

Looks like Shopify team broke orders API... I have only one question: why have older versions of API changed? I thought that the main reason for versioning of API is to provide stable API points to use in application. This is not serious - how can other developers create some applications based on such API. It's a rhetorical question.

james148
Shopify Partner
27 0 11

I guess stuff like this can occur - but your point is perfectly valid...this whole 3 month versioning is absolutely bonkers when stuff breaks like this!

AlexanderPashuk
Visitor
2 0 7

I agree - shit happens sometimes 🙂

But this is not the first time we have had problems while working with Shopify API during the year...

cottton
Shopify Partner
11 0 13

TL;DR: use|map "fulfillment_status" and "financial_status" to NULL if you would use "any".

 

A tmp solution for a search by "name" (aka increment id) is
to disable (NULL) the two params, but keep the "status" : "any".

NULL actually should mean that your http client will not send this param.


Why:
"fulfillment_status" and "financial_status" are by default "any".
(See https://shopify.dev/docs/api/admin-rest/2023-10/resources/order#get-orders)
BUT "status" is by default "open". So you would get different results without a status" : "any".

I tested this with our dev shop and i got all (different status) orders with the 2 NULL-params.
So not using those 2 params (still) means by default "any", as documented and expected.

 

Find by name example:

// Example params to search an order by "name" : "ABC1234"
array(
    'name'               => 'ABC1234',
    'ids'                => null,
    'since_id'           => null,
    'status'             => 'any', // KEEP!
    'fulfillment_status' => null, // DISABLED 'any',
    'financial_status'   => null, // DISABLED 'any',
    'created_at_max'     => null,
    'created_at_min'     => null,
    'updated_at_max'     => null,
    'updated_at_min'     => null,
    'processed_at_max'   => null,
    'processed_at_min'   => null,
    'fields'             => null,
    'limit'              => 50,
)
// Then check if result count = 1 and result[0][name] = {expected name}​



As for search functions that filter by dynamically params:
you could map the 2 params "fulfillment_status" and "financial_status".
PHP code:

$options = {get the options as usual}
foreach (['fulfillment_status', 'financial_status'] as $offset) {
    if (isset($options[$offset]) and $options[$offset] === "any") {
        $options[$offset] = null;
    }
}

So your "any" search, which is now broken, is just using the default (working) "any".

TranslatorDerek
Shopify Partner
8 0 0

We are seeing the same failures within the last 20 hours. No longer marked as Unfulfilled status appears as null in both API and .json view.

Marcus_Mc
Visitor
2 0 0

Hi Cotton / All,
We run a Sap to Shopify to Sap custom C# tool we developed to assist with aligning stock level, using committed, sold, to calculate replenishment quantities, this tool is run weekly and we have just found the same issue as above, using...
API
2022-10/orders.json
Filter
fulfillment_status=null
Endpoint
https://xxxxxxx-xxxxxxxx-xxxxxx.myshopify.com/admin/api/2022-10/orders.json?fulfillment_status=null

This API is now returning 0 orders, when we can clearly see we have committed orders on the shop that's not been fulfilled.


In your expert opinion, am I best to find an alternative?, or wait for the API to be made whole again 🙂

Thanks in advance.
All the best
Marcus


james148
Shopify Partner
27 0 11

Depends how quickly you need those orders synced?

Marcus_Mc
Visitor
2 0 0

All sorted,
Changed from
myshopify.com/admin/api/2022-10/orders.json?fulfillment_status=null
Changed to
myshopify.com/admin/api/2022-10/orders.json?fulfillment_status=unshipped

Un-fulfilled orders are now being returned as expected 🙂

Thanks all..

BR
M

ThinkingShip
Shopify Partner
1 0 0

Same problem here with:

/admin/api/2023-07/orders.json?fulfillment_status=fulfilled&status=any&created_at_min=2023-04-07T14:12:07+00:00

 

We keep getting empty results.

 

 

NicklasSmit
Shopify Partner
4 0 0

+1 I am having the exact same error since last night, 24-10-2024. Hopefully this will be resolved soon. Tons of backend systems being effected by this.