-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
FulfillmentService function not working after update to latest version ! #948
Comments
Hey @BasitBulbulia! I think the problem is the You should be able to fix that error by using |
Oh I see, which version were you using before @BasitBulbulia? It looks like you're using the older method for creating fulfillments that Shopify has deprecated and removed. They require apps to use a new "Fulfillment Order" based approach for fulfilling line items and entire orders, we're not allowed to create fulfillments with the old API anymore. I don't know much VB unfortunately, so this may not be entirely correct. I think you want something like this: Try
Dim fulfillmentOrderService As New FulfillmentOrderService(domain, accessToken)
Dim fulfillmentService As New FulfillmentService(domain, accessToken)
Dim policy As New LeakyBucketExecutionPolicy()
fulfillmentOrderService.SetExecutionPolicy(policy)
fulfillmentService.SetExecutionPolicy(policy)
' Find open fulfillment orders for this order
Dim openFulfillmentOrders = Await fulfillmentOrderService.ListAsync(orderId)
openFulfillmentOrders = openFulfillmentOrders.Where(Function(f) f.Status = "open").ToList()
' Fulfill all line items across all open fulfillment orders in this Shopify order
Dim lineItems = openFulfillmentOrders.Select(Function(o) New LineItemsByFulfillmentOrder With {
.FulfillmentOrderId = o.Id.Value
' Optionally specify a list of line items if you're doing a partial fulfillment
' .FulfillmentRequestOrderLineItems = ...
})
' Fulfill the line items
Dim fulfillment = Await fulfillmentService.CreateAsync(New FulfillmentShipping With {
.Message = "items are shipping!",
' Set to true to send an email to the customer that their items have shipped
.NotifyCustomer = False,
' You can leave the tracking info out if you have no tracking info
.TrackingInfo = New TrackingInfo With {
.Company = "UPS",
.Url = "...",
.Number = "..."
}
})
Catch ex As Exception
If DoAllStockUpdate = False Then MsgBox("SetOrdersAsComplete-->" & ex.Message)
Return False
End Try Check this thread here for more info on the Fulfillment Orders workflow: #828 |
This is my code !
The error is :-
ListResult(Of Location)' cannot be indexed because it has no default property.
The error location is @ locations(0).Id
I am totally lost as to how I could fix this code
The text was updated successfully, but these errors were encountered: