Fuel: transactions, summary, vehicles
7 operations at https://api.zaitrack.app. Request and response bodies are JSON with camelCase keys; ids are UUIDs; times are RFC 3339 in UTC.
Every operation needs an API key, a personal access token or an OAuth access token unless it says otherwise. An Idempotency-Key is replayed for 24 hours; see Idempotency. Errors are application/problem+json; see Errors.
Get a fuel transaction
GET /v1/fuel/transactions/{id}
- Scope:
fuel:readorfuel:* - Rate class:
read(100 per second and 360,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
Path parameters: id.
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
id | — | |
externalId | — | |
source | — | |
cardId | — | |
vehicleId | — | |
driverId | — | |
stationName | — | |
station | — | |
purchasedAt | string | |
product | — | |
litres | — | |
totalCents | — | |
currency | — | |
unitPriceCents | — | |
odometerKm | — | |
status | — | |
findings | — | |
vehicleDistanceM | — | |
distanceSincePrevKm | — | |
l100km | — | |
checkedAt | — | |
reviewedBy | — | |
reviewNote | — | |
reviewedAt | — | |
createdAt | string | |
version | — |
Example
curl "https://api.zaitrack.app/v1/fuel/transactions/$ID" \
-H "Authorization: Bearer zk_test_…"
Correct a fuel transaction
PATCH /v1/fuel/transactions/{id}
- Scope:
fuel:writeorfuel:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: not used
- Audited: medium risk
- Step-up MFA: no
- If-Match: the version you read; a stale one is refused (412 or 409)
Path parameters: id.
Request
Fields the handler reads, taken from its source.
| Field | Type | Notes |
|---|---|---|
vehicleId | string | optional |
driverId | string | optional |
odometerKm | number | optional |
stationName | string | optional |
product | string | optional |
purchasedAt | string (date-time) | optional |
litres | number | optional |
totalCents | integer | optional |
currency | string | optional |
stationLat | number | optional |
stationLon | number | optional |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Get a fuel transaction.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X PATCH "https://api.zaitrack.app/v1/fuel/transactions/$ID" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Content-Type: application/json" \
-d '{"vehicleId": "…", "driverId": "…"}'
Approve a flagged transaction
POST /v1/fuel/transactions/{id}:approve
- Scope:
fuel:writeorfuel:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: optional
- Audited: low risk
- Step-up MFA: no
- If-Match: the version you read; a stale one is refused (412 or 409)
Path parameters: id.
Request
Fields the handler reads, taken from its source. One handler serves several actions here, so a field may not apply to this one.
| Field | Type | Notes |
|---|---|---|
note | string | |
reason | string |
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Get a fuel transaction.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/fuel/transactions/$ID:approve" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"note": "…", "reason": "…"}'
Reject a flagged transaction
POST /v1/fuel/transactions/{id}:reject
- Scope:
fuel:writeorfuel:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: optional
- Audited: low risk
- Step-up MFA: no
- If-Match: the version you read; a stale one is refused (412 or 409)
Path parameters: id.
Request
Fields the handler reads, taken from its source. One handler serves several actions here, so a field may not apply to this one.
The same fields as the request of Approve a flagged transaction.
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Get a fuel transaction.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/fuel/transactions/$ID:reject" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"note": "…", "reason": "…"}'
Void a transaction
POST /v1/fuel/transactions/{id}:void
- Scope:
fuel:writeorfuel:* - Rate class:
write(50 per second and 36,000 per hour) - Idempotency-Key: optional
- Audited: medium risk
- Step-up MFA: no
- If-Match: the version you read; a stale one is refused (412 or 409)
Path parameters: id.
Request
Fields the handler reads, taken from its source. One handler serves several actions here, so a field may not apply to this one.
The same fields as the request of Approve a flagged transaction.
Response
200: fields the handler writes, taken from its source.
The same fields as the response of Get a fuel transaction.
Example
Every field is sent with a placeholder value: replace them with yours.
curl -X POST "https://api.zaitrack.app/v1/fuel/transactions/$ID:void" \
-H "Authorization: Bearer zk_test_…" \
-H 'If-Match: "3"' \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"note": "…", "reason": "…"}'
Fuel spend and volume over a period
GET /v1/fuel/summary
- Scope:
fuel:readorfuel:* - Rate class:
read(100 per second and 360,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
| Query parameter | Type | Notes |
|---|---|---|
from | string | |
to | string |
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
from | string | |
to | string | |
items | array of object | |
items[].vehicleId | — | |
items[].fills | — | |
items[].litres | — | |
items[].spendCents | — | |
items[].flagged | — | |
items[].avgL100km | — |
Example
curl "https://api.zaitrack.app/v1/fuel/summary" \
-H "Authorization: Bearer zk_test_…"
A vehicle's fuel profile
GET /v1/fuel/vehicles/{vehicleId}/profile
- Scope:
fuel:readorfuel:* - Rate class:
read(100 per second and 360,000 per hour) - Idempotency-Key: not used
- Audited: no
- Step-up MFA: no
Path parameters: vehicleId.
Request
No body.
Response
200: fields the handler writes, taken from its source.
| Field | Type | Notes |
|---|---|---|
vehicleId | — | |
product | string | |
tankLitres | number | |
expectedL100km | number | |
updatedAt | string |
Example
curl "https://api.zaitrack.app/v1/fuel/vehicles/$VEHICLE_ID/profile" \
-H "Authorization: Bearer zk_test_…"