Closed tkalliom closed 1 year ago
@tkalliom Hey guys, I'm trying to migrate the use cases for the new 2023-01 API update, and I just noticed we need to use the following:
POST /admin/api/2022-10/fulfillments.json
instead of POST /orders/{order_id}/fulfillments.json
Do you know if this library is supporting this change?? Thanks!!! Ref: https://shopify.dev/api/release-notes/2022-07
@FlavioAandres the /orders/{order_id}/fulfillments.json
seems to be still supported. See https://shopify.dev/api/admin-rest/2023-01/resources/fulfillmentorder#get-orders-order-id-fulfillment-orders.
Can you test it?
const shopify = new Shopify({
shopName: 'xxx',
apiVersion: '2023-01',
accessToken: 'xxx'
});
const fulfillments = await shopify.fulfillment.list(orderId);
@FlavioAandres I misread your comment, sorry. You can use:
const fulfillment = await shopify.fulfillment.createV2(params);
Can you please split the commit in two?
[api] Add cancelV2 action to Fulfillment resource
[api] Add fulfillments action to FulfillmentOrder
Thank you.
@tkalliom Thanks for adding those changes, are really useful. @lpinca Do you have an idea when these changes can be released to NPM?
@FlavioAandres soon. I would also like to include https://github.com/MONEI/Shopify-api-node/pull/560 and https://github.com/MONEI/Shopify-api-node/pull/564 in the next release.
Hello, I'm kinda new to using this library so I apologize if my question is a bit weird. Can someone explain to me how to use createV2? we've been using create for a while but because of the 2023-01 change were trying to make createV2 work. What is the difference in using create and createV2 regarding the params? and how does createV2 know which order is for fulfillment without the orderId parameter like the create function has?
edit: I tried using it this way
const shopify = new Shopify({ shopName: merchant.domain, apiVersion: '2023-01', accessToken: merchant.shopifyToken, });
shopify.fulfillment.createV2({
notify_customer: false,
location_id: inventoryLocation?.id,
order_id: order.orderId,
line_items_by_fulfillment_order: [
{
fulfillment_order_id: order.id,
...(targetMerchant.serviceType === ServiceType.MARKETPLACE
? {
fulfillment_order_line_items: order.items.map((item: OrderItems) => {
return { id: toNumber(item.id) };
}),
}
: null)
}
]
})
but I received this error: "Shopify Open Fulfillment: {"errors":"The api_client does not have the required permission(s)."} , Order ID: 5b1707b0-5908-49a4-9372-9343c163715c , Merchant ID: 55530553543 , Error Message: Response code 403 (Forbidden)"