I want to generate the Checkout URL for existing Order. When I see the Checkout API, it is always asking to create an new Order (fill location_id, item details). Is there anyway to pass the existing Order Id to get the Checkout URL for that?
Currently, there isn’t a way to pass an existing order to the Checkout API to create the checkout_url. If you are first using CalculateOrder with your customer throughout the checkout experience you can then create the order with the CreateCheckout request at the end of the checkout experience.
Just curious if this is still the case? We use draft orders that get updated as the user builds their cart, and our current plan is to duplicate the order using the checkouts api. We’d much rather just take the order out of draft and pay for it.
Thanks for that Josh! Just so I fully understand, can we pass an existing orderId into that endpoint to create the checkout link? In the example you linked it looked like they were creating a new order with line items and other stuff. Thanks!
Currently, a pre-existing order cannot be used with CreatePaymentLink — a new order needs to be defined for the link.
For our own reference though, I’m curious to know more about your use case! Is this mostly about ease of integration with the order creation logic that already exists in your app?
@josh-square Currently in the same boat exploring how to pay for an order that I update as the user adds and removes cart items. Wondering how this was resolved in the end?
Any order CreatePaymentLink generates can be updated with UpdateOrder. You can add or remove line items accordingly before redirecting the customer to the checkout page.