> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fleetit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Submit Test Toll

> **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

| Parameter          | Type     | Description                                                                                             |
| ------------------ | -------- | ------------------------------------------------------------------------------------------------------- |
| `transaction_date` | `string` | Date of the toll transaction in `YYYY-MM-DD` format.                                                    |
| `exit_time`        | `string` | Time of exit in `HH:MM:SS` format.                                                                      |
| `exit_plaza`       | `string` | Identifier for the exit plaza e.g `"HT"`.                                                               |
| `agency`           | `string` | Agency code associated with the toll (e.g., `"PANYNJ"`).                                                |
| `amount`           | `float`  | Toll amount charged.                                                                                    |
| `plate_number`     | `string` | License plate number of the vehicle of your fleet. Vehicle must be added prior to submitting test toll. |
| `plate_state`      | `string` | State code of the vehicle registration (e.g., `"NY"`).                                                  |

### Sample Request Payload

```json theme={null}
{
    "transaction_date": "2024-08-15",
    "exit_time": "01:55:00",
    "exit_plaza": "HT",
    "agency": "PANYNJ",
    "amount": 100.0,
    "plate_number": "ABC123",
    "plate_state": "NY"
}
```

## Responses

### 201 Created

**Description:** The toll ticket was successfully created.

**Sample Response:**

```json theme={null}
{
    "exit_plaza": "HT",
    "agency": "PANYNJ",
    "amount": 100.0,
    "plate_number": "ABC123",
    "plate_state": "NY",
    "vehicle": 7848
}
```

### 400 Created

#### Case 1

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

**Sample Response:**

```json theme={null}
{
    "queue_reason": [
        "Duplicate of existing ticket: 11746"
    ]
}

```

#### Case 2

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

**Sample Response:**

```json theme={null}
{
    "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:**

```json theme={null}
{
    "detail": "You do not have permission to perform this action."
}
```

## Error Codes

| Status Code | Description                                                     |
| ----------- | --------------------------------------------------------------- |
| **201**     | Toll ticket created successfully.                               |
| **400**     | Bad request due to duplicate ticket or business rule violation. |
| **403**     | Forbidden: 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.
