2023 API REST Fulfillment Orders

dbelmonte
Shopify Partner
24 0 3

hello, I am using API version 2022-04 in my webservice and I am currently upgrading to version 2022 and 2023 respectively but I am having problems preparing orders.

 

Checking other forum posts I found this one: https://community.shopify.com/c/fulfillment-api-deprecation/rest-fulfillment-creation-help-please/m-...


I have followed the steps but I always get { "error": "not found" } or blank response.

 

Is there any more exact documentation on how to fulfill orders.

 

greetings

Replies 3 (3)

ShopifyDevSup
Shopify Staff
1357 224 473

Hi @dbelmonte 👋


Absolutely, the new fulfillment docs here are quite thorough outlining both REST and GraphQL steps. Please review whether you are migrating as a fulfillment order management app or a fulfillment services app since the workflows are very different. 

 

If you're encountering errors, please keep in mind that we will need more context on exactly which step is yielding the error. That is, we would need the actual request (REST endpoint or GraphQL query/mutation) and the accompanying payload. We will also need the X-Request-ID (+timestamp) from within 7 days to review the logs. 

 

Hope that helps!

 

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

dbelmonte
Shopify Partner
24 0 3

Hi ShopifyDevSup

 

Sorry but I'm new to shopify development, following the documentation like this:

 

Step 1: Retrieve an order

https://myshop.myshopify.com/admin/api/2022-10/orders/454654546/fulfillment_orders.json

Response: OK

Step 2: Query the supported order fulfillment actions.

https://myshop.myshopify.com/admin/api/unstable/graphql.json

Response:
{
    "data": {
        "order": {
            "id": "gid://shopify/Order/454654546",
            "name": "#1000",
            "fulfillmentOrders": {
                "edges": [
                    {
                        "node": {
                            "id": "gid://shopify/FulfillmentOrder/5816130004222",
                            "status": "OPEN",
                            "requestStatus": "UNSUBMITTED",
                            "supportedActions": [
                                {
                                    "action": "CREATE_FULFILLMENT"
                                },
                                {
                                    "action": "HOLD"
                                }
                            ]
                        }
                    }
                ]
            }
        }
    },
    "extensions": {
        "cost": {
            "requestedQueryCost": 23,
            "actualQueryCost": 5,
            "throttleStatus": {
                "maximumAvailable": 10000.0,
                "currentlyAvailable": 9995,
                "restoreRate": 500.0
            }
        }
    }
}

Step 3: Determine the actions to be performed (CREATE_FULFILLMENT)

https://myshop.myshopify.com/admin/api/2022-10/fulfillments.json

{
	"fulfillment": {
		"line_items_by_fulfillment_order": [{
    		"fulfillment_order_id": "454654546",
            "fulfillment_order_line_items": [
                {"id": "12037198054564546", "quantity": "1"}
            ]
        }],
        "tracking_info": {
            "number": "000002",
            "company": "company",
            "url": "company.com"
        },
		"notify_customer": false,
        "origin_address":null,
        "message":"test message"
	}
}

Response: 
{
    "errors": "Not Found"
}

 

what am I doing wrong or what step am I missing.

 

best regards

ShopifyDevSup
Shopify Staff
1357 224 473

If you're seeing a `Not Found` error, it suggests that this particular fulfillment order ID or line item ID does not belong to this particular shop. In this case, we will need to investigate this particular shop and fulfillment order, so it would be best if you would contact us here from an authenticated partner account with access to this merchant's store, fulfillments, orders, and this app. Please be sure to provide the team with X-Request-ID (+timestamp) from within 7 days for each step.

 

That being said, a few things to note here:

 

  • The request in each step appears to be switching between REST and GraphQL, then also using different versions: Step 1 is in REST version 2022-10, step 2 is using GraphQL version `unstable`, then step 3 reverts to REST version 2022-10
  • The fulfillment order ID referenced in step 2 (gid://shopify/FulfillmentOrder/5816130004222) is different from step 3 ("fulfillment_order_id": "454654546"\)

Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog