Fulfillment Order Cancellation Requests Failing

precisionlaser
Excursionist
14 1 0

My app is setup to receive the FULFILLMENT_REQUEST and CANCELLATION_REQUEST requests via a callback endpoint on my server. The fulfillment request side works flawlessly and reliably, but I can't get the cancellation request side to work reliably. As an example for this post, I created a test order in my dev store and it arrived at the endpoint complete with all of the fulfillment order information. I accepted the order and then submitted a cancellation request. At the callback, I got a response but only an empty edges array where the product info should have been found.  My graphql query is as follows:

 

{
shop {
assignedFulfillmentOrders(first: 10, assignmentStatus: CANCELLATION_REQUESTED) {
pageInfo {
hasNextPage
hasPreviousPage
}
edges {
cursor
node {
id
requestStatus
merchantRequests(first: 10, reverse: true) {
edges {
cursor
node {
message
sentAt
}
}
}
}
}
}
}
}

This is what I get as a response:

{
"errors": false,
"response": {},
"status": 200,
"body": {
"data": {
"shop": {
"assignedFulfillmentOrders": {
"pageInfo": {
"hasNextPage": false,
"hasPreviousPage": false
},
"edges": []
}
}
},
"extensions": {
"cost": {
"requestedQueryCost": 133,
"actualQueryCost": 3,
"throttleStatus": {
"maximumAvailable": 1000,
"currentlyAvailable": 997,
"restoreRate": 50
}
}
}
},
"timestamps": [
1602981962.5611119
]
}

I'm new to graphql so I wonder if it's something I've done wrong or if there's a bug in the api code...help!

0 Likes
precisionlaser
Excursionist
14 1 0

More info in case it helps. Here is one set of responses I got from the API where I submitted an order from my development store to my app. I then "accepted" the order on the app and then I requested cancellation from the development store. As you can see, I get nothing in the edges array (most of the time...rarely it will work right, but most of the time I get the below):

FULFILLMENT_REQUEST:
{
    "errors": false,
    "response": {},
    "status": 200,
    "body": {
        "data": {
            "shop": {
                "assignedFulfillmentOrders": {
                    "edges": [
                        {
                            "node": {
                                "id": "gid:\/\/shopify\/FulfillmentOrder\/2651314356387"
                            }
                        }
                    ]
                }
            }
        },
        "extensions": {
            "cost": {
                "requestedQueryCost": 253,
                "actualQueryCost": 4,
                "throttleStatus": {
                    "maximumAvailable": 1000,
                    "currentlyAvailable": 996,
                    "restoreRate": 50
                }
            }
        }
    },
    "timestamps": [
        1603044964.3891921
    ]
}  
CANCELLATION_REQUEST:
{
    "errors": false,
    "response": {},
    "status": 200,
    "body": {
        "data": {
            "shop": {
                "assignedFulfillmentOrders": {
                    "edges": []
                }
            }
        },
        "extensions": {
            "cost": {
                "requestedQueryCost": 253,
                "actualQueryCost": 3,
                "throttleStatus": {
                    "maximumAvailable": 1000,
                    "currentlyAvailable": 997,
                    "restoreRate": 50
                }
            }
        }
    },
    "timestamps": [
        1603045005.8092549
    ]
}  

 

0 Likes
mddickens
New Member
2 0 0

This still isn't working. I'm new here. Is there a secret to getting an answer out of Shopify on things like this? Amazing.

0 Likes