Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create fulfillment #623

Open
alihamza1214 opened this issue Jul 31, 2023 · 6 comments
Open

Unable to create fulfillment #623

alihamza1214 opened this issue Jul 31, 2023 · 6 comments

Comments

@alihamza1214
Copy link

We were using create fulfillment resource which was working fine until now. We believe that shopify have changed resources after version 2022-10 so may be it has to do something with that.

await shopify.fulfillment.create('1323', {
   notify_customer: false,
   location_id: '',
   tracking_number: '',
   tracking_url: '',
   tracking_company: 'Other',
 })

this was the format that was working before but now its giving 404 not found and if we provide new params format from shopify admin rest api doc, it gives bad request.

https://store-test.myshopify.com/admin/api/2023-01/fulfillments.json
    "fulfillment": {
        "line_items_by_fulfillment_order": [
            {
                "fulfillment_order_id": 123123131
            }
        ],
        "tracking_info": {
            "number": "123123",
            "url": "https://www.my-shipping-company.com?tracking_number=1231"
        }
    }
}

above code snippet works from direct postman call but we are not able to figure out how to make this call using this package.

@alihamza1214
Copy link
Author

even tried with this json mentioned in tests
{
"fulfillment": {
"tracking_number": null,
"line_items": [
{
"id": 466157049,
"quantity": 1
}
]
}
}

@swherden
Copy link

swherden commented Aug 8, 2023

Same problem here - as shopify changed the Fulfillment API

@alihamza1214
Copy link
Author

Same problem here - as shopify changed the Fulfillment API

Yes but the package is still making old API calls and there is no recent update .

@swherden
Copy link

swherden commented Aug 8, 2023

Correct, but shopify seems to reject old API calls regarding fulfillment. Tried also the createv2 method but also not working.

I will gonna change it to the new API with a lot of effort and directly with the shopifyAPI.

@alihamza1214
Copy link
Author

Correct, but shopify seems to reject old API calls regarding fulfillment. Tried also the createv2 method but also not working.

I will gonna change it to the new API with a lot of effort and directly with the shopifyAPI.

Yes we are also using direct admin API call to create fulfillment and its working but if its fixed in package then it will be good because we are using many other APIs in our project.

@enchorb
Copy link

enchorb commented May 4, 2024

Any ETA on a fix here, the below works for now

    const [fulfillment] = await shopify.order.fulfillmentOrders(id);
    await fetch(
      `https://${config.shopify.name}.myshopify.com/admin/api/${SHOPIFY_API_VERSION}/fulfillments.json`,
      {
        method: 'POST',
        headers: {
          'Content-Type': 'application/json',
          'X-Shopify-Access-Token': config.shopify.token
        },
        body: JSON.stringify({
          fulfillment: {
            line_items_by_fulfillment_order: [{ fulfillment_order_id: fulfillment.id }],
            tracking_info: {
              number: '......',
              url: '.....'
            }
          }
        })
      }
    );



Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants