-
-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from bhushankumarl/development
Development
- Loading branch information
Showing
9 changed files
with
234 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -214,6 +214,79 @@ var amazonMws = require('amazon-mws')('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY | |
}); | ||
``` | ||
|
||
### MerchantFulfillment | ||
|
||
#### Get Eligible Shipping Services | ||
```js | ||
amazonMws.merchantFulfillment.search({ | ||
'Version': '2015-06-01', | ||
'Action': 'GetEligibleShippingServices', | ||
'SellerId': 'SELLER_ID', | ||
'MWSAuthToken': 'MWS_AUTH_TOKEN', | ||
'ShipmentRequestDetails.AmazonOrderId': 'AMAZON_ORDER_ID', | ||
'ShipmentRequestDetails.PackageDimensions.Length': 'PACKAGE_LENGTH', | ||
'ShipmentRequestDetails.PackageDimensions.Width': 'PACKAGE_WIDTH', | ||
'ShipmentRequestDetails.PackageDimensions.Height': 'PACKAGE_HEIGHT', | ||
'ShipmentRequestDetails.PackageDimensions.Unit': 'PACKAGE_UNIT', | ||
'ShipmentRequestDetails.Weight.Value': 'WEIGHT_VALUE', | ||
'ShipmentRequestDetails.Weight.Unit': 'WEIGHT_UNIT', | ||
'ShipmentRequestDetails.ShipFromAddress.Name': 'SHIP_FROM_ADDRESS_NAME', | ||
'ShipmentRequestDetails.ShipFromAddress.AddressLine1': 'SHIP_FROM_ADDRESS_LINE_1', | ||
'ShipmentRequestDetails.ShipFromAddress.City': 'SHIP_FROM_ADDRESS_CITY', | ||
'ShipmentRequestDetails.ShipFromAddress.StateOrProvinceCode': 'SHIP_FROM_ADDRESS_STATE_OR_PROVINCE_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.PostalCode': 'SHIP_FROM_ADDRESS_POSTAL_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.CountryCode': 'SHIP_FROM_ADDRESS_COUNTRY_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.Email': 'SHIP_FROM_ADDRESS_EMAIL', | ||
'ShipmentRequestDetails.ShipFromAddress.Phone': 'SHIP_FROM_ADDRESS_PHONE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience': 'DELIVERY_EXPERIENCE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp': 'CARRIER_WILL_PICKUP', | ||
'ShipmentRequestDetails.ItemList.Item.1.OrderItemId': 'ORDER_ITEM_ID', | ||
'ShipmentRequestDetails.ItemList.Item.1.Quantity': 'QUANTITY' | ||
}, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
``` | ||
#### Create Shipment | ||
```js | ||
amazonMws.merchantFulfillment.create({ | ||
'Version': '2015-06-01', | ||
'Action': 'CreateShipment', | ||
'SellerId': 'SELLER_ID', | ||
'MWSAuthToken': 'MWS_AUTH_TOKEN', | ||
'ShippingServiceId': 'SHIPPING_SERVICE_ID', | ||
'ShipmentRequestDetails.AmazonOrderId': 'AMAZON_ORDER_ID', | ||
'ShipmentRequestDetails.PackageDimensions.Length': 'PACKAGE_LENGTH', | ||
'ShipmentRequestDetails.PackageDimensions.Width': 'PACKAGE_WIDTH', | ||
'ShipmentRequestDetails.PackageDimensions.Height': 'PACKAGE_HEIGHT', | ||
'ShipmentRequestDetails.PackageDimensions.Unit': 'PACKAGE_UNIT', | ||
'ShipmentRequestDetails.Weight.Value': 'WEIGHT_VALUE', | ||
'ShipmentRequestDetails.Weight.Unit': 'WEIGHT_UNIT', | ||
'ShipmentRequestDetails.ShipFromAddress.Name': 'SHIP_FROM_ADDRESS_NAME', | ||
'ShipmentRequestDetails.ShipFromAddress.AddressLine1': 'SHIP_FROM_ADDRESS_LINE_1', | ||
'ShipmentRequestDetails.ShipFromAddress.City': 'SHIP_FROM_ADDRESS_CITY', | ||
'ShipmentRequestDetails.ShipFromAddress.StateOrProvinceCode': 'SHIP_FROM_ADDRESS_STATE_OR_PROVINCE_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.PostalCode': 'SHIP_FROM_ADDRESS_POSTAL_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.CountryCode': 'SHIP_FROM_ADDRESS_COUNTRY_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.Email': 'SHIP_FROM_ADDRESS_EMAIL', | ||
'ShipmentRequestDetails.ShipFromAddress.Phone': 'SHIP_FROM_ADDRESS_PHONE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience': 'DELIVERY_EXPERIENCE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp': 'CARRIER_WILL_PICKUP', | ||
'ShipmentRequestDetails.ItemList.Item.1.OrderItemId': 'ORDER_ITEM_ID', | ||
'ShipmentRequestDetails.ItemList.Item.1.Quantity': 'QUANTITY' | ||
}, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
``` | ||
|
||
|
||
### Orders | ||
|
||
#### List Orders | ||
|
@@ -409,12 +482,11 @@ var amazonMws = require('amazon-mws')('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY | |
#### Additionally all api returns Throttling: Limits to how often you can submit requests | ||
Reference : http://docs.developer.amazonservices.com/en_CA/dev_guide/DG_Throttling.html | ||
```json | ||
{ | ||
{ | ||
"x-mws-quota-max": "60.0", | ||
"x-mws-quota-remaining": "38.0", | ||
"x-mws-quota-resetson": "2017-12-08T08:21:00.000Z", | ||
"x-mws-timestamp": "2017-12-08T07:52:15.567Z" | ||
} | ||
``` | ||
Originally by [Bhushankumar Lilapara](https://github.com/bhushankumarl) ([email protected]). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
'use strict'; | ||
|
||
var accessKey = process.env.AWS_ACCESS_KEY_ID || 'YOUR_KEY'; | ||
var accessSecret = process.env.AWS_SECRET_ACCESS_KEY || 'YOUR_SECRET'; | ||
|
||
var amazonMws = require('../../../lib/amazon-mws')(accessKey, accessSecret); | ||
|
||
var merchantFulfillmentRequest = function () { | ||
|
||
amazonMws.merchantFulfillment.create({ | ||
'Version': '2015-06-01', | ||
'Action': 'CreateShipment', | ||
'SellerId': 'SELLER_ID', | ||
'MWSAuthToken': 'MWS_AUTH_TOKEN', | ||
'ShippingServiceId': 'SHIPPING_SERVICE_ID', | ||
'ShipmentRequestDetails.AmazonOrderId': 'AMAZON_ORDER_ID', | ||
'ShipmentRequestDetails.PackageDimensions.Length': 'PACKAGE_LENGTH', | ||
'ShipmentRequestDetails.PackageDimensions.Width': 'PACKAGE_WIDTH', | ||
'ShipmentRequestDetails.PackageDimensions.Height': 'PACKAGE_HEIGHT', | ||
'ShipmentRequestDetails.PackageDimensions.Unit': 'PACKAGE_UNIT', | ||
'ShipmentRequestDetails.Weight.Value': 'WEIGHT_VALUE', | ||
'ShipmentRequestDetails.Weight.Unit': 'WEIGHT_UNIT', | ||
'ShipmentRequestDetails.ShipFromAddress.Name': 'SHIP_FROM_ADDRESS_NAME', | ||
'ShipmentRequestDetails.ShipFromAddress.AddressLine1': 'SHIP_FROM_ADDRESS_LINE_1', | ||
'ShipmentRequestDetails.ShipFromAddress.City': 'SHIP_FROM_ADDRESS_CITY', | ||
'ShipmentRequestDetails.ShipFromAddress.StateOrProvinceCode': 'SHIP_FROM_ADDRESS_STATE_OR_PROVINCE_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.PostalCode': 'SHIP_FROM_ADDRESS_POSTAL_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.CountryCode': 'SHIP_FROM_ADDRESS_COUNTRY_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.Email': 'SHIP_FROM_ADDRESS_EMAIL', | ||
'ShipmentRequestDetails.ShipFromAddress.Phone': 'SHIP_FROM_ADDRESS_PHONE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience': 'DELIVERY_EXPERIENCE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp': 'CARRIER_WILL_PICKUP', | ||
'ShipmentRequestDetails.ItemList.Item.1.OrderItemId': 'ORDER_ITEM_ID', | ||
'ShipmentRequestDetails.ItemList.Item.1.Quantity': 'QUANTITY' | ||
}, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
}; | ||
|
||
merchantFulfillmentRequest(); |
43 changes: 43 additions & 0 deletions
43
examples/javaScript/merchantFulfillment/getEligibleShippingServices.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use strict'; | ||
|
||
var accessKey = process.env.AWS_ACCESS_KEY_ID || 'YOUR_KEY'; | ||
var accessSecret = process.env.AWS_SECRET_ACCESS_KEY || 'YOUR_SECRET'; | ||
|
||
var amazonMws = require('../../../lib/amazon-mws')(accessKey, accessSecret); | ||
|
||
var merchantFulfillmentRequest = function () { | ||
|
||
amazonMws.merchantFulfillment.search({ | ||
'Version': '2015-06-01', | ||
'Action': 'GetEligibleShippingServices', | ||
'SellerId': 'SELLER_ID', | ||
'MWSAuthToken': 'MWS_AUTH_TOKEN', | ||
'ShipmentRequestDetails.AmazonOrderId': 'AMAZON_ORDER_ID', | ||
'ShipmentRequestDetails.PackageDimensions.Length': 'PACKAGE_LENGTH', | ||
'ShipmentRequestDetails.PackageDimensions.Width': 'PACKAGE_WIDTH', | ||
'ShipmentRequestDetails.PackageDimensions.Height': 'PACKAGE_HEIGHT', | ||
'ShipmentRequestDetails.PackageDimensions.Unit': 'PACKAGE_UNIT', | ||
'ShipmentRequestDetails.Weight.Value': 'WEIGHT_VALUE', | ||
'ShipmentRequestDetails.Weight.Unit': 'WEIGHT_UNIT', | ||
'ShipmentRequestDetails.ShipFromAddress.Name': 'SHIP_FROM_ADDRESS_NAME', | ||
'ShipmentRequestDetails.ShipFromAddress.AddressLine1': 'SHIP_FROM_ADDRESS_LINE_1', | ||
'ShipmentRequestDetails.ShipFromAddress.City': 'SHIP_FROM_ADDRESS_CITY', | ||
'ShipmentRequestDetails.ShipFromAddress.StateOrProvinceCode': 'SHIP_FROM_ADDRESS_STATE_OR_PROVINCE_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.PostalCode': 'SHIP_FROM_ADDRESS_POSTAL_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.CountryCode': 'SHIP_FROM_ADDRESS_COUNTRY_CODE', | ||
'ShipmentRequestDetails.ShipFromAddress.Email': 'SHIP_FROM_ADDRESS_EMAIL', | ||
'ShipmentRequestDetails.ShipFromAddress.Phone': 'SHIP_FROM_ADDRESS_PHONE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.DeliveryExperience': 'DELIVERY_EXPERIENCE', | ||
'ShipmentRequestDetails.ShippingServiceOptions.CarrierWillPickUp': 'CARRIER_WILL_PICKUP', | ||
'ShipmentRequestDetails.ItemList.Item.1.OrderItemId': 'ORDER_ITEM_ID', | ||
'ShipmentRequestDetails.ItemList.Item.1.Quantity': 'QUANTITY' | ||
}, function (error, response) { | ||
if (error) { | ||
console.log('error ', error); | ||
return; | ||
} | ||
console.log('response', response); | ||
}); | ||
}; | ||
|
||
merchantFulfillmentRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
var path = require('path'); | ||
var AmazonMwsResource = require('../AmazonMwsResource'); | ||
var amazonMwsMethod = AmazonMwsResource.method; | ||
|
||
module.exports = AmazonMwsResource.extend({ | ||
|
||
path: 'MerchantFulfillment', | ||
search: amazonMwsMethod({ | ||
method: 'GET' | ||
}), | ||
|
||
create: amazonMwsMethod({ | ||
method: 'GET' | ||
}) | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters