Hello, I am in the process of reviewing my dropshipping application. I am waiting for only one step that is required of me and that is to enable a fullfilmentRequest button. The following image shows what the Shopify reviewer sends me.
I have tried following the documentation: https://shopify.dev/docs/api/admin-rest/2023-10/resources/fulfillmentrequest
but it doesn’t work for me, it gives me error 422, this piece of code is being executed in the order creation webhook,
// payload is a body of webhook
const fullfilmentOrder = await shopify.api.rest.FulfillmentOrder.all({
session: session,
order_id: payload.id,
});
const fulfillment_request = new shopify.api.rest.FulfillmentRequest({session: session});
fulfillment_request.fulfillment_order_id = fullfilmentOrder.data[0].id;
fulfillment_request.message = "Fulfill this ASAP please.";
await fulfillment_request.save({
update: true,
});
For that specific code I receive this error message
HttpResponseError: Received an error response (422 Unprocessable Entity) from Shopify:
[
"The fulfillment order's assigned fulfillment service must be of api type"
]
If you report this error, please include this id: 28fef8d3-0a5e-4f75-8ad7-cdabfc716f66
Thank you so much.