Checkout API - How to get Transaction Response

We are looking into Checkout API for Quick pay checkout.

How can we test the following:

  1. How to get notified if the payment was successful? Will the transaction response be POSTed to the redirect URL?

  2. If there is a webhook service to get transaction response, will the webhook be triggered before user get redirected to the redirect url?

:wave: With the Checkout API you’ll get the order_id in the URL of the redirect that you can use to call RetrieveOrder to get the order details. Also you can listen to payment webhooks to be notified of successful payments. The webhook will be triggered immediately after the payment however the customer will most likely be redirected prior to receiving the event. :slightly_smiling_face:


We are using the “Quick Pay Checkout” and sending the custom redirect URL in the create payment link request.

Just want to confirm that once the user pay on the Square Checkout Page, they will get redirected to the “Redirect URL” we sent in the create payment link along with the order_id?


As there is no way to test the redirect URL in sandbox, we wanted to make sure that the order_id will indeed be present in the redirect URL as thats the only piece of information we would have for that payment, which we can use to get order details and then parse the payment_id from it to get the Payment details.

Yes, once the customer pays then they will be redirected to the configured redirect_url which will include the order_id. :slightly_smiling_face:


In the create payment link request, can we add parameters to the redirect_url?

For example:
“redirect_url”: “https://{redirect_url}?customField1=one&customField2=two”

Will those parameters be sent as well after user get redirected to the redirect_url?

@Bryan-Square I am using checkout API for payment at my C# WPF application. It works fine for payment. But it do not redirected to my redirect_url , that’s why i am unable to apply next process after payment success.

When you create the payment link is the redirect_url in the API response? If it’s not in the response it probably not set correctly in the API request. If it is there what’s the request body that your passing in and the redirect_url your using? :slightly_smiling_face:

1 Like

Thank @Bryan-Square .I found that I have passee redirect_url with different parent object that’s why I not found it in response. I have updated it and successfully redirected to my defined url.

Great! Glad to hear you figured it out. :slightly_smiling_face:

1 Like