C# UWP/WinRT MWS Inbound: Get Preorder Info

Back to Index

Returns pre-order information, including dates, that a seller needs before confirming a shipment for pre-order. Also indicates if a shipment has already been confirmed for pre-order.

Documentation: http://docs.developer.amazonservices.com/en_US/fba_inbound/FBAInbound_GetPreorderInfo.html

CURL Command

curl -X POST https://mws.amazonaws.com/FulfillmentInboundShipment/2010-10-01 \
  -d "AWSAccessKeyId=AWS_ACCESS_KEY_ID" \
  -d "Action=GetPreorderInfo" \
  -d "MWSAuthToken=MWS_AUTH_TOKEN" \
  -d "SellerId=MWS_SELLER_ID" \
  -d "SignatureVersion=2" \
  -d "Timestamp=CURRENT_DATE_TIME" \
  -d "Version=2010-10-01" \
  -d "Signature=MWS_SIGNATURE" \
  -d "SignatureMethod=HmacSHA256" \
  -d "ShipmentId=FBA2F3KCQF"

C# UWP/WinRT Example

Chilkat.Rest rest = new Chilkat.Rest();
bool success;

//  URL: https://mws.amazonaws.com/FulfillmentInboundShipment/2010-10-01
bool bTls = true;
int port = 443;
bool bAutoReconnect = true;
success = await rest.ConnectAsync("mws.amazonaws.com",port,bTls,bAutoReconnect);
if (success != true) {
    Debug.WriteLine("ConnectFailReason: " + Convert.ToString(rest.ConnectFailReason));
    Debug.WriteLine(rest.LastErrorText);
    return;
}

rest.AddQueryParam("AWSAccessKeyId","AWS_ACCESS_KEY_ID");
rest.AddQueryParam("Action","GetPreorderInfo");
rest.AddQueryParam("MWSAuthToken","MWS_AUTH_TOKEN");
rest.AddQueryParam("SellerId","MWS_SELLER_ID");
rest.AddQueryParam("SignatureVersion","2");
rest.AddQueryParam("Version","2010-10-01");
rest.AddQueryParam("SignatureMethod","HmacSHA256");
rest.AddQueryParam("ShipmentId","FBA2F3KCQF");

rest.Host = "mws.amazonaws.com";
//  The AddMwsSignature method adds the Timestamp and Signature query params.
rest.AddMwsSignature("POST","/FulfillmentInboundShipment/2010-10-01","mws.amazonaws.com","MWS_SECRET_KEY");

string strResponseBody = await rest.FullRequestFormUrlEncodedAsync("POST","/FulfillmentInboundShipment/2010-10-01");
if (rest.LastMethodSuccess != true) {
    Debug.WriteLine(rest.LastErrorText);
    return;
}

Chilkat.Xml xmlResponse = new Chilkat.Xml();
xmlResponse.LoadXml(strResponseBody);

string GetPreorderInfoResponse_xmlns;
string tagPath;
string ShipmentContainsPreorderableItems;
string NeedByDate;
string ConfirmedFulfillableDate;
string ShipmentConfirmedForPreorder;
string RequestId;

GetPreorderInfoResponse_xmlns = xmlResponse.GetAttrValue("xmlns");
ShipmentContainsPreorderableItems = xmlResponse.GetChildContent("GetPreorderInfoResult|ShipmentContainsPreorderableItems");
NeedByDate = xmlResponse.GetChildContent("GetPreorderInfoResult|NeedByDate");
ConfirmedFulfillableDate = xmlResponse.GetChildContent("GetPreorderInfoResult|ConfirmedFulfillableDate");
ShipmentConfirmedForPreorder = xmlResponse.GetChildContent("GetPreorderInfoResult|ShipmentConfirmedForPreorder");
RequestId = xmlResponse.GetChildContent("ResponseMetadata|RequestId");

Sample XML Response Body

<?xml version="1.0" encoding="utf-8" ?>
<GetPreorderInfoResponse xmlns="http://mws.amazonaws.com/FulfillmentInboundShipment/2010-10-01/">
    <GetPreorderInfoResult>
        <ShipmentContainsPreorderableItems>true</ShipmentContainsPreorderableItems>
        <NeedByDate>2015-12-27</NeedByDate>
        <ConfirmedFulfillableDate>2015-12-31</ConfirmedFulfillableDate>
        <ShipmentConfirmedForPreorder>true</ShipmentConfirmedForPreorder>
    </GetPreorderInfoResult>
    <ResponseMetadata>
        <RequestId>4a1a7029-462b-4a27-a04c-4cbe0fd107e3</RequestId>
    </ResponseMetadata>
</GetPreorderInfoResponse>