If an order was placed through adminhtml, graphql, restapi or soapapi, the order items would not have ids yet. This normally isn't an issue except for Afterpay (and potentially Klarna) which requires the merchant_item_id to be set. This is caused by the order not having been saved yet, which is the case when you order through the regular frontend.
…adminhtml, graphql, restapi or soapapi
If an order was placed through adminhtml, graphql, restapi or soapapi, the order items would not have ids yet. This normally isn't an issue except for Afterpay (and potentially Klarna) which requires the merchant_item_id to be set. This is caused by the order not having been saved yet, which is the case when you order through the regular frontend.