Bluepark API - Create Order(s) - Advice sought please...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TonyRS
    Junior Blueparker
    • Oct 2012
    • 21

    #1

    Bluepark API - Create Order(s) - Advice sought please...

    We've successfully connected to our store, using the Bluepark API, and can grab Order and SKU details OK.
    We'd now like to create orders we are grabbing from Amazon into out Bluepark store.

    Try as I might, I'm unable to create an order through the API. I'm using the simplest of examples, as detailed in API documentation, but nothing is being created? I'm not clear how to pass in my order data. If anyone is successfully doing this, perhaps you might be kind enough to point out what I've missed and/or what I might be doing wrong.

    Essentially, this is my example call to API to create an order...

    Code:
    $order[0]['email_address']                          = "mail@xyzdomain.co.uk";
    $order[0]['products'][0]['sku']                     = "C792X77G";   
    $order[0]['products'][0]['quantity']                = 1;
    
    
    $response = bp::create("orders", $order));
    Thanks, hopefully!
    TonyRS
  • Bandanashop
    Senior Blueparker
    • Jun 2012
    • 236

    #2
    You seem to be missing a shipping method? Which I suspect is mandatory. Also check that you are 'POST'ing rather than GET or PUT in the HTTP call.
    I would use the API specification tool online until I got all the mandatory fields correct and got a valid 200 response back from BP. Then transpose those fields to your PHP code.
    Regards
    Rob
    www.herniapants.com

    Comment

    • TonyRS
      Junior Blueparker
      • Oct 2012
      • 21

      #3
      Thanks - And, another query!!

      Hi Bandanashop,

      Thanks for taking the time to reply.

      We're now able to retrieve Orders from Amazon and insert them into Bluepark using their API. We are now trying to solve a few "Funnies".

      Our prices are obviously higher on Amazon than on our Bluepark site, to cater for Amazon's commission. Have yet to figure out how to store item prices, paid on Amazon. Currently, when creating an order through BP API and assigning a distributor to each item, it seems to insert distributors -> sku price, as set on our Bluepark Site, rather than store the actual amazon item price we are passing through API order creation call?

      Rgds

      Comment

      • TonyRS
        Junior Blueparker
        • Oct 2012
        • 21

        #4
        ...OrderLine Price..?

        Originally posted by TonyRS
        Hi Bandanashop,

        Thanks for taking the time to reply.

        We're now able to retrieve Orders from Amazon and insert them into Bluepark using their API. We are now trying to solve a few "Funnies".

        Our prices are obviously higher on Amazon than on our Bluepark site, to cater for Amazon's commission. Have yet to figure out how to store item prices, paid on Amazon. Currently, when creating an order through BP API and assigning a distributor to each item, it seems to insert distributors -> sku price, as set on our Bluepark Site, rather than store the actual amazon item price we are passing through API order creation call?

        Rgds
        Or to put it another way...

        How do we set a price in a BP API created order line to the Amazon order line ['ItemPrice']['Amount'] ???

        Rgds

        Comment

        • Bandanashop
          Senior Blueparker
          • Jun 2012
          • 236

          #5
          We do not seem to have this problem. but your BP config might be set up differently to our own. As far as I am aware we can create a new order via the API and put in any price we like over-riding the associated SKU price that is associated with BP.
          Regards
          Rob
          www.herniapants.com

          Comment

          • TonyRS
            Junior Blueparker
            • Oct 2012
            • 21

            #6
            API - Creating Order - Order Items Prices

            Originally posted by Bandanashop
            We do not seem to have this problem. but your BP config might be set up differently to our own. As far as I am aware we can create a new order via the API and put in any price we like over-riding the associated SKU price that is associated with BP.
            Regards
            Rob
            Hi Rob,

            Thank you for your reply.

            Struggling with this somewhat! Would you be able to advise which field(s) you are using to place your Amazon order price into Bluepark Order->Products to override Blueparks default prices?

            Rgds

            Comment

            • Bandanashop
              Senior Blueparker
              • Jun 2012
              • 236

              #7
              Originally posted by TonyRS
              Hi Rob,

              Thank you for your reply.

              Struggling with this somewhat! Would you be able to advise which field(s) you are using to place your Amazon order price into Bluepark Order->Products to override Blueparks default prices?

              Rgds
              Tony, condensing several thousand lines of code to the following...
              I am doing a 'ListOrder' call to Amazon, I then do a call to Bluepark to establish if it exists or not, then for every Un-shipped Amazon order returned in that ListOrder call I do a 'ListorderItems' call to Amazon to pick up the Order lines. I then merge both into the Create Orders Bluepark API call

              with 'payment_taken' = amazon field 'amount'
              products collection has each SKU and price_paid_exc_vat

              You might be able to do a two set process, create the order then update/add order lines. There are probably at a couple of ways of doing it.

              To cross-reference the Amazon orderid e.g. 202-12345-67890 I put that into the channel number and a Channel Name of Amazon which was pre-created.
              That way I can see and identify Amazon orders separately if required in the Order Manager.

              In the Admin comments I add the text 'Amazon price : 12.85' or similar to identify what they actually paid. The total is correct and I send the Amazon Invoice to the customer which has what they paid on it.
              Regards
              Rob
              www.herniapants.com

              Comment

              • TonyRS
                Junior Blueparker
                • Oct 2012
                • 21

                #8
                Hi Rob,

                Thank you for such an informative reply. All very helpful.

                Currently, we use an hourly cron job to retrieve Amazon Orders, storing them in an intermediated online database; with a second hourly cron job grabbing Amazon orders from that database to create Bluepark Orders through their API, retrieve back Bluepark created orders and update online database to match Bluepark Order ID's and Bluepark Order numbers with Amazon Order ID's.

                Next...

                • Working towards triggering all the drop shipping for our Amazon -> Bluepark Orders
                • Then, through MWS, updating Amazon Order Shipment to trigger payment by Amazon.
                • Automating Daily Stock Price Update of products in our Amazon store


                So, we're moving forwards I hope...

                Once more, many thanks, your replies have all proved most helpful

                Rgds

                Comment

                Working...