How to split fulfillment_orders for managing fulfillments separately

My app is useing REST API “POST 2022-07/orders/{order_id}/fulfillments.json” to split a fulfillment.
but this API is removed in 2023-04 of API version.

I would like to split a fulfillment_order to manage fulfillments separately.

according to the article fulfillment_order API is able to use instead of legacy fulfillment API.
but fulfillment_order API cannot splited like legacy fulfillment API.

as well I have read this article but it doesn’t indecate that

https://shopify.dev/docs/apps/fulfillment/migrate#requirements

Please let me know how I should use APIs to resolve the problem.

The fulfillment creation API has an optional line item array. You can use this to split the order into multiple fulfillments.

Hi RobZone

Sorry for replying so late.

Thank you for your advise
I have tried to use the API that you advised me.
And I confirmed that the API is able to split fulfillments
But the status of the fulfillment that are splited was success. and it is uncontrollable.

Is there a way that changes status ?

What do you mean by uncontrollable? If you can DM me an example, I can take a look.

I might have confused you
I’m going to explain properly.

Here’s a legacy code that I am useing

const result = await axios.post(
    `2022-04/orders/${order_id}/fulfillments.json`,
    {
        fulfillment: {
          location_id: my_location_number,
          line_items: [{
              id: the_line_items_id,
              quantity: the_item_quantity_number
          }],
          status: "open",
    }
);

This is the fulfillment creation api that I have tried to use

const result = await axios.post(
    `2023-04/fulfillments.json`,
    {
        fulfillment: {
          line_items_by_fulfillment_order:[{
            fulfillment_order_id: the_fulfillment_order_id,
            fulfillment_order_line_items: [{
                id: the_line_item_id,
                quantity: the_item_quantity_number
            }]
          }],
        }
    }    
)

The legacy code is available to use the status of parameters. on the other hand the new API is not available to use the one. the splited fulfillment is always success status.

I would like the splited fulfillment to be open status. but I couldn’t have changed the status.

The OPEN fulfillment status is not relevant in the new API, the equivalent is an unfulfilled fulfillment order. It looks like you are trying to split the order between two locations without creating the fulfillment. Is that right? If that is the case, you can use the move operation to change the location of a fulfillment order. If you do not want to move all line items, the optional line item parameter will allow you to split a fulfillment order between two locations.

https://shopify.dev/docs/api/admin-rest/2023-04/resources/fulfillmentorder#post-fulfillment-orders-fulfillment-order-id-move

Does that help?