Payment links auto-delete

I figured out how to make, list, and delete successful payment links with the square API using curl.

On my website, I internally generate a grand total price based on the services a customer orders, and the generation of links this way is useful, however, if I had 100,000 different customers each placing 1,000 orders, then I’d have 100,000,000 different links created which consumes storage space on squares servers, and if enough space is consumed, then there’s none left for others to create links.

Is there a way to configure the link through the square API’s to have the link automatically be deleted after a set number of hours or at a specific time?

And when a payment link is deleted, does it affect my reporting in my square dashboard in any way? (example: if I removed a link after someone made a payment through it, would that entry be deleted from my logs on the square dashboard?)

At this time Square’s API does not offer an automatic deletion feature for payment links after a set number of hours or at a specific time. However, you could implement a server-side script that runs periodically (e.g., via a cron job) to delete old payment links using the Square API. This script would need to keep track of the creation time of each link and calculate when it should be deleted.

Regarding the impact of deleting payment links on your reporting, deleting a payment link wil not affect the reporting of completed transactions in your Square Dashboard. The payment link is simply a method for customers to access the payment processing interface. Once a transaction is completed, the record of that transaction is stored independently of the payment link. Deleting a payment link will not delete any transaction records or affect your logs. :slightly_smiling_face:

1 Like