Interface ZendriveInsurance

Applications which want to record Fairmatic insurance periods for a driver may use this API.

  • All drives (automatically detected or manually started) when a period is in progress will be tagged with the period id.
  • This period id will be made available in the reports and API that Fairmatic provides via Zendrive.
  • Only one period may be active at a time. To switch the Fairmatic insurance period, the application can call the relevant startPeriod method directly.
  • Switching periods or calling stopPeriod stops any active drives (automatic or manual).
  • A drive with multiple insurance periods will be split into multiple trips for different insurance periods.
interface ZendriveInsurance {
    startDriveWithPeriod1(): Promise<ZendriveOperationResult>;
    startDriveWithPeriod2(trackingId): Promise<ZendriveOperationResult>;
    startDriveWithPeriod3(trackingId): Promise<ZendriveOperationResult>;
    stopPeriod(): Promise<ZendriveOperationResult>;
}

Methods

  • Start a drive in Fairmatic insurance period 1. A manual trip with trackingId com.zendrive.sdk.internal will be started immediately. The entire duration in this period will be recorded as a single trip. If period 1 is already in progress with the same trackingId, this call will be a no-op.

    Returns Promise<ZendriveOperationResult>

  • Start Fairmatic insurance period 2 in the SDK. A manual trip with the given trackingId will be started immediately. The entire duration in this period will be recorded as a single trip. If period 2 is already in progress with the same trackingId, this call will be a no-op.

    Parameters

    • trackingId: String

      an identifier which allows identifying this drive uniquely. This identifier must be unique for this user. It may not be null or a empty string. It will be truncated to 64 characters if it is longer than 64 characters. Passing invalid trackingId is an error.

    Returns Promise<ZendriveOperationResult>

  • Start Fairmatic insurance period 3 in the SDK. A manual trip with the given trackingId will be started immediately. The entire duration in this period will be recorded as a single trip. If period 3 is already in progress with the same trackingId, this call will be a no-op.

    Parameters

    • trackingId: String

      an identifier which allows identifying this drive uniquely. This identifier must be unique for this user. It may not be null or a empty string. It will be truncated to 64 characters if it is longer than 64 characters. Passing invalid trackingId is an error.

    Returns Promise<ZendriveOperationResult>