Page 1 of 1

Support for Idempotency Key?

Posted: Mon Oct 07, 2024 10:18 am
by johntrickett
Does the Simpro API currently have Idempotency Key support? For example, Stripe has this: https://docs.stripe.com/api/idempotent_requests

Re: Support for Idempotency Key?

Posted: Fri Oct 11, 2024 1:16 am
by SimproAPITeam
Hi johntricket,
If I understand correctly you are asking what happens if there is an error or timeout.

If you are creating or updating anything and something is not successful we will return an error, informing of what went wrong or what might be missing in the request.

If successful we will return the ID of new items created, and a 201 Success response. If you get a success response from us and then run the same operation again you will create another item or update the same data again.

Regards

Re: Support for Idempotency Key?

Posted: Fri Oct 18, 2024 11:28 am
by johntrickett
Hi!

No this is for safely retrying requests without accidentally performing the same operation twice. When creating or updating an object, some APIs use an idempotency key. Then, if a connection error occurs, you can safely repeat the request without risk of creating a second object or performing the update twice.

Obviously this isn't an issue for GET requests, or DELETE requests (as you can only delete something once anyway!). It is useful however for POST requests and can avoid creating duplicate records.