QuickStart

Create Tradeable Items

Create private Tradeable Items to represent the goods, products or commodities relevant to your business or use case.

Back to Getting Started with the API

Tradeable Items

Tradeable Items represent goods, products or assets that are exchanged in a Market. Each Market is between two Tradeable Items. For example, in a Market for buying and selling Apples in America, one Tradeable Item would be Apples and one would be USD Dollars.

Users can create their own Private Tradeable Items to represent what they want to create Markets for. There are also Public Tradeable Items available for common currencies and cryptocurrencies.

Link to Tradeable Items documentation

Create a Tradeable Item

The call to create a new Tradeable Item requires a Name and Description for the item, and a Tick Size. The Name is intended as the short descriptor, and the Description is intended to hold more extended information. The Tick Size is the minimum division of the Tradeable.

The Tradeable Item can have an optional Expiry date. This can be used for Tradeable Items such as tickets that cease to be tradeable after an event has occurred. Markets between Tradeable Items with expiry dates and times cannot be used after the expiry of either of the Tradeable Items in that Market.

Some Tradeable Items may require restrictions on either the minimum quantity accepted on an Order, or a maximum quantity allowed. A Max and Min value can optionally be provided to constrain the transactional quantity allowed on an individual Order when this item is traded.

  • name (mandatory): Short text description.
  • description (mandatory): Long text description.
  • ticksize (mandatory): Decimal value indicating minimum unit size.
  • expiry (optional): UTC Datetime after which the item becomes invalid.
  • max (optional): Maximum quantity allowed on a single order.
  • min (optional): Minimum quantity required on a single order.
Windows CMD
              
curl -X POST "https://prod.haggledigital.com/v01/tradeables/create" ^
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" ^
  -H "Content-Type: application/json" ^
  -d "{\"name\": \"My Tradeable Item\", \"description\": \"A Description of this Tradeable Item\", \"ticksize\": \"0.01\", \"expiry\": \"2040-12-31T23:59:59\", \"max\": \"100\", \"min\": \"1\"}"
              
            
UNIX/MacOS
              
curl -X POST "https://prod.haggledigital.com/v01/tradeables/create" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "My Tradeable Item",
  "description": "A Description of this Tradeable Item",
  "ticksize": "0.01",
  "expiry": "2040-12-31T23:59:59",
  "max": "100",
  "min": "1"
}'
              
            

Response

The response will be an HTTP 200 OK message on success, or an error indicating a problem with the supplied data.

In the case of a successful response, a copy of the created object is returned, which will include a "pk" field. The value in the "pk" field is the unique identifier key that will be required whenever using or editing the Tradeable Item.

Response
              
{
  "pk": "00000000-0000-0000-0000-000000000001",
  "name": "My Tradeable Item",
  "description": "A Description of this Tradeable Item",
  "ticksize": "0.01",
  "max": "100",
  "min": "1",
  "expiry": "2040-12-31T23:59:59",
  "private": 1
}
              
            

Using the Tradeable Item

The returned JSON data packet has the pk ("primary key") element, where the value is the unique system identifier or key for the created Tradeable Item.

When making calls to create a Market with this Tradeable Item, or edit the Tradeable Item, this pk key has to be included in the request to identify it. The key should be included exactly as it appears in the pk field, including the hyphens.

A Market allows the exchange of two distinct Tradeable Items. In many cases, the first Tradeable Item is a product of some kind, and the second is a Currency. A selection of common Currency Tradeable Items have been set up with Public privilege access, for all to use.


Viewing Private Tradeable Items

The collection of Private Tradeable Items that a User has access to can be retrieved by calling the /v01/tradeables/private endpoint.

Windows CMD
              
curl -X GET "https://prod.haggledigital.com/v01/tradeables/private" ^
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
              
            
UNIX/MacOS
              
curl -X GET "https://prod.haggledigital.com/v01/tradeables/private" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" 
              
            

Response

The response will be an HTTP 200 OK message on success, or an error indicating a problem with the optional parameters. On success, a list of Tradeable Item objects is returned.

If a large number of Tradeable Items exist, the data can be requested in paginated form. Query parameters can be added to the request to set the values for rowsPerPage and pageNo. The caller should call iteratively with an incrementing pageNo value until an HTTP 204 No Content message is returned, indicating a successful call with no more data to return.

Viewing Public Tradeable Items

Public Tradeable Items are available for all users as a convenience. These include common currencies and cryptocurrencies, and can be retrieved by calling the /v01/tradeables/public endpoint.

Windows CMD
              
curl -X GET "https://prod.haggledigital.com/v01/tradeables/public" ^
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
              
            
UNIX/MacOS
              
curl -X GET "https://prod.haggledigital.com/v01/tradeables/public" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" 
              
            

Response

The response will be an HTTP 200 OK message on success, or an error indicating a problem with the optional parameters. On success, a list of Tradeable Item objects is returned.

If a large number of Tradeable Items exist, the data can be requested in paginated form. Query parameters can be added to the request to set the values for rowsPerPage and pageNo. The caller should call iteratively with an incrementing pageNo value until an HTTP 204 No Content message is returned, indicating a successful call with no more data to return.


Create Markets

With two Tradeable Items, a Market can be created. When the Market is open it can receive and match Orders.

Continue to Create Markets.