배송 생성
윌로그 플랫폼에 배송을 생성할 수 있습니다.
success 가 true 인 데이터는 생성, false 인 데이터는 실패한 데이터입니다.
customerCode가 있을 경우 고객사에 대하여 배송을 생성할 수 있습니다.serial이 없다면 transportCode에 대한 배송과 시리얼을 미리 매핑이 되어있어야 배송 생성이 가능합니다.serial이 있을 경우 serial이 사용가능한 디바이스인 경우에만 배송 생성이 가능합니다.
Request
POST https://openapi.willog.io/ext/v1/box/transports
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
| customerCode | String | false | 고객사 코드 |
| transports | Array | true | 생성할 배송 데이터 목록 (최대: 100) |
| transportCode | String | true | 배송 코드 |
| serial | String | false | 디바이스 시리얼 |
| departureTime | Unix timestamp(ms) | false | 출고 시간 |
| fetchedManualArrivalTime | Unix timestamp(ms) | false | 임의 도착시간 |
| receiverName | String | true | 거래처 |
| receiverAddress | String | true | 거래처 주소 |
| receiverAddressDetail | String | false | 거래처 상세 주소 |
| receiverPostCode | String | false | 거래처 우편 번호 |
| products | Array | false | 배송할 물품 정보 |
| name | String | true | 물품명 |
| quantity | Number | true + | 물품 수량 |
| unit | String | false | 물품 단위 (예: EA) |
| description | String | false | 물품 설명 |
Example Request
POST /ext/v1/box/transports
Authorization: Bearer token
{
"customerCode": "customer1",
"transports": [
{
"transportCode": "5089229ca9f1",
"serial": "AB000343",
"departureTime": 1738655274000,
"fetchedManualArrivalTime": 1738655274000,
"receiverName": "윌로그-거래처",
"receiverAddress": "서울특별시 강남구 삼성로 507",
"receiverAddressDetail": "9층 윌로그",
"receiverPostCode": "06158",
"products": [
{
"name": "V2",
"quantity": 1,
"unit": "EA",
"description": "윌로그 디바이스"
},
{
"name": "V1",
"quantity": 1
}
]
},
{
"transportCode": "f0531fb95d21",
"receiverName": "윌로그-연구소",
"receiverAddress": "서울특별시 강남구 삼성로 507"
}
]
}
Response
Response Body
| Name | Type | Not-null | Description |
|---|---|---|---|
| customerCode | String | false | 요청한 고객사 코드 |
| results | Array | true | 배송 생성 결과 |
| transportCode | String | true | 배송 코드 |
| serial | String | true | 디바이스 시리얼 |
| success | Boolean | true | 배송 생성 성공 여부 |
| error | Object | false | 실패 정보 |
| type | String | true | 에러 타입 (아래 정보와 같습니다) |
| message | String | true | 에러 메시지 |
Error Type
| Name | Description |
|---|---|
| REQUIRED_MAPPING | 매핑이 필요한 경우 |
| UNREGISTERED_DEVICE | 등록되지 않은 디바이스 |
| ALREADY_USING_DEVICE | 이미 사용중인 디바이스 |
| DUPLICATED_TRANSPORT_CODE | 중복된 배송 코드 |
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
- customerCode에 대한 권한 없음
HTTP/1.1 400 Bad Request
{
"code": "A0016"
}