If you are looking for the Amazon’s FBA to fulfill your orders than this post belong to you. Amazon’s shipping cost for international customers are pretty good. That is why many amazon sellers seeking to integrate his eCommerce store to Amazon’s FBA solutions automatically.
So whenever they get any new order in their eCommerce store, it will automatically send to Amazon fulfillment center to send on destination address.
In this process, sellers use their Amazon seller inventory stock to complete external orders. For example you can sync Magento store with Amazon seller account. Must check that each Magento store product listed on amazon and have stock to fulfill it.
In our previous post explained how to get MWS API access keys and Add Products on Amazon via Submit Feed. Using this method you can list multiple products on amazon at one time.
Creating Amazon Fulfillment Order via API
Lets explain how to create fulfillment order in amazon via API call.
Amazon marketplace web service has a method “CreateFulfillmentOrder” that send request to Amazon fulfillment center to ship order to a customer address. You can check complete method description here:
http://docs.developer.amazonservices.com/en_IN/fba_outbound/FBAOutbound_CreateFulfillmentOrder.html
First you have to make an create fulfillment order parameters request. check below API parameters data which require to accomplish this API request.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
$param = array(); $param['AWSAccessKeyId'] = 'AGIAI*********XYTG'; $param['Action'] = 'CreateFulfillmentOrder'; $param['MWSAuthToken'] = 'amzn.mws.*******-****-****-4bae-87eesEXAMPLE'; $param['MarketplaceId'] = 'A***********R'; $param['SellerId'] = 'A***********U'; $param['SignatureMethod'] = 'HmacSHA256'; $param['SignatureVersion'] = '2'; $param['Timestamp'] = gmdate("Y-m-d\TH:i:s.\\0\\0\\0\\Z", time()); $param['Version'] = '2010-10-01'; $param['SellerFulfillmentOrderId'] = 'GHGFV34547VHJ'; // reference order ID $param['DisplayableOrderId'] = '56879896589'; // Display Order ID $param['DisplayableOrderDateTime'] = '2018-01-01T05:00:00Z'; $param['DisplayableOrderComment'] = 'Thanks for the order'; $param['FulfillmentAction'] = 'Ship'; $param['ShippingSpeedCategory'] = 'Standard'; $param['DestinationAddress.Name'] = 'Recipient Name'; $param['DestinationAddress.Line1'] = 'Recipient Address Line 1'; $param['DestinationAddress.Line2'] = 'Recipient Address Line 2'; $param['DestinationAddress.City'] = 'Recipient City'; $param['DestinationAddress.CountryCode'] = 'US'; $param['DestinationAddress.StateOrProvinceCode'] = 'Recipient State Code'; $param['DestinationAddress.PostalCode'] = 'Recipient Postal Code'; $param['Items.member.1.Quantity'] = '1'; $param['Items.member.1.SellerFulfillmentOrderItemId'] = 'Seller Order Item ID'; $param['Items.member.1.SellerSKU'] = 'ExampleSKU'; |
Now using Amazon MWS POST api request to send above parameter to mws.amazonservices.com server. Below code will help you to submit these parameters via POST api method. Check it out below code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
<?php $secret = '2w5qpOR********************NB2hyTs'; $url = array(); foreach ($param as $key => $val) { $key = str_replace("%7E", "~", rawurlencode($key)); $val = str_replace("%7E", "~", rawurlencode($val)); $url[] = "{$key}={$val}"; } sort($url); $arr = implode('&', $url); $sign = 'POST' . "\n"; $sign .= 'mws.amazonservices.com' . "\n"; $sign .= '/FulfillmentOutboundShipment/2010-10-01' . "\n"; $sign .= $arr; $signature = hash_hmac("sha256", $sign, $secret, true); $signature = urlencode(base64_encode($signature)); $link = "https://mws.amazonservices.com/FulfillmentOutboundShipment/2010-10-01?"; $link .= $arr . "&Signature=" . $signature; //echo($link); //for debugging - you can paste this into a browser and see if it loads. $ch = curl_init($link); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); $response = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); ?> |
If you have multiple Amazon’s seller account, you can manage it also. Just change the API access credential in request parameters.
For extra parameters, check official MWS documentation. Hopefully this post will help you create amazon fulfillment order api request call.
Hello, thanks for this post it really help me,
Basically i need to send my store order to my amazon seller account to user the FBA fulfillment service so i am using laravel,
Can this help me in this regard
Please help.
thanks
Hi, you need to Create Fullfillment Order using Amazon API. Is you facing any issue in creating API call ?
Thanks