Updating order before posting with custom-field

Hi everyone, I am working on a project using nextjs with the Printful Api. I want the user to be able to submit their own image and then post the order with the new image they want printed. I am trying to send the image URL with the new image using the hidden data-item-custom-value and recover the information when snipcart webhook calls the route. But when I add the item-custom-fild to the button then the payment process does not works. Shows: “snipcart_error_operation_failed”

Thanks