For a general description of the protocol, go to the page: Description of the API protocol...
$ curl -X GET -G http://scat-server/api/version
{"status": "DONE", "response": {"version": "1.10.0"}}
| URL |
/api/version |
| Request method |
GET |
| Key required |
No |
{
"version": str // Information about version (1.0.0)
}
$ curl -X GET -G http://scat-server/api/changeset
{"status": "DONE", "changeset": [["1.0.0", "Basic set of functions"]]}
| URL |
/api/changeset |
| Request method |
GET |
| Key is required |
No |
{
"changeset": [
["version", "changes"],
...
] // list of changes (1.10.0)
}
| Version |
Description |
| 1.0.0 |
Basic set of functions |
| 1.0.1 |
When getting a list of streets, startswith is replaced with contains |
| 1.1.0 |
Get a list of services and tariffs |
| 1.1.1 |
Extended information in the list of tariffs |
| 1.2.0 |
Getting a list of drivers |
| 1.3.0 |
We get the coordinates of the driver by his call sign |
| 1.3.1 |
Return the order number when creating |
| 1.4.0 |
Receive information about the order |
| 1.4.1 |
Changed the format of the response about the coordinates of the driver |
| 1.4.2 |
Поле с номером заказа при создании переименовано с id на order_id |
| 1.4.3 |
The field with the order number was replaced with the uuid during creation |
| 1.4.4 |
Added an optional time parameter when creating an order |
| 1.4.5 |
Added optional driver_id parameter when creating an order |
| 1.4.6 |
Added optional parameter pre_order_time when creating an order |
| 1.4.7 |
Added optional parameters lat, lon, region_id, amount when creating an order |
| 1.5.0 |
We get a parking lot at the address |
| 1.5.1 |
Added optional parameter moderation_required when creating an order |
| 1.6.0 |
We get the parking lot by coordinates |
| 1.7.0 |
We get a list of parking lots |
| 1.7.1 |
The dst, comment, and apartment parameters become optional when creating an order |
| 1.7.2 |
Added the start_time, remaining_time, amount b rate_id fields to the order information |
| 1.8.0 |
Cancel the order |
| 1.8.1 |
The driver_id now returns the call sign when receiving order information |
| 1.8.2 |
The car_brand, car_color, car_model and car_number fields in the order information |
| 1.8.3 |
'Phone' field in the list of drivers |
| 1.9.0 |
Sending SMS |
| 1.9.1 |
The first name and phone fields in the order information |
| 1.9.2 |
Added the optional need_notify parameter when creating an order |
| 1.9.3 |
Added optional parameters dst_street and dst_house when creating an order |
| 1.10.0 |
Getting a list of changes |
| 1.11.0 |
Getting and changing the balance of drivers and contractors |
| 1.11.1 |
Fixed a crash when creating an order with an erroneous region_id |
| 1.11.2 |
An empty string from this version is considered the absence of an argument and is not passed to the API function |
| 1.12.0 |
Function for preliminary cost calculation (according to the tariff schedule) |
| 1.12.1 |
For the preliminary calculation, the service ID is no longer required (by default, the first service) |
| 1.12.2 |
Fixed working with empty passed arguments |
| 1.13.0 |
When creating an order, calculating the cost and in the parking determination functions, the city is taken into account |
| 1.13.1 |
Added optional parameters city_id, service_id when requesting a list of drivers, parking lots |
| 1.13.2 |
When requesting a list of services, you can specify city_id, otherwise services for all cities will be returned. |
| 1.14.0 |
Added an optional city_id parameter for the list of streets, changed the search algorithm by pattern |
| 1.15.0 |
Added optional city_id parameter for the list of tariffs |
| 1.16.0 |
Expanded driver information (speed, direction, order number, parking) |
| 1.16.1 |
We do not use RPC when getting information on an individual driver |
| 1.17.0 |
It is not necessary to indicate the house if the name of a public place is given instead of the street |
| 1.17.1 |
When creating an order, the presence of a phone number in the blacklist is checked |
| 1.18.0 |
Added a function for receiving and changing the status of an external order |
| 1.18.1 |
Added an optional check parameter to check the order status in the database after the change |
| 1.19.0 |
Expanded driver information (city) |
⚠️The pre-calculation function will return token,
which can be used to quickly create an order with already calculated parameters:
$ curl -X GET -G http://scat-server/api/order/pre_cost
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d way_points=[{"name": "Нова Парк"}, {"name": "Аэропорт"}]
{"status": "DONE", "response": {"token": "0LfQvdCw0YfQtdC90LjQtSDRgtC+0LrQtdC90LA="}}
$ curl -X POST http://scat-server/api/order \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d token=0LfQvdCw0YfQtdC90LjQtSDRgtC+0LrQtdC90LA=
{"status": "DONE", "response": {"uuid": "fc1d6f52-9aef-11e3-84ae-0015af9e1aa1"}}
| URL |
/api/order |
| Request method |
POST |
| Key required |
Yes |
| Parameter |
Description |
Acceptable values |
Default value |
Available from version |
| Required parameters |
| Token |
Token |
The token received when performing the preliminary calculation |
- |
СКАТ 7.0 |
| Optional parameters |
| comment |
Comment on the order |
Any text |
- |
1.7.1 |
| moderation_required |
Send to the dispatcher for moderation |
yes, no |
yes |
1.5.1 |
| need_notify |
Client notification required |
yes, no |
yes |
1.9.2 |
| driver_id |
Driver ID |
A natural number.
Send the order directly to the driver.
|
- |
1.0.0 |
| service_id |
Service ID |
Natural number |
1 |
1.0.0 |
| extras |
Additional services |
A comma-separated string is optional. services of the type extra_id*count or extra_id if qty=1 |
- |
1.26.0 |
Array of objects containing fields: street (street), house (house), lat (latitude), lon(longitude). All elements except street are optional
For instance
[{"street": "Pulkovskaya", "house": "78", "lat": 54.454554, "lon": 45.0990999}, {"street": "F-lagmann", "lat": 45.56787, "lon": 45.39807}]
{
"id": int, // order ID (1.0.0)
"order_id": int, // order ID (1.4.2)
"uuid": uuid, // external order ID (1.4.3)
"message": str // system comment (1.0.0)
}
The order is created without the fare estimate token: order fields are passed in the request body in the SKAT server order JSON model format.
The request body is JSON (Content-Type: application/json). The key is passed in the X-Api-Key header or in the api_key query parameter.
If the fare (fare) is not passed, the order is calculated the same way as in the fare estimate:
the fare is set only for services with the "Route" and "Rate table" calculation types, for other types the fare is empty and the order is calculated by the taximeter.
If the fare can not be calculated, the order is still created with an empty fare. A passed fare is locked.
$ curl -X POST http://scat-server/api/v2/order \
-H 'X-Api-Key: 0dcf277e-0317-4eef-9142-24b7a2b4788a' \
-H 'Content-Type: application/json' \
-d '{"attributes": {
"service": {"id": 1},
"client": {"phone": "79001112233", "name": "John"},
"from": {"street": "Lenina", "house": "1", "latitude": 55.1, "longitude": 61.4, "entrance": "2"},
"to": {"street": "Mira", "house": "10"},
"extras": [{"extraId": 4, "count": 1}],
"note": "At the second entrance"
},
"source": "site", "source_order_id": "A-123"}'
{"status": "DONE", "response": {"message": "Your order saved.", "uuid": "fc1d6f52-9aef-11e3-84ae-0015af9e1aa1",
"fare": "300", "approximate": false, "rating_discreteness": 5, "moderation": true}}
| URL |
/api/v2/order |
| Request method |
POST |
| Key required |
Yes (X-Api-Key header or api_key parameter) |
| Field |
Description |
Valid values |
Default value |
Available since |
| Required fields |
| service |
Service |
{"id": int} |
- |
SKAT 9.2.64 |
| client |
Client: phone — phone number (required), name — name, customerId — counterparty ID, customerCardId — counterparty card ID |
{"phone": str, "name": str, "customerId": int, "customerCardId": int} |
- |
SKAT 9.2.64 |
| from |
Pick-up address |
Route point, see the format below |
- |
SKAT 9.2.64 |
| Optional fields |
| waypoints |
Intermediate points |
Array of route points |
[] |
SKAT 9.2.64 |
| to |
Destination address |
Route point |
- |
SKAT 9.2.64 |
| queueId |
Queue ID |
int |
Service queue |
SKAT 9.2.64 |
| cityId |
City ID |
int |
Service city |
SKAT 9.2.64 |
| rate |
Rate |
{"id": int} |
Defined by calculation |
SKAT 9.2.64 |
| time |
Pre-order time |
{"reservation": "2026-11-10T08:00:00+00:00"} — ISO string with timezone |
Current order |
SKAT 9.2.64 |
| extras |
Additional services. Prices are calculated by the server |
[{"extraId": int, "count": int}] |
[] |
SKAT 9.2.64 |
| fare |
Order fare. Locked if passed |
Number |
Calculated |
SKAT 9.2.64 |
| note |
Order comment |
Any text |
- |
SKAT 9.2.64 |
| billingType |
Payment type |
0 — cash, 1 — non-cash, 2 — direct non-cash |
0 |
SKAT 9.2.64 |
| executor |
Assign a driver |
{"id": int} |
- |
SKAT 9.2.64 |
| needModeration |
Send the order to an operator for moderation |
true, false |
true |
SKAT 9.2.64 |
| disableAutoDial |
Disable automatic client notifications |
true, false |
false |
SKAT 9.2.64 |
| allowReject |
Allow the driver to reject the order |
true, false |
- |
SKAT 9.2.64 |
| redialNumber |
Callback number |
String |
- |
SKAT 9.2.64 |
| requestedCarClass |
Car class |
int |
- |
SKAT 9.2.64 |
| delivery |
Delivery data (pre-orders only): parcel, consigneeName, consigneePhone, deliveryTime, parcelAmount, intercom |
Object |
- |
SKAT 9.2.64 |
Other order model fields (status, orderSource, totalFare, markup etc.) are not allowed — INVALID_ARGUMENT error is returned.
¶ Request body fields outside attributes
| Field |
Description |
Valid values |
Default value |
Available since |
| Optional fields |
| source |
Order source |
String |
- |
SKAT 9.2.64 |
| source_order_id |
Order ID in the source |
String |
- |
SKAT 9.2.64 |
| customer_card_number |
Counterparty card number. Allows creating a counterparty order from any phone number |
int |
- |
SKAT 9.2.64 |
| use_bonuses |
Use bonuses for order payment |
true, false |
false |
SKAT 9.2.64 |
Object with fields: cityId, regionId, name (public place), street, house, apartment, floor, entrance, latitude, longitude.
Either street or latitude and longitude is required. The region is defined automatically.
{"street": "Pulkovskaya", "house": "78", "latitude": 54.454554, "longitude": 45.0990999}
{
"uuid": uuid, // external order ID
"message": str, // system comment
"fare": str | null, // order fare, null — the order is calculated by the taximeter
"approximate": bool, // the fare is approximate
"rating_discreteness": int, // driver rating scale: 5 or 2, null — rating is disabled
"moderation": bool // the order is sent for moderation
}
Changing an active order created with the same key. Changes are written to the order log.
The request body is JSON (Content-Type: application/json) with changed fields in the attributes object.
The route is replaced entirely: if any of from, waypoints, to is passed, from is required, and intermediate points and the destination that are not passed are removed.
If the route, rate or additional services are changed without fare, the fare is recalculated by the same rules as on creation; if it can not be recalculated, the fare is cleared and the order is calculated by the taximeter.
$ curl -X PATCH http://scat-server/api/v2/order/fc1d6f52-9aef-11e3-84ae-0015af9e1aa1 \
-H 'X-Api-Key: 0dcf277e-0317-4eef-9142-24b7a2b4788a' \
-H 'Content-Type: application/json' \
-d '{"attributes": {"note": "Call 5 minutes before", "extras": [{"extraId": 4, "count": 2}]}}'
{"status": "DONE", "response": {"message": "Your order updated.", "uuid": "fc1d6f52-9aef-11e3-84ae-0015af9e1aa1",
"fare": "350", "approximate": false}}
| URL |
/api/v2/order/<uuid> |
| Request method |
PATCH |
| Key required |
Yes (X-Api-Key header or api_key parameter) |
| Field |
Description |
Valid values |
Default value |
Available since |
| Optional fields (at least one is required) |
| note |
Order comment |
Any text |
- |
SKAT 9.2.64 |
| fare |
Order fare. Locked |
Number |
- |
SKAT 9.2.64 |
| from |
Pick-up address |
Route point |
- |
SKAT 9.2.64 |
| waypoints |
Intermediate points |
Array of route points |
- |
SKAT 9.2.64 |
| to |
Destination address |
Route point |
- |
SKAT 9.2.64 |
| rate |
Rate |
{"id": int} |
- |
SKAT 9.2.64 |
| extras |
Additional services, replace the order additional services |
[{"extraId": int, "count": int}] |
- |
SKAT 9.2.64 |
| billingType |
Payment type |
0, 1, 2 |
- |
SKAT 9.2.64 |
{
"uuid": uuid, // external order ID
"message": str, // system comment
"fare": str | null, // new fare if it was changed
"approximate": bool // the fare is approximate
}
Errors: NO_DATA — the order is not found, ACCESS_DENIED — the order is created with another key, INVALID_ARGUMENT — the order is not active or a field that can not be changed is passed.
$ curl -X GET -G http://scat-server/api/order/pre_cost \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d way_points=[{"name": "Нова Парк"}, {"name": "Аэропорт"}]
{"status": "DONE", "response": {"amount": "638.73"}}
⚠️ The precalculation function will return token,
which can be used to quickly create an order with already calculated parameters:
$ curl -X GET -G http://scat-server/api/order/pre_cost
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d way_points=[{"name": "New Park"}, {"name": "Airport"}]
{"status": "DONE", "response": {"token": "0LfQvdCw0YfQtdC90LjQtSDRgtC+0LrQtdC90LA="}}
$ curl -X POST http://scat-server/api/order \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d token=0LfQvdCw0YfQtdC90LjQtSDRgtC+0LrQtdC90LA=
{"status": "DONE", "response": {"uuid": "fc1d6f52-9aef-11e3-84ae-0015af9e1aa1"}}
| URL |
/api/order/pre_cost |
| Request Method |
GET |
| Key required |
Yes |
| Parameter |
Description |
Valid values |
Default value |
Available since version |
| Optional parameters |
| phone |
Telephone |
Telephone number in international format: + <code> <prefix> <number> (E.164)
|
- |
СКАТ 7.0 |
| way_points |
List of addresses |
[
{
// Pick up location:
"name": "New Park", // Place
"street": "10 Years of October", // Street
"house": "80", // House
"latitude": 56.86804 // Latitude (СКАТ >= 8.0)
"longitude": 53.27337, // Longitude (СКАТ >= 8.0)
"lat": 56.86804, // Latitude (СКАТ < 8.0)
"lon": 53.27337, // Longitude (СКАТ < 8.0)
"entrance": "Central entrance", // Entrance
"floor": "3", // Floor
"apartment": "309б", // Apartment/ Office
"region_id": 1 // Area ID
},
{
// Where to go first
},
{
// Where are we going then
}
]
|
- |
СКАТ 7.0 |
| service_id |
Service ID |
A natural number. |
1 |
1.12.1 |
| pre_order_time_utc |
Advance order time (UTC) |
yyyy-mm-dd HH:MM:SS
Advance order time zone UTC.
|
- |
СКАТ 7.0 |
| extras |
Additional services |
⚠️ Additional features with the flag of "default" must be passed explicitly.
{
// "id": count
"76": 1, // air conditioning
"12": 2 // two children's seat
}
|
- |
СКАТ 7.0 |
| use_bonuses |
Use bonuses |
yes/no
The number of bonuses is determined automatically according to the conditions of the bonus program.
|
- |
СКАТ 7.0 |
| src_name |
Place |
The name of the location to the starting point.
It will be added to the top of the address list.
⚠️ В СКАТ 8.0 highly recommend instead of this parameter, use way_points.
|
- |
СКАТ 7.0 |
| src_street |
Street |
The street name for the starting point including the prefix.
Will be added to the list of addresses.
⚠️ В СКАТ 8.0 we strongly recommend using this parameter instead way_points.
|
- |
СКАТ 7.0 |
| src_house |
House |
House number for origin including the case and the letter.
Will be added to the list of addresses.
⚠️ В СКАТ 8.0 highly recommend instead of this parameter, use way_points.
|
- |
СКАТ 7.0 |
| src_lat |
Width |
The latitude of the starting point.
It will be added to the top of the address list.
⚠️ В СКАТ 8.0 highly recommend instead of this parameter, use way_points.
|
- |
СКАТ 7.0 |
| src_lon |
Longitude |
Longitude of the starting point.
Will be added to the list of addresses.
⚠️ В СКАТ 8.0 we strongly recommend using this parameter instead way_points.
|
- |
СКАТ 7.0 |
| src_entrance |
Entrance |
The room entrance or clarification of the place of delivery of the car to the starting point.
Will be added to the list of addresses.
⚠️ В СКАТ 8.0 highly recommend instead of this parameter, use way_points.
|
- |
СКАТ 7.0 |
| src_floor |
Floor |
Floor to the starting point.
Will be added to the list of addresses.
⚠️ В СКАТ 8.0 we strongly recommend using this parameter insteadway_points.
|
- |
СКАТ 7.0 |
| src_apartment |
Apartment/Office |
Apartment/office number for the starting point.
Will be added to the list of addresses.
⚠️ В СКАТ 8.0 highly recommend instead of this parameter, useway_points.
|
- |
СКАТ 7.0 |
| src_region_id |
Region |
Identifier for area of origin.
A natural number.
It will be added to the top of the address list.
⚠️ В СКАТ 8.0highly recommend instead of this parameter, use way_points.
|
- |
СКАТ 7.0 |
| dst_name |
Place |
The name of the place to the destination.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 we strongly recommend using this parameter instead way_points.
|
- |
СКАТ 7.0 |
| dst_street |
Street |
The street name for the destination including the prefix.
It will be added to the end of the address list.
⚠️ В СКАТ 8.0 highly recommend instead of this parameter, use way_points.
|
- |
СКАТ 7.0 |
| dst_house |
House |
Number of the house for the destination point including the building and the letter.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 We strongly recommend that this parameter be replaced by way_points.
|
- |
СКАТ 7.0 |
| dst_lat |
Latitude |
Latitude of the destination point.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 We strongly recommend that this parameter be replaced by way_points.
|
- |
СКАТ 7.0 |
| dst_lon |
Longitude |
Length of destination.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 We strongly recommend that this parameter be replaced by way_points.
|
- |
СКАТ 7.0 |
| dst_entrance |
Entrance |
The number of the approach or clarification of the place of the car delivery for the destination point.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 We strongly recommend that this parameter be replaced by way_points.
|
- |
СКАТ 7.0 |
| dst_floor |
Этаж |
The floor for the destination point.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 We strongly recommend that this parameter be replaced by way_points.
|
- |
СКАТ 7.0 |
| dst_apartment |
Apartment/Office |
The apartment/office number for the destination point.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 We strongly recommend that this parameter be replaced by way_points.
|
- |
СКАТ 7.0 |
| dst_region_id |
Region |
Destination area identifier.
Natural number.
Will be added to the end of the address list.
⚠️ В СКАТ 8.0 We strongly recommend that this parameter be replaced by way_points.
|
- |
СКАТ 7.0 |
| route_time |
Travel time |
Time in seconds calculated by an external service.
Natural number.
|
- |
1.50.1 |
| distance |
Distance |
Distance in meters calculated by an external service.
Natural number.
|
- |
1.50.1 |
| queue_id |
Queue identifier |
Natural number. |
The main queue of the selected service |
1.12.1 |
| rate_id |
Tariff ID |
Natural number. |
The basic rate of the selected service |
1.12.1 |
| customer_id |
Counterparty Identifier |
Natural number |
- |
1.12.1 |
| customer_card_id |
Counterparty card ID |
Natural number. |
- |
1.12.1 |
| customer_card_number |
Counterparty card number |
Natural number. |
- |
1.12.1 |
{
"amount": string // order fare (1.12.0)
"distance": float // route distance
"approximate": boolean // approx. fare - true. false - exact fare
"token": string // guaranteed value code. is used to create an order
"route": { // route details
"distance": float, // route distance
"points": [[latitude: float, longitude: float], ...] // waypoints
},
"rateMutatedByLoad": boolean // the tariff was changed due to increased demand
"loadMarkup": string // surcharge in foreign currency due to increased demand
"loadMarkupPercent": string // surcharge in percent due to increased demand
}
$ curl -X GET -G http://scat-server/api/order \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1
{"status": "DONE", "response": {"status": 100, "message": "Заказ выполнен", "driver_id": "d1", "start_time": "2014-08-26 18:15:00", "remaining_time": "5", "amount": 150.00, "rate_id": 1}}
| URL |
/api/order |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.4.0 |
{
status: int, // код статуса заказа (1.4.0)
message: str, // сообщение статуса заказа (1.4.0)
driver_id: str // идентификатор водителя (1.4.0)
driver_id: str // позывной (1.8.1)
start_time: datetime/null, // время начала выполнения заказа (%Y-%m-%d %H:%M:%S) (1.7.2)
remaining_time: int/null, // время подачи автомобиля (в минутах) (1.7.2)
amount: float/null, // стоимость заказа (1.7.2)
rate_id: int/null, // идентификатор тарифа (1.7.2)
car_brand: str, // марка (1.8.2)
car_model: str, // модель (1.8.2)
car_color: str, // цвет (1.8.2)
car_number: str // госномер (1.8.2)
}
$ curl -X POST http://scat-server/api/cancel_order \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1
{"status": "DONE", "response": {"message": "Your order canceled."}}
| URL |
/api/cancel_order |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.8.0 |
{
message: str, // комментарий системы (1.8.0)
}
$ curl -X POST http://scat-server/api/order/status \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1 \
-d code=7
{"status": "DONE", "response": {"code": 7, "name": "Клиент не выходит"}}
| URL |
/api/order/status |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.18.0 |
| code |
Код статуса заказа |
Натуральное число |
- |
1.18.0 |
| Необязательные параметры |
| check |
Проверить изменение статуса в базе перед ответом (медленно) |
yes, no |
no |
1.18.1 |
{
code: int, // код статуса заказа (1.18.0)
name: str // наименование статуса (1.18.0)
}
$ curl -X GET -G http://scat-server/api/order/status \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1
{"status": "DONE", "response": {"code": 7, "name": "Клиент не выходит"}}
| URL |
/api/order/status |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.18.0 |
{
code: int, // код статуса заказа (1.18.0)
name: str // наименование статуса (1.18.0)
}
$ curl -X GET -G http://scat-server/api/services \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"services": [{"id": 1, "name": "Такси", "city_id": 1}, {"id": 2, "name": "Тест", "city_id": 1}]}}
| URL |
/api/services |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| city_id |
Идентификатор города |
Натуральное число |
- |
1.13.2 |
{
"services":
[
{
"id": int, // идентификатор службы (1.1.0)
"name": str, // наименование службы (1.1.0)
"city_id": int // идентификатор города, если не указан в запросе (1.13.2)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/regions \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"regions": [{"id": 1, "name": "Центр"}, {"id": 2, "name": "Металлург"}]}}
| URL |
/api/services |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| service_id |
Идентификатор службы |
Нтуральное число |
- |
1.13.1 |
| city_id |
Идентификатор города |
Нтуральное число |
- |
1.13.1 |
{
"regions":
[
{
"id": int, // идентификатор стоянки (1.7.0)
"name": str // наименование стоянки (1.7.0)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/region_by_address \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d street=Пушкинская \
-d house=268
{"status": "DONE", "response": {"id": 1, "name": "Центр"}}
| URL |
/api/region_by_address |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| street |
Название улицы |
Название улицы, включая префикс |
- |
1.5.0 |
| house |
Номер дома клиента |
Номер дома, включая корпус и литеру |
- |
1.5.0 |
{
"id": int, // идентификатор стоянки (1.5.0)
"name": str // наименование стоянки (1.5.0)
}
$ curl -X GET -G http://scat-server/api/region_by_coord \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d lon=12.345678 \
-d lat=87.654321
{"status": "DONE", "response": {"id": 1, "name": "Центр"}}
| URL |
/api/region_by_coord |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| lon |
Координаты клиента: долгота |
Число с плавающей точкой |
- |
1.6.0 |
| lat |
Координаты клиента: широта |
Число с плавающей точкой |
- |
1.6.0 |
{
"id": int, // идентификатор стоянки (1.6.0)
"name": str // наименование стоянки (1.6.0)
}
$ curl -X GET -G http://scat-server/api/rates \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"rates": [{"id": 1, "name": "Эконом", "km_cost": "15.00", "km_start": 2, "stand_kost": "10.00", "free_wait_time": 5, "free_stand_time": 1, "start_hour": 18, "end_hour": 22, "city_id": 1}, {"id": 2, "name": "ВИП", "km_cost": "20.00", "km_start": 1, "stand_kost": "15.00", "free_wait_time": 10, "free_stand_time": 2, "start_hour": null, "end_hour": null, "city_id": 1}]}}
| URL |
/api/rates |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| city_id |
Идентификатор города |
Натуральное число |
- |
1.15.0 |
{
rates:
[
{
id: int, // идентификатор (1.1.0)
name: str, // наименование (1.1.0)
km_cost: float, // стоимость километра (1.1.1)
km_start: int, // сколько первых километров не считается (1.1.1)
stand_cost: float, // стоимость стоянки (1.1.1)
free_wait_time: int, // время бесплатного ожидания (1.1.1)
free_stand_time: int, // сколько первых минут стоянки не считаются (1.1.1)
start_hour: int/null, // время начала действия тарифа (1.1.1)
end_hour: int/null, // время окончания действия тарифа (1.1.1)
city_id: int // идентификатор города, если не указан в запросе (1.15.0)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/streets \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d pattern=киров
{"status": "DONE", "response": {"streets": ["Кирова", "Парк им. Кирова"]}}
| URL |
/api/streets |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| pattern |
Начало имени для поиска |
Любая строка |
- |
1.0.0 |
| pattern |
Часть имени для поиска |
Любая строка |
- |
1.0.1 |
| pattern |
Начало любого слова в наименовании для поиска без учёта регистра |
Любая строка |
- |
1.14.0 |
| Необязательные параметры |
| city_id |
Идентификатор города |
Любая строка |
- |
1.14.0 |
{
"streets":
[
str, // название улицы/общественного места (1.0.0)
// ...
]
}
$ curl -X GET -G http://scat-server/api/drivers \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"drivers": [{"first_name": "Иван", "code": "001", "car_brand": "Ниссан", "car_model": "Альмера", "car_reg_num": "A476BO", "lon": "12.345678", "lat": "87.654321", "permit_number": "58567437900", "car_year": "1997", "phone": "89123456789", "id": 1}]}}
| URL |
/api/drivers |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| service_id |
Идентификатор службы |
Натуральное число |
- |
1.13.1 |
| city_id |
Идентификатор города |
Натуральное число |
- |
1.13.1 |
{
"drivers":
[
{
id: int, // идентификатор водителя (1.2.0)
first_name: str, // имя (1.2.0)
code: str, // позывной (1.2.0)
phone: str, // номер телефона (1.8.3)
permit_number: str/null, // номер разрешения (1.2.0)
lat: str, // широта (1.2.0)
lon: str, // долгота (1.2.0)
car_brand: str, // марка авто (1.2.0)
car_model: str, // модель (1.2.0)
car_reg_num: str, // гос.номер (1.2.0)
car_year: str/null // год выпуска (1.2.0)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/drivers \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d code=001
{"status": "DONE", "response": {"bearing": 0, "region_id": 45, "city_id": 1, "lon": 53.273845, "order_id": null, "lat": 56.86814, "speed": 0}}
| URL |
/api/drivers |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| code |
Позывной водителя |
Любая строка |
- |
1.3.0 |
{
driver = {
lat: str,
lon: str
} // координаты (1.3.0)
lat: str, // широта (1.4.1)
lon: str, // долгота (1.4.1)
lat: float, // широта (1.16.0)
lon: float, // долгота (1.16.0)
speed: float, // скорость (1.16.0)
bearing: float, // направление (1.16.0)
order_id: int/null, // идентификатор заказа (1.16.0)
region_id: int/null, // идентификатор стоянки (1.16.0)
city_id: int // идентификатор города (1.19.0)
}
$ curl -X GET -G http://scat-server/api/client/bonus/count \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d phone=89012345678
{"status": "DONE", "response": {"bonus": 100, "phone": "89012345678"}}
| URL |
/api/client/bonus/count |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| phone |
Номер телефона клиента |
Номер телефона, начинающийся с 8... |
- |
1.0.0 |
{
"phone": str, // номер телефона клиента (1.0.0)
"bonus": int // количество бонусов (1.0.0)
}
$ curl -X POST http://scat-server/api/driver/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d driver_code=001 \
-d txn_id=f782t32t23328r3r223r23t5y6h54r \
-d amount=500
{"status": "DONE", "response": {"balance": 1100.0}}
| URL |
/api/driver/balance |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| driver_code |
Позывной водителя |
Строка |
- |
1.11.0 |
| txn_id |
Номер транзакции |
Строка (>=30) |
- |
1.11.0 |
| amount |
Сумма платежа |
Число с плавающей точкой |
- |
1.11.0 |
{
"balance": float // баланс водителя после платежа (1.11.0)
}
$ curl -X GET -G http://scat-server/api/driver/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d driver_code=001
{"status": "DONE", "response": {"balance": 1100.0, "firstname": "Иванов", "lastname": "Иван", "middlename": "Иванович"}}
| URL |
/api/driver/balance |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| driver_code |
Позывной водителя |
Строка |
- |
1.11.0 |
{
"balance": float, // баланс водителя (1.11.0)
"firstname": str, // имя водителя (1.11.0)
"lastname": str, // фамилия водителя (1.11.0)
"middlename": str // отчество водителя (1.11.0)
}
$ curl -X POST http://scat-server/api/customer/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d customer_id=1 \
-d amount=500
{"status": "DONE", "response": {"balance": 1100.0}}
Для общего описания протокола перейдите на страницу: Описание протокола API...
$ curl -X GET -G http://scat-server/api/version
{"status": "DONE", "response": {"version": "1.10.0"}}
| URL |
/api/customer/balance |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| URL |
/api/version |
| Метод запроса |
GET |
| Требуется ключ |
Нет |
{
"version": str // информация о версии (1.0.0)
}
$ curl -X GET -G http://scat-server/api/changeset
{"status": "DONE", "changeset": [["1.0.0", "Базовый набор функций"]]}
| URL |
/api/changeset |
| Метод запроса |
GET |
| Требуется ключ |
Нет |
{
"changeset": [
["version", "changes"],
...
] // список изменений (1.10.0)
}
| Версия |
Описание |
| 1.0.0 |
Базовый набор функций |
| 1.0.1 |
При получении списка улиц istartswith заменён на icontains |
| 1.1.0 |
Получаем список служб и тарифов |
| 1.1.1 |
Расширенная информация в списке тарифов |
| 1.2.0 |
Получаем список водителей |
| 1.3.0 |
Получаем координаты водителя по его позывному |
| 1.3.1 |
Возвращаем номер заказа при создании |
| 1.4.0 |
Получаем информацию о заказе |
| 1.4.1 |
Изменён формат ответа о координатах водителя |
| 1.4.2 |
Поле с номером заказа при создании переименовано с id на order_id |
| 1.4.3 |
Поле с номером заказа при создании заменено на uuid |
| 1.4.4 |
Добавлен необязательный параметр time при создании заказа |
| 1.4.5 |
Добавлен необязательный параметр driver_id при создании заказа |
| 1.4.6 |
Добавлен необязательный параметр pre_order_time при создании заказа |
| 1.4.7 |
Добавлены необязательные параметры lat, lon, region_id, amount при создании заказа |
| 1.5.0 |
Получаем стоянку по адресу |
| 1.5.1 |
Добавлен необязательный параметр moderation_required при создании заказа |
| 1.6.0 |
Получаем стоянку по координатам |
| 1.7.0 |
Получаем список стоянок |
| 1.7.1 |
Параметры dst, comment, appartment становятся необязательными при создании заказа |
| 1.7.2 |
Добавлены поля start_time, remaining_time, amount и rate_id в информацию о заказе |
| 1.8.0 |
Отменяем заказ |
| 1.8.1 |
В driver_id теперь возвращается позывной при получении информации о заказе |
| 1.8.2 |
Поля car_brand, car_color, car_model и car_number в информации о заказе |
| 1.8.3 |
Поле phone в списке водителей |
| 1.9.0 |
Отправка СМС |
| 1.9.1 |
Поля firstname и phone в информации о заказе |
| 1.9.2 |
Добавлен необязательный параметр need_notify при создании заказа |
| 1.9.3 |
Добавлены необязательные параметры dst_street и dst_house при создании заказа |
| 1.10.0 |
Получаем список изменений |
| 1.11.0 |
Получение и изменение баланса водителей и контрагентов |
| 1.11.1 |
Исправлено падение при создании заказа с ошибочным region_id |
| 1.11.2 |
Пустая строка с этой версии считается отсутствием аргумента и не передаётся в API функцию |
| 1.12.0 |
Функция для предварительного расчёта стоимости (по тарифной сетке) |
| 1.12.1 |
Для предварительного расчёта идентификатор службы теперь не обязателен (по-умолчанию первая служба) |
| 1.12.2 |
Исправлена работа с пустыми переданными аргументами |
| 1.13.0 |
При создании заказа, расчёте стоимости и в функциях определения стоянки учитывается город |
| 1.13.1 |
Добавлены необязательные параметры city_id, service_id при запросе списка водителей, стоянок |
| 1.13.2 |
При запросе списка служб можно указать city_id, иначе будут возвращены службы для всех городов |
| 1.14.0 |
Добавлен необязательный параметр city_id для списка улиц, изменён алгоритм поиска по паттерну |
| 1.15.0 |
Добавлен необязательный параметр city_id для списка тарифов |
| 1.16.0 |
Расширена информация по водителю (скорость, направление, номер заказа, стоянка) |
| 1.16.1 |
Не используем RPC при получении информации по отдельному водителю |
| 1.17.0 |
Дом указывать не обязательно, если вместо улицы передано название общественного места |
| 1.17.1 |
При создании заказа проверяется наличие номера телефона в чёрном списке |
| 1.18.0 |
Добавлена функция для получения и смены статуса внешнего заказа |
| 1.18.1 |
Добавлен необязательный параметр check для проверки статуса заказа в базе после изменения |
| 1.19.0 |
Расширена информация по водителю (город) |
$ curl -X POST http://scat-server/api/order \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d phone=89012345678 \
-d street=Ленина \
-d house=11а \
-d appartment=42 \
-d dst="Пушкинская 268" \
-d moderation_required=no
{"status": "DONE", "response": {"message": "Your order saved.", "uuid": "fc1d6f52-9aef-11e3-84ae-0015af9e1aa1"}}
| URL |
/api/order |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| phone |
Номер телефона клиента |
Номер телефона, начинающийся с 8... |
- |
1.0.0 |
| street |
Название улицы/общественного места |
Название улицы/общественного места, включая префикс |
- |
1.17.0 |
| street |
Название улицы |
Название улицы, включая префикс |
- |
1.0.0 |
| house |
Номер дома клиента |
Номер дома, включая корпус и литеру |
- |
1.0.0 |
| appartment |
Номер квартиры клиента |
Число |
- |
1.0.0 |
| dst |
Точка назначения |
Адрес точки назначения в одну строку |
- |
1.0.0 |
| comment |
Комментарий к заказу |
Любой текст |
- |
1.0.0 |
| Необязательные параметры |
| house |
Номер дома клиента |
Номер дома, включая корпус и литеру |
- |
1.17.0 |
| appartment |
Номер квартиры клиента |
Число |
- |
1.7.1 |
| dst |
Точка назначения |
Адрес точки назначения в одну строку |
- |
1.7.1 |
| region_id |
Идентификатор стоянки |
Натуральное число |
- |
1.4.7 |
| lon |
Координаты клиента: долгота |
Число с плавающей точкой |
- |
1.4.7 |
| lat |
Координаты клиента: широта |
Число с плавающей точкой |
- |
1.4.7 |
| moderation_required |
Отправлять диспетчеру на модерацию |
yes, no |
yes |
1.5.1 |
| service_id |
Идентификатор службы |
Натуральное число |
1 |
1.0.0 |
| driver_id |
Идентификатор водителя |
Натуральное число |
- |
1.0.0 |
| amount |
Стоимость заказа |
Число с плавающей точкой |
- |
1.4.7 |
| pre_order_time |
Время предварительного заказа |
Время и дата в формате %Y-%m-%d %H:%M:%S |
- |
1.4.6 |
| comment |
Комментарий к заказу |
Любой текст |
- |
1.7.1 |
| need_notify |
Требуется оповещение клиента |
yes, no |
yes |
1.9.2 |
| dst_street |
Улица назначения |
Название улицы, включая префикс |
- |
1.9.3 |
| dst_house |
Дом назначения |
Номер дома, включая корпус и литеру |
- |
1.9.3 |
| dst_lat |
Координата адреса назначения: широта |
Число с плавающей точкой |
- |
1.26.0 |
| dst_lon |
Координата адреса назначения: долгота |
Число с плавающей точкой |
- |
1.26.0 |
| way_points |
Промежуточные точки маршрута |
JSONArray |
- |
1.26.0 |
| extras |
Доп услуги |
Строка, разделенные запятыми доп. услуги вида extra_id*count или extra_id если кол-во=1 |
- |
1.26.0 |
Массив объектов содержащих поля: street (улица), house (дом), lat(широта), lon(долгота). Все элементы кроме street не обязательны
Например
[{"street": "Пулковская", "house": "78", "lat": 54.454554, "lon": 45.0990999}, {"street": "ТЦ Флагман", "lat": 45.56787, "lon": 45.39807}]
{
"id": int, // идентификатор заказа (1.0.0)
"order_id": int, // идентификатор заказа (1.4.2)
"uuid": uuid, // внешний идентификатор заказа (1.4.3)
"message": str // комментарий системы (1.0.0)
}
$ curl -X GET -G http://scat-server/api/order/pre_cost \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d src_street=Ленина \
-d src_house=11а \
-d dst_street=Кирова \
-d dst_house=18
{"status": "DONE", "response": {"amount": 100.0}}
| URL |
/api/order/pre_cost |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| src_street |
Название улицы |
Название улицы, включая префикс |
- |
1.12.0 |
| src_house |
Номер дома клиента |
Номер дома, включая корпус и литеру |
- |
1.12.0 |
| dst_street |
Улица назначения |
Название улицы, включая префикс |
- |
1.12.0 |
| dst_house |
Дом назначения |
Номер дома, включая корпус и литеру |
- |
1.12.0 |
| service_id |
Идентификатор службы |
Натуральное число |
- |
1.12.0 |
| Необязательные параметры |
| src_lon |
Координаты клиента: долгота |
Число с плавающей точкой |
- |
1.12.0 |
| src_lat |
Координаты клиента: широта |
Число с плавающей точкой |
- |
1.12.0 |
| dst_lon |
Координаты точки назначения: долгота |
Число с плавающей точкой |
- |
1.12.0 |
| dst_lat |
Координаты точки назначения: широта |
Число с плавающей точкой |
- |
1.12.0 |
| src_region_id |
Идентификатор района клиента |
Натуральное число |
- |
1.12.0 |
| dst_region_id |
Идентификатор района назначения |
Натуральное число |
- |
1.12.0 |
| service_id |
Идентификатор службы |
Натуральное число |
1 |
1.12.1 |
| route_time |
Время в пути, в секундах |
Натуральное число |
- |
1.50.1 |
{
"amount": string // стоимость заказа (1.12.0)
"distance": float // дистанция маршрута
"approximate": boolean // примерная стоимость - true. false - точная стоимость
"token": string // код гарантированной стоимости. используется для создания заказа
}
$ curl -X GET -G http://scat-server/api/order \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1
{"status": "DONE", "response": {"status": 100, "message": "Заказ выполнен", "driver_id": "d1", "start_time": "2014-08-26 18:15:00", "remaining_time": "5", "amount": 150.00, "rate_id": 1}}
| URL |
/api/order |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.4.0 |
{
status: int, // код статуса заказа (1.4.0)
message: str, // сообщение статуса заказа (1.4.0)
driver_id: str // идентификатор водителя (1.4.0)
driver_id: str // позывной (1.8.1)
start_time: datetime/null, // время начала выполнения заказа (%Y-%m-%d %H:%M:%S) (1.7.2)
remaining_time: int/null, // время подачи автомобиля (в минутах) (1.7.2)
amount: float/null, // стоимость заказа (1.7.2)
rate_id: int/null, // идентификатор тарифа (1.7.2)
car_brand: str, // марка (1.8.2)
car_model: str, // модель (1.8.2)
car_color: str, // цвет (1.8.2)
car_number: str // госномер (1.8.2)
}
$ curl -X POST http://scat-server/api/cancel_order \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1
{"status": "DONE", "response": {"message": "Your order canceled."}}
| URL |
/api/cancel_order |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.8.0 |
{
message: str, // комментарий системы (1.8.0)
}
$ curl -X POST http://scat-server/api/order/status \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1 \
-d code=7
{"status": "DONE", "response": {"code": 7, "name": "Клиент не выходит"}}
| URL |
/api/order/status |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.18.0 |
| code |
Код статуса заказа |
Натуральное число |
- |
1.18.0 |
| Необязательные параметры |
| check |
Проверить изменение статуса в базе перед ответом (медленно) |
yes, no |
no |
1.18.1 |
{
code: int, // код статуса заказа (1.18.0)
name: str // наименование статуса (1.18.0)
}
$ curl -X GET -G http://scat-server/api/order/status \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d uuid=fc1d6f52-9aef-11e3-84ae-0015af9e1aa1
{"status": "DONE", "response": {"code": 7, "name": "Клиент не выходит"}}
| URL |
/api/order/status |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| uuid |
Уникальный идентификатор заказа, полученный при его создании |
uuid |
- |
1.18.0 |
{
code: int, // код статуса заказа (1.18.0)
name: str // наименование статуса (1.18.0)
}
$ curl -X GET -G http://scat-server/api/services \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"services": [{"id": 1, "name": "Такси", "city_id": 1}, {"id": 2, "name": "Тест", "city_id": 1}]}}
| URL |
/api/services |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| city_id |
Идентификатор города |
Натуральное число |
- |
1.13.2 |
{
"services":
[
{
"id": int, // идентификатор службы (1.1.0)
"name": str, // наименование службы (1.1.0)
"city_id": int // идентификатор города, если не указан в запросе (1.13.2)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/regions \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"regions": [{"id": 1, "name": "Центр"}, {"id": 2, "name": "Металлург"}]}}
| URL |
/api/services |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| service_id |
Идентификатор службы |
Нтуральное число |
- |
1.13.1 |
| city_id |
Идентификатор города |
Нтуральное число |
- |
1.13.1 |
{
"regions":
[
{
"id": int, // идентификатор стоянки (1.7.0)
"name": str // наименование стоянки (1.7.0)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/region_by_address \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d street=Пушкинская \
-d house=268
{"status": "DONE", "response": {"id": 1, "name": "Центр"}}
| URL |
/api/region_by_address |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| street |
Название улицы |
Название улицы, включая префикс |
- |
1.5.0 |
| house |
Номер дома клиента |
Номер дома, включая корпус и литеру |
- |
1.5.0 |
{
"id": int, // идентификатор стоянки (1.5.0)
"name": str // наименование стоянки (1.5.0)
}
$ curl -X GET -G http://scat-server/api/region_by_coord \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d lon=12.345678 \
-d lat=87.654321
{"status": "DONE", "response": {"id": 1, "name": "Центр"}}
| URL |
/api/region_by_coord |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| lon |
Координаты клиента: долгота |
Число с плавающей точкой |
- |
1.6.0 |
| lat |
Координаты клиента: широта |
Число с плавающей точкой |
- |
1.6.0 |
{
"id": int, // идентификатор стоянки (1.6.0)
"name": str // наименование стоянки (1.6.0)
}
$ curl -X GET -G http://scat-server/api/rates \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"rates": [{"id": 1, "name": "Эконом", "km_cost": "15.00", "km_start": 2, "stand_kost": "10.00", "free_wait_time": 5, "free_stand_time": 1, "start_hour": 18, "end_hour": 22, "city_id": 1}, {"id": 2, "name": "ВИП", "km_cost": "20.00", "km_start": 1, "stand_kost": "15.00", "free_wait_time": 10, "free_stand_time": 2, "start_hour": null, "end_hour": null, "city_id": 1}]}}
| URL |
/api/rates |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| city_id |
Идентификатор города |
Натуральное число |
- |
1.15.0 |
{
rates:
[
{
id: int, // идентификатор (1.1.0)
name: str, // наименование (1.1.0)
km_cost: float, // стоимость километра (1.1.1)
km_start: int, // сколько первых километров не считается (1.1.1)
stand_cost: float, // стоимость стоянки (1.1.1)
free_wait_time: int, // время бесплатного ожидания (1.1.1)
free_stand_time: int, // сколько первых минут стоянки не считаются (1.1.1)
start_hour: int/null, // время начала действия тарифа (1.1.1)
end_hour: int/null, // время окончания действия тарифа (1.1.1)
city_id: int // идентификатор города, если не указан в запросе (1.15.0)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/streets \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d pattern=киров
{"status": "DONE", "response": {"streets": ["Кирова", "Парк им. Кирова"]}}
| URL |
/api/streets |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| pattern |
Начало имени для поиска |
Любая строка |
- |
1.0.0 |
| pattern |
Часть имени для поиска |
Любая строка |
- |
1.0.1 |
| pattern |
Начало любого слова в наименовании для поиска без учёта регистра |
Любая строка |
- |
1.14.0 |
| Необязательные параметры |
| city_id |
Идентификатор города |
Любая строка |
- |
1.14.0 |
{
"streets":
[
str, // название улицы/общественного места (1.0.0)
// ...
]
}
$ curl -X GET -G http://scat-server/api/drivers \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a
{"status": "DONE", "response": {"drivers": [{"first_name": "Иван", "code": "001", "car_brand": "Ниссан", "car_model": "Альмера", "car_reg_num": "A476BO", "lon": "12.345678", "lat": "87.654321", "permit_number": "58567437900", "car_year": "1997", "phone": "89123456789", "id": 1}]}}
| URL |
/api/drivers |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| service_id |
Идентификатор службы |
Натуральное число |
- |
1.13.1 |
| city_id |
Идентификатор города |
Натуральное число |
- |
1.13.1 |
{
"drivers":
[
{
id: int, // идентификатор водителя (1.2.0)
first_name: str, // имя (1.2.0)
code: str, // позывной (1.2.0)
phone: str, // номер телефона (1.8.3)
permit_number: str/null, // номер разрешения (1.2.0)
lat: str, // широта (1.2.0)
lon: str, // долгота (1.2.0)
car_brand: str, // марка авто (1.2.0)
car_model: str, // модель (1.2.0)
car_reg_num: str, // гос.номер (1.2.0)
car_year: str/null // год выпуска (1.2.0)
},
// ...
]
}
$ curl -X GET -G http://scat-server/api/drivers \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d code=001
{"status": "DONE", "response": {"bearing": 0, "region_id": 45, "city_id": 1, "lon": 53.273845, "order_id": null, "lat": 56.86814, "speed": 0}}
| URL |
/api/drivers |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| code |
Позывной водителя |
Любая строка |
- |
1.3.0 |
{
driver = {
lat: str,
lon: str
} // координаты (1.3.0)
lat: str, // широта (1.4.1)
lon: str, // долгота (1.4.1)
lat: float, // широта (1.16.0)
lon: float, // долгота (1.16.0)
speed: float, // скорость (1.16.0)
bearing: float, // направление (1.16.0)
order_id: int/null, // идентификатор заказа (1.16.0)
region_id: int/null, // идентификатор стоянки (1.16.0)
city_id: int // идентификатор города (1.19.0)
}
$ curl -X GET -G http://scat-server/api/client/bonus/count \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d phone=89012345678
{"status": "DONE", "response": {"bonus": 100, "phone": "89012345678"}}
| URL |
/api/client/bonus/count |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| phone |
Номер телефона клиента |
Номер телефона, начинающийся с 8... |
- |
1.0.0 |
{
"phone": str, // номер телефона клиента (1.0.0)
"bonus": int // количество бонусов (1.0.0)
}
$ curl -X POST http://scat-server/api/driver/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d driver_code=001 \
-d txn_id=f782t32t23328r3r223r23t5y6h54r \
-d amount=500
{"status": "DONE", "response": {"balance": 1100.0}}
| URL |
/api/driver/balance |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| driver_code |
Позывной водителя |
Строка |
- |
1.11.0 |
| txn_id |
Номер транзакции |
Строка (>=30) |
- |
1.11.0 |
| amount |
Сумма платежа |
Число с плавающей точкой |
- |
1.11.0 |
{
"balance": float // баланс водителя после платежа (1.11.0)
}
$ curl -X GET -G http://scat-server/api/driver/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d driver_code=001
{"status": "DONE", "response": {"balance": 1100.0, "firstname": "Иванов", "lastname": "Иван", "middlename": "Иванович"}}
| URL |
/api/driver/balance |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| driver_code |
Позывной водителя |
Строка |
- |
1.11.0 |
{
"balance": float, // баланс водителя (1.11.0)
"firstname": str, // имя водителя (1.11.0)
"lastname": str, // фамилия водителя (1.11.0)
"middlename": str // отчество водителя (1.11.0)
}
$ curl -X POST http://scat-server/api/customer/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d customer_id=1 \
-d amount=500
{"status": "DONE", "response": {"balance": 1100.0}}
| URL |
/api/customer/balance |
| Метод запроса |
POST |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| customer_id |
Идентификатор контрагента |
Целое число |
- |
1.11.0 |
| amount |
Сумма платежа |
Число с плавающей точкой |
- |
1.11.0 |
{
"balance": float // баланс контрагента после платежа (1.11.0)
}
$ curl -X GET -G http://scat-server/api/customer/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d driver_code=001
{"status": "DONE", "response": {"balance": 1100.0, "name": "Иван"}}
| URL |
/api/customer/balance |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| customer_id |
Идентификатор контрагента |
Целое число |
- |
1.11.0 |
{
"balance": float, // баланс контрагента (1.11.0)
"name": str // имя контрагента (1.11.0)
}
$ curl -X GET -G http://scat-server/api/extras \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d service_id=1
{"status": "DONE", "response": {"extras": [{"id": 1, "name": "Пустой багажник", "price": 100, "allow_multiple": false}, {....}]}}
| URL |
/api/extras |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| service_id |
Идентификатор службы |
Целое число |
- |
1.11.0 |
| queue_id |
Идентификатор очереди заказов |
Целое число |
- |
1.11.0 |
{
"extras": JSONArray, // баланс контрагента (1.11.0)
}
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| customer_id |
Идентификатор контрагента |
Целое число |
- |
1.11.0 |
| amount |
Сумма платежа |
Число с плавающей точкой |
- |
1.11.0 |
{
"balance": float // баланс контрагента после платежа (1.11.0)
}
$ curl -X GET -G http://scat-server/api/customer/balance \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d driver_code=001
{"status": "DONE", "response": {"balance": 1100.0, "name": "Иван"}}
| URL |
/api/customer/balance |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Обязательные параметры |
| customer_id |
Идентификатор контрагента |
Целое число |
- |
1.11.0 |
{
"balance": float, // баланс контрагента (1.11.0)
"name": str // имя контрагента (1.11.0)
}
$ curl -X GET -G http://scat-server/api/extras \
-d api_key=0dcf277e-0317-4eef-9142-24b7a2b4788a \
-d service_id=1
{"status": "DONE", "response": {"extras": [{"id": 1, "name": "Пустой багажник", "price": 100, "allow_multiple": false}, {....}]}}
| URL |
/api/extras |
| Метод запроса |
GET |
| Требуется ключ |
Да |
| Параметр |
Описание |
Допустимые значения |
Значение по-умолчанию |
Доступен с версии |
| Необязательные параметры |
| service_id |
Идентификатор службы |
Целое число |
- |
1.11.0 |
| queue_id |
Идентификатор очереди заказов |
Целое число |
- |
1.11.0 |
{
"extras": JSONArray, // баланс контрагента (1.11.0)
}