Clients

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

List all clients

  • Endpoint: https://app.tradetrak.com.au/api/client/list
  • Request Data: None
  • Request Type: GET
  • Returned Data: A JSON array containing information about each client, including any contacts.

    [{
        "id": 0,
        "name": "Demo Client",
        "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 Client"
        },
        "contacts": [{
            "name": "John Doe",
            "phone": null,
            "email": "contact@digitalbasis.com"
        }]
    }]
    

List single client

  • Endpoint: https://app.tradetrak.com.au/api/client/<CLIENT #>/list > E.G. https://app.tradetrak.com.au/api/client/0/list
  • Request Data: None
  • Request Type: GET
  • Returned Data: Same data returned as list all clients, however only one single client will be returned, or an array containing error information if the client wasn't found.

Create client

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

    {
       *"name": "The clients 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 client - string",
       "phone_number": "Contact phone number for client, if a landline it must contain the area code - string"
    }
    
  • Request Type: POST

  • Returned Data: Returns client information for created client as above, or an array containing error information if the client wasn't created successfully.

List client contacts

  • Endpoint: https://app.tradetrak.com.au/api/client/<CLIENT #>/contacts/<OPTIONAL CONTACT ID #> > E.G. https://app.tradetrak.com.au/api/client/0/contacts
  • Request Data: None
  • Request Type: GET
  • Returned Data: Returns array of all clients contacts, or single client 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 Client"
    }]
    

Add client contact

  • Endpoint: https://app.tradetrak.com.au/api/client/<CLIENT #>/add-contact > E.G. https://app.tradetrak.com.au/api/client/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"
       "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.