Checkout API Hosted Checkout Timeout

Is there a way to include a timeout when using the CreatePaymentLink so the hosted page is only good for so long. The use case would be anything that has limited qtys available and only wanting to hold that inventory on our side for so long before releasing it again. Let’s say the timeout was 5 minutes, so when the customers gets directed to Square there would be a countdown timer on the checkout page alerting the customer they only have so long to complete the transaction. If the timer reaches 0 then the page automatically returns as a cancelled order.

Once transferred to Square, I don’t think we have a way to keep the customer from completing the order if its been too long and we have already released the contents of that cart back into inventory.

1 Like

Checkouts created via CreatePaymentLink do not have an expiration. If you’d like to implement one yourself, you can add timeout logic to your app via DeletePaymentLink.

What happens if the customer is already on the checkout page and the link is deleted? I assume it would still allow the payment to go through?

The order associated with the checkout is cancelled when the link is deleted, so in this scenario the payment will not go through the the customer will get an error instead.