- Reference
- OCPI 2.1.1 (CPO)
- Sender Tariff
OpenAPI reference
Sender Tariff
/tariffsFetch a list of all Tariffs, last updated between the {date_from} and {date_to} (paginated).
API: OCPI 2.1.1 (CPO) · Module: Tariffs (CPO)
Base path:/tariffs· Base URL:https://ocpi-api.gridos.co/ocpi/cpo/2.1.1
Overview
GET /tariffsAbsolute URL: https://ocpi-api.gridos.co/ocpi/cpo/2.1.1/tariffs
Fetch a list of all Tariffs, last updated between the {date_from} and {date_to} (paginated).
Requires authentication. Use Authorization: Token <token>. See OCPI credentials.
How to call
Quick Shell sample (set OCPI_TOKEN when auth is required). Full Python and TypeScript under Examples.
curl -sS -X GET 'https://ocpi-api.gridos.co/ocpi/cpo/2.1.1/tariffs?date_from=2025-01-01T00%3A00%3A00Z&date_to=2025-01-01T00%3A00%3A00Z&offset=0&limit=50' \
-H "Authorization: Token $OCPI_TOKEN"Request
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
date_from | string (date-time) | No | Only return objects with last_updated after this DateTime (inclusive). |
date_to | string (date-time) | No | Only return objects with last_updated before this DateTime (exclusive). |
offset | integer | No | The offset of the first object returned. Default is 0. |
limit | integer | No | Maximum number of objects to GET. |
Responses
| Status | Description | Schema |
|---|---|---|
200 | Successful Response | TariffsResponse |
400 | Invalid or missing parameters (HTTP 200, OCPI envelope) | — |
401 | Unauthorized | — |
422 | Validation Error | HTTPValidationError |
200 — successful response
application/json
Schema: TariffsResponse
| Field | Type | Required | Description |
|---|---|---|---|
status_code | integer | No | Default: 1000 |
status_message | string | No | — |
timestamp | string (date-time) | No | — |
data | TariffOut[] | No | Data. Default: [] |
Response example
{
"status_code": 1000,
"status_message": "Success",
"timestamp": "2015-06-29T22:39:09Z",
"data": []
}400 — invalid or missing parameters (HTTP 200, OCPI envelope)
application/json
Response example
{
"status_code": 2001,
"status_message": "Invalid or missing parameters",
"timestamp": "2025-01-01T00:00:00Z",
"doc_url": "https://github.com/ocpplab/ocpi-gateway/blob/main/docs/errors.md#2001-invalid-parameters",
"errors": [
{
"field": "country_code",
"message": "expected 'NL' to match Token A identity",
"type": "value_error.identity_mismatch"
}
]
}401 — unauthorized
application/json
Response example
{
"status_code": 2000,
"status_message": "Unauthorized",
"timestamp": "2025-01-01T00:00:00Z"
}422 — validation error
application/json
Schema: HTTPValidationError
| Field | Type | Required | Description |
|---|---|---|---|
detail | ValidationError[] | No | Detail |
Response example
{
"detail": [
{
"loc": [],
"msg": "string",
"type": "string",
"input": {
"_type": "Input"
},
"ctx": {
"_type": "Context"
}
}
]
}Examples
Shell, Python, and TypeScript (set OCPI_TOKEN when auth is required).
curl -sS -X GET 'https://ocpi-api.gridos.co/ocpi/cpo/2.1.1/tariffs?date_from=2025-01-01T00%3A00%3A00Z&date_to=2025-01-01T00%3A00%3A00Z&offset=0&limit=50' \
-H "Authorization: Token $OCPI_TOKEN"