Skip to main content

Save Delivery Trucks

An API that registers new delivery trucks or updates existing ones based on the vehicle number.

  • If the vehicle number already exists:
    • The data for the corresponding vehicle number will be updated with the provided data.
  • If the vehicle number does not exist:
    • A new delivery truck will be registered with the given vehicle number.

To remove specific data from an existing vehicle, send a null value for the data field you want to remove. Conversely, to retain specific data, you must include that data in full in the request.

If the same vehicle number is included more than once in a request, all entries with that vehicle number will fail.

Request


PUT https://openapi.willog.io/hub/v1/delivery-trucks

Request Body

NameTypeRequiredDescription
vehiclesArraytrueList of vehicle data (max: 200)
vehicles[].identifierStringtrueVehicle number
vehicles[].assetCodeStringfalseAsset code
vehicles[].driverNameStringfalseDriver name
vehicles[].groupNameStringfalseGroup name (center name)
vehicles[].weightKgNumberfalseWeight in kg (min: 0)
vehicles[].memoStringfalseMemo (remarks)

Example Request

PUT /hub/v1/delivery-trucks
Authorization: Bearer apiKey

{
"vehicles": [
{
"identifier": "12AD3456",
"assetCode": "ABCD-1234",
"weightKg": 1000,
"memo": null,
"driverName": null,
"groupName": null
},
{
"identifier": "09W8765",
"assetCode": "EFGH-5678",
"weightKg": 3000,
"memo": "Weekend delivery vehicle",
"driverName": null,
"groupName": null
}
]
}

Response


Response Body

NameTypeNot-nullDescription
itemsArraytrueArray of response data
items[].resultCodeStringtrueDelivery truck save result
items[].identifierStringtrueVehicle number
items[].identifierTypeStringtrueVehicle identifier type
items[].assetCodeStringfalseAsset code

ResultCode

NameDescription
SUCCESSSuccess
DUPLICATE_REQUEST_IDENTIFIERFailed (same vehicle number included more than once in the request)

Identifier Types

NameDescription
CAR_LICENSE_NUMBERLicense plate number

Example Response

HTTP/1.1 200 OK

{
"items": [
{
"resultCode": "SUCCESS",
"identifier": "12AD3456",
"assetCode": "ABCD-1234",
"identifierType": "CAR_LICENSE_NUMBER"
},
{
"resultCode": "DUPLICATE_REQUEST_IDENTIFIER",
"identifier": "34W5678",
"assetCode": "ABCD-5678",
"identifierType": "CAR_LICENSE_NUMBER"
},
{
"resultCode": "DUPLICATE_REQUEST_IDENTIFIER",
"identifier": "34W5678",
"assetCode": "EFGH-1234",
"identifierType": "CAR_LICENSE_NUMBER"
}
]
}

Error Responses

- Invalid Token or API Key

HTTP/1.1 400 Bad Request

{
"code": "A0010"
}

- Invalid Request Parameters

HTTP/1.1 400 Bad Request

{
"code": "E0021"
}

- Server Error

HTTP/1.1 500 Internal Server Error

{
"code": "OA-9999"
}