Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

« Предыдущий Версия 3 Следующий »



Autopurchase module — is assistant (automation) to work with orders on Taobao website.

There are three types of ordering systems that are involved in the process:

  1. Your ordering system (as  OT API Key owner).

  2. OT Platform ordering system.

  3. Ordering system of products supplier (Taobao).

Autopurchase module works with  systems listed above as 2 and 3 (from OT Platform to Supplier system):

  • It exports orders.

  • Synchronizes goods and order statuses, tracks parcels codes etc.

Since Autopurchase module only works with orders in OT Platform system, it is necessary to download orders from your system in OT Platform using API . The further work with Autopurchase module is possible when the orders will be loaded in OT Platform.

Warning!

Autopurchase module requires registration at the goods provider’s website, and doesn’t substitute communication with vendors (approving available products , discussing shipping and discards, etc.).All terms and conditions should be prenegotiated with the seller who placed goods in the trade provider website.

Initial configuration

To get started you need to create a user in OT Platform admin. Follow http://open-demo.otcommerce.com/ik.php  and enter your key:

Now enter username and password, which were provided with the key:

Go to "Users> Customers" section and create a random user (using "Customers" article instructions). If you have any questions, you are welcome to contact OT manager in your project’s Skype chat.

Please save (just write or remember) login and password for the created user — you will need it for further customization.

Move to "Configuration> Shipping> International" section  and add external delivery with free (zero) value, using instructions in "External Delivery (Configuration)" article (If you have any questions, you are welcome to contact OT manager in your project’s Skype chat). It’s the necessary action  because orders in OT Platform system are attached to Delivery service (as the configuration itself is not very important we set the shipping free).

For further customization you need to save (just write or remember) delivery ID.

Types of sessions

Admin / operator session — is needed for all operations, including work with Autopurchase, getting order data to synchronize with ordering system and change the order status. Avaliable with AuthenticateInstanceOperator method by transferring your admin's username / password, provided with the OT API Key (just enter them in the field at method’s page).

User / customer session — is needed for placing orders under user’s account. Avaliable with Authenticate method, by transferring your username / password of the user you’ve created earlier.

Provider Session — is needed for work with Autopurchase module. It’s linked with external systems like Taobao and, in the given example, depends on your Taobao account and authorization in it. See details on getting this session in the description of  Autopurchase module.

Add orders into ОТ Platform system

AddOrder method is used to add orders into ОТ Platform system

Required:

  • User/customer session (added login and password in initial settings)

  • Order description in xml format

Order in xml format

General information about order:

  • DeliveryModeId — delivery identifier (added earlier)

  • Comment — comments to order (optional)

  • UserProfileId — customer profile identifier (available by GetUserProfileInfoList method by customer session)

Orders lines list (products descriptions):

  • Id — product identifier

  • ConfigurationId — product configuration identifier (goods options), value 0 should be send if product doesn’t have options.

  • Quantity — product quantity

  • Weight — product weight, unimportant in this case, optional value

  • Comment — comment to product (optional value)

  • PromotionId — product discount identifier, optional value for order without discount

It’s recommended to save orders IDs for synchronization with your system or send your identification information as comments.

AddOrder method result

All parameters will be pre-tested. Goods will be deleted from order if it can’t be ordered.

In response AddOrder method will give information about ready order or an error message. It is necessary to verify list of products in ready order and the one that was sent into the method.

One can proceed with orders operations if all of them were sucessfully ordered and you are satisfied with their components: control, synchronization and autopurchase.

One can cancel the order by CancelSalesOrder method sending customer session and order ID if gaps are unacceptable and attempt to re-add order with other parameters.

Possible reasons of errors

It’s possible to check possible errors list for the order and solve the problem despite the fact that a clear failure reason can’t be sent.

  1. Product is no longer available (ended in warehouse, etc.). Remove item from goods list or select the same at another seller.

  2. No such configuration on website (or ended). Choose another configuration (color, size, etc.) or select the same at another seller.

  3. No such seller on website. Select the same product at another seller.

  4. Mistake in any document field. Check the data you entered is correct.

AddOrder method result: order from your system was sent to ОТ Platform system (that is it was sent from block 1 to clock 2).

Order payment simulation

Attention!

Admin session is required.

It’s impossible to send unpaid order into Autopurchase because system is configured for active website with payment systems. It’s necessary to set order payment simulation under the scheme described below until we develop a different solution on this issue.

All actions are divided into 2 parts:

  1. Deposit funds to customer account.

  2. Order payment from customer account.

Real money transfer is not required!

Deposit funds to customer account

It’s possible to deposit funds with PostTransaction method. Required:

  • Admin session.

  • Customer (account) ID.

  • Sum.

  • Value true is sent to isDebit (because we deposit).

  • Comment and date are optional.

Customer ID and sum can be found in order information received in answer to AddOrder (or get separately by GetSalesOrderDetailsForOperator method — admin session also, order ID, empty string can be sent to filter parameter, value in queryType is 0. Method will be useful further on.)

Order payment from customer account

Method SalesPaymentReserve will be used for payment from customer account.

Required:

  • Admin session.

  • Order ID.

  • Sum.

Order is paid and it’s possible to export it to trade provider system if both operations were successful.

Method GetSalesOrderDetailsForOperator is used to check order status. It will be also used to get information from provider such as track numbers, status, etc.

Autopurchase

Initial Settings

If you have account at Taobao.com, you can add Taobao as trade provider.

Warning!

Autopurchase does not work for Tmall products.

About 1.5 years ago part  ofTmall discounts have been blocked inTaobao api and are not provided any more.

The exclusive method of getting Tmall discounts, developed by OpenTrade Commerce, which is used in OT System, does not allow to get  these discounts by Autopurchase module, as the automatize purchase system works with discounts provided via Taobao api only.

You need the following data for connection:

List of Taobao usernames , which will be used to purchase (you can use unlimited number of logins). Attention! Phone number is not used as login. Login is a nickname of customer account:

Parcels recipient info (warehouse information) in Chinese:

  • Name of recipient (If not specified, transliterated name of the buyer will be set) — Note! The name has to be 2 to 14 characters.

  • Recipient mobile number (11 characters).

  • Region code (you can find it by selecting the inner delivery region in admin).

  • Postal code (zip-code).

  • Warehouse address in Chinese except the region. For example, if the region was selected as Beijing, you don’t have to write the city name in the address field. Or if you’ve selected any district of Beijing above, you don’t have to write its name.


Example

Name: 王鑫磊奇跡

Mobile number: 11147043234

Region code : 150784

Postal code: 021400

Address: 尚都国际小区东区9号楼23号车库

If you have any questions, you are welcome to contact OT manager in your project’s Skype chat.

Getting provider session

If you use many accounts in the provider system (such as Taobao), then each account will have its own session. All the sessions after receipt are stored in OT Platform system and used not only for export, but also, for example, for automatic background synchronization.

Recomendation

As the estimated lifetime of Taobao session is 24 hours, we reccomend you to pass through all the accounts and get sessions for them every day before starting to work with them.

If the session has already been received, it is possible to educe it by GetProviderOrdersIntegrationSessionInfoList method. Unfortunately, the geting process requires operator manual actions and can not be fully automated.

To get the session, you need:

  1. URL with processor on your site,  where Taobao will return operator after login.

  2. Call up GetProviderOrdersIntegrationSessionAuthenticationInfo method, by passing your return address (paragraph 1). As a reply you’ll get the address that you have to open for operator.

  3. Open the received address for operator in browser.

  4. Operator have to enter Taobao account and confirm that he allows working with it in OT Platform System.

  5. After that your browser will get back to the return address (paragraph 1), and parameters will show completed session or error text.

The session can be saved or reopened again by requesting the list by GetProviderOrdersIntegrationSessionInfoList method.


  • Нет меток