Duplicate Order creating with API


(Page Designer) #1

Hi, im having issue with api, some orders are duplicated in IS, this is not for all orders but some orders, not sure why this is happening? Im using Latest PHP API sdk from IS


(John Borelli) #2

That’s really not enough information to go on. When did it start or did it just start or has it always been the case? What’s the source of the orders? WooCommerce/WP or other site, IS order page or just a coded integration?

The short of it will be, however, that it is highly unlikely that the api is randomly deciding to duplicate orders and that a call is being somehow made twice. API’s don’t just ‘add’ stuff on a whim, it’s either going to do it all the time (as a bug) or it’s not the api and it’s the programmer not catching their mistake.


(Page Designer) #3

It was working fine i just noticed few contacts with same orders multiple times, i made test purchase to replicate the issue but was unable to find any issue on m side, im not sure how this is happening but this is happening, i have check couple of contacts who have correct orders but there are few contacts who have multiple same orders on the same date (some have 5 some have 10+)


(John Borelli) #4

So where do the orders originate from then? This almost has the smell of a tag process being over triggered but not knowing where in your model orders are created (website, IS manual entry, IS eComm, Campaign assigned, http post (coded)) etc. it’s impossible to say…but be sure it something in that line not because the api is re-generating orders that have been created… I think focusing on the process and not the api is a better direction.

Also, when created with the api, a note is also created to tell you about it. Have you looked at that information yet?


(Page Designer) #5

The API uses HTTP post from Click Bank which creates order in IS, every time a product is purchased from CB, a HTTP POST is forwarded to IS to create order in IS, i have check all coding for this it is fine and it was working perfect until this issue occurred, i have also checked the tags and they are also correct and not triggering any order, I found this description in API:
"This contact was modified on 5/1/2017 4:32 PM because of a discrepancy in data while updating."
this is multiple time for the contact


(Jon Smith) #6

This sounds like a Legacy Order form is being used with an HTTP post to process and isn’t actually using the API unless the note says addWithDupCheck. What happens if you click on the link multiple times to place the order before the order processes?


(Page Designer) #7

Im not using Legacy Order form, the orders are created automatically in IS using API, as describes above once an order is created in clickbank, a notification as HTTP POST is forwarded to PHP API code, for every order its a single HTTP POST from CB and single order in IS is created, unfortunately it is creating multiple orders for some contacts not all, to make sure that CB is not sending multiple notification, i asked them and they confirmed that they are not sending multiple HTTP POST for single order, moreover they said the issue is from IS not from CB side.


(John Borelli) #8

Well, I would start populating a custom field or two with information showing the requesting ip address when a call is made using the api. If CB then the ip will always be from them. If IS then the ip will be from them. Do you do any logging? If so, also check your logs. If the logs show that the api is making all the calls then the question would be why… You need tracking at each and every ‘joint’ in the process if you want to show what’s happening. I’ve written a lot of integrations for clients and I can say that when something like this has happened with them…my logs and that information led me to something the client changed. Not one exception (so far and knock on wood)


(Jon Smith) #9

Let me clarify. When a note is added to a contact’s record it is done through a few reasons. The note that you are describing is either one that is auto generated when a Legacy Order Form is filled out or when the API service for adding with duplicate checking is used. If you look at the subject of the note it will tell you exactly which one is being used.

With that explanation it sounds like an HTTP post is being used to submit a Legacy Order forum instead of Using the API since a post to a form isn’t a documented endpoint. If I’m wrong about this please let me know which API service is being used to add these orders into Infusionsoft.