Search code examples
square

Processing a failed payment in square (should I use a new Idempotency key if the error is related to the customers bank)


I am using square to take payments from customers. When a payment request fails for a reason like insufficient funds etc I want to retry it a few hours later. We are using Card On File so we have the ability to do this. Should I use the same idempotency key or a new one?

https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency


Solution

  • You'll want to generate a new idempotency_key for each new CreatePayment request with the card on file.