MONEI / Shopify-api-node

Node Shopify connector sponsored by MONEI
https://monei.com/shopify-payment-gateway/
MIT License
940 stars 279 forks source link

Question: Regarding the required updates for April 1, 2023 #589

Closed kristiandm closed 1 year ago

kristiandm commented 1 year ago

What updated do we need to change in Shopify-api-node usage in regarding to this? Because when I checked our code we were not calling the endpoints that where specified as deprecated in the change docs, so I'm assuming it's an update to be done in the shopify-api-node usage? if yes what functions are affected by the update that we need to update? image

lpinca commented 1 year ago

Because when I checked our code we were not calling the endpoints that where specified as deprecated in the change docs

In that case you can ignore the warning.

kristiandm commented 1 year ago

I found docs regarding how to migrate to fulfillment orders(https://shopify.dev/docs/apps/fulfillment/migrate) but it only shows how to do it in rest and graphql, is there a guide or docs to do it using shopify-api-node? or can anyone tell me how to do it?

arendajaelu commented 1 year ago

But Shopify will unlisted our app by this?

kristiandm commented 1 year ago

according to the email they sent, yes. @arendajaelu

danidaryaweesh commented 1 year ago

Any progress with this? We are also struggling with this and don't know how to migrate.

ikudosi commented 1 year ago

Just went through this when migrating from an extremely old codebase. Here's the two methods within this package you'll need to use:

  1. order.fulfillmentOrders() (see Fulfillment Order)
  2. fulfillment.createV2() (see Fulfillment). For every fulfillment order you retrieved from step 1, you'll need to create a fulfillment. Since a fulfillment is unique by tracking #, if you do split shipments, you'll need to send multiple fulfillments for the same fulfillment order ID.
seymurcrisp commented 1 year ago

@ikudosi is right. I did the same and it worked. Also know that the "Line item ID"s in "Order" and "Fulfillment Order" are different.

kristiandm commented 1 year ago

@ikudosi Can you point me in the right direction where to find the guide or usage docs for those methods/functions in this package? or are the information in these links(https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillmentorder#get-orders-order-id-fulfillment-orders , https://shopify.dev/docs/api/admin-rest/2023-01/resources/fulfillment#post-fulfillments) the same one's used for this package? also followup question do we still need to do the steps written here https://shopify.dev/docs/apps/fulfillment/migrate to use those methods/functions you stated?

ikudosi commented 1 year ago

@kristiandm To use any parts of this package is all dependent on the permissions set on the API key being used. For me, all I had to do was ensure that the permissions of read_assigned_fulfillment_orders & write_assigned_fulfillment_orders were set.

And regarding your first question - yes the documentation listed in my prior bullets are associated with each other.

  1. The ID to get fulfillment orders for step #1 is the shopify order ID I believe.
  2. Sample of creating a fulfillment order using createV2:
    
    const apiData:FulfillmentOrder = {
    message: "",
    notify_customer: tracking ? true : false,
    tracking_info: tracking ? this.buildTrackingInfo(tracking) : {},
    line_items_by_fulfillment_order
    }

try { await shopifyService.fulfillment.createV2(apiData) ...

kristiandm commented 1 year ago

@ikudosi just to be clear we only need to add the permissions, use fulfillment orders, fulfillment createv2? and we no longer need to do the step 3 and up from this https://shopify.dev/docs/apps/fulfillment/migrate? Also can you give an example of what is inside the line_items_by_fulfillment_order from your first example?

ikudosi commented 1 year ago

@kristiandm I skipped those steps as I worked directly with the store owner and do the full order management for them. Hard to say a yes / no for you since I have no idea on the scope of your app.