Skip to main content

GET /invoices

A GET to the /invoices endpoint allows your application to fetch an array of the invoices your use is authorized to view. Requests made to this endpoint require an authorization header using your authentication token:

Auth Header
curl --request GET \
--url https://api.hopdrive.com/v1/invoices \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your token>'

Filters

You can filter the events based using the following optional query parameters.

limit - The number of results per page.

page - Which page to start with.

rooftop - A valid rooftop id that your token has access to.

from - An IS8601 timestamp to search from. This will search based on the invoices start_datetime.

Example Request

GET /v1/invoices?page=0&limit=2&rooftop=57&from=2022-08-22T00%3A18%3A00-04%3A00

Example Response

200 /v1/invoices?page=0&limit=2&rooftop=57&from=2022-08-22T00%3A18%3A00-04%3A00
{
"invoices": [
{
"id": 12904,
"status": "closed",
"due_amount": 45.01,
"paid_amount": 35.01,
"discount_amount": 10,
"balance_remaining": 0,
"payments": [
{
"amount" : 45.01,
"date" : "2023-04-25T23:59:59+00:00",
"status": "paid",
"method": {
"id": 12,
"type": "ach/card",
"last4": 1234
},
"charges": [
{
"id": 123,
"amount": 123
}
]
}
],
"start_datetime": "2023-04-09T00:00:00+00:00",
"end_datetime": "2023-04-15T23:59:59+00:00",
"customer": {
"id": 108,
"name": "Dealer name"
},
"charges": [
{
"id": 123,
"move_id": 85788, // optional, only if charge type is move
"type": "move",
"status": "paid",
"disputed": false,
"dispute_reason": "description...",
"discount_amount": 12.00,
"discount_reason": "description...",
"due_amount": 45.01,
"paid_amount": 45.01,
"balance_remaining": 0,
"details": [
{
"name": "Transport",
"amount": 44.87,
"notes": "Standard transport cost of move",
"mileage_band": {
"rate": 6,
"type": "flat",
"distance_start": 0,
"distance_end": 666,
"contract": {
"begin_date": "2023-08-01T04:00:00+00:00",
"end_date": "2028-08-31T04:00:00+00:00"
}
}
},
{
"name": "Surge",
"amount": 0.14,
"notes": "uber ride service"
}
]
}
]
}
]
}

See the invoice object documentation for more information about the response object.