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

Ключ

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

...

Admin/operator session — required for all operator’s actions including operations with Autopurchase module and receiving information about orders to synchronize them and change their statuses. Available by AuthenticateInstanceOperator method sending your admin 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 with external systems like Taobao and (in this example) depends on your Taobao account and login. Read more how to get in description of Autopurchase module.

Add orders into ОТ Platform system

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

The following things required:

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

...

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>