Skip to main content

Create Charging Entry

POST 

https://secure.fleetio.com/api/charging_entries

Creates a new Charging Entry

Request

Body

    additional_fees_centsinteger

    The amount, in cents, of any fees applied to the Charging Entry.

    Possible values: >= 0

    approved_atdate-time

    The time a Charging Entry was approved.

    Example: 2023-03-14T13:46:27-06:00
    approved_by_idinteger

    The ID associated with the User who approved this Charging Entry.

    custom_fieldsobjectnullable

    *Full details on working with Custom Fields here.

    discount_centsinteger

    The amount, in cents, of any discounts applied to the Charging Entry, must be a negative number.

    Possible values: <= 0

    documents_attributes object[]

    An array of one or more document objects to add to the record. Follow our Attaching Documents and Images guide to upload to our third party storage provider in order to obtain file_url.

  • Array [
  • namestring

    The name to give the file which will be shown in the UI.

    Possible values: <= 255 characters

    file_urlstring

    The URL obtained from our storage provider that points to the file.

    Possible values: <= 255 characters

    file_mime_typestring

    The MIME type of the file. For example, application/pdf.

    Possible values: <= 255 characters

    file_namestring

    The name of the file.

    Possible values: <= 255 characters

    file_sizeinteger

    The size of the file in bytes.

  • ]
  • duration_secondsinteger

    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

    ended_atdate-time

    The date and time at which the Charging Entry ended.

    Example: 2023-03-14T13:46:27-06:00
    geolocation objectnullable
    gps_devicestringnullable
    original_vendorstringnullable
    exception_distance_in_minumbernullable
    exception_distance_in_kmnumbernullable
    images_attributes object[]

    An array of one or more image objects to add to the record. Follow our Attaching Documents and Images guide to upload to our third party storage provider in order to obtain file_url.

  • Array [
  • namestring

    The name to give the image which will be shown in the UI.

    Possible values: <= 255 characters

    file_urlstring

    The URL obtained from our storage provider that points to the image.

    Possible values: <= 255 characters

    file_mime_typestring

    The MIME type of the image. For example, image/png.

    Possible values: <= 255 characters

    file_namestring

    The name of the image.

    Possible values: <= 255 characters

    file_sizeinteger

    The size of the image file in bytes.

  • ]
  • meter_entry_attributes object

    Each Charging Entry can have an associated Meter Entry

    valuefloat

    The value is the actual number on the meter that increments over time. The unit is determined by the configured meter_unit on the associated Vehicle.

    Example: 108043
    voidboolean

    If you attempt to save a meter value, which is too high or too low, Fleetio's validation rules will reject it. If you need to bypass this validation, you may mark an entry as void.

    personalboolean

    Indicates whether this Charging Entry was for personal use. This field is false if not provided.

    price_per_kwh_centsfloat

    The unit price per kilowatt hour for the Charging Entry.

    Possible values: >= 0

    referencestring

    A reference number or identifier for this Charging Entry. This field is often used to store a receipt number or other unique identifier.

    started_atdate-timerequired

    We recommend using ISO-8601 formatted dates to avoid ambiguity.

    Example: 2023-03-14T13:46:27-06:00
    statusstring

    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]

    Default value: manually_completed
    total_amount_centsinteger

    The total cost, in cents, of the Charging Entry.

    Possible values: >= 0

    total_kwhfloat

    The total kilowatt hours of the Charging Entry.

    Possible values: >= 0

    vehicle_idId (integer)required

    Possible values: >= 1

    vendor_idinteger

    The Fleetio id of the Vendor associated with this Charging Entry.

    Possible values: >= 1

Responses

OK

Response Headers
    Schema
      additional_fees_centsintegernullablerequired

      The amount, in cents, of any fees applied to the Charging Entry.

      approved_atdate-timenullablerequired

      The time a Charging Entry was approved.

      approved_by_idintegernullablerequired

      The ID associated with the User who approved this Charging Entry.

      cost_per_hrstringnullablerequired

      The automatically calculated cost per hour since the last Charging Entry.

      cost_per_kmstringnullablerequired

      The automatically calculated cost per kilometer since the last Charging Entry.

      cost_per_mistringnullablerequired

      The automatically calculated cost per mile since the last Charging Entry.

      discount_centsintegernullablerequired

      The amount, in cents, of any discounts applied to the Charging Entry, must be a negative number.

      duration_secondsintegerrequired

      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

      ended_atdate-timenullablerequired

      The date and time at which the Charging Entry ended.

      Example: 2023-03-14T13:46:27-06:00
      geolocation objectnullablerequired
      gps_devicestringnullable
      original_vendorstringnullable
      exception_distance_in_minumbernullable
      exception_distance_in_kmnumbernullable
      km_per_kwhstringrequired

      The automatically calculated kilometers per kilowatt hour since the last Charging Entry.

      mi_per_kwhstringrequired

      The automatically calculated miles per kilowatt hour since the last Charging Entry.

      personalbooleanrequired

      Indicates whether this Charging Entry was for personal use. This field is false if not provided.

      Default value: false
      price_per_kwh_centsstringnullablerequired

      The unit price per kilowatt hour for the Charging Entry.

      referencestringnullablerequired

      Optional data field for collecting information such as the invoice number, transaction id, or receipt number, for example.

      started_atdate-timerequired

      The date and time at which this Charging Entry started.

      Example: 2023-03-14T13:46:27-06:00
      statusstringrequired

      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]

      Default value: manually_completed
      total_amount_centsintegernullablerequired

      The total cost, in cents, of the Charging Entry.

      total_kwhstringrequired

      The total kilowatt hours of the Charging Entry.

      usage_in_hrstringnullablerequired

      The automatically calculated usage in hours since the most recent Charging Entry.

      usage_in_kmstringnullablerequired

      The automatically calculated usage in kilometers since the most recent Charging Entry.

      usage_in_mistringnullablerequired

      The automatically calculated usage in miles since the most recent Charging Entry.

      vehicle_idintegerrequired

      The Fleetio id of the Vehicle associated with this Charging Entry.

      Possible values: >= 1

      vendor_idintegernullablerequired

      The Fleetio id of the Vendor associated with this Charging Entry.

      Possible values: >= 1

      comments_countintegerrequired

      The number of comments on this Charging Entry.

      documents_countintegerrequired

      The number of documents added to this Charging Entry.

      images_countintegerrequired

      The number of images added to this Charging Entry.

      commentsobject[]

      Comments associated with this Charging Entry.

      documentsobject[]

      Documents associated with this Charging Entry.

      imagesobject[]

      Images associated with this Charging Entry.

    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)

    Request Collapse all
    Base URL
    https://secure.fleetio.com/api
    Auth
    Body
    {
      "additional_fees_cents": 0,
      "approved_at": "2023-03-14T13:46:27-06:00",
      "approved_by_id": 0,
      "custom_fields": {},
      "discount_cents": 0,
      "documents_attributes": [
        {
          "name": "string",
          "file_url": "string",
          "file_mime_type": "string",
          "file_name": "string",
          "file_size": 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
      },
      "images_attributes": [
        {
          "name": "string",
          "file_url": "string",
          "file_mime_type": "string",
          "file_name": "string",
          "file_size": 0
        }
      ],
      "meter_entry_attributes": {
        "value": "108043",
        "void": true
      },
      "personal": true,
      "price_per_kwh_cents": 0,
      "reference": "string",
      "started_at": "2023-03-14T13:46:27-06:00",
      "status": "manually_completed",
      "total_amount_cents": 0,
      "total_kwh": 0,
      "vehicle_id": 0,
      "vendor_id": 0
    }
    
    ResponseClear

    Click the Send API Request button above and see the response here!