Skip to main content
POST
/
reservations
/
{reservation}
Update a reservation
curl --request POST \
  --url https://api.chargeapi.co/v1/reservations/{reservation} \
  --header 'Content-Type: application/json' \
  --data '
{
  "ideal_start": 1711933200
}
'
{
  "id": "<string>",
  "object": "reservation",
  "cancellation_policy": {
    "free_until_before": 123,
    "type": "free_cancellation"
  },
  "charging_station": "<string>",
  "confirmed_at": 123,
  "connector_type": [
    "<string>"
  ],
  "created": 123,
  "currency": "<string>",
  "driver": "<string>",
  "earliest_start": 123,
  "failed_reason": "no_available_connectors",
  "ideal_end": 123,
  "ideal_start": 123,
  "latest_end": 123,
  "location": {
    "latitude": 123,
    "longitude": 123,
    "radius": 123
  },
  "metadata": {},
  "payment_method": "<string>",
  "reservation_fee": 123,
  "reserved_end": 123,
  "reserved_start": 123,
  "status": "pending",
  "updated": 123,
  "vehicle": "<string>"
}

Path Parameters

reservation
string
required

ID of the reservation to update.

Body

application/json
connector_type
enum<string>[]

Updated acceptable connector types.

earliest_start
integer | null

Updated earliest acceptable start time.

ideal_start
integer

Updated preferred start time for charging.

ideal_end
integer

Updated preferred end time for charging.

latest_end
integer | null

Updated latest acceptable end time.

location
object

Updated location and search radius.

metadata
object

Custom key-value pairs to attach to this reservation.

Response

Returns the updated Reservation object reflecting your changes. Raises an error if the reservation is already confirmed, cancelled, or otherwise unmodifiable.

id
string
required

Unique identifier for the reservation.

object
enum<string>
required

String representing the object's type. Always reservation.

Available options:
reservation
created
integer
required

Timestamp when reservation was created.

ideal_end
integer
required

Ideal reservation end time (requested by driver).

ideal_start
integer
required

Ideal reservation start time (requested by driver).

status
enum<string>
required

Current status of the reservation.

  • pending: Created intent, awaiting confirmation.
  • confirmed: Connector reserved successfully.
  • completed: Charging session occurred successfully.
  • cancelled: Cancelled by driver before start.
  • failed: Unable to assign a connector.
  • expired: Reservation window passed without use.
Available options:
pending,
confirmed,
completed,
cancelled,
failed,
expired
updated
integer
required

Timestamp when reservation was last updated.

cancellation_policy
object

Defines conditions for reservation cancellation.

charging_station
string | null

ID of assigned charging station (populated once confirmed).

confirmed_at
integer | null

Timestamp when reservation status changed to confirmed.

connector_type
string[]

Acceptable connector types for charging.

currency
string

ISO currency code for the reservation fee (e.g., usd).

driver
string

ID of the driver associated with the reservation.

earliest_start
integer | null

Earliest acceptable reservation start time.

failed_reason
enum<string> | null

Reason why reservation failed, if applicable.

Available options:
no_available_connectors,
payment_failed,
other
latest_end
integer | null

Latest acceptable reservation end time.

location
object

Geographic area where reservation is requested.

metadata
object

Custom metadata (key-value pairs).

payment_method
string

ID of the payment method used for the reservation fee.

reservation_fee
integer

Reservation fee amount in smallest currency unit (e.g., cents).

reserved_end
integer | null

Finalized end time after confirmation.

reserved_start
integer | null

Finalized start time after confirmation.

vehicle
string

ID of the vehicle associated with the reservation.