Checkout not redirecting to redirect URL

I am using the online-checkout/payment-links option to allow a person to checkout from a link on a website. I can see in the post that I am making to square that there is a URL in the redirect_URL field and it is correct. However, when someone pays successfully it is just displaying the square thank you page and not sending them back to the site. I have another checkout page that uses the same code, but for a different square account and it works as expected. Is there something I may be missing? Thanks in advance

What’s the application ID? Also is the redirect_url in the API response? :slightly_smiling_face:

Bryan- Thanks for the quick reply. I don’t have the app id handy at the moment. I have included what I am sending and response back below. I have X’d out some information. I am sending redirect URL over, but I am not getting it in the response.

Sent
{ “idempotency_key”: “2-DD0A6D33-F733-B68E-C75C2BB7BB9EC7A3”, “pre_populated_data”: { “buyer_address”: { “first_name”: “XXXXXX”, “last_name”: “XXXXXX”, “postal_code”: “80104” }, “buyer_email”: “XXXXXX” }, “payment_note”: “XXXXXX”, “checkout_options”: {}, “merchant_support_email”: “XXXXXX”, “redirect_url”: “https://cox-education.com/XXXX.cfm”, “description”: “Cox Education Class Registration”, “order”: { “location_id”: “XXXXXX”, “line_items”: [ { “quantity”: “1”, “base_price_money”: { “amount”: 100, “currency”: “USD” }, “item_type”: “ITEM”, “name”: "GJARA TEST CLASS ", “note”: "GJARA TEST CLASS " } ] } }

Response
{“payment_link”:{“id”:“EQEKFW6MY6GYMDWJ”,“version”:1,“description”:“Cox Education Class Registration”,“order_id”:“FHWsOunFG7U0yHXPEbbS0CnZs7IZY”,“checkout_options”:{},“pre_populated_data”:{“buyer_email”:“XXXXXX”,“buyer_address”:{“postal_code”:“80104”,“first_name”:“XXXXXX”,“last_name”:“XXXXXX”}},“url”:“https://square.link/u/QtNocHMG",“created_at”:“2023-04-13T22:27:37Z”,“payment_note”:“XXXXXX”},“related_resources”:{“orders”:[{“id”:“FHWsOunFG7U0yHXPEbbS0CnZs7IZY”,“location_id”:“XXXXXX”,“source”:{“name”:“Education”},“line_items”:[{“uid”:“kmsz8lhDsDspWgeptpcHnB”,“name”:"GJARA TEST CLASS on 4/13/25”,“quantity”:“1”,“note”:“GJARA TEST CLASS”,“item_type”:“ITEM”,“base_price_money”:{“amount”:100,“currency”:“USD”},“variation_total_price_money”:{“amount”:100,“currency”:“USD”},“gross_sales_money”:{“amount”:100,“currency”:“USD”},“total_tax_money”:{“amount”:0,“currency”:“USD”},“total_discount_money”:{“amount”:0,“currency”:“USD”},“total_money”:{“amount”:100,“currency”:“USD”},“total_service_charge_money”:{“amount”:0,“currency”:“USD”}}],“fulfillments”:[{“uid”:“TFFLylgtcei3eXtC9rudDC”,“type”:“DIGITAL”,“state”:“PROPOSED”}],“net_amounts”:{“total_money”:{“amount”:100,“currency”:“USD”},“tax_money”:{“amount”:0,“currency”:“USD”},“discount_money”:{“amount”:0,“currency”:“USD”},“tip_money”:{“amount”:0,“currency”:“USD”},“service_charge_money”:{“amount”:0,“currency”:“USD”}},“created_at”:“2023-04-13T22:27:37.243Z”,“updated_at”:“2023-04-13T22:27:37.243Z”,“state”:“DRAFT”,“version”:1,“total_money”:{“amount”:100,“currency”:“USD”},“total_tax_money”:{“amount”:0,“currency”:“USD”},“total_discount_money”:{“amount”:0,“currency”:“USD”},“total_tip_money”:{“amount”:0,“currency”:“USD”},“total_service_charge_money”:{“amount”:0,“currency”:“USD”},“net_amount_due_money”:{“amount”:100,“currency”:“USD”}}]}}

Thanks for providing the request. The reason the redirect_url isn’t working is cause your checkout_options is empty and the redirect_url isn’t nested in the options. You have

“checkout_options”: {},

If you set it like the following it will redirect correctly:

"checkout_options": {
            "merchant_support_email": "XXXXXX", 
            "redirect_url": "https://cox-education.com/XXXX.cfm"
        }

:slightly_smiling_face:

Thank you! You are correct. I am sorry I missed that. Have a good day!