-
1. Re: API CHANGES?
TomCuneo-MLT Aug 19, 2013 8:01 AM (in response to TomCuneo-MLT)I opened a ticket with this information - is ANYONE else having these kinds of issues??
We are seeing recently where the API is not returning entityID's properly but is returning -1 in the fields. We are seeing this with about 50% of the orders recently we have been getting.
Here are a couple of examples:
Order from August 17 at 9:48pm - the order looks fine in the system but from our end when we pull the API data it returns a -1 as the entityID - its not happening with every order but is happening frequently, very much causing headaches and hassles with our off site reporting.Another example is:
The API sent us order ID 3459227 - but we never got an email about it nor can we find it in the system but yet its in our API output from BC but returns a -1 as the entityID
Online Shop 16-Aug-2013 08:17 PMWe see this order in our API output but not in the BC system - why is this? Why all of the sudden is the API not stable. We need stability because we use the API for accounting purposes.
Here are some other order examples that are not in BC front end but show up in the API but also return -1 as the entityID
Online Shop 16-Aug-2013 05:36 PM - order id: 3459160
Online Shop 16-Aug-2013 05:17 PM - order id: 3459148
Online Shop 16-Aug-2013 04:17 PM - 3459108I have literally dozens of these "messed up api returns" in our off site db....
We need answers and resolution, if the system is no longer stable then that poses a huge problem for our business.....
-
2. Re: API CHANGES?
TomCuneo-MLT Aug 19, 2013 8:08 AM (in response to TomCuneo-MLT)Here is a raw API output -
[88] => stdClass Object ( [entityId] => -1 [orderId] => 3459885 [orderName] => Online Shop 18-Aug-2013 06:54 PM [workflowId] => 13886 [statusTypeId] => 749177 [countryCode] => US [orderType] => 0 [invoiceNumber] => 0 [invoiceDate] => 0001-01-01T00:00:00 [userID_AssignedTo] => 0 [shippingAmount] => 0 [shippingTaxRate] => 0 [shippingAttention] => [shippingInstructions] => [shippingOptionId] => 0 [discountCodeId] => 0 [discountRate] => 0 [totalOrderAmount] => 64.2 [directDebitTypeId] => 0 [directDebitDays] => 0 [isRecur] => [nextInvoiceDate] => 0001-01-01T00:00:00 [endRecurDate] => 0001-01-01T00:00:00 [cycleTypeID] => 0 [createDate] => 2013-08-18T18:54:00 [lastUpdateDate] => 2013-08-18T18:55:00 [deleted] => [products] => stdClass Object ( [Product] => Array ( [0] => stdClass Object ( [productId] => 6670861 [productCode] => GC Plus [productDescription] => [units] => 1 [unitPrice] => 30 [unitTaxRate] => 7 [totalProductPrice] => 32.1 [productName] => GC Plus ) [1] => stdClass Object ( [productId] => 6272400 [productCode] => ENVee [productDescription] => [units] => 1 [unitPrice] => 30 [unitTaxRate] => 7 [totalProductPrice] => 32.1 [productName] => ENVee ) ) ) ) GRRRR!
-
3. Re: API CHANGES?
TomCuneo-MLT Aug 19, 2013 8:23 AM (in response to TomCuneo-MLT)According to our database of orders we have kept for over a year the bad data did not start coming through until around May 30th 2013 - all the orders before then are fine, orders after then are coming through about half of them with the entity ID as -1
-
4. Re: API CHANGES?
Liam Dilley Aug 19, 2013 3:24 PM (in response to TomCuneo-MLT)Tom. You do realise as soon as items added to cart an order is made including id, this can be abonded and thus then cleared. A sale makes an invoice with invoice ID.
On the cart page before success you can fetch the order information via the API for example. So this is logged, stored and can be returned but can also then be abondonded. You need to account for that in any API system you make.
-
5. Re: API CHANGES?
TomCuneo-MLT Aug 19, 2013 3:36 PM (in response to Liam Dilley)This would still be tied to a user would it not with an entity ID? :-)
My other thing is why we do not see this before May 28th or there abouts as well.
That would be cool if it turned out to the be the case but the status id's being also returned in this case are showing the order was completed. If I am correct that is what [statusTypeId] => 749177 means.?
Tom
-
6. Re: API CHANGES?
Liam Dilley Aug 19, 2013 4:07 PM (in response to TomCuneo-MLT)No, Because the user could be not logged in or has finished processing. It is just an order and order id.
-
7. Re: API CHANGES?
TomCuneo-MLT Aug 19, 2013 4:21 PM (in response to Liam Dilley)[statusTypeId] => 749177 is our default for "purchased payment received" -
And all of the -1 entityID's are listing this status. I think this is what has us freaked out a bit is why would an abandoned cart carry a status of "purchase - payment received" if the order was not completed and cart abandoned.
Just trying to understand Liam - we have a pretty intricate off bc system tied to this API which generates accounting data -
-
8. Re: API CHANGES?
TomCuneo-MLT Aug 19, 2013 4:28 PM (in response to TomCuneo-MLT)We were coding some of our software and in our reports we were seeing huge gaps in the output - where as certain distributors (our resellers) were not showing up at all in our reports(known distributors), so when we query our DB we get nothing (e.g. name not found) but we see all these orders with -1 entity ID but with a purchase payment received status -
We found it because our system dumps all the orders and all the customers into different DB tables, we then use break away tables to pull together certain data - e.g. name with entityID - we KNOW these "names" have placed orders but they do not show up in our breakaway tables - so we dug into the db and discovered all the -1's in the fields. We had never seen this before and have had this system hooked into the API for over a year, doing as much as 100k a month in sales.It was not until our reports starting not showing over half of the distributors we realized an issue (distributors come and go, so to see it varying a little was not unusual) -
So I still have concern something isn't right but will check further into the theory you have above Liam and sincerely appreciate the feedback on it
-
9. Re: API CHANGES?
Liam Dilley Aug 19, 2013 5:37 PM (in response to TomCuneo-MLT)Well that is down to the order status. You have that by default. BC does have that when you build a site but you should always change that.Think about it, how does that make any sense?
If you do offline payment options etc the default order status is payment recieved?
I have one of processing. IT would be nice if BC automated it better to know if it is paid via payment gateway etc to change automatically but it does not do that right now.
So if an order is made then the default order status is what you have it set to.
-
10. Re: API CHANGES?
Liam Dilley Aug 19, 2013 5:40 PM (in response to TomCuneo-MLT)I am not saying the API is not buggy as well by the way, well not buggy but crap in places but you need to ensure you have your codes, checks and knowledge of what is going on in place to have all your API checks, workarounds and handles in place. If you dont you get issues.
But your issue could be something else but I am taking this as abaondend sales because you have no invoice number on your example.
So 100k of abonded sales over a year sounds about right as well, well depends on the shop but I can picture people not going through with sales becoming a high value.
-
11. Re: API CHANGES?
TheBCMan Aug 19, 2013 6:24 PM (in response to TomCuneo-MLT)An EntityID of -1 is a yet to be completed order. This change happened over 12 months ago as they didn't use to come down.
When I query the API I either ignore entityID's of -1 or store it and lookup the orderID to see if an order has become completed and inject the entity ID.
They will stay at -1 until the cart is set as abandoned, I think it is 24-48 hours, can't remember off the top of my head.
-
12. Re: API CHANGES?
TomCuneo-MLT Aug 19, 2013 6:27 PM (in response to TheBCMan)Thanks everyone for clearing it up... I just had never seen it before in our previous dumps I guess - but i understand fully - peace.
Tom -
13. Re: API CHANGES?
Liam Dilley Aug 19, 2013 8:17 PM (in response to TheBCMan)Yep, that confirms what I was saying Tom for you.
I think its basically 24 hours but it pings on the 12 hour at night really I find.
-
14. Re: API CHANGES?
Liam Dilley Aug 19, 2013 8:18 PM (in response to TomCuneo-MLT)It is actually a good change, it is helpful as you can run with this and do some cool API work with that abonded cart. I can think of sending an email if they were also logged in and say "hey we saw you had xxx" we can give you 20% discount to tempt you: Etc.
-
15. Re: API CHANGES?
TheBCMan Aug 19, 2013 8:25 PM (in response to Liam Dilley)Liam: If we knew who they were which we don't, no entity ID



