Success redirect on hosted checkout page

When using the hosted checkout page, there is a button after confirming the payment on the confirmation page that closes the modal. I’m wondering is there any way to set a success_url on the button to redirect to a custom page url. I know there is a onChargeSuccess callback with the React component, but this doesn’t seem to work very well when trying to redirect customers to another page.

there is redirect_url (and cancel_url) that you can specify when you first create the charge so you can specify where to send users after payment is made. the documentation for commerce is a mess.

Interesting, in my case I was just creating a checkout session with the amounts rather than charges. But it doesn’t seem like you can set the redirect_url on checkouts for some reason.

1 Like

Hello @sags95 and @cryptonut, Thank you for taking an interest in trying out Coinbase Commerce APIs. For the details regarding your inquiry, we will check on this for you with our team to see how we can best assist. We’ll get back to you once we have more information. Keep in touch!

Hello @sags95, We would like to let you know that the checkouts page do not have a redirect_url. However, you can use the redirect_url when creating charges. When a charge is created it will return a hosted_url. The customer can take advantage of the redirect_url property when creating the charge to redirect users to whatever website after a successful payment and use the hosted_url property when displaying a hosted page for that charge.

We hope this is helpful. We’d be happy to answer anymore queries.