Duplicate POST

Ryan Johnston's Avatar

Ryan Johnston

25 Aug, 2015 02:45 PM

I'm updating the sharpy client to include promotions (coupon codes).
https://github.com/SeanOC/sharpy (original)
https://github.com/SmartFile/sharpy (updates)

Occasionally, I get a 400 error about duplicate posts:

<?xml version="1.0" encoding="UTF-8"?>
<error id="24999971" code="400" auxCode="duplicate">Duplicate POST detected (1 seconds)</error>
These are definitely duplicate posts. The tests are posting the same data when creating customers.

What are the rules around duplicate posts?

What is the time limit between posts that is acceptable?
One knowledge base article mentioned 20 minutes (http://support.cheddargetter.com/discussions/problems/183-duplicate...).
Another said the limit was 10 seconds (http://support.cheddargetter.com/discussions/questions/4948-duplica...).

Is changing one field all that is necessary to work around this?

There is no information about the duplicate limit in the API documentation.
http://support.cheddargetter.com/kb/api-8/error-handling
https://cheddargetter.com/developers

Ryan Johnston
SmartFile

  1. Support Staff 1 Posted by Marc Guyer on 25 Aug, 2015 07:16 PM

    Marc Guyer's Avatar

    Hi Ryan --

    What are the rules around duplicate posts?

    These endpoints are checked for duplicates:

    • customers/new
    • customers/edit
    • customers/edit-subscription
    • customers/add-charge
    • invoices/new

    The duplicate window is 10 seconds.

    Is changing one field all that is necessary to work around this?

    Yes. If any request param is different, it is not considered a duplicate. You could even send in an otherwise superfluous param with a random value if you want to workaround the duplicate check.

    There is no information about the duplicate limit in the API documentation.

    Thanks for pointing this out. I went ahead and added a section here: http://support.cheddargetter.com/kb/api-8/error-handling#duplicate

  2. 2 Posted by Ryan Johnston on 25 Aug, 2015 07:25 PM

    Ryan Johnston's Avatar

    Thanks.

    I like the random superfluous parameter for the unit tests.

  3. Ryan Johnston closed this discussion on 25 Aug, 2015 07:25 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM