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

Ключ

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

...

Оглавление

...

Autopurchase module — is assistant (automation) to work with orders on Taobao websitehelps to process orders (automatic performance) on trade provider (Taobao, 1688, etc.).

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

  1. Your ordering system (as  OT ОТ API Key ownercustomer).

  2. OT Platform ordering system.

  3. Ordering system of products supplier Trader provider ordering system (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.

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. 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.

Информация
titleWarning!

Autopurchase module requires registration at the goods provider’s website, and doesn’t substitute on trade provider website and does not replace communication with vendors   (approving available products coordination, discussing shipping and discardsquestions, defects, etc.). All It is required to discuss personally all terms and conditions should be prenegotiated with the seller who placed goods in the of cooperation with vendor who added goods to trade provider website (if necessary).

Initial

...

settings

It is required

...

To get started you need to create a user in OT Platform admin panel. Follow these steps:

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

Image Added

Enter your Instance Key  and enter your key:

Image Modified

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

Image Removed

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.

Image Removed

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

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.)

Image Added

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

Go to Configuration > Delivery > External and 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 null) cost. (You can contact OT manager in your project’s Skype chat ). It’s the necessary action  because created for your project if you have questions.) This action is required because orders in OT Platform system are attached to Delivery service (as the configuration bind to delivery. Configuration itself is not very important, therefore we make it free. ortant we set the shipping free).

For further customization you need to save (just write or rememberSave (write down or memorize) delivery ID for further settings.

Types of sessions

Admin/operator session — is needed — required for all operator’s actions including operations , including work with Autopurchase , getting order data module and receiving information about orders to synchronize with ordering system them and change the order status. Avaliable with their statuses. Available by AuthenticateInstanceOperator method by transferring sending 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.

login and password (received from tech support with your Instance Key)

User/Customer session — required to add orders from user’s name. It is username and password of a user from your site. Available by Authenticate method sending user login and password previously created. You can get session ID using AuthenticateInstanceOperator method.

Provider session — required for operations with Autopurchase module. It is bound Provider Session — is needed for work with Autopurchase module. It’s linked with external systems like Taobao and , (in the given this example, ) depends on your Taobao account and authorization in it. See details on getting this session in the description of  Autopurchase login. Read more how to get in description of Autopurchase module.

Add orders into ОТ Platform system

Use AddOrder method is used to add orders into ОТ Platform system. AddOrder always creates one order, but the order can be any number of products

The following things requiredRequired:

  • User/customer Customer session (added created login and password in during 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)

...

  • 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.

...

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.

...

  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).

...

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.

...

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.

...

  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.

Interactive operations

All other operations with Autopurchase module undescribed above except getting can be run for an indefinite time and be interactive (require operator actions), therefore they are implemented in the system of background activity. Each used method gives background activity  ID, all actions take place within it and it can be controlled and managed via general methods.

There are 4 manual actions with Autopurchase module.

1. Order export into provider

RunOrderExportingToProvider method gets:

  • admin session,

  • provider type,

  • provider session,

  • structure where order ID and order lines IDs are specified.

The whole order (exactly all available lines) will be exported if order lines are not listed. But it is possible to export part of order if specific order lines are listed.

Operation process:

First, there is a check for goods availability, configurations, prices accuracy. Each discrepancy will send an issue to operator what to do with such product. Activity is suspended in case of question until gets a response. Read more about it in section about background activity.

Then goes attempt to export. If successful, order (or several) will be visible in provider system (in Taobao) and order lines in OT Platform system will contain information which line belongs to which provider order. Further synchronization will be processed according to this information. Information about error (if it occurs) will be reported in background activity.

Possible errors:

  • Incorrect address settings for autopurchase (data for Taobao: address in China, phone number, etc. It is required to enter correct data).

  • Limit of unpaid orders in provider system (booked orders limit exceeded. each trade provider has limit for booked orders number. It is required to deposit funds on trade provider website and buy part of goods.)

  • Missed inconsistencies upon discrepancy check such as insufficient quantity, etc.

  • Other errors like bad connection with provider, works in provider system or OT Platform system, etc.

In addition, OT Platform system settings can include export check if it was successful. In this case, system will report an error, for example, item was with a discount but it was booked without discount.

2. Manual synchronization

RunOrdersSynchronizingWithProvider method gets:

  • admin session,

  • provider type,

  • provider session.

It is possible to run synchronization manually even if it runs periodically automatically in background.

All exported orders are checked during synchronization, statuses change if they changed on provider side (for example, vendor sent parcel), tracking numbers are set, etc.

Synchronization is one-sided and order will not be cancelled in provider system if it was cancelled in OT Platform system (Taobao allows in only manually on the website). Therefore, it is required to cancel order manually in provider personal account for the order to get cancelled status. Order will have uniform status in all systems after synchronization.

3. Manual binding of orders

RunOrderLinkingWithProvider method gets:

  • admin session,

  • provider type,

  • provider session,

  • structure with order ID and provider orders list.

It is not always possible to book (export) goods automatically. The main reason in Taobao case is special TMall discounts that are unavailable automatically.

It is possible to buy manually and bind orders to use synchronization benefits. Further on they will be synchronized similarly to automatically exported orders.

System itself will try to define matching products in chosen orders and will ask operator what to do with them if it does not find.

4. Unbind order

RunOrderUnlinkingFromProvider method gets:

  • admin session,

  • provider type,

  • provider session,

  • structure with order ID and provider orders list.

All bound lines will be unbound if order lines are not listed.

First, it is important to unbind order lines before retry if export sometimes goes wrong or wrong orders are bound or you don’t want to synchronize them.

Orders processing in OT Platform system

Detailed information about order

It is possible to check orders for necessary information if you saved OT Platform orders ID in your system.

GetSalesOrderDetailsForOperator method gives detailed information about order. It includes admin session, order ID. Filter parameter can be blank and queryType value can be 0.

It is worth paying attention to order lines list in method response (SalesLinesList property). The following things are important in each of them:

  • StatusId/StatusName — item status, it changes according to status of provider order. Compliances can be set according to “Autopurchase module settings” section of this manual.

  • VendPurchId — provider order ID.

  • VendPurchWaybill invoice number , delivery tracking number sent by vendor.

  • VendPurchAccountId — account name that purchased goods.

  • VendPurchStatus — original status of goods in provider order that was not sent to OT Platform.

  • VendPurchItemId / VendPurchConfigurationId / VendPurchPromotionId — goods ID / configurations / discounts in provider order.

Search of order lines by provider order ID

You can get information on order in OTPlatform if you know provider order ID (for example, it is visible in orders list in personal account on Taobao).

Use SearchOrderLines method with xmlSearchParameters parameter like this to get information:

 

Блок кода
languagexml
<OrderLineSearchParameters>
  <VendorPurchaseIdList>
    <Id>provider order ID here</Id>
  </VendorPurchaseIdList>
</OrderLineSearchParameters>

 

Search of order line by tracking number

You can get information on order in OTPlatform if you know delivery tracking number. For Taobao it is invoice number printed on parcel and delivered to your warehouse. It is available there as a bar code that you can pick if you have scanner.

Use SearchOrderLines method with xmlSearchParameters parameter like this to get information:

 

Блок кода
languagexml
<OrderLineSearchParameters>
  <VendorPurchaseWaybillIdList>
    <Id>Tracking number here</Id>
  </VendorPurchaseWaybillIdList>
</OrderLineSearchParameters>