Did you verify the userData saved by querying for the line item directly instead of via the orders endpoint?
Yes, I used this endpoint "/v3/merchants/GRQX6PQ7JGRN4/orders/ZJZJ0ZVGRHR60/line_items/R69RCCFQYMPWC" to get the single line item and the userData is still null. It appears the userData is not saving with this endpoint: /v3/merchants/mId/orders/orderId/line_items
Here is an example of a previous request that came back as status OK:
{\"id\":null,\"orderRef\":null,\"orderId\":null,\"item\":{\"id\":\"9KWK8RAJETPQT\"},\"name\":\"Reservation Cancel\",\"price\":550,\"printed\":false,\"createdTime\":0,\"orderClientCreatedTime\":0,\"exchanged\":false,\"refunded\":false,\"isRevenue\":false,\"userData\":\"{\\\"reservationId\\\":2401,\\\"cloverOrderId\\\":\\\"DC00A8REBG7KE\\\",\\\"cloverLineItemId\\\":\\\"NVAAWQHFSNZH0\\\"}\"}
Thanks for your help. FYI, update allows me to save the userData on an existing line item, but I'd prefer to do it on create to limit my api calls.
Ok, it's good that you have a work-around for now. I did briefly look at the code and couldn't determine why it isn't working but I don't work on the REST API.
Has this bug been resolved?
The issue is still open, so it looks like it has not. You will have to use the work-around of using update.
Apparently this works using the bulk line items endpoint:
https://docs.clover.com/reference#orderbulkcreatelineitems-2
However, as OP said, it does not work for the normal single line item creation endpoint:
https://docs.clover.com/reference#ordercreatelineitem-2
You could consider using the bulk line item endpoint to reduce the amount of requests you make to clover end in this case (as long as all your properties are supported by this endpoint)
The atomic order API has the same issue. In our case updating it after creation doesn't work, as we don't know which order item to assign which user data (as the IDs are generated by Clover).
4 People are following this question.