Note: This endpoint is only available in the staging environment and requires special permissions granted by administrators.

Endpoint

POST https://api.staging.fleetit.com/api/tickets/individual/

Description

This endpoint enables the submission of a dummy toll ticket for a specified vehicle and transaction with authentication. It either creates a new toll ticket or returns error messages if there are issues with the request or specific business rules are triggered. Tolls are not sent immediately; instead, they are queued and processed for integration in the background.


Request Body Parameters

ParameterTypeDescription
transaction_datestringDate of the toll transaction in YYYY-MM-DD format.
exit_timestringTime of exit in HH:MM:SS format.
exit_plazastringIdentifier for the exit plaza e.g "HT".
agencystringAgency code associated with the toll (e.g., "PANYNJ").
amountfloatToll amount charged.
plate_numberstringLicense plate number of the vehicle of your fleet
plate_statestringState code of the vehicle registration (e.g., "NY").

Sample Request Payload

{
    "transaction_date": "2024-08-15",
    "exit_time": "01:55:00",
    "exit_plaza": "HT",
    "agency": "PANYNJ",
    "amount": 100.0,
    "plate_number": "NEILTEST104",
    "plate_state": "NY"
}

Responses

201 Created

Description: The toll ticket was successfully created.

Sample Response:

{
    "exit_plaza": "HT",
    "agency": "PANYNJ",
    "amount": 100.0,
    "plate_number": "NEILTEST104",
    "plate_state": "NY",
    "vehicle": 7848
}

400 Created

Case 1

Description: The submitted ticket is a duplicate of an existing one.

Sample Response:

{
    "queue_reason": [
        "Duplicate of existing ticket: 11746"
    ]
}

Case 2

Description: The ticket submission matches specific business rules and cannot proceed.

Sample Response:

{
    "queue_reason": [
        "Ticket matches business rule(s): All February Tolls"
    ]
}

403 Created

Description: You do not have permission to perform this action. Contact Support.

Sample Response:

{
    "detail": "You do not have permission to perform this action."
}

Error Codes

Status CodeDescription
201Toll ticket created successfully.
400Bad request due to duplicate ticket or business rule violation.
403Forbidden: User lacks necessary permissions.

Additional Information

  • Environment: This endpoint is exclusive to the staging environment.
  • Permissions: Access requires special permissions that can be obtained from an administrator.

Usage Notes

  • Ensure that all date and time fields are formatted correctly.
  • The amount should be a positive number representing the toll charge.
  • Make sure you have the necessary permissions before attempting to use this endpoint.