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

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

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



Autopurchase module helps to process orders (automatic performance) on trade provider (Taobao, 1688, etc.).

There are 3 types of ordering systems involved in the process:

  1. Your ordering system (ОТ API customer).

  2. OT Platform ordering system.

  3. Trader provider ordering system (Taobao).

The whole process can be outlined in the following scheme (using processes numeration mentioned above):

  • 1 → 2 — Add orders into OT Platform system

  • 2 3 — Autopurchase operation (orders export; statuses synchronization (goods and order), delivery tracking codes, etc.

  • 2 → 1 — Operation with orders after Autopurchase processing

It is required to add orders from your system to OT Platform ordering system via API since Autopurchase module works only with orders in OT Platform ordering system. Further Autopurchase process is available when orders are added.

Warning!

Autopurchase module requires registration on trade provider website and does not replace communication with vendors (available products coordination, shipping questions, defects, etc.). It is required to discuss personally all terms and conditions of cooperation with vendor who added goods to trade provider website (if necessary).

Initial settings

It is required to create user in OT Platform admin panel. Follow these steps:

Click the link: http://open-demo.otcommerce.com/ik.php

Enter your Instance Key:

Enter login and password to admin panel that you received from tech support with your Instance Key:

 

Go to Users > Customers and create any user. (You can contact OT manager in Skype chat created for your project if you have questions.)

Save login and password of created user (write down or memorize) for further settings.

Go to Configuration > Delivery > External and add external delivery with free (null) cost. (You can contact OT manager in Skype chat created for your project if you have questions.) This action is required because orders in OT Platform are bind to delivery. Configuration itself is not important, therefore we make it free. ortant we set the shipping free).

Save (write down or memorize) delivery ID for further settings.

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.


  • Нет меток