Charges
This is the main table at the center of the charges domain.
Name | Data Type | Description |
---|---|---|
charge_id | INTEGER | numerical row id (often referred to as PHP charge id) assigned automatically when creating a charge (even before anything happens on the charge point if the charge is started through the API) |
date | TIMESTAMP | Completion timestamp of the charge |
month | DATE | Completion month (last date of the month) of the charge |
external_id | VARCHAR | "global" charge id, assigned by: php (if started through the API) the charge_id is copied into this column ocpp (if started via RFID, terminal, ...) ocpp's generated charge id (generated uuid) gets stored in this column roaming (if monta as EMSP) the roaming charge's id is stored in this column |
charge_point_auth_token_id | INTEGER | Reference to the charge_point_auth_tokens.id that was used to start the charge |
state | ENUM | State of the charge, mostly tracking the state of the charge point via the integration, but also has: virtual states (scheduled, starting, releasing) before the charge point has been contacted completed: this is the state all charges SHOULD end up in, even if they are failed. For failed charges see failed_reason, failed_at some transition states |
user_id | INTEGER | The id of the user that the charge is assigned to. When the user is unknown, we default to the fallback user's id. |
paying_team_id | INTEGER | Reference to teams id denoting the team, whose wallet/payment method is used to pay for the charge |
sponsor_team_id | INTEGER | Reference to teams id denoting the team that is sponsoring the charge |
cp_id | INTEGER | The numerical id of the charge point that the charge is taking place on (charge_points.id) |
vehicle_id | INTEGER | Numerical id that references the vehicles table if the vehicle is known when the charge is initiated |
cost_price_group_id | INTEGER | Reference to team_price_groups denoting the price group used for calculating the electricity costs for the charge |
native_schedule | BOOLEAN | A boolean yes/no whether the charge has started with lower amps (0.001 amp) until the time the user (or smart charge) set the car to charge when it turns to full power. |
starting_at | TIMESTAMP | Timestamp for the charge start signal being sent to the charge point. Used as the time of charge start, until charging_at timestamp is filled in |
cable_plugged_in_at | TIMESTAMP | Timestamp of when it was registered that cable was plugged in - especially relevant for scheduled charges where the creation time can be much earlier than cable plugging in |
charging_at | TIMESTAMP | Timestamp for when the charge point started charging |
completed_at | TIMESTAMP | Timestamp for when the charge processing and post-processing has completed - e.g. final prices calculated. After completed_at is set, no further changes or updates should happen on the charge. |
released_at | TIMESTAMP | Timestamp for when the car was released from the charge point |
failed_at | TIMESTAMP | The datetime when a charge is deemed as failed for whatever reason. Its value is the system's current time when the respective handling is being processed |
failed_reason | VARCHAR | A short text description of why has the charge failed |
stopped_reason | VARCHAR | A short text description of why a charge has been stopped. Note, that stopped does not mean failed. |
estimated_charge_minutes | INTEGER | Calculated duration of the charge based on the amount of KWh to charge and the charge rate of the charge point |
currency_id | INTEGER | A numerical id referencing the Currency that the charge is going to be paid in. Depending on the Pricing type it can be: 1. The currency of the team 2. The currency of the charge point |
source_type | VARCHAR | Type of source that source_id is referencing - e.g. Stripe |
payment_type | VARCHAR | type of payment |
payment_id | INTEGER | unique id of the payment transaction |
estimated_kwh | FLOAT | Calculated amount of KWh that is expected to be charged. Calculated from the related vehicle's battery size and soc or taken from the kwh_limit set on the charge. If there is no vehicle connected to the charge and no kwh_limit set, it falls back to a default of (at the time of writing) 50 |
estimated_price_eur | FLOAT | Price estimated based on the amount of KWh, expected starting time, charge rate of the charge point and pricings configured for the charge. Stylized example: 35 KWh expected to be charged on an 11 KW charge point starting at 11.00 would result in a calculation of 11 KWh charged from 11-12 11 KWh charged from 12-13 11 KWh charged from 13-14 2 KWh charged from 14-15 Each hour's price is calculated based on the spot price, additionals, tariffs etc. that may be configured for the charge, and summed for the total estimate. |
payment_method | VARCHAR | The "business" method by which the payment is done. By "business" method we mean that the payment_method column does not refer to a physical/virtual way of executing a transaction (eg, credit card, apple-pay etc). For that, see payment_method_type Possible values are: • free • team-has-fund • team-has-auto-refill • source • payment |
payment_method_type | VARCHAR | The "physical" way of executing a payment. For example: • card • apple-pay • google-pay • free • adyen • payment-terminal • team-wallet |
is_reservation | BOOLEAN | A yes/no boolean determining whether a charge has a reservation or not. During a reservation the charge point is shown as busy to the public and the user is paying 50% of charging costs while reserved |
start_source | FLOAT | The initiator of the charge, specifying if the charge started by the user swiping in the Android or iOS app, whether it was through the Partner API or an RFID token for OCPP/OCPI/Hubject |
kwh | FLOAT | This column gets regularly updated with the current (and later final) kWh consumed. |
start_meter_kwh | FLOAT | The charge point's meter value when the charge was started. We get the value from OCPP in wh and persist it in kwh |
end_meter_kwh | FLOAT | The charge point's meter value when the charge is completed. We get the value from OCPP in wh and persist it in kwh |
price_eur | FLOAT | This column gets regularly updated with the current (and later final) price billed. |
cost_org | FLOAT | Cost |
original_price_eur | FLOAT | Total price calculated before any adjustments or modifications made by e.g. regulations, bilateral agreements or protections against negative spot prices |
reservation_price_eur | FLOAT | Price of the fee for reserving the charge point in reservation_min minutes |
cost_eur | FLOAT | cost of the charge |
price_group_id | INTEGER | Reference to the price group applied to the charge, whose pricings are copied and used for the charge price calculations |
co2 | FLOAT | Co2 in kgs |
soc_source | VARCHAR | Source of state of charge information (could be 'vehicle', 'charge point' and 'none') |
soc | FLOAT | Current percentage State of Charge for the vehicle's battery. |
soc_start | FLOAT | State of Charge percentage at the start of the charge |
avg_price_kwh_org | FLOAT | Price (in original currency) / kwh or 0 if the kwh is non existent. |
avg_price_kwh_eur | FLOAT | Average price per kwh adjusted to Euro. |
avg_renewable | FLOAT | average renewable energy content |
co2_savings_per_kwh | FLOAT | Savings of co2 in grams per kwh derived from charging when scheduled as compared to an instant charge |
expected_sc_co2_saving | FLOAT | Expected Co2 saving with smart charging |
expected_sc_price_saving | FLOAT | Expected price saving with smart charging |
instant_sc_co2 | FLOAT | Instant smart charge Co2 |
instant_sc_price | FLOAT | Instant smart charge price |
actual_sc_co2_saving | FLOAT | Actual Co2 saving with smart charging |
actual_sc_price_saving | FLOAT | Actual price saving with smart charging |
created_at | TIMESTAMP | Time of creation for the charge - i.e. when it was initiated. This does include scheduled charging, where there is not yet a car at a charge point, ready to charge |
vehicle_model | VARCHAR | Reference to the model of the vehicle on which charge was performed |
vehicle_brand | VARCHAR | Reference to the brand of the vehicle on which charge was performed |
firmware | VARCHAR | firmware the charge point was at when the charge was started. The charge point may have been updated since, if you need the charge point's current firmware, check elsewhere. |
application_id | INTEGER | References the mobile application that the charge was started from. Ways to figure out the application: -Straight from the API request's headers -Through the authenticated user, if known -Through the operator, if known |
charge_rating | FLOAT | Rating provided for the charge by the user |
comment | VARCHAR | Comment on the charge |
application_name | VARCHAR | The name of the mobile application that the charge was started from. |
is_roaming_charge | BOOLEAN | Boolean for whether a charge is roaming or not |
roaming_provider | VARCHAR | The roaming provider of the operator |
monta_roaming_role | VARCHAR | Whether monta acts as EMP (roaming off) or CPO (roaming on) |
is_failed_charge | BOOLEAN | Boolean for whether the charge failed |
is_deleted_charge | BOOLEAN | Boolean for whether the charge is deleted |
is_operator_charge | BOOLEAN | The charge session belongs to one of the operator's charge points or teams. |
is_application_user_charge | BOOLEAN | The charge session originated from the operator's own application. Note that the application_id need to be currently linked to the operator. |
Updated about 8 hours ago