Skip to content

Latest commit

 

History

History
448 lines (395 loc) · 13.7 KB

products.md

File metadata and controls

448 lines (395 loc) · 13.7 KB

Products

https://api.ventata.com/products?ApiKey={YourStoreAPIKey}

Dealing with Time

  • All times should be set to UTC, our algorithms depend on the date and times being set to UTC to ensure consistency across evaluations.
  • DateTimes in JSON are expecting a 13 digit epoch time, if your language only does 10 make sure to add '000' to the end to account for milliseconds.

Choosing a Pricing Strategy

The "Strategy" property should be set as one of the following:

  • "Unlimited Supply": Apps, songs, videos, drop-ship arragements or any other good where the current supply has little to no effect on pricing decisions. I.e. you can sell the item as fast as your customers can hit the buy button.

  • "Limited Supply": Tickets to an event or flash sales. Items that either expire or inventory that should be moved quickly should use this strategy. (Required fields: StartingSupply, CurrentSupply, DateAvailable and DateExpires).

  • "Capacity Control": If you are trying to prevent buyers from overloading a system like on a toll road or parking lot, capacity control will spike the price at the threshold chosen. (Required fields: CapacityBaselinePrice and CapacityCurb).

For more info see Pricing Strategies.

Other Odd Fields

  • MinPrice & MaxPrice: (Optional) You can set a minimum and maximum price. Otherwise, just set it to zero to remove the limit.
  • MANUCODE: (Optional) Manufacturer's Code for your product
  • SKU: (Optional)
  • StoreCode: (Optional) Mainly used for ecommerce platforms. It's internal ID in your system, we have a few API's that you can use to reconcile the ecommerce platform and our database.
  • DateCreated: Autogenerated by our system (Cannot be changed from API)
  • LastEvaluation: It's a UTC timestamp we put on the product when we evaluate the price. (Cannot be changed from the API)
  • ExpectedSale: Internally used for next expected sale. (Cannot be changed from API)
  • ExploitUntil: Internally used for determing the next exploit period. (Cannot be changed from API)

Create

Create a product by sending the product in the content of a POST request as json or xml. In this example, we are using json.

Request

POST https://api.ventata.com/product?ApiKey={YourStoreAPIKey}
Content-Type: application/json;

{
    "Cost": 4.5,
    "CurrentSupply": 10,
    "DateAvailable": "/Date(-62135596800000+0000)/",
    "DateCreated": "/Date(1338874208950+0000)/",
    "DateExpires": "/Date(-62135596800000+0000)/",
    "Description": "The most amazing Nirvana t-shirt anyone will ever own",
    "LastEvaluation": "/Date(1338874208950+0000)/",
    "MANUCODE": "TSHIRT120",
    "MaxPrice": 0,
    "MinPrice": 0,
    "Name": "New test product",
    "Price": 10,
    "SKU": "SHIRT-1",
    "StartingSupply": 10,
    "StoreId": "37a3c415-d292-4e76-8ec5-05288e279266",
    "Strategy": "Unlimited Supply"
}

Response

{
    "CapacityBaselinePrice": 0,
    "CapacityCurb": 0,
    "Cost": 4.5,
    "CurrentSupply": 10,
    "DateAvailable": "/Date(-62135596800000+0000)/",
    "DateCreated": "/Date(1343876420697+0000)/",
    "DateExpires": "/Date(-62135596800000+0000)/",
    "Description": "The most amazing Nirvana t-shirt anyone will ever own",
    "ExpectedSale": "/Date(-62135596800000+0000)/",
    "ExploitUntil": "/Date(-62135596800000+0000)/",
    "Id": "6ade437a-8535-3r84-979c-08k58d3d9228",
    "LastEvaluation": "/Date(1343876420697+0000)/",
    "MANUCODE": "TSHIRT120",
    "MaxPrice": 0,
    "MinPrice": 0,
    "Name": "New test product",
    "Price": 10,
    "SKU": "SHIRT-1",
    "StartingSupply": 10,
    "StoreCode": null,
    "StoreId": "141f55de-7776-49e2-996e-7c0cfc6c5f92",
    "Strategy": "Unlimited Supply"
}

Create Many (Array of Products)

To create many products in our system, send an array of products in the content of a POST request as json or xml to the subresource "list". In this example, we are using json.

Do not send more than 50 products in a single call. Break them up into multiple calls.

Request

POST https://api.ventata.com/product/list?ApiKey={YourStoreAPIKey}
Content-Type: application/json;

[
    {
        "Cost": 4.5,
        "CurrentSupply": 10,
        "DateAvailable": "/Date(-62135596800000+0000)/",
        "DateCreated": "/Date(1338874208950+0000)/",
        "DateExpires": "/Date(-62135596800000+0000)/",
        "Description": "The most amazing Nirvana t-shirt anyone will ever own",
        "LastEvaluation": "/Date(1338874208950+0000)/",
        "MANUCODE": "TSHIRT120",
        "MaxPrice": 0,
        "MinPrice": 0,
        "Name": "New test product",
        "Price": 10,
        "SKU": "SHIRT-1",
        "StartingSupply": 10,
        "StoreId": "37a3c415-d292-4e76-8ec5-05288e279266",
        "Strategy": "Unlimited Supply"
    },
    {
        "Cost": 4.5,
        "CurrentSupply": 10,
        "DateAvailable": "/Date(-62135596800000+0000)/",
        "DateCreated": "/Date(1338874208950+0000)/",
        "DateExpires": "/Date(-62135596800000+0000)/",
        "Description": "The second most amazing Nirvana t-shirt anyone will ever own",
        "LastEvaluation": "/Date(1338874208950+0000)/",
        "MANUCODE": "TSHIRT121",
        "MaxPrice": 0,
        "MinPrice": 0,
        "Name": "New test product again",
        "Price": 10,
        "SKU": "SHIRT-2",
        "StartingSupply": 10,
        "StoreId": "37a3c415-d292-4e76-8ec5-05288e279266",
        "Strategy": "Unlimited Supply"
    }
]

Response

[
    {
        "CapacityBaselinePrice": 0,
        "CapacityCurb": 0,
        "Cost": 4.5,
        "CurrentSupply": 10,
        "DateAvailable": "/Date(-62135596800000+0000)/",
        "DateCreated": "/Date(1343876420697+0000)/",
        "DateExpires": "/Date(-62135596800000+0000)/",
        "Description": "The most amazing Nirvana t-shirt anyone will ever own",
        "ExpectedSale": "/Date(-62135596800000+0000)/",
        "ExploitUntil": "/Date(-62135596800000+0000)/",
        "Id": "6ade437a-8535-3r84-979c-08k58d3d9228",
        "LastEvaluation": "/Date(1343876420697+0000)/",
        "MANUCODE": "TSHIRT120",
        "MaxPrice": 0,
        "MinPrice": 0,
        "Name": "New test product",
        "Price": 10,
        "SKU": "SHIRT-1",
        "StartingSupply": 10,
        "StoreCode": null,
        "StoreId": "141f55de-7776-49e2-996e-7c0cfc6c5f92",
        "Strategy": "Unlimited Supply"
    },
    {
        "CapacityBaselinePrice": 0,
        "CapacityCurb": 0,
        "Cost": 4.5,
        "CurrentSupply": 10,
        "DateAvailable": "/Date(-62135596800000+0000)/",
        "DateCreated": "/Date(1343876420697+0000)/",
        "DateExpires": "/Date(-62135596800000+0000)/",
        "Description": "The second most amazing Nirvana t-shirt anyone will ever own",
        "ExpectedSale": "/Date(-62135596800000+0000)/",
        "ExploitUntil": "/Date(-62135596800000+0000)/",
        "Id": "5667a51d-a0a7-433b-8ee0-3fd7cd95e60b",
        "LastEvaluation": "/Date(1343876420697+0000)/",
        "MANUCODE": "TSHIRT121",
        "MaxPrice": 0,
        "MinPrice": 0,
        "Name": "New test product again",
        "Price": 10,
        "SKU": "SHIRT-2",
        "StartingSupply": 10,
        "StoreCode": null,
        "StoreId": "141f55de-7776-49e2-996e-7c0cfc6c5f92",
        "Strategy": "Unlimited Supply"
    }
]

Read

Retrieving a product is as simple as passing the product id to the Product endpoint:

Request

GET https://api.ventata.com/product/6ade437a85353r84979c08k58d3d9228?ApiKey={YourStoreAPIKey}
Accept: application/json;

Response

{
    "CapacityBaselinePrice": 0,
    "CapacityCurb": 0,
    "Cost": 4.5,
    "CurrentSupply": 10,
    "DateAvailable": "/Date(-62135596800000+0000)/",
    "DateCreated": "/Date(1343876420697+0000)/",
    "DateExpires": "/Date(-62135596800000+0000)/",
    "Description": "The most amazing Nirvana t-shirt anyone will ever own",
    "ExpectedSale": "/Date(-62135596800000+0000)/",
    "ExploitUntil": "/Date(-62135596800000+0000)/",
    "Id": "6ade437a-8535-3r84-979c-08k58d3d9228",
    "LastEvaluation": "/Date(1343876420697+0000)/",
    "MANUCODE": "TSHIRT120",
    "MaxPrice": 0,
    "MinPrice": 0,
    "Name": "New test product",
    "Price": 10,
    "SKU": "SHIRT-1",
    "StartingSupply": 10,
    "StoreCode": null,
    "StoreId": "141f55de-7776-49e2-996e-7c0cfc6c5f92",
    "Strategy": "Unlimited Supply"
}

Update

Update a product by sending the product in the content of a PUT request as json or xml. In this example, we are using json.

Request

PUT https://api.ventata.com/product?ApiKey={YourStoreAPIKey}
Content-Type: application/json;

{
    "Cost": 4.5,
    "CurrentSupply": 10,
    "DateAvailable": "/Date(-62135596800000+0000)/",
    "DateCreated": "/Date(1338874208950+0000)/",
    "DateExpires": "/Date(-62135596800000+0000)/",
    "Id": "6ade437a-8535-3r84-979c-08k58d3d9228",
    "Description": "The most amazing Nirvana t-shirt anyone will ever own",
    "LastEvaluation": "/Date(1338874208950+0000)/",
    "MANUCODE": "TSHIRT120",
    "MaxPrice": 0,
    "MinPrice": 0,
    "Name": "New test product",
    "Price": 10,
    "SKU": "SHIRT-1",
    "StartingSupply": 10,
    "StoreId": "37a3c415-d292-4e76-8ec5-05288e279266",
    "Strategy": "Unlimited Supply"
}

Response

{
    "CapacityBaselinePrice": 0,
    "CapacityCurb": 0,
    "Cost": 4.5,
    "CurrentSupply": 10,
    "DateAvailable": "/Date(-62135596800000+0000)/",
    "DateCreated": "/Date(1343876420697+0000)/",
    "DateExpires": "/Date(-62135596800000+0000)/",
    "Description": "The most amazing Nirvana t-shirt anyone will ever own",
    "ExpectedSale": "/Date(-62135596800000+0000)/",
    "ExploitUntil": "/Date(-62135596800000+0000)/",
    "Id": "6ade437a-8535-3r84-979c-08k58d3d9228",
    "LastEvaluation": "/Date(1343876420697+0000)/",
    "MANUCODE": "TSHIRT120",
    "MaxPrice": 0,
    "MinPrice": 0,
    "Name": "New test product",
    "Price": 10,
    "SKU": "SHIRT-1",
    "StartingSupply": 10,
    "StoreCode": null,
    "StoreId": "141f55de-7776-49e2-996e-7c0cfc6c5f92",
    "Strategy": "Unlimited Supply"
}

Update (Partial)

To partially update a product, send the product in the content of a PUT request as json or xml to the "patch" sub-resource. In this example, we are using json.

Request

PUT https://api.ventata.com/product/patch/6ade437a85353r84979c08k58d3d9228?ApiKey={YourStoreAPIKey}
Content-Type: application/json;

{
    "ColumnName": "CurrentSupply",
    "ColumnValue": "9"
}

Response

{
    "CapacityBaselinePrice": 0,
    "CapacityCurb": 0,
    "Cost": 4.5,
    "CurrentSupply": 9,
    "DateAvailable": "/Date(-62135596800000+0000)/",
    "DateCreated": "/Date(1343876420697+0000)/",
    "DateExpires": "/Date(-62135596800000+0000)/",
    "Description": "The most amazing Nirvana t-shirt anyone will ever own",
    "ExpectedSale": "/Date(-62135596800000+0000)/",
    "ExploitUntil": "/Date(-62135596800000+0000)/",
    "Id": "6ade437a-8535-3r84-979c-08k58d3d9228",
    "LastEvaluation": "/Date(1343876420697+0000)/",
    "MANUCODE": "TSHIRT120",
    "MaxPrice": 0,
    "MinPrice": 0,
    "Name": "New test product",
    "Price": 10,
    "SKU": "SHIRT-1",
    "StartingSupply": 10,
    "StoreCode": null,
    "StoreId": "141f55de-7776-49e2-996e-7c0cfc6c5f92",
    "Strategy": "Unlimited Supply"
}

Delete

Delete a product by sending a DELETE request with the product id in the querystring:

Request

DELETE https://api.ventata.com/product/6ade437a85353r84979c08k58d3d9228?ApiKey={YourStoreAPIKey}
Content-Length: 0

Response

Response will be empty.

Get a New Price (the good stuff!)

To get a new price make a GET request out to the sub-resource "price":

Request

GET https://api.ventata.com/product/6ade437a85353r84979c08k58d3d9228/price?ApiKey={YourStoreAPIKey}
Accept: application/json;

Response

{
    "CapacityBaselinePrice": 0,
    "CapacityCurb": 0,
    "Cost": 4.5,
    "CurrentSupply": 9,
    "DateAvailable": "/Date(-62135596800000+0000)/",
    "DateCreated": "/Date(1343876420697+0000)/",
    "DateExpires": "/Date(-62135596800000+0000)/",
    "Description": "The most amazing Nirvana t-shirt anyone will ever own",
    "ExpectedSale": "/Date(-62135596800000+0000)/",
    "ExploitUntil": "/Date(-62135596800000+0000)/",
    "Id": "6ade437a-8535-3r84-979c-08k58d3d9228",
    "LastEvaluation": "/Date(1343876420697+0000)/",
    "MANUCODE": "TSHIRT120",
    "MaxPrice": 0,
    "MinPrice": 0,
    "Name": "New test product",
    "Price": 10.23,
    "SKU": "SHIRT-1",
    "StartingSupply": 10,
    "StoreCode": null,
    "StoreId": "141f55de-7776-49e2-996e-7c0cfc6c5f92",
    "Strategy": "Unlimited Supply"
}

Get Price History

To get a historical prices make a GET request out to the sub-resource "history":

Request

GET https://api.ventata.com/product/6ade437a85353r84979c08k58d3d9228/history?ApiKey={YourStoreAPIKey}
Accept: application/json;

Response

[
    {
        "key": "/Date(1343861896000+0000)/",
        "value": 6
    },
    {
        "key": "/Date(1343861951000+0000)/",
        "value": 4.91
    },
    {
        "key": "/Date(1343862043000+0000)/",
        "value": 4.02
    },
    {
        "key": "/Date(1343862126000+0000)/",
        "value": 3.29
    },
    {
        "key": "/Date(1343862219000+0000)/",
        "value": 3.95
    },
    {
        "key": "/Date(1343862265000+0000)/",
        "value": 4.74
    },
    {
        "key": "/Date(1343862278000+0000)/",
        "value": 4.91
    },
    {
        "key": "/Date(1343862347000+0000)/",
        "value": 4.64
    }
]