Maintenance of price and availability of a calendar-based item can be divided into the following three categories:
The first way to update the price of a canlendar-based item is: full overwrite of a package at the item level, that is to overwrite the original package calendar information of the item with new package calendar information uploaded by a user, i.e., the whole original package calendar will be deleted.
The service is provided via the TOP.API: taobao.alitrip.travel.item.sku.override
Example usage scenario of the service: Assuming that item I originally had packages A and B, and packages A and C have been uploaded when updating price and availability of the packages using the service, then original packages A and B of item I will be deleted, and new packages A and C will be used as the item package calendar.
The second way to update the price of a calendar-based item is: create, delete, and overwrite operations at the package level, that is to create, delete, or overwrite of one or more packages, and other packages of the item remain unchanged. (Specially note that each package must have an id (merchant code of the package, i.e. Outer_sku_id). The program will locate the package according to this id, and performs delete and overwrite operations on the package)
The service is provided via the TOP.API: taobao.alitrip.travel.item.sku.package.modify
Example usage scenario of the service: When a user wishes to update individual package information of an item leaving other packages under the item unchanged, the user may use this service. Specific use example is shown in the table below.
No. | Scenario | Demo |
---|---|---|
1 | Create a package | “skus”: [{ “outer_sku_id”: “123456”, “package_name”: “套餐名称”, “package_operation”: 1, “prices”: [{ “date”: “2016-03-19 00:00:00”, “outer_price_id”: “23333”, “price”: 1223, “price_type”: 1, “stock”: 12 }], “products”: [{ “element_id”: “12345”, “num”: 2 }, { “element_id”: “2333”, “num”: 1 }] }] |
2 | Delete a package, set outer_sku_id as an identifier | “skus”: [{ “outer_sku_id”: “123456”, “package_operation”: 2 }] |
3 | Overwrite a package, set outer_sku_id as an identifier | “skus”: [{ “outer_sku_id”: “123456”, “package_name”: “套餐名称”, “package_operation”: 3, “prices”: [{ “date”: “2016-03-19 00:00:00”, “outer_price_id”: “23333”, “price”: 1223, “price_type”: 1, “stock”: 12 }], “products”: [{ “element_id”: “12345”, “num”: 2 }, { “element_id”: “2333”, “num”: 1 }] }] |
The third way to update the price of a calendar-based item is: quantity update of price and availability at the date level, i.e. original calendar price and availability of a package will remain, and the price or availability for certain dates within certain packages can be selectively updated.
The service is provided via the TOP.API: taobao.alitrip.travel.item.sku.price.modify
Example usage scenario of the service: When a user wishes to update price or availability information for individual dates within individual packages of an item and other calendar price and availability remain unchanged, the user may use this service. Specific use example is shown in the table below. An example is shown below: Assuming that an item has a package A (the package A must have an id (merchant code of the package, i.e. outer_sku_id), the program will locate the package according to this id, and update calendar price and availability within the package), and a user wishes to update the price and availability for a certain date within the package.
The meaning of the operation field within the structure of “prices” in the service interface is as follows, the default is 1.
No. | Scenario | Demo |
---|---|---|
1 | Add price and availability for a certain day | “prices”: [{ date:2015-09-15, operation:1, stock:20, price:10000, priceType:1 }] |
2 | Quantity update: quantity modification only while leaving the original unchanged (only quantity modification of availability is supported) | “prices”: [{ date:2015-09-15, operation:2, stock:10, priceType:1 }, { date:2015-09-15, operation:2, stock:-5, priceType:2 }] |
3 | Overwrite to replace the original | “prices”: [{ date:2015-09-15, operation:3, stock:3, price:15000, priceType:1 }, { date:2015-09-15, operation:3, stock:2, price:10000, priceType:2 }] |
4 | Delete | “prices”: [{ date:2015-09-15, operation:4, priceType:1 }] |