> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.fleetwire.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.fleetwire.io/_mcp/server.

# Add a charge (tolls, violations, fees)

POST https://api.fleetwire.io/api/v2/bookings/{b_id}/charges
Content-Type: application/json

**Scope:** `charges:write`

For a toll or violation service the host connected with an API token: add one toll, violation or fee to a booking. It's billed on the booking's invoices and the host collects it from the renter. If the booking's invoice is already paid, it goes on a new invoice for that booking rather than reopening the paid one. (Services working with many hosts should use the Fleetwire Partner API instead: one key, no per-host tokens.)

- `provider` (string, required) — your service's short id, e.g. `myeztoll` (lowercase letters, digits, `-`, `_`)
- `external_id` (string, required) — your id for the charge. **Idempotent:** sending the same `external_id` with the same amount and kind returns the original with `200` and never bills twice. Different details under the same id return `409`.
- `kind` (required) — `toll`, `violation` or `fee`
- `amount_cents` (integer, required) — the road cost or fine
- `provider_fee_cents` (integer) — your fee, billed as its own line next to the charge
- `occurred_at` (ISO 8601, required except for `fee`) — when the toll was passed or the violation issued
- `description` (string) — shown to the renter on the invoice line, e.g. `E-ZPass NY — 3 tolls, Oct 10`
- `listing_id`, `plate`, `plate_state` — cross-checked against the booking's vehicle
- `authority`, `location`, `citation_number`, `violation_type` (`parking`, `red_light`, `speed`, `other`), `due_at`
- `document` (PDF file, multipart), `document_pdf` (base64) or `document_url` (public https link) — an itemized receipt, up to 5 MB
- `currency` (default `USD`)

**Refused (422)** when the charge isn't for that booking: a different `listing_id` or `plate`, or an `occurred_at` outside the trip. **404** for a booking that isn't yours. **409** when the booking has no order to bill, or the `external_id` conflicts.

`status` is `unbilled`, `billed` (on an unpaid invoice), `paid` or `voided`.

Reference: https://docs.fleetwire.io/api-reference/bookings/post-bookings-b-id-charges

## Authentication

- `Authorization` header (bearer token, required) — An API token from **Settings → API tokens** in Fleetwire, sent as `Authorization: Bearer …`. Each token carries scopes: `read` for every GET, plus write scopes such as `bookings:write`.

## Servers

- `https://api.fleetwire.io/api` (Production, default)
- `https://staging.fleetwire.io/api` (Sandbox (Partner API))

## Request

### Path parameters

- `b_id` (string, required) — Booking ID

### Body (application/json)

This endpoint expects an object.

- `provider` (string, required) — Your service's short id, e.g. `myeztoll`.
- `external_id` (string, required) — Your id for the charge. The idempotency key.
- `kind` (enum, required)
  - Allowed values: `toll`, `violation`, `fee`
- `amount_cents` (integer, required) — The road cost or fine.
- `provider_fee_cents` (integer, optional, default: 0) — Your fee, billed as its own line.
- `currency` (string, optional, default: USD)
- `occurred_at` (datetime, optional) — Required unless `kind` is `fee`.
- `listing_id` (string, optional) — Cross-checked against the booking's vehicle.
- `plate` (string, optional) — Cross-checked against the booking's vehicle.
- `plate_state` (string, optional)
- `authority` (string, optional)
- `location` (string, optional)
- `description` (string, optional) — Shown on the renter's invoice line.
- `citation_number` (string, optional)
- `violation_type` (enum, optional)
  - Allowed values: `parking`, `red_light`, `speed`, `other`
- `due_at` (date, optional)
- `document_pdf` (string, optional) — Itemized receipt PDF, base64. Up to 5 MB.
- `document_url` (string, optional) — A public https link to the receipt PDF.

## Response

### 200

OK

- `charge_id` (string, optional)
- `external_id` (string, optional)
- `provider` (string, optional)
- `kind` (string, optional)
- `status` (string, optional)
- `amount_cents` (integer, optional)
- `provider_fee_cents` (integer, optional)
- `currency` (string, optional)
- `occurred_at` (string, optional)
- `description` (string, optional)
- `has_document` (boolean, optional)
- `created_at` (string, optional)
- `voided_at` (string, optional, nullable)

### 201

Created

- `charge_id` (string, optional)
- `external_id` (string, optional)
- `provider` (string, optional)
- `kind` (string, optional)
- `status` (string, optional)
- `amount_cents` (integer, optional)
- `provider_fee_cents` (integer, optional)
- `currency` (string, optional)
- `occurred_at` (string, optional)
- `description` (string, optional)
- `has_document` (boolean, optional)
- `created_at` (string, optional)
- `voided_at` (string, optional, nullable)

## Errors

### 401 Unauthorized Error

Missing or invalid token.

- `message` (string, required)

### 403 Forbidden Error

The token doesn't carry the scope this needs, or the plan doesn't include API access.

- `message` (string, required)

### 404 Not Found Error

Not found, or it isn't your company's.

- `message` (string, required)

### 422 Unprocessable Entity Error

The request is invalid.

- `message` (string, required)
- `errors` (map from string to list of string, required) — Each invalid field with its problems.

### 429 Too Many Requests Error

Too many requests. Wait for the `Retry-After` header (seconds).

- `message` (string, required)

## Examples

### Already received (retry)

**Response**

```json
{
  "charge_id": "9b1c2f0e-4d5a-4e7b-8a3c-2f1e0d9c8b7a",
  "external_id": "mez_toll_8812",
  "provider": "myeztoll",
  "kind": "toll",
  "status": "billed",
  "amount_cents": 675,
  "provider_fee_cents": 1000,
  "currency": "USD",
  "occurred_at": "2026-10-10T18:12:00Z",
  "description": "E-ZPass NY — 3 tolls, Oct 10",
  "has_document": true,
  "created_at": "2026-10-14T13:05:00Z",
  "voided_at": null
}
```

**SDK Code**

```python Already received (retry)
import requests

url = "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Already received (retry)
const url = 'https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Already received (retry)
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Already received (retry)
require 'uri'
require 'net/http'

url = URI("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Already received (retry)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Already received (retry)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Already received (retry)
using RestSharp;

var client = new RestClient("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Already received (retry)
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Created

**Response**

```json
{
  "charge_id": "9b1c2f0e-4d5a-4e7b-8a3c-2f1e0d9c8b7a",
  "external_id": "mez_toll_8812",
  "provider": "myeztoll",
  "kind": "toll",
  "status": "billed",
  "amount_cents": 675,
  "provider_fee_cents": 1000,
  "currency": "USD",
  "occurred_at": "2026-10-10T18:12:00Z",
  "description": "E-ZPass NY — 3 tolls, Oct 10",
  "has_document": true,
  "created_at": "2026-10-14T13:05:00Z",
  "voided_at": null
}
```

**SDK Code**

```python Created
import requests

url = "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript Created
const url = 'https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Created
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Created
require 'uri'
require 'net/http'

url = URI("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Created
using RestSharp;

var client = new RestClient("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Created
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Bookings_postBookingsBIdCharges_example

**Request**

```json
{
  "provider": "myeztoll",
  "external_id": "mez_toll_8812",
  "kind": "toll",
  "amount_cents": 675,
  "provider_fee_cents": 1000,
  "occurred_at": "2026-10-10T18:12:00Z",
  "listing_id": "l_EXAMPLE1",
  "plate": "K72LMX",
  "plate_state": "NJ",
  "authority": "E-ZPass NY",
  "description": "E-ZPass NY — 3 tolls, Oct 10"
}
```

**Response**

```json
{
  "charge_id": "9b1c2f0e-4d5a-4e7b-8a3c-2f1e0d9c8b7a",
  "external_id": "mez_toll_8812",
  "provider": "myeztoll",
  "kind": "toll",
  "status": "billed",
  "amount_cents": 675,
  "provider_fee_cents": 1000,
  "currency": "USD",
  "occurred_at": "2026-10-10T18:12:00Z",
  "description": "E-ZPass NY — 3 tolls, Oct 10",
  "has_document": true,
  "created_at": "2026-10-14T13:05:00Z",
  "voided_at": null
}
```

**SDK Code**

```python Bookings_postBookingsBIdCharges_example
import requests

url = "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges"

payload = {
    "provider": "myeztoll",
    "external_id": "mez_toll_8812",
    "kind": "toll",
    "amount_cents": 675,
    "provider_fee_cents": 1000,
    "occurred_at": "2026-10-10T18:12:00Z",
    "listing_id": "l_EXAMPLE1",
    "plate": "K72LMX",
    "plate_state": "NJ",
    "authority": "E-ZPass NY",
    "description": "E-ZPass NY — 3 tolls, Oct 10"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Bookings_postBookingsBIdCharges_example
const url = 'https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"provider":"myeztoll","external_id":"mez_toll_8812","kind":"toll","amount_cents":675,"provider_fee_cents":1000,"occurred_at":"2026-10-10T18:12:00Z","listing_id":"l_EXAMPLE1","plate":"K72LMX","plate_state":"NJ","authority":"E-ZPass NY","description":"E-ZPass NY — 3 tolls, Oct 10"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Bookings_postBookingsBIdCharges_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges"

	payload := strings.NewReader("{\n  \"provider\": \"myeztoll\",\n  \"external_id\": \"mez_toll_8812\",\n  \"kind\": \"toll\",\n  \"amount_cents\": 675,\n  \"provider_fee_cents\": 1000,\n  \"occurred_at\": \"2026-10-10T18:12:00Z\",\n  \"listing_id\": \"l_EXAMPLE1\",\n  \"plate\": \"K72LMX\",\n  \"plate_state\": \"NJ\",\n  \"authority\": \"E-ZPass NY\",\n  \"description\": \"E-ZPass NY — 3 tolls, Oct 10\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Bookings_postBookingsBIdCharges_example
require 'uri'
require 'net/http'

url = URI("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"provider\": \"myeztoll\",\n  \"external_id\": \"mez_toll_8812\",\n  \"kind\": \"toll\",\n  \"amount_cents\": 675,\n  \"provider_fee_cents\": 1000,\n  \"occurred_at\": \"2026-10-10T18:12:00Z\",\n  \"listing_id\": \"l_EXAMPLE1\",\n  \"plate\": \"K72LMX\",\n  \"plate_state\": \"NJ\",\n  \"authority\": \"E-ZPass NY\",\n  \"description\": \"E-ZPass NY — 3 tolls, Oct 10\"\n}"

response = http.request(request)
puts response.read_body
```

```java Bookings_postBookingsBIdCharges_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"provider\": \"myeztoll\",\n  \"external_id\": \"mez_toll_8812\",\n  \"kind\": \"toll\",\n  \"amount_cents\": 675,\n  \"provider_fee_cents\": 1000,\n  \"occurred_at\": \"2026-10-10T18:12:00Z\",\n  \"listing_id\": \"l_EXAMPLE1\",\n  \"plate\": \"K72LMX\",\n  \"plate_state\": \"NJ\",\n  \"authority\": \"E-ZPass NY\",\n  \"description\": \"E-ZPass NY — 3 tolls, Oct 10\"\n}")
  .asString();
```

```php Bookings_postBookingsBIdCharges_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges', [
  'body' => '{
  "provider": "myeztoll",
  "external_id": "mez_toll_8812",
  "kind": "toll",
  "amount_cents": 675,
  "provider_fee_cents": 1000,
  "occurred_at": "2026-10-10T18:12:00Z",
  "listing_id": "l_EXAMPLE1",
  "plate": "K72LMX",
  "plate_state": "NJ",
  "authority": "E-ZPass NY",
  "description": "E-ZPass NY — 3 tolls, Oct 10"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Bookings_postBookingsBIdCharges_example
using RestSharp;

var client = new RestClient("https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"provider\": \"myeztoll\",\n  \"external_id\": \"mez_toll_8812\",\n  \"kind\": \"toll\",\n  \"amount_cents\": 675,\n  \"provider_fee_cents\": 1000,\n  \"occurred_at\": \"2026-10-10T18:12:00Z\",\n  \"listing_id\": \"l_EXAMPLE1\",\n  \"plate\": \"K72LMX\",\n  \"plate_state\": \"NJ\",\n  \"authority\": \"E-ZPass NY\",\n  \"description\": \"E-ZPass NY — 3 tolls, Oct 10\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Bookings_postBookingsBIdCharges_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "provider": "myeztoll",
  "external_id": "mez_toll_8812",
  "kind": "toll",
  "amount_cents": 675,
  "provider_fee_cents": 1000,
  "occurred_at": "2026-10-10T18:12:00Z",
  "listing_id": "l_EXAMPLE1",
  "plate": "K72LMX",
  "plate_state": "NJ",
  "authority": "E-ZPass NY",
  "description": "E-ZPass NY — 3 tolls, Oct 10"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.fleetwire.io/api/v2/bookings/b_EXAMPLE1/charges")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```