I've noticed that after I create a charge with the /v1/charges API endpoint, if I immediately attempt to get the charge, the /v1/charges/{id} endpoint returns "404 Not Found". If I force a delay of about 5 seconds between creating the charge and retrieving it, it works fine. Anything less than that returns the 404 error.
This seems odd to me, the API shouldn't be responding that the charge doesn't exist after it has been created. Is this a bug? Does this problem exist in the production API as well?
If this is by-design, what is the best way to handle this? I can put artificial delays in parts of my app, or I can continually poll the API before eventually giving up.. but neither of those seem like ideal solutions.
Any advice would be appreciated.
Thanks!