Python SDK - Redirect to my website after payment

I have a Python Flask App up and running that calculates a cost, and sends that to:

square_client.checkout.create_payment_link(body=payment_link_body)

Here is an example of my payment_body_link:

    payment_link_body = {
        "idempotency_key": idempotency_key,
        "order": {
            "location_id": square_location_id,
            "reference_id": order_id,
            "line_items": [
                {
                    "name": f"Order {order_id}",
                    "quantity": "1",
                    "base_price_money": {
                        "amount": base_total,
                        "currency": "USD"
                    }
                }
            ],
            "taxes": [
                {
                    "name": "Sales Tax",
                    "type": "ADDITIVE",
                    "percentage": str(tax_rate),
                    "scope": "ORDER"
                }
            ]
        },
        "ask_for_shipping_address": False,
        "enable_coupon": False,
        "redirect_url": square_redirect_url
    }

The problem is that the redirect_url is not functioning. My current redirect URL is: https://redacted/payment-confirmation?checkoutId=checkout_id_value&transactionId=transaction_id_value
(Redacted for security)

My questions are these:
1.) Does the payment body even look correct for the redirect_url? The payment works fine, I get directed to square appropriately, and can make a payment, but afterwards, I am just shown a Square successful confirmation page, and am not sent back to my programmed redirect_url
2.) My tests so far have been $0.00 items, will the redirect_url be affected by a zero dollar item and handle this differently?
3.) Can you provide me with a link to documentation regarding the response once the redirect is successful? I am guessing with the checkout_id_value and transaction_id_value from what I have found in other posts, but would like to see the Square doc on this.

And if no one has said it to you guys in a while, I love your Python SDK and all you do for the community. Thank you and keep it up.

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

Quick Pay Checkout
Checkout API
Make your First API Call

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

I found the above link that shows a redirect_url needs to be inside of the checkout_options section. I believe I am missing that entirely. I am going to update my payment request to match the linked format above and will report back if the issue is resolved.

I would still be curious about the answer to #3.

This looks to be the deprecated Checkout API since there is an order within an order. We don’t recommend building an integration using that endpoint. You should be using the Checkout API endpoint CreatePaymentLink. :slightly_smiling_face: