The E-Commerce API that Wasn't



  • My company has this new, addictive product, and we decided to break with our modus operandi and sell this stuff directly to retail customers online.  The CTO went with a turn-key e-commerce solution - one of the big names.  I signed off on it because I read the first few pages of their "API" documentation and concluded that it would give us all the interop we needed.

    Well as it turns out, the API is read-only.  Read.  Only.  API.

    So I cursed loudly, sent them some nasty notes, reinstalled Fiddler, and found ways to adapt.

    I'm coding up a C# API to wrap their XML HTTP Post API (again, read-only), and it has lots of nice search options.  The most important of these for my company at this very moment is to get daily reports of what shipped so that we can reconcile inventory and other accounting nauseum.

    So I use my brand-new, bulletproof C# API to issue the query to get orders that shipped today.  My OrderSetQuery : Query object sends the request and parses the response into an OrderSet : IEnumerable<Order> object.  Which in this case contained one Order object for every order that ever shipped.

    I go to their KB to see if anyone ever noticed that their fromDate search node doesn't actually do anything.  Turns out it's a confirmed bug.  They promised to fix it in April.  It's now August, with no update.

    This means that I have to suck down every order we have ever shipped, every single fucking day, just to get a day's worth of Order objects in my OrderSet.  We expect to hit 3000 orders per day by the end of the year.

    My Query class is completely stream-based; each Order is created and populated as the data comes in off the wire, but this is going to be a bandwidth hog, and there is precious little I can do to stop it.

    It's just jaw-dropping WTFery all around.



  • Would it be a product that rhymes with Peecometry?



  •  It kinda rhymes with Pig Pommers.



  • @hoodaticus said:

     It kinda rhymes with Pig Pommers.

    Must be the infamous Dick Commerce then. Yep, heard about it.



  • @hoodaticus said:

    I signed off on it because I read the first few pages of their "API" documentation and concluded

    ... prematurely.  Oops.

    @hoodaticus said:

    Well as it turns out, the API is read-only.  Read.  Only.  API.

      Assuming you're talking about http://www.bigcommerce.com/pdf/Big_Commerce_API_Guide_1.0.pdf, it should have been evident after reading even the first page (the ToC), which lists all five of the API methods, all of which are search/retrieve queries and none of which mention submitting or modifying any kind of records.

    @hoodaticus said:

    So I use my brand-new, bulletproof C# API to issue the query to get orders that shipped today.  My OrderSetQuery : Query object sends the request and parses the response into an OrderSet : IEnumerable<Order> object.  Which in this case contained one Order object for every order that ever shipped.

    I go to their KB to see if anyone ever noticed that their fromDate search node doesn't actually do anything.  Turns out it's a confirmed bug.  They promised to fix it in April.  It's now August, with no update.

    This means that I have to suck down every order we have ever shipped, every single fucking day, just to get a day's worth of Order objects in my OrderSet.  We expect to hit 3000 orders per day by the end of the year.

    My Query class is completely stream-based; each Order is created and populated as the data comes in off the wire, but this is going to be a bandwidth hog, and there is precious little I can do to stop it.

    Did you check if the dateRange node works?  Or, are the orderId values monotonically increasing so that you can use orderFrom and remember the maximum orderId to resume from next time?

     




  • Would it not have been appropriate, once you find the buggy fromDate method, to turn round and say, "Sorry, doesn't do as advertised" and terminate contract, then go to a rival company which does provide an API which is not read-only? Treat it as a narrow escape, like?

    ED: Quoting the entire OP causes more Matrix movies to be made.  Love, BTK



  • @Matt Westwood said:

    Would it not have been appropriate, once you find the buggy fromDate method, to turn round and say, "Sorry, doesn't do as advertised" and terminate contract, then go to a rival company which does provide an API which is not read-only? Treat it as a narrow escape, like?
    I can do that.  But I'm afraid that the alternative I'll end up with will be [i]even worse[/i].

    Suggestions are welcome, please.  I need programmatic ability to read-write query orders and integration with a credit card transaction processor and FedEx.  The true API documentation should NOT involve browsing the site with Fiddler running.

    And now I'm inflicted with cognitive dissonance. I have a streaming idiot-proof C# API for it now (with write capability coming next week thanks to Fiddler).  I'd have to throw it out and start over.  But a quality web API would save me time on the write-capability dev.

    My kingdom for a web service!



  • Yes, DaveK, I am TRWTF.  In my defense, they promised a new, writeable API for the 7.1 release, (being rolled out now).  They seem to have gotten amnesia.  Besides, I knew from experience that - worst case scenario - I could handle it (even with no API at all), and I didn't really have time to consider alternatives when the push was to get the site up ASAP.

    @DaveK said:

    Did you check if the dateRange node works?  Or, are the orderId values monotonically increasing so that you can use orderFrom and remember the maximum orderId to resume from next time?
    dateRange works.  Too bad it's not an actual date range, and there is no documentation (other than your link), KB, or forum post that even contains the word dateRange, so that I could know what the values do.  What is the difference between "day" and "today"?  My guess that "day" let me enter "monday" was, sadly, wrong.

    I just figured out at the end of the day that it DOES let me pull in orders for today without nabbing all of antiquity.  But two months from now, if someone makes me prove my API didn't screw something up, I'm going to have to pull a year's worth of orders down from that site.

    Tracking numbers.  It lets you search for orders by partial tracking number match.  But does it let you GET the tracking number?  Oh, no.

    I told my CTO that these guys are making me want to open my own e-commerce site just to show them how it's done.



  • @Matt Westwood said:

    ED: Quoting the entire OP causes more Matrix movies to be made...
    ... or wins Keanu Reeves an Oscar.



  • @hoodaticus said:

    @Matt Westwood said:
    ED: Quoting the entire OP causes more Matrix movies to be made...
    ... or wins Keanu Reeves an Oscar.
    I know kung-fu...

    FUCK YOU, YOU DON'T!!! BAHHH!!!



  • I just beg-mailed my CTO to move us to Magento.  Let's see what happens.



  • I have some experience using Magento. I don't know a lot about the alternatives, but it works great for us and I've never had much problems with it.


  • Discourse touched me in a no-no place

    @Xyro said:

    I have some experience using Magento. I don't know a lot about the alternatives, but it works great for us and I've never had much problems with it.
    I do as well, and I've had nothing but problems. It continuously manages to clobber its own indexes and has the dumbest database design I have ever met.



  • Have you met a lot of database designs?  Maybe through one of those database design dating services where you have 2 minutes to talk to each other, then a bell rings?



  • I'm confused... dateRange documentation in the linked PDF says:

    dateRange – Search for orders placed in the specified time period
    (acceptable values are today, yesterday, day, week, month, this_month,
    this_year)

    That's on page 6....



  • @darkmattar said:

    I'm confused... dateRange documentation in the linked PDF says:

    dateRange – Search for orders placed in the specified time period
    (acceptable values are today, yesterday, day, week, month, this_month,
    this_year)

    That's on page 6....

    Yes, that solved the problem of having to suck in everything just to get today.  It still leaves ad-hoc queries for a given date more than a month ago forcing me to suck down an entire year.  It's less of a WTF than it was, but you tell me which is easier from their perspective:

    a) Permitting date-based queries

    or

    b) Permitting relative queries like "week".

    Their WTF is supporting option 2 and not option 1, when option 1 is more powerful for the end-user and way simpler to code for them as well.

    Their other WTF is supporting a daterange query on the order date, but not the shipment date.  Now which one of those is Accounting more interested in, do you think?



  • @Weng said:

    @Xyro said:
    I have some experience using Magento. I don't know a lot about the alternatives, but it works great for us and I've never had much problems with it.
    I do as well, and I've had nothing but problems. It continuously manages to clobber its own indexes and has the dumbest database design I have ever met.

    I don't disagree about the database mess. Once I had to change something manually after a migration to another Magento install. That was ... arduous. But I dunno, for the most part, it just works. What kind of problems do you have?


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.