Suppliers

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

List all suppliers

  • Endpoint: https://app.tradetrak.com.au/api/supplier/list
  • Request Data:
    • Optional search filter "name" can be passed as a GET parameter to filter suppliers by name
    • Optional limit option "limit" can be passed as a GET parameter which can be used to limit the number of results returned
  • Request Type: GET
  • Returned Data: A JSON array containing information about each supplier, including any contacts.
  [{
      "id": 0,
      "name": "Demo Supplier",
      "address_line_1": null,
      "address_line_2": null,
      "suburb": null,
      "postcode": null,
      "state": null,
      "country": null,
      "primary_contact": {
          "id": 0,
          "first_name": "John",
          "last_name": "Doe",
          "phone_number": null,
          "office_phone_number": null,
          "email": "contact@digitalbasis.com",
          "firm_id": 0,
          "firm": "Demo Supplier"
      },
      "contacts": [{
          "name": "John Doe",
          "phone": null,
          "email": "contact@digitalbasis.com"
      }]
  }]

List single supplier

  • Endpoint: https://app.tradetrak.com.au/api/supplier/<SUPPLIER #>/list

E.G. https://app.tradetrak.com.au/api/supplier/0/list

  • Request Data: None
  • Request Type: GET
  • Returned Data: Same data returned as list all suppliers, however only one single supplier will be returned, or an array containing error information if the supplier wasn't found.

Create supplier

  • Endpoint: https://app.tradetrak.com.au/api/supplier/create
  • Request Data: A JSON object containing the following information. Required fields are prefixed with an asterisk (*)
  {
     *"name": "The suppliers name - string",
     *"contact": Object containing information to create a contact - see Create a Contact for required fields,

     "address_line_1": "string",
     "address_line_2": "string"
     "suburb": "string",
     "state": "Full state name, not abbreviated - string"
     "postcode": "string",
     "country": "Full country name, not abbreviated - string"
     "email": "Contact email address for supplier - string",
     "phone_number": "Contact phone number for supplier, if a landline it must contain the area code - string"
  }
  • Request Type: POST
  • Returned Data: Returns supplier information for created supplier as above, or an array containing error information if the supplier wasn't created successfully.

List supplier contacts

  • Endpoint: https://app.tradetrak.com.au/api/supplier/<SUPPLIER #>/contacts/<OPTIONAL CONTACT ID #>

E.G. https://app.tradetrak.com.au/api/supplier/0/contacts

  • Request Data: None
  • Request Type: GET
  • Returned Data: Returns array of all suppliers contacts, or single contact if contact ID is specified
  [{
      "id": 0,
      "first_name": "John",
      "last_name": "Doe",
      "phone_number": null,
      "office_phone_number": null,
      "email": "contact@digitalbasis.com",
      "firm_id": 0,
      "firm": "Demo Supplier"
  }]

Add supplier contact

  • Endpoint: https://app.tradetrak.com.au/api/supplier/<SUPPLIER #>/add-contact

E.G. https://app.tradetrak.com.au/api/supplier/0/add-contact

  • Request Data: A JSON object containing the following information. Required fields are prefixed with an asterisk (*)
  {
     *"first_name": "The contacts first name - string",
     "last_name": "The contacts last name - string",
     "email": "Contact email address - string",
     "phone_number": "Contact phone number, if a landline it must contain the area code - string"
     "office_phone_number": "Contact office phone number, if a landline it must contain the area code - string"
  }
  • Request Type: POST
  • Returned Data: Returns array of added contact data (see above), or an array containing error information if the contact could not be created.