This week we pushed out a major refactoring to our fulfillment backend. These changes will benefit our Shopify merchants using an external fulfillment service like Amazon, Shipwire or Wegistix.
One of the problems every SAAS provider is facing nowadays is a high dependency on external services. Shopify connects to a lot of external services like payment gateways, fulfillment providers, carrier shipping rate providers, asset hosts and many more. If an external server ever goes down then Shopify is of course unable to process your request.
For fulfillments this caused problems in two ways:
- If the external server doesn't respond to our request we would immediately retry the fulfillment up to three times. If a server ever goes down it usually takes a few minutes for it to get back up, meaning our retries would be sent when there's a high chance the request won't arrive.
- The request might time out and we never receive a response to let us know that the fulfillment has been received. But on the fulfillment service side the request is accepted it's just that it took too long to provide a response to Shopify so we weren't notified that this fulfillment arrived.
We addressed the problem by processing all fulfillment requests to external services in a dedicated background job. That means that whenever you click the fulfill button within Shopify, the page will immediately respond letting you know that the fulfilment request for these line items has been sent out to the third party server. You can continue to send more fulfillment requests without waiting for the service to respond.
If a fulfillment service is unavailable or a request times out, then we will continue to send this request in increasing time intervals up to 48 hours, and we will always use the same order number when retrying these fulfillments to ensure that the fulfillment provider doesn't send out the order twice.
For shop owners this means that immediately after hitting the fulfill button your line items will show up as pending meaning they are currently being sent off.
For App developers
using the API, this means that when you initially create a fulfillment request
it will have a status of pending
if the line items use an external fulfillment service. You can use an orders/fulfilled web hook
if you need to check whether the fulfillment request has successfully arrived at the third party server.