API/Tracking

Fetching Job State

Get the current delivery state of a given job to build your own custom tracking page.

Endpoint

Returns all relevant completion state information of a given job.

GET Endpoint
https://app.logisapp.ca/api/apikeys/track

Authentification

This endpoint requires authentification via a custom API key header.

Required Header
LOGIS-API-KEY: YOUR_SECRET_API_KEY

The API key used must have the "Allow Public Track" permission enabled in the Logis settings.

Request Parameters

This endpoint accepts one query parameter in the URL: job_id

Example URL

GET /api/apikeys/track?job_id=job_uuid4_id

Success Response

The endpoint returns a 200 OK status code, and a LOT of data.

Response Body
{
  "job_track": {
    "job": {
      "id": "85b0ed57-06c7-4123-b046-b897022d28f6",
      "address_detail": {
        "id": "38f46ed1-1ade-4cea-9c05-c28c4b977cf8",
        "building_number": 101, 
        "street_name": "Main Street",
        "apt_number": "Apt 10",
        "city": "Anytown",
        "postal_code": "A1A 1A1",
        "notes": null,
        "latitude": 45.52138,
        "longitude": -73.67074,
        "added_by": "45c5e01a-6daa-4535-aaf7-077d0c474966"
      },
      "name": "Shipment #XYZ",
      "notes": null,
      "item_count": null,
      "deadline": "2025-12-15T14:46:00Z",
      "original_deadline": "2025-12-15T14:46:00Z", 
      "started_at": null,
      "completed_at": null,
      "created_at": "2025-11-10T18:51:46.932508Z",
      "status": "PLANNED",
      "order": 3,
      "rating_delivery": null,
      "rating_job": null,
      "rating_comment": null,
      "do_notify_sms": true,
      "code_secure_deliveries": false,
      "delivery_code_retrieved": false,
      "delivery_proof": null,
      "assignee": null,
      "client": "4a982d9a-8b37-4339-98de-fc3499870d35",
      "route": "2bab3e6a-d455-4423-b73c-c1beb616540d"
    },
    "client": {
      "id": "4a982d9a-8b37-4339-98de-fc3499870d35",
      "address_detail": {
        "id": "38f46ed1-1ade-4cea-9c05-c28c4b977cf8",
        "building_number": 101,
        "street_name": "Main Street",
        "apt_number": "Apt 10",
        "city": "Anytown",
        "postal_code": "A1A 1A1",
        "notes": null,
        "latitude": 45.52138,
        "longitude": -73.67074,
        "added_by": "45c5e01a-6daa-4535-aaf7-077d0c474966"
      },
      "first_name": "Test",
      "last_name": "Client",
      "phone_number": "+1 555-555-1234",
      "email": null,
      "created_at": "2025-11-01T19:31:36.138462Z", 
      "is_active": true,
      "notes": "",
      "do_notify_sms": true,
      "code_secure_deliveries": false,
      "added_by": "c06d4310-601d-45c9-ac4b-b37ccf7f13e9"
    },
    "store": {
      "id": "c06d4310-601d-45c9-ac4b-b37ccf7f13e9",
      "email": "store_owner@example.com",
      "account_type": "STORE_OWNER",
      "subscription_plan": "FREE",
      "parent_user": "45c5e01a-6daa-4535-aaf7-077d0c474966",
      "company_detail": {
        "id": "861b5029-8182-4556-be67-1f808f037041",
        "address_detail": {
          "id": "f8c39d69-3c8f-40e9-a2c1-674d0ce95d1b",
          "building_number": 500,
          "street_name": "Business Avenue",
          "apt_number": null,
          "city": "Metroville",
          "postal_code": "B2B 2B2",
          "notes": null,
          "latitude": 45.60240,
          "longitude": -73.72886,
          "added_by": null
        },
        "name": "My Local Store",
        "email": "contact@mystore.com", 
        "phone_number": "+1 888-555-0000", 
        "logo": "/media/logos/default_logo.png", 
        "background": "/media/backgrounds/default_bg.jpg", 
        "primary_color": "#4A90E2",
        "on_primary_color": "#FFFFFF",
        "secondary_color": "#F5A623",
        "on_secondary_color": "#000000",
        "tertinary_color": "#7ED321",
        "on_tertinary_color": "#FFFFFF",
        "surface_color_primary": "#F8F8F8",
        "on_primary_surface": "#333333",
        "surface_color_secondary": "#EEEEEE",
        "on_secondary_surface": "#444444",
        "google_page": "",
        "website": "https://www.example.com", 
        "do_notify_clients_sms": true,
        "code_secure_deliveries": true,
        "allow_client_self_update": false
      },
      "first_name": "Store", 
      "last_name": "Owner", 
      "date_joined": "2025-11-01T19:25:45.062517Z", 
      "phone_number": "+1 555-555-5678",
      "is_staff": false,
      "is_superuser": false,
      "address_detail": {
        "id": "6c1213ce-0d0f-42cd-9b8b-9fea92dea8f2",
        "building_number": 99,
        "street_name": "Second Street",
        "apt_number": null,
        "city": "Othertown",
        "postal_code": "C3C 3C3",
        "notes": null,
        "latitude": 45.54009,
        "longitude": -73.60451,
        "added_by": null
      },
      "hourly_salary": null,
      "availability": null,
      "global_daily_api_limit": 100000,
      "global_api_usage_today": 65
    },
    "provider": {
      "id": "45c5e01a-6daa-4535-aaf7-077d0c474966",
      "email": "provider@logis.com",
      "account_type": "PROVIDER",
      "subscription_plan": "BASIC",
      "parent_user": null,
      "company_detail": null,
      "first_name": "Platform", 
      "last_name": "Admin", 
      "date_joined": "2025-11-01T19:23:17.321966Z", 
      "phone_number": "+1 555-555-0001", 
      "is_staff": false,
      "is_superuser": false,
      "address_detail": {
        "id": "d292a2c6-da23-405e-9980-e1747474c52d",
        "building_number": 1,
        "street_name": "Provider Way",
        "apt_number": null,
        "city": "Serviceville",
        "postal_code": "D4D 4D4",
        "notes": null,
        "latitude": 45.57692,
        "longitude": -73.79776,
        "added_by": "45c5e01a-6daa-4535-aaf7-077d0c474966"
      },
      "hourly_salary": null,
      "availability": null,
      "global_daily_api_limit": 100000,
      "global_api_usage_today": 0
    },
 
    /// --- Driver & Route Details (Included ONLY if job has been assigned to a route) ---
 
    "driver": {
      "id": "f980aed9-1528-4f8c-be48-777ceccc4914",
      "email": "driver_123@logis.com", 
      "account_type": "DRIVER",
      "subscription_plan": "FREE",
      "parent_user": "45c5e01a-6daa-4535-aaf7-077d0c474966",
      "company_detail": null,
      "first_name": "Driver", 
      "last_name": "One", 
      "date_joined": "2025-11-01T19:27:35.332731Z",
      "phone_number": "+1 555-555-1111",
      "is_staff": false,
      "is_superuser": false,
      "address_detail": {
        "id": "b8a7b961-62bc-4895-9951-5cbbb3f96bb1",
        "building_number": 100,
        "street_name": "Driver's Road",
        "apt_number": "Unit 5",
        "city": "Anytown",
        "postal_code": "E5E 5E5",
        "notes": null,
        "latitude": 45.50395,
        "longitude": -73.56233,
        "added_by": "45c5e01a-6daa-4535-aaf7-077d0c474966"
      },
      "hourly_salary": null,
      "availability": null,
      "global_daily_api_limit": 100000,
      "global_api_usage_today": 0
    },
    "route_status": "IN_PROGRESS",
    "route_date": "2025-12-16T14:38:00Z",
    "jobs_before_you": 1,
    "distance_previous_job": "1441 m",
    "time_previous_job": "13 min",
    "driver_time_away": null,
    "review_key": "653de526-6082-4360-859b-537b01d88fa6"
  }
}

Key Response Fields Explained

  • job: Contains all details about the specific job being tracked.
  • client: Information about the end customer receiving the service/delivery.
  • store: Information about the Store Owner user (and their company) who manages this client.
  • provider: Information about the Logistics Provider.
  • driver: (Only present if job is routed) Information about the driver assigned to the route.
  • route_status: (Only present if job is routed) The current status of the entire route.
  • route_date: (Only present if job is routed) The scheduled start time of the route.
  • jobs_before_you: (Only present if job is routed) How many stops the driver needs to complete before arriving at this job. Useful for ETA estimations.
  • distance_previous_job / time_previous_job: (Only present if job is routed and not the first stop) Estimated travel distance/time from the previous stop on the route to this job's location.
  • driver_time_away: (Only present if job status is STARTED) Estimated travel time for the driver from their current location to this job's address. This provides a real-time ETA (but needs to be refetched).

Error Responses

Status CodeError Code / ReasonDescription
400 Bad RequestMissing job_idThe job_id query parameter was not provided.
401 UnauthorizedMissing LOGIS-API-KEY headerThe required API key header was not included.
403 ForbiddenInvalid/Inactive LOGIS-API-KEYThe provided API key is not valid or is inactive.
403 ForbiddenPermission Denied (allow_public_track)The API key used does not have permission for public tracking.
404 Not FoundJob Not FoundNo job exists with the provided job_id.
429 Too Many RequestsRate Limit Exceeded (Key or Global)Either the specific API key's hourly limit or the user's global daily limit was exceeded.

Code Examples

Future<Map<String, dynamic>?> getJobTrack(String jobId, String apiKey) async {
  final String url = 'https://app.logisapp.ca/api/apikeys/track?job_id=$jobId';
  final Map<String, String> headers = {
    'LOGIS-API-KEY': apiKey,
  };
 
  try {
    final response = await http.get(
      Uri.parse(url),
      headers: headers,
    );
 
    final decodedBody = json.decode(response.body);
 
    if (response.statusCode == 200 && decodedBody != null && decodedBody['job_track'] is Map) {
      debugPrint('Job track data fetched successfully.');
      return decodedBody['job_track']; // Return the job_track data map
    } else if (response.statusCode == 404) {
       debugPrint('Job track not found for ID: $jobId');
       return null;
    }
    else {
      final errorMessage = decodedBody['error'] ?? 'Request failed with status: ${response.statusCode}';
      debugPrint('LogisService API error (getJobTrack): $errorMessage');
      throw Exception(errorMessage);
    }
  } catch (error) {
    debugPrint('LogisService Network/Request error (getJobTrack): $error');
    throw Exception('Failed to fetch job track: $error');
  }
}

On this page