Development discussions around Shopify APIs
Return management just got easier! We’ve launched Customer Self-Serve Returns to all Shopify merchants. Click here to learn more!
Hi all,
I've built a fulfillment app for our store (carrier integrations in NZ are terrible, so it made sense for our use case to build). We're adding in functionality to handle fulfillment holds, as they're quite useful if there are any issues with the customer's details. However, the GraphQL API appears to be inconsistent in updating the updatedAt field if a fulfillment hold is applied or removed. Our update is currently based on polling for new orders rather than using webhooks, and so we use a query to check for orders updated since our last poll. If the updatedAt field doesn't change for a fulfillment hold, we can't update the order in our system.
Our query is (just limited to one order for an example):
{
orders (first: 10, query: "name:1024") {
pageInfo {
hasNextPage
}
edges{
cursor
node {
name
updatedAt
createdAt
fulfillmentOrders(first: 3, reverse: true) {
edges {
node {
id
status
deliveryMethod {
methodType
}
}
}
}
}
}
}
}
On an order with no fulfillment holds, this will return:
"data": {
"orders": {
"pageInfo": {
"hasNextPage": false
},
"edges": [
{
"cursor": "eyJsYXN0X2lkIjo0MjM2NDAwODUzMTg2LCJsYXN0X3ZhbHVlIjoxNjM2OTQ4MTUxMDAwfQ==",
"node": {
"name": "#1024",
"updatedAt": "2021-11-23T04:08:43Z",
"createdAt": "2021-11-15T03:49:11Z",
"fulfillmentOrders": {
"edges": [
{
"node": {
"id": "gid://shopify/FulfillmentOrder/5139950731458",
"status": "OPEN",
"deliveryMethod": null
}
}
]
}
}
}
]
}
},
If I add a fulfillment hold, the query will return:
"data": {
"orders": {
"pageInfo": {
"hasNextPage": false
},
"edges": [
{
"cursor": "eyJsYXN0X2lkIjo0MjM2NDAwODUzMTg2LCJsYXN0X3ZhbHVlIjoxNjM2OTQ4MTUxMDAwfQ==",
"node": {
"name": "#1024",
"updatedAt": "2021-11-23T04:08:43Z",
"createdAt": "2021-11-15T03:49:11Z",
"fulfillmentOrders": {
"edges": [
{
"node": {
"id": "gid://shopify/FulfillmentOrder/5139950731458",
"status": "ON_HOLD",
"deliveryMethod": null
}
}
]
}
}
}
]
}
},
(note no change to the 'updatedAt' field)
When I remove the fulfillment hold ("Release Fulfillment" in the Shopify Admin), the query will return:
"data": {
"orders": {
"pageInfo": {
"hasNextPage": false
},
"edges": [
{
"cursor": "eyJsYXN0X2lkIjo0MjM2NDAwODUzMTg2LCJsYXN0X3ZhbHVlIjoxNjM2OTQ4MTUxMDAwfQ==",
"node": {
"name": "#1024",
"updatedAt": "2021-11-23T04:27:08Z",
"createdAt": "2021-11-15T03:49:11Z",
"fulfillmentOrders": {
"edges": [
{
"node": {
"id": "gid://shopify/FulfillmentOrder/5139950731458",
"status": "OPEN",
"deliveryMethod": null
}
}
]
}
}
}
]
}
},
which has the updatedAt field changed to reflect the update in the FulfillmentOrder status.
Is this intentional behaviour? Has anyone found a workaround around this?
I am facing it too. It looks like putting order on hold does not update field :updated_at while releasing fulfillment does. This makes our system unable to fetch and handle an order once it got put on hold.
User | RANK |
---|---|
16 | |
7 | |
7 | |
6 | |
5 |
Learn these 5 things I had to learn the hard way with starting and running my own business
By Kitana Jan 27, 2023Would you love to unleash the unbridled power of the Google Shopping Channel into your sho...
By Gabe Jan 6, 2023How can you turn a hobby into a career? That’s what Emmanuel did while working as a wa...
By Skye Dec 30, 2022