Hi All,
I am integrating the Square Terminal API into my website so customers can initiate an in-person payment from the checkout page and complete it using a connected Square Terminal reader. The general payment flow is working: my backend creates a checkout request, sends it to the Terminal API, and the reader receives the payment request and displays the expected amount. Customers can then follow the instructions on the device and complete the transaction. However, I am experiencing an issue where some checkout requests remain in a pending or in-progress state in my application even after the customer has successfully completed the payment on the terminal. The reader appears to finish the transaction normally, but my website does not always receive or reflect the final payment status. This leaves the checkout process waiting for confirmation even though the customer may already have been charged.
The issue is inconsistent, which makes it difficult to identify the exact point where the payment flow stops progressing. Some transactions update correctly within a short time, and my backend receives the expected status information so the website can display a successful payment message. In other cases, the terminal displays that the payment has been completed, but the corresponding checkout record in my application continues showing a pending status. Refreshing the checkout page does not always resolve the situation, and checking the transaction again through my backend sometimes produces the same intermediate state. I am concerned that the website may incorrectly treat a completed payment as unfinished, which could confuse customers or cause them to attempt another payment. I want to make sure that the final payment status is reliably reflected in my application without creating duplicate transactions or incorrectly marking an unsuccessful payment as completed.
I have reviewed the code that creates Terminal API checkout requests and stores the returned checkout information in my database. I am saving the checkout identifier so that the backend can retrieve the corresponding status later, and I have checked that the identifier being used belongs to the expected transaction. I have also reviewed the response received when the checkout is initially created, but I understand that an accepted checkout request does not necessarily mean the payment has been completed. My current implementation relies on subsequent status updates to determine when the transaction reaches its final state. I am now trying to understand whether I am handling the checkout lifecycle correctly, particularly when the reader completes the payment but the final status is not immediately reflected in my application. I would appreciate clarification on which API response or resource should be treated as the authoritative source for confirming the completed transaction.
I have also been looking into the webhook notifications provided by Square because I want my backend to receive payment updates without depending entirely on repeated status checks. However, I am not completely certain that my current webhook handling covers every relevant event in the Terminal API payment flow. I want to understand which event types should be monitored to detect a completed terminal checkout and how they relate to the checkout and payment resources. Another point I am unsure about is how to handle delayed, repeated, or out-of-order notifications. If my backend receives the same event more than once, I need to make sure it does not process the payment twice, while a delayed notification should not cause an already completed transaction to remain pending indefinitely. I would appreciate recommendations for designing this part of the integration so that the website maintains an accurate payment status even when notifications do not arrive immediately.
For troubleshooting, I have started recording the checkout identifiers, API responses, timestamps, and status changes associated with each transaction. This should help me compare successful transactions with the ones that remain pending, but I am not sure which additional information would be most useful when investigating this behavior. I would also like to know whether there are particular Terminal API endpoints or payment resources I should query after the reader finishes processing a checkout. Is it better to retrieve the checkout status, inspect the associated payment, or use both to determine the final outcome? I am trying to avoid introducing unnecessary polling requests while still ensuring that the customer receives a timely confirmation. If anyone has a recommended approach for reconciling Terminal API checkout status with the actual payment state, especially when webhook delivery or status updates are delayed, I would appreciate an example of how to implement it reliably.
Has anyone encountered a similar issue where a Square Terminal reader completes a payment but the application continues to show the associated checkout as pending? I would appreciate guidance on the correct sequence for tracking a terminal checkout from creation through completion, identifying the appropriate webhook events, and confirming the final payment status before updating my website’s order record. I am particularly interested in understanding whether this behavior is usually caused by webhook configuration, delayed status propagation, incorrect checkout tracking, or an issue in the backend’s payment reconciliation logic. My goal is to ensure that every completed terminal payment is accurately recognized by my website without asking customers to retry a successful transaction or risking duplicate charges. Any practical advice from developers who have implemented the Square Terminal API in a similar checkout workflow would be very helpful.