Amzon MWS API Development Order Interface

Source: Internet
Author: User

The Amazon order interface is a chunk of the Amazon MWS development interface that we can use to get order data through an interface call.

Before invoking the interface, we first need to obtain information such as store key for the store merchant. As follows:

Here I define all the information in a class, in a serialized way, to facilitate access to the value.

/// <summary>    ///Account Information/// </summary>[Serializable] Public classAccountconfig:baseconfig<accountconfig>    {        /// <summary>        ///Application Name/// </summary>         Public stringAppName {Get;Set; } /// <summary>        ///Application Version/// </summary>         Public stringappversion {Get;Set; } /// <summary>        ///Account keyID/// </summary>         Public stringAccesskeyid {Get;Set; } /// <summary>        ///Key ID/// </summary>         Public stringSecretaccesskey {Get;Set; } /// <summary>        ///Mall ID/// </summary>         Public stringMerchantid {Get;Set; } /// <summary>        ///Mall Unique identification ID/// </summary>         Public stringMarketplaceid {Get;Set; } /// <summary>        ///server-side URL/// </summary>         Public stringserviceurl {Get;Set; } }

Then we go back to the documentation, and we'll find that there are two parameters in the request parameter that are required: Createdafter, Marketplaceid. The method of invoking the interface is very simple, it is to construct the complete object, in fact, the main is to maintain the integrity of the required parameters, this time we take the Listorder interface for example:

  

/// <summary>        ///Get account information/// </summary>        protectedaccountconfig Account {Get            {                returnaccountconfig.instance; }        }        Privatemarketplacewebserviceordersconfig GetConfig () {varConfig =NewMarketplacewebserviceordersconfig (); Config. Serviceurl=Account.serviceurl; returnconfig; }        Privatemarketplacewebserviceordersclient getclient () {varConfig = This.            GetConfig (); varClient =Newmarketplacewebserviceordersclient (Account.appname, Account.appversion, Account.accesskeyid, ACCOUNT.SECR            Etaccesskey, config); returnclient; }        #regionGet a list of orders (OrderList)PrivateList<order> Getnextorderlist (ref stringNextToken) {            varClient = This.            Getclient (); varRequest =Newlistordersbynexttokenrequest (); Request. Sellerid=Account.merchantid; Request. NextToken=NextToken; varResponse =client.            Listordersbynexttoken (Request); varresult =Response.            Listordersbynexttokenresult; NextToken=result.            NextToken; List<Order> orderlist =result.            Orders.order; returnorderlist; }        /// <summary>        ///get a list of orders (Specify request mode)/// </summary>        /// <param name= "Request" >listordersrequest</param>        /// <returns></returns>         PublicList<order>getorderlist (DateTime createdafter, datetime createdbefore) {varRequest =Newlistordersrequest (); Request. Createdafter=amazonhelper.converttoiso8601 (Createdafter); Request. Createdbefore=amazonhelper.converttoiso8601 (Createdbefore); Request. Marketplaceid=Newmarketplaceidlist (); Request. Marketplaceid.id=Newlist<string>{Account.marketplaceid}; Request. Sellerid=Account.merchantid; varClient =getclient (); varResponse =client.            Listorders (Request); varresult =Response.            Listordersresult; varOrderList =result.            Orders.order; stringNextToken =result.            NextToken;  while(!string. IsNullOrEmpty (NextToken)) {List<Order> templist = Getnextorderlist (refNextToken); OrderList=Orderlist.concat (templist).            ToList (); }            returnorderlist; }        #endregion

Remember, do not neglect to assign a value in the request parameter to the Sellerid in the call.

Amzon MWS API Development Order Interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.