API Reference - pims.vehicle.price
Info: Stellantis Mobile SDK for ex Groupe PSA brands (CitroĂŤn, DS, Peugeot, Opel and Vauxhall) is not publicly available for now.
This API allows to access and modify default fuel/electricity price.
Input Parameter | |||||
---|---|---|---|---|---|
Param name | Description | Type | Unit/Values | Example | Required |
vin | Vehicle Identification Number |
String |
|
VR1AB12C3D4567890
|
true |
Output Data | ||||
---|---|---|---|---|
Data name | Description | Type | Unit/Values | Example |
priceFuel | Price for fuel. |
Number |
|
1.27
|
priceElectric | Price for electricity. |
Number |
|
0.85
|
Error | |
---|---|
Error Code | Error Label |
2001 | Facade not initialized |
2101 | Missing [PARAMETER] parameter |
2102 | Invalid [PARAMETER] parameter |
2344 | [Component] not configured |
Code Example
1
2
3
4
5
6
7
8
9
pims.get("pims.vehicle.price",
mapOf( /* parameters */
Pair("", "")
)
) { message -> when (message["status"] as? String) {
"SUCCEEDED" -> { } // handle succeeded status
"FAILED" -> { } // handle failed status
} }
1
2
3
4
5
6
7
8
9
pims.get(api: "pims.vehicle.price",
parameters: [
"": ""
]
) { (message) in
if message["status"] == "SUCEEDED" { } // handle succeeded status
else if message["status"] == "FAILED" { } // handle failed status
}
1
2
3
4
5
6
7
8
9
// representation of the `succeeded` dictionary object message as JSON
{
"transactionId": "953cfefb-bc72",
"status": "SUCCEEDED",
"result": {
"priceFuel": "1.27",
"priceElectric": "0.85"
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// representation of the `failed` dictionary objects messages as JSON
/* -------- STATUS FAILED: 2001 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2001,
"label": "Facade not initialized"
}
}
/* -------- STATUS FAILED: 2101 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2101,
"label": "Missing [PARAMETER] parameter"
}
}
/* -------- STATUS FAILED: 2102 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2102,
"label": "Invalid [PARAMETER] parameter"
}
}
/* -------- STATUS FAILED: 2344 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2344,
"label": "[Component] not configured"
}
}
This API allows to access and modify default fuel/electricity price.
Edition will be done only in field is present.
Input Parameter | |||||
---|---|---|---|---|---|
Param name | Description | Type | Unit/Values | Example | Required |
vin | Vehicle Identification Number |
String |
|
VR1AB12C3D4567890
|
true |
priceFuel | Price for fuel. |
Number |
|
1.27
|
true |
priceElectric | Price for electricity. |
Number |
|
0.85
|
true |
Output Data | ||||
---|---|---|---|---|
No data |
Error | |
---|---|
Error Code | Error Label |
2001 | Facade not initialized |
2101 | Missing [PARAMETER] parameter |
2102 | Invalid [PARAMETER] parameter |
2344 | [Component] not configured |
2378 | Canât store fuel price |
Code Example
1
2
3
4
5
6
7
8
9
10
11
pims.set("pims.vehicle.price",
mapOf( /* parameters */
Pair("", ""),
Pair("priceFuel", "1.27"),
Pair("priceElectric", "0.85")
)
) { message -> when (message["status"] as? String) {
"SUCCEEDED" -> { } // handle succeeded status
"FAILED" -> { } // handle failed status
} }
1
2
3
4
5
6
7
8
9
10
11
pims.set(api: "pims.vehicle.price",
parameters: [
"": "",
"priceFuel": "1.27",
"priceElectric": "0.85"
]
) { (message) in
if message["status"] == "SUCEEDED" { } // handle succeeded status
else if message["status"] == "FAILED" { } // handle failed status
}
1
2
3
4
5
6
// representation of the `succeeded` dictionary object message as JSON
{
"transactionId": "953cfefb-bc72",
"status": "SUCCEEDED",
"result": null
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// representation of the `failed` dictionary objects messages as JSON
/* -------- STATUS FAILED: 2001 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2001,
"label": "Facade not initialized"
}
}
/* -------- STATUS FAILED: 2101 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2101,
"label": "Missing [PARAMETER] parameter"
}
}
/* -------- STATUS FAILED: 2102 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2102,
"label": "Invalid [PARAMETER] parameter"
}
}
/* -------- STATUS FAILED: 2344 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2344,
"label": "[Component] not configured"
}
}
/* -------- STATUS FAILED: 2378 -------- */
{
"transactionId": "953cfefb-bc72",
"status": "FAILED",
"error": {
"code": 2378,
"label": "Can't store fuel price"
}
}