Connector Improvement: Shopify Expired orders
AnsweredHI All,
We are currently facing an issue with one of our finance payment method providers is setting declined orders in "EXPIRED" state, but this state is NOT VISIBLE via REST API ( orders there are still visible as Pending .
I asked Shopify AI about it and got that response:
The REST API's
financial_statusfield in the Order endpoint stays as "PENDING" and doesn't show "EXPIRED". Let me search for information about where expired status information is available in Shopify's APIs. Perfect! I found the exact information you need. Based on the documentation, you're correct that the REST API'sfinancial_statusfield stays as "PENDING" for expired orders. However, there is a way to get the expired status information.The solution is to use the Admin GraphQL API instead of REST API.
In the Admin GraphQL API, you can access the
displayFinancialStatusfield on the Order object, which includesEXPIREDas one of its enum values:GraphQL field:
displayFinancialStatusEnum values include:
AUTHORIZEDEXPIRED← This is what you needPAIDPARTIALLY_PAIDPARTIALLY_REFUNDEDPENDINGREFUNDEDVOIDEDWhy this difference exists:
- The REST API's
financial_statusfield appears to maintain backward compatibility and shows "PENDING" for expired authorizations- The GraphQL API's
displayFinancialStatusfield provides more granular status information, including the "EXPIRED" stateTo get expired order information, you would need to:
- Use the Admin GraphQL API instead of REST API
- Query the
displayFinancialStatusfield on orders- Filter for orders where
displayFinancialStatusequalsEXPIREDThis is the only reliable way to programmatically identify expired orders through Shopify's APIs.
Will it be possible to add displayFinancialStatus to orders table?
-
Official comment
Hi Tomasz,
Thank you for your feature request regarding Shopify expired orders. We've implemented the GraphQL API, which includes the ability to view expired orders through the displayFinancialStatus field.
We're in the final steps of enabling this schema for everyone, and you can expect it to be available within the coming weeks. Setting up the new GraphQL schema will allow you to see expired orders as requested.
Best,
Sandeep
Please sign in to leave a comment.
Comments
1 comment