Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

You need to get application settings when you start ithttp://docs.otapi.net/en/Documentations/Method?name=GetCommonInstanceOptionsInfo with parameter applicationType=MobileApplication/Android or applicationType=MobileApplication/iOS depends on system.

Application should get a list of available languages from the settings and provide user with an interface to choose application language (if there is more than one language in the list). Further queries to api are called with this language. When starting, the application should take the first language from the list in the settings, check user session (anonymous or authorized) with this language and get application language from the user’s preferences (for more details see working with the user block).

It is also necessary to request a list of translations for application interface at the starthttp://docs.otapi.net/ru/Documentations/Method?name=GetApplicationUITranslations with language and parameter passing applicationType=MobileApplication/Android or applicationType=MobileApplication/iOS depends on system.

The list of successfully received settings must be cached. It is worth clearing settings cache in the background without slowing down application’s operation with this request. It’s worth clearing cache in background either every N hours or every time the application starts. Settings are the same for the entire application and do not differ for different users.

...

and parameter applicationType=MobileApplication/Android or applicationType=MobileApplication/iOS depends on system. Received data for each collection has a serial number for sorting <Order> 0 </Order>, you need to display collections on the application screen according to this sorting. It is recommended to show collections only from cache. Collections in cache must be updated in background: every 60 minutes, request BatchSearchRatingLists method and save result in the cache. When receiving a response, you need to check HasTranslateErrors node (http://docs.dev.otapi.net/en/Documentations/Type?name=BatchRatingListsSearchResultAnswer), if the node is "true", then you do not need to cache the response. You must check HasError node (http://docs.dev.otapi.net/en/Documentations/Type?name=RatingListSearchResult) for each RatingList element in the response, if the node is true, then this collection item does not need to be cached.

...

You can get a full list of banners configured for application by http://docs.otapi.net/en/Documentations/Method?name=GetBanners method, passing parameter applicationType=MobileApplication/Android or applicationType=MobileApplication parameter/iOS depends on system.

Each banner will have its name, image address, type of action, and action parameter. The current types of actions and the meaning of their parameters are listed below.

...

 

Раскрыть
titleCustomer did not choose anything
<Request />
equal to
<Request>
    <Current />
</Request>
equal to
<Request>
    <Current Quantity="1" />
</Request>
Раскрыть
titleRequest with quantity in a product without options at all or without selected options
<Request>
    <Current Quantity="5" />
</Request>
Request to current options:
<Request>
    <Current ConfigurationId="idconfiguration" />
</Request>
or
<Request>
    <Current ConfigurationId="idconfiguration" Quantity="5" />
</Request>
or
<Request>
    <Current>
        <Property Id="idcolor" ValueId="idRed"
    </Current>
</Request>
or
<Request>
    <Current>
        <Property Id="idcolor" ValueId="idRed"
        <Property Id="idSize" ValueId="idMiddle"
    </Current>
</Request>
or
<Request>
    <Current Quantity="5">
        <Property Id="colorid" ValueId="idRed"
        <Property Id="idSize" ValueId="idMiddle"
        <Property Id="idModel" ValueId="idSomeModel"
    </Current>
</Request>
Раскрыть
titleRequest with selected other configurations
<Request>
    <Selected ConfigurationId="idConfiguration" Quantity="1" />
    <Selected ConfigurationId="idConfiguration" Quantity="2" />
    ...
</Request>
or
<Request>
    <Selected Quantity="1">
        <Property Id="idColor" ValueId="idRed"
        <Property Id="idSize" ValueId="idMiddle"
    </Selected>
    <Selected Quantity="2">
        <Property Id="idColor" ValueId="idGreen"
        <Property Id="idSize" ValueId="idMiddle"
    </Selected>
    ...
</Request>

A query with everything together can be any combination of other types of queries, for example:
<Request>
    <Current Quantity="5">
        <Property Id="idColor" ValueId="idRed"
    </Current>
    <Selected Quantity="2">
        <Property Id="idColor" ValueId="idGreen"
        <Property Id="idSize" ValueId="idMiddle"
    </Selected>
</Request>


What's Current/Selected - and what's correct? Current or Selected?

If you need only 1 simultaneously selected config, then you can not think about Selected at all.
If you need several (as in 1688), then in Selected send everything where the quantity is entered.

 

Favourite goods

Get list of itemshttp://docs.otapi.net/en/Documentations/Method?name=BatchGetUserData , blockList=Note.

Add item to favorites: http://docs.otapi.net/en/Documentations/Method?name=AddItemToNote , fieldParameters=<Fields/>

Remove item from favorites: http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromNote , confirmation to delete is required before removing.

Move item into cart: http://docs.otapi.net/en/Documentations/Method?name=MoveItemFromNoteToBasket

Change item quantity in favorites: http://docs.otapi.net/en/Documentations/Method?name=EditNoteItemQuantity

Change commenthttp://docs.otapi.net/en/Documentations/Method?name=EditNoteItemFields , <Fields><FieldInfo Name="Comment" Value="Text for comment"/></Fields>

Change item configuration:
1. you can get available configurations by the following methods http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemFullInfo and http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemConfigurationInfo - similar to item card.
2. new configuration is saved by adding a new one and deleting the old one, i.e. consecutive calls http://docs.otapi.net/en/Documentations/Method?name=AddItemToNote (it is important to pass all fieldParameters from the old record into the method, otherwise you may lose some of information, for example, user’s comment on a product) and http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromNote 

Favourite sellers

Vendors list: http://docs.otapi.net/en/Documentations/Method?name=BatchGetUserData , blockList=FavoriteVendors

Add vendor to favorites: http://docs.otapi.net/en/Documentations/Method?name=AddVendorToFavorites , fieldParameters=<Fields/>

Remove vendor from favorites: http://docs.otapi.net/en/Documentations/Method?name=RemoveVendorFromFavorites , confirmation to delete is required before removing.

Cart

Get list of items: http://docs.otapi.net/en/Documentations/Method?name=BatchGetUserData , blockList=Basket.

The list of goods should be divided by providers, as you can order goods of only one provider in one order. User should be notified about minimum order amount (if it is set in configuration), you can get it using http://docs.otapi.net/en/Documentations/Method?name=GetCommonInstanceOptionsInfo method (Result->Order->MinOrderCost)

Remove item from cart: http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromBasket , confirmation to delete is required before removing.

Empty cart http://docs.otapi.net/en/Documentations/Method?name=ClearBasket , confirmation to delete is required before removing.

Move selected item from cart to favorites: http://docs.otapi.net/en/Documentations/Method?name=MoveItemFromCartToNote several calls are made to transfer several marked products MoveItemFromCartToNote

Change quantity of items in the cart: http://docs.otapi.net/en/Documentations/Method?name=EditBasketItemQuantity

Add/edit comment to item: http://docs.otapi.net/en/Documentations/Method?name=EditBasketItemFields <Fields><FieldInfo Name="Comment" Value="Comment text"/></Fields>

Edit item weight: http://docs.otapi.net/en/Documentations/Method?name=EditBasketItemFields <Fields><FieldInfo Name="Weight" Value="New weight of an item"/></Fields>

Edit item configuration:
1. you can get available configurations by http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemFullInfo and http://docs.otapi.net/en/Documentations/Method?name=BatchGetSimplifiedItemConfigurationInfo methods - similar to item card.
2. new configuration is saved by adding a new one and deleting the old one, i.e. consecutive calls http://docs.otapi.net/en/Documentations/Method?name=AddItemToBasket (it is important to pass all fieldParameters from the old record into the method, otherwise you may lose some of information, for example, user’s comment on a product) and http://docs.otapi.net/en/Documentations/Method?name=RemoveItemFromBasket 

Profile

Get basic information about user (name, email, etc.): http://docs.otapi.net/en/Documentations/Method?name=GetUserInfo , you can edit this information with http://docs.otapi.net/en/Documentations/Method?name=UpdateUser method.

Delivery address. Delivery address is created and edited separately from basic information about the user. N delivery addresses are possible in total where N is taken from the setting http://docs.otapi.net/en/Documentations/Method?name=GetCommonInstanceOptionsInfo UserProfile->MaxProfilesCount. Methods for working with delivery address:

Interface is required for user that allows to select default profile https://www.screencast.com/t/1fZ9HuauBjf . Selected profile must be saved in user preferences: http://docs.otapi.net/en/Documentations/Method?name=UpdateUserPreferences , ProfileId field.

Get a list of content pages for profile screen: http://docs.otapi.net/en/Documentations/Method?name=GetContentMenuItemTree , parameters:

applicationType=MobileApplication/Android or applicationType=MobileApplication/iOS depends on system
menuList=Profile
includeContent=true

Get list of countries for delivery: http://docs.otapi.net/en/Documentations/Method?name=GetDeliveryCountryInfoList .

Get list of cities: http://docs.otapi.net/en/Documentations/Method?name=SearchCities  (while user enters characters to search for the city, i.e. QueryText parameter is empty, you need to send IsMainCity = true to get a list of default cities). When user selects city from the list, save it in the City profile and CityCode profile and automatically fill in the Region field.

Important: CountryCode - obligatory field for placing an order, CityCode - optional field, system must transfer the code to the services if user selected a city from the list. Save only City node if user entered city that is not in SearchCities list.

Orders list

http://docs.otapi.net/en/Documentations/Method?name=SearchOrdersForUser

Active: <OrderSearchParametersForUser><IsCancelled>false</IsCancelled><IsCompleted>false</IsCompleted></OrderSearchParametersForUser>

Cancelled: <OrderSearchParametersForUser><IsCancelled>true</IsCancelled></OrderSearchParametersForUser>

Completed: <OrderSearchParametersForUser><IsCompleted>true</IsCompleted></OrderSearchParametersForUser>

The list of fields to display:

  • Order ID passed in API into all possible methods: Id
  • Order number displayed to buyer: DisplayId
  • Order date: CreatedDateTime
  • Statusс: StatusName
  • Sum: TotalAmount
  • Already paid: TotalAmount minus RemainAmount
  • For payment: RemainAmount
  • Goods price: GoodsAmount
  • Items positions: do not show this field if there is no such information

Order. Detailed information

Get order information: http://docs.otapi.net/en/Documentations/Method?name=GetSalesOrderDetails

Display order information for user (OrderInfo node, details here http://docs.otapi.net/en/Documentations/Type?name=OtapiOrderInfo), properties:

Display goods list in the order (SalesLinesList node, details about each line is here http://docs.otapi.net/en/Documentations/Type?name=SalesLine)

Shippings list - http://docs.otapi.net/en/Documentations/Method?name=GetSalesOrderShippings

Order. Placing an order and choosing delivery method

You can place goods of only one provider into one order.

When placing an order, you will need a form for choosing delivery address or, if an address was previously created, a form for creating delivery address / s (delivery profile documentation anchor).

When placing an order, you will need to select a delivery method from provided list: http://docs.otapi.net/en/Documentations/Method?name=SearchDeliveryModes request, xmlSearchParameters parameters:

  • ProviderType - provider ID;
  • Weight - goods weight, you will need to get a list of goods by http://docs.otapi.net/en/Documentations/Method?name=GetPartialBasket method in case of making order from the cart, get the sum of each item weight (for each product you need to multiply item weight by ordered quantity);
  • CountryCode - delivery country code from selected delivery address;
  • CityCode - delivery city code from selected delivery address.

Parameters example: <DeliveryModeSearchParameters><CountryCode>RU</CountryCode><CityCode>7700000000000</CityCode><Weight>75.000</Weight><ProviderType>Taobao</ProviderType></DeliveryModeSearchParameters>.

IsPickupPointMode flag must be considered when displaying delivery methods.

  • Show user Delivery address and zip code fields (take field values from selected delivery address) if flag = false.
  • Take delivery address and zip code from selected pickup location if flag = true. Provide user with an interface for choosing a pick-up point: show all available pick-up points for current delivery method http://docs.otapi.net/en/Documentations/Method?name=SearchDeliveryPickupPoints (by default, the pick-up point must be selected, which is stored in selected address / delivery profile).

Save ExternalDeliveryId to user preferences after successful order (http://docs.otapi.net/en/Documentations/Method?name=UpdateUserPreferences) as well as update delivery address parameters, if the interface has not done it immediately (http://docs.otapi.net/en/Documentations/Method?name=UpdateUserProfile).

From cart

"check" relevance of prices and possibility to buy before placing an order from the cart:

  • call http://docs.otapi.net/en/Documentations/Method?name=RunBasketChecking method with selected cart identifiers after customer checked off goods that he wants to buy, we get and save "activity identifier" in response;
  • show overlay to client and a phrase "Please wait. Products in the cart are checked for availability. Verification time depends on quantity of goods in the cart" and progress bar;
  • call function http://docs.otapi.net/en/Documentations/Method?name=GetBasketCheckingResult passing  activity identifier to it;
    • show the progress to the customer from ProgressPercent node and call GetBasketCheckingResult method in one second again if there is no error in the response and IsFinished! = true;
    • show text and status (display status by changing line color, Ok - green, Warning - yellow, Error - red) from Messages node for necessary item in the cart 
    • if IsFinished == true hide progress bar and 
      • scroll the screen to the first error and allow customer to correct the error (for example, select different quantity of products and run checking the cart again) if there is at least one Error in Messages;
      • scroll the screen up to the first warning and allow customer to click "place order" button again if there are no errors, but there is at least one Warning. Clicking again should immediately start the process of placing an order without checking the cart again (important: cart checking process should start again if customer changed quantity, configuration or ticked other products);
      • immediately open checkout screen if there are no errors or warnings.

It is important to start cart checking again each time customer changes selected products, as well as re-display error / success messages from the services.

You can place an order "from the cart" calling http://docs.otapi.net/en/Documentations/Method?name=CreateOrder method, passing:

Follow-up Order

Allow customer to make a follow-up order (if customer has such an opportunity) when making an order. Get orders that allow to make a follow-up order, call http://docs.otapi.net/en/Documentations/Method?name=SearchOrdersForUser with parameters xmlSearchParameters= <OrderSearchParametersForUser><ProviderType>IDProvider(for example, Taobao)</ProviderType><IsAvailableForRecreation>true</IsAvailableForRecreation></OrderSearchParametersForUser>. Allow customer to choose if he makes a new order or a follow-up order if there are such orders. Call http://docs.otapi.net/en/Documentations/Method?name=RecreateOrder method for follow-up order.

Quick order

It is possible to make an order from item card by "Quick order" button. Call http://docs.otapi.net/en/Documentations/Method?name=AddOrder method sending:

  • a list of ordered goods (for quick ordering from card from 1688.com, these are several products of different configurations). It is necessary to pass product ID, configuration ID and quantity for each product (no other parameters need to be passed);
  • delivery method
  • customer profle
  • optional: comment for the order.

Order payment and recharging personal account

If the order is not paid, be sure to offer customer to pay it. Call http://docs.otapi.net/en/Documentations/Method?name=GetAccountInfo method if there are funds in customer's personal account, AvailableAmount node (definitely use CurrencySign for display), offer customer a button that will pay for the order from personal account. Write available payment amount on the button, this should be RemainAmount from order information http://docs.otapi.net/en/Documentations/Method?name=GetSalesOrderDetails (provided that personal account has more than RemainAmount) or AvailableAmount (provided that personal account is less than RemainAmount).

Call http://docs.otapi.net/en/Documentations/Method?name=PaymentPersonalAccount method when clicking the button and refresh order page.

Order can be paid through payment systems. Request a list of available payment systems: http://docs.otapi.net/en/Documentations/Method?name=GetPaymentModes . Image of PS - AbsoluteImageUrl, name of PS - Name. Display "Pay" button after clicking payment system and display email input field if CustomField node == "Email", display phone number input field if CustomField node == "Phone".

Call http://docs.otapi.net/en/Documentations/Method?name=GetPaymentParameters after clicking "Pay" button. Pass the following parameters: Amount (RemainAmount from order information), CurrencyCode, PaymentSystemId, OrderId, SuccessUrl and FailUrl return addresses that application can intercept.

Form http-form based on received response, open it in browser and submit it:

  • RequestUrl - url to send the form to;
  • RequestMethod, if it doesn’t come, send a POST form (sometimes you have to send GET, according to parameter);
  • IsNewWindow - you need to open the form in a new window or in the current one, parameter is apparently not relevant for a mobile application - we always open request in a new browser window;
  • IsIFrame - display iframe src={RequestUrl}?{Parameters type param1=value1&param2=value2} in browser instead of form;
  • IsImmmediate - ignore in mobile application at the moment;
  • Parameters - list of payment parameters to be processed depending on property IsUserData7
    • parameter must be inserted into the form to pass to payment system if IsUserData==false;
    • display parameter on the screen if IsUserData==true.

Customer’s personal account will be replenished by Amount if you don't pass OrderId into GetPaymentParameters method.

Browser will return to one of the transmitted addresses after successful or unsuccessful payment, accordingly application should intercept them, close browser and show appropriate screen.