Create Shipment
This endpoint allows you to create shipments on the Willog platform. A response with "success": true indicates a successful creation, while "success": false indicates a failure.
- If a customerCode is provided, the shipment is created for that customer.
- If serial is not provided, a pre-mapped relationship for the given transportCode must already exist for the shipment to be created.
- If a serial is provided, the shipment will only be created if the device is eligible for use.
Request
POST https://openapi.willog.io/ext/v1/box/transports
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| customerCode | String | false | Customer code |
| transports | Array | true | List of shipment data (max: 100 items) |
| transportCode | String | true | Shipment code |
| serial | String | false | Device serial number |
| departureTime | Unix timestamp(ms) | false | Departure time |
| fetchedManualArrivalTime | Unix timestamp(ms) | false | Manually fetched arrival time |
| receiverName | String | true | Receiver (client) name |
| receiverAddress | String | true | Receiver address |
| receiverAddressDetail | String | false | Detailed receiver address |
| receiverPostCode | String | false | Receiver postal code |
| products | Array | false | List of products to be shipped |
| name | String | true | Product name |
| quantity | Number | true | Product quantity |
| unit | String | false | Product unit (e.g., EA) |
| description | String | false | Product description |
Example Request
POST /ext/v1/box/transports
Authorization: Bearer token
{
"customerCode": "customer1",
"transports": [
{
"transportCode": "5089229ca9f1",
"serial": "AB000343",
"departureTime": 1738655274000,
"fetchedManualArrivalTime": 1738655274000,
"receiverName": "Willog customer",
"receiverAddress": "Samseong-ro, Gangnam-gu, Seoul, Republic of Korea",
"receiverAddressDetail": "9F Willog",
"receiverPostCode": "06158",
"products": [
{
"name": "V2",
"quantity": 1,
"unit": "EA",
"description": "Willog's device"
},
{
"name": "V1",
"quantity": 1
}
]
},
{
"transportCode": "f0531fb95d21",
"receiverName": "Willog Research Center",
"receiverAddress": "Samseong-ro, Gangnam-gu, Seoul, Republic of Korea"
}
]
}
Response
Response Body
| Name | Type | Not-null | Description |
|---|---|---|---|
| customerCode | String | false | The customer code (if provided in the request) |
| results | Array | true | Shipment creation results |
| transportCode | String | true | Shipment code |
| serial | String | true | Device serial number |
| success | Boolean | true | Indicates whether shipment creation was successful |
| error | Object | false | Error details (present if creation failed) |
| type | String | true | Error type (see table below) |
| message | String | true | Error message |
Error Types
| Name | Description |
|---|---|
| REQUIRED_MAPPING | Mapping is required |
| UNREGISTERED_DEVICE | Device is not registered |
| ALREADY_USING_DEVICE | Device is already in use |
| DUPLICATED_TRANSPORT_CODE | Shipment code is duplicated |
Example Response
HTTP/1.1 200 OK
{
"customerCode": "customer1",
"results": [
{
"transportCode": "5089229ca9f1",
"serial": "AB000343",
"success": true
},
{
"transportCode": "f0531fb95d21",
"serial": "AB000881",
"success": false,
"error": {
"type": "REQUIRED_MAPPING",
"message": "The mapping is required."
}
},
{
"transportCode": "e1507e850213",
"serial": "AB000883",
"success": false,
"error": {
"type": "ALREADY_USING_DEVICE",
"message": "The device is already in use."
}
}
]
}
Error Responses
- Unauthorized Access to Customer Data
HTTP/1.1 400 Bad Request
{
"code": "A0016"
}