Online Checkout redirect

Hi, just started using square after time using PayPal where I would have used a smart button on my page which captured the payment and redirected the user to my website confirmation page. I’m trying to replicate that. I understand the purchaser has to leave the page for the transaction to be captured and processed when using the online checkout. However, how do I add a custom redirect. I note the help doc states:

Note that, the application can optionally provide a redirect URL in the request. If not provided, Square redirects the buyer to a Square-provided confirmation page.

But I can’t figure out how to add a redirect url, any help would be appreciated, thanks.

:wave: The redirect_url is configured in the checkout_options in the API request to create the payment link. For example:

{
   "idempotency_key":"{{$guid}}",
   "checkout_options": {
      "redirect_url": "https://www.your_redirect_link.com/"
    },
   "quick_pay":{
      "name":"Auto Detailing",
      "price_money":{
         "amount":100,
         "currency":"USD"
      },
      "location_id":"{{location_id}}"
   }
}

:slightly_smiling_face:

Hi, thanks for the reply. I should have been clearer I think, I am using the Checkout Link buy now button which I just copy and paste into my website. When I used paypal previously, it generated the javascript code for the button with the payment amount and I was able to alter their code to add my custom redirect, not forgetting it was great that the customer remained on my site during the payment processing, which isn’t a huge issue but the redirect is important to me. While I created my website myself, I have no experience of working adding a fully integrated solution using an api so was looking a nice and easy solution, am I right in saying therefore using the button I can’t redirect? apologies if I sound unclear but it’s down to my lack of knowledge, thanks

Okay, when you create the link in the Advanced settings you’ll configure the redirect URL. :slightly_smiling_face:

Hi, thanks for the reply, I don’t seem to have advanced settings showing, either in creating the pay button or when created and trying to edit it?

Just to confirm, I am following these steps:

  1. From the online Square Dashboard, select Add button to website.
  2. Select the Link purpose: Collect a payment, Sell an Item or Accept donations.
  3. Add a Title, Button text, amount and adjust the Frequency of the payment.
  4. Add an optional Image.
  5. Adjust the Advance settings if needed.
  6. Click Continue. Adjust the style that will be applied to all of your buttons
    a. Select a custom font in the Font dropdown menu
    b. Select a standard colour or enter your brand HEX code colour in the Colour field
    c. Select from three button shapes
    d. Display the image, title or price
  7. Select, copy and paste the embed code on your existing website

Apologies for the hassle, hopefully I am missing something obvious.

Hi, I’d really love to get this problem solved, can you please look at my previous post and confirm where the advanced settings should show? Thanks

Hmm, I think this has to do with the location of your Square account. Since this is the Checkout Links that are configured in the Seller Dashboard I’d recommend reaching out to our Customer Success team. This Forum is mainly for developer related questions. :slightly_smiling_face:

1 Like

Hi Bryan! I hope this message find you well! I know this forum discussion is a bit old, but I wanted to ask if there is a way to add a redirect link when a customer books an appointment/service? Some background, I’m trying to set up conversion tracking, but whenever someone books on my domain they get sent to book.sqaureup.com. Therefore I can’t track the conversion as it’s taken out of my domain. I’ve tried embedding code to embed the square booking flow, but it still take them out of my domain into the other. I’ve even tried encoding to detect changes in the url and when it does to redirect the customer back to my page on a Thank You page. I thought of doing this since book.squareup features /confirmation in the URL when a successful booking occurs. But no luck. I would really appreciate any help. Thanks.

Unfortunately, at this time the ability to add a redirect to a booking isn’t currently available. We’re constantly working to improve our features based on feedback like this, so I’ll be sure to share your request to the API product team. :slightly_smiling_face: