Products

The products API main endpoint is https://app.tradetrak.com.au/api/product/ and the following functions are currently available.

Create product

  • Endpoint: https://app.tradetrak.com.au/api/product/create
  • Request Data: A JSON object containing the following information. Required fields are prefixed with an asterisk (*)

    {
       *"supplier_id": the id of the supplier this product is for - integer,
       *"sku": "A unique product code - string",
       *"name": "Product name - string",
       "description": "Notes about the product - string",
       *"cost_price": amount you pay the supplier for the product - float,  
       *"rrp": amount you charge the customer for the product - float - at least one of `rrp` or `cost_price` must be passed to the call,    
    }
    
  • Request Type: POST

  • Returned Data: Returns information for created product, or an array containing error information if the product wasn't created successfully. See List products for data returned.

Update product

  • Endpoint: https://app.tradetrak.com.au/api/product/update
  • Request Data: A JSON object containing the following information. Required fields are prefixed with an asterisk (*). If an item with the passed SKU already exists it will be updated.

    {
       *"supplier_id": the id of the supplier this product is for - integer,
       *"sku": "A unique product code - string",
       *"name": "Product name - string",
       "description": "Notes about the product - string",
       *"cost_price": amount you pay the supplier for the product - float,            
       *"rrp": amount you charge the customer for the product - float - at least one of `rrp` or `cost_price` must be passed to the call,            
    }
    
  • Request Type: POST

  • Returned Data: Returns information for updated product, or an array containing error information if the product wasn't created successfully. See List products for data returned.

List products

  • Endpoint: https://app.tradetrak.com.au/api/product/list
  • Request Data: A JSON object containing the following information. Required fields are prefixed with an asterisk (*)

    {
       "supplier_id": supplier id to filter with - integer,
       "sku": "Unique SKU of product to filter - string",
       "product_id": id of the product to filter - integer,
    }
    
  • Request Type: GET

  • Returned Data: Returns quote information for all products.

    [{
       "id": "1",
       "sku": "TESTSKU",
       "name": "Test Product",
       "description": "A description for this product",
       "specification": [
            "Details": {
                "A long value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec suscipit sollicitudin ante at ultrices. Aliquam a augue felis. Pellentesque interdum, ligula sit amet mollis vehicula, nisi est fermentum justo, ut ullamcorper elit diam ac nisi. Donec vitae finibus ante. "
            },
            "Another heading": {
                "Some": "Data",
                "More": "Data"
            },
        ],
       "cost_price": 100.00, 
       "rrp": 125.00 
       "supplier": "Demo Supplier",      
    }]