Create Charging Entry
POSThttps://secure.fleetio.com/api/charging_entries
Creates a new Charging Entry
Request
- application/json
Body
The amount, in cents, of any fees applied to the Charging Entry.
Possible values: >= 0
The time a Charging Entry was approved.
2023-03-14T13:46:27-06:00
The ID associated with the User who approved this Charging Entry.
*Full details on working with Custom Fields here.
The amount, in cents, of any discounts applied to the Charging Entry, must be a negative number.
Possible values: <= 0
documents_attributes object[]
The duration, in seconds, between the Charging Entry start and end events. If started_at and ended_at are provided, it will automatically calculate the duration_seconds using those attributes.
Possible values: >= 0
The date and time at which the Charging Entry ended.
2023-03-14T13:46:27-06:00
geolocation objectnullable
images_attributes object[]
meter_entry_attributes object
Indicates whether this Charging Entry was for personal use.
This field is false
if not provided.
The unit price per kilowatt hour for the Charging Entry.
Possible values: >= 0
A reference number or identifier for this Charging Entry. This field is often used to store a receipt number or other unique identifier.
We recommend using ISO-8601 formatted dates to avoid ambiguity.
2023-03-14T13:46:27-06:00
The status of the Charging Entry. This field is "manually_completed" if not provided.
Possible values: [in_progress
, target_reached
, ready_for_review
, manually_completed
, approved
, auto_approved
, unknown
]
manually_completed
The total cost, in cents, of the Charging Entry.
Possible values: >= 0
The total kilowatt hours of the Charging Entry.
Possible values: >= 0
Possible values: >= 1
The Fleetio id
of the Vendor associated with this
Charging Entry.
Possible values: >= 1
Responses
- 201
- 400
- 401
- 403
- 422
- 500
OK
Response Headers
- application/json
- Schema
- Example (auto)
Schema
The amount, in cents, of any fees applied to the Charging Entry.
The time a Charging Entry was approved.
The ID associated with the User who approved this Charging Entry.
The automatically calculated cost per hour since the last Charging Entry.
The automatically calculated cost per kilometer since the last Charging Entry.
The automatically calculated cost per mile since the last Charging Entry.
The amount, in cents, of any discounts applied to the Charging Entry, must be a negative number.
The duration, in seconds, between the Charging Entry start and end events. If started_at and ended_at are provided, it will automatically calculate the duration_seconds using those attributes.
Possible values: >= 0
The date and time at which the Charging Entry ended.
2023-03-14T13:46:27-06:00
geolocation objectnullablerequired
The automatically calculated kilometers per kilowatt hour since the last Charging Entry.
The automatically calculated miles per kilowatt hour since the last Charging Entry.
Indicates whether this Charging Entry was for personal use.
This field is false
if not provided.
false
The unit price per kilowatt hour for the Charging Entry.
Optional data field for collecting information such as the invoice number, transaction id, or receipt number, for example.
The date and time at which this Charging Entry started.
2023-03-14T13:46:27-06:00
The status of the Charging Entry. This field is "manually_completed" if not provided.
Possible values: [in_progress
, target_reached
, ready_for_review
, manually_completed
, approved
, auto_approved
, unknown
]
manually_completed
The total cost, in cents, of the Charging Entry.
The total kilowatt hours of the Charging Entry.
The automatically calculated usage in hours since the most recent Charging Entry.
The automatically calculated usage in kilometers since the most recent Charging Entry.
The automatically calculated usage in miles since the most recent Charging Entry.
The Fleetio id
of the Vehicle associated with this Charging Entry.
Possible values: >= 1
The Fleetio id
of the Vendor associated with this Charging Entry.
Possible values: >= 1
The number of comments on this Charging Entry.
The number of documents added to this Charging Entry.
The number of images added to this Charging Entry.
Comments associated with this Charging Entry.
Documents associated with this Charging Entry.
Images associated with this Charging Entry.
{
"additional_fees_cents": 0,
"approved_at": "2024-07-29T15:51:28.071Z",
"approved_by_id": 0,
"cost_per_hr": "string",
"cost_per_km": "string",
"cost_per_mi": "string",
"discount_cents": 0,
"duration_seconds": 0,
"ended_at": "2023-03-14T13:46:27-06:00",
"geolocation": {
"gps_device": "string",
"original_vendor": "string",
"exception_distance_in_mi": 0,
"exception_distance_in_km": 0
},
"km_per_kwh": "string",
"mi_per_kwh": "string",
"personal": false,
"price_per_kwh_cents": "string",
"reference": "string",
"started_at": "2023-03-14T13:46:27-06:00",
"status": "manually_completed",
"total_amount_cents": 0,
"total_kwh": "string",
"usage_in_hr": "string",
"usage_in_km": "string",
"usage_in_mi": "string",
"vehicle_id": 0,
"vendor_id": 0,
"comments_count": 0,
"documents_count": 0,
"images_count": 0,
"comments": [
{
"id": 0,
"created_at": "2023-03-14T13:46:27-06:00",
"updated_at": "2023-03-14T13:46:27-06:00",
"commentable_type": "Contact",
"commentable_id": 0,
"user_id": 0,
"comment": "string",
"user_full_name": "string",
"user_image_url": "string",
"rich_content": {},
"html_content": "string",
"with_mentions": true
}
],
"documents": [
{
"id": 0,
"created_at": "2023-03-14T13:46:27-06:00",
"updated_at": "2023-03-14T13:46:27-06:00",
"name": "string",
"description": "string",
"documentable_id": 0,
"documentable_type": "ServiceEntry",
"file_name": "string",
"file_mime_type": "string",
"file_size": 0,
"file_url": "string",
"full_file_url": "string"
}
],
"images": [
{
"id": 0,
"created_at": "2023-03-14T13:46:27-06:00",
"updated_at": "2023-03-14T13:46:27-06:00",
"name": "string",
"description": "string",
"imageable_id": 0,
"imageable_type": "ExpenseEntry",
"file_name": "string",
"file_mime_type": "string",
"file_size": 0,
"file_url": "string",
"full_url": "string"
}
]
}
The format or parameters of the request was invalid
- application/json
- Schema
- Example (auto)
Schema
errors object
{
"errors": {}
}
Request could not be authenticated
- application/json
- Schema
- Example (auto)
Schema
Possible values: >= 400
and <= 599
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}
Insufficient permission to perform this operation
- application/json
- Schema
- Example (auto)
Schema
Possible values: >= 400
and <= 599
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}
Unprocessable Entity
- application/json
- Schema
- Example (auto)
- Example
Schema
errors object
{
"errors": {}
}
{
"errors": {
"field1": [
"error1",
"error2"
],
"field2": [
"error3"
]
}
}
Something unexpected happened
- application/json
- Schema
- Example (auto)
Schema
Possible values: >= 400
and <= 599
A short, human-readable summary of the problem type. It SHOULD NOT change from occurrence to occurrence of the problem, except for purposes of localization.
A human-readable explanation specific to this occurrence of the problem.
A URI reference that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"status": 0,
"title": "string",
"detail": "string",
"instance": "string"
}
Authorization: Authorization
name: Authorizationtype: apiKeyin: headerdescription: Prefix the value with "Token", for example: "Token 76cbe06c49a64". You can generate a new API key [here](https://secure.fleetio.com/api_keys).
name: Account-Tokentype: apiKeyin: headerdescription: You can find your Account-Token [here](https://secure.fleetio.com/api_keys)
- curl
- ruby
- python
- csharp
- go
- java
- nodejs
- php
- CURL