Farmers

Farmers are at the heart of the Hello Tractor ecosystem. The Hello Tractor API provides endpoints to manage and retrieve information about farmers who use tractor services. These endpoints allow you to get details about all farmers or a specific farmer using their unique identifier.

The farmer model

A farmer model is comprised of the following.

Properties

  • Name
    farmer_id
    Type
    string
    Description

    Unique identifier for the farmer.

  • Name
    first_name
    Type
    string
    Description

    First name of the farmer.

  • Name
    last_name
    Type
    string
    Description

    Last name of the farmer.

  • Name
    phone_number
    Type
    string
    Description

    Contact phone number of the farmer.

  • Name
    email
    Type
    string
    Description

    Email address of the farmer.

  • Name
    location
    Type
    object
    Description

    Location details of the farmer including country and region.

  • Name
    farms
    Type
    array
    Description

    Array of farm IDs owned by the farmer.

  • Name
    total_bookings
    Type
    number
    Description

    Total number of tractor bookings made by the farmer.

  • Name
    created_at
    Type
    timestamp
    Description

    Timestamp of when the farmer was registered.


GET/v1/farmers

List all farmers

This endpoint allows you to retrieve a paginated list of all farmers. By default, a maximum of 25 farmers are shown per page.

Optional attributes

  • Name
    limit
    Type
    integer
    Description

    Limit the number of farmers returned.

  • Name
    offset
    Type
    integer
    Description

    Offset for pagination.

Request

GET
/v1/farmers
curl -G https://api.hellotractor.com/v1/farmers \
  -H "Authorization: Bearer {token}" \
  -d limit=10

Response

{
  "data": [
    {
      "farmer_id": "farmer_789",
      "first_name": "John",
      "last_name": "Kamau",
      "phone_number": "+254712345678",
      "email": "john.kamau@example.com",
      "location": {
        "country": "Kenya",
        "region": "Nakuru County"
      },
      "farms": ["farm_123456", "farm_234567"],
      "total_bookings": 15,
      "created_at": "2023-06-10T08:00:00Z"
    },
    {
      "farmer_id": "farmer_890",
      // ...
    }
  ],
  "pagination": {
    "total": 500,
    "limit": 25,
    "offset": 0
  }
}
GET/v1/farmers/:farmer_id

Retrieve a farmer

This endpoint allows you to retrieve farmer details using the farmer id. Refer to the list at the top of this page to see which properties are included with farmer objects.

Request

GET
/v1/farmers/farmer_789
curl https://api.hellotractor.com/v1/farmers/farmer_789 \
  -H "Authorization: Bearer {token}"

Response

{
  "farmer_id": "farmer_789",
  "first_name": "John",
  "last_name": "Kamau",
  "phone_number": "+254712345678",
  "email": "john.kamau@example.com",
  "location": {
    "country": "Kenya",
    "region": "Nakuru County"
  },
  "farms": ["farm_123456", "farm_234567"],
  "total_bookings": 15,
  "created_at": "2023-06-10T08:00:00Z"
}

New collaborators request access first; approved teams sign in and register integrations.

Was this page helpful?