-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Help with FulfillmentService #871
Comments
Hi.I also have the same problem. Have you solved your problem? |
Hey, sorry I missed this. This should be possible still after Shopify's fulfillment changes. I'm not at my computer at the moment, but I'll post some example code for you later today that should help. |
Looks like I forgot to get that example code, @swalsh88 and @smart222zx did you get this working yet? |
Yes, I am using HttpClient to directly call the API, but this is just a temporary workaround. |
Thanks! Can you post the code you're using to create a fulfillment with the HttpClient? I'm curious what it might be doing differently. |
Here's an example for using ShopifySharp's var fulfillments = new FulfillmentService(domain, accessToken);
var fulfillmentOrders = new FulfillmentOrderService(domain, accessToken);
var orderId = 123456;
// Find open fulfillment orders for this order
var openFulfillmentOrders = await fulfillmentOrders.ListAsync(orderId);
openFulfillmentOrders = openFulfillmentOrders.Where(f => f.Status == "open").ToList();
// Fulfill the line items
var lineItems = openFulfillmentOrders.Select(o => new LineItemsByFulfillmentOrder
{
FulfillmentOrderId = o.Id.Value
// Optionally specify a list of line items if you're doing a partial fulfillment
// FulfillmentRequestOrderLineItems = ...
});
var fulfillment = await fulfillments.CreateAsync(new FulfillmentShipping
{
Message = "items are shipping!",
FulfillmentRequestOrderLineItems = lineItems,
NotifyCustomer = true,
TrackingInfo = new TrackingInfo
{
Company = "UPS",
Url = "...",
Number = "..."
}
}); Can everyone in here try that and let me know how it works? This is functionally the same as creating fulfillments used to be before Shopify's API change, it's just using their recommended fulfillment orders flow. Note that you need to have the |
@nozzlegear I had to enable Your code has an error. var lineItems = openFulfillmentOrders.Select(o => new LineItemsByFulfillmentOrder
{
FulfillmentOrderId = o.Id.Value
// Optionally specify a list of line items if you're doing a partial fulfillment
// FulfillmentRequestOrderLineItems = ...
}); Should be... var lineItems = openFulfillmentOrders.Select(o => new LineItemsByFulfillmentOrder
{
FulfillmentOrderId = o.FulfillmentOrderId.Value
// Optionally specify a list of line items if you're doing a partial fulfillment
// FulfillmentRequestOrderLineItems = ...
}); I can hit the API successfully following those changes. |
I've set the write_merchant_managed_fulfillment_orders permission and I'm still receiving the 404. I'm running version v6.2. Has anyone been able to get this working? |
Hey @themultiv3rs3, sorry you're having issues. What specifically is giving you a 404: trying to list fulfillment orders, getting the order itself, or something else? |
when calling:
|
@davitgr @themultiv3rs3 Solution posted here! You need to add the specific fulfillment order line items to the |
I'm trying to convert my fulfillment code over to the 2022-07 API. I've read through the comments on issue #828 and attempted to work with the sample code that was provided. However, when I execute the code below, I receive a 404 error.
I'm not using a third party fulfilment service. I (the merchant) want to fulfill our own orders as mentioned in https://shopify.dev/docs/apps/fulfillment/order-management-apps
Can anyone help me understand what I might be missing?
The text was updated successfully, but these errors were encountered: