BUD CDA Interface
The following interfaces are applicable to the CDA data integration API. Please understand before docking API 接入流程
Create CDA (REQUEST TYPE : POST)
- Request Url
| ENV | URL |
|---|---|
| UAT | https://api-cn-t.lenovo.com/uat/v1.0/supply_chain/scc/cda/bud/create |
| PRD | https://api-cn.lenovo.com/v1.0/supply_chain/scc/cda/bud/create |
- params
| params | type | required | length | desc | example |
|---|---|---|---|---|---|
| cdaId | String | N | 50 | Return after successful creation | RID_1234567 |
| cdaNo | String | N | 50 | Return after successful creation | CDA2023091100022 |
| mrn | String | N | 50 | MRN | 110001 |
| trackingId | String | Y | 50 | Tracking ID (HAWB/HBL/CMR) | CODE0000001 |
| mawb | String | N | 50 | if Mode of Transport contains air, the field 'MAWB' must not be null! | 1234 |
| forwarder | String | Y | 50 | Courier/Forwarder | CODE0000001 |
| containerNo | String | N | 50 | if Mode of Transport is sea, the field 'Container No.' must not be null! | CODE0000001 |
| containerSize | String | N | 50 | if Mode of Transport is sea, the field 'Container Size' must not be null! | CODE0000001 |
| modeOfTransport | String | Y | 50 | Mode of Transport | CODE0000001 |
| invoice | String | Y | 50 | Invoice | CODE0000001 |
| bond | String | Y | 50 | Bonded | Y/N |
| portOfDischarge | String | N | 50 | if Mode of Transport is not truck or mail, the field 'Port of discharge' must not be null! | CODE0000001 |
| chargeableWeight | Number | N | 50 | if Mode of Transport contains air, the field 'Chargeable Weight' must not be null! | 5000 |
| portOfLoading | String | N | 50 | if Mode of Transport is not truck or mail, the field 'Port of loading' must not be null! | CODE0000001 |
| po | String | Y | 50 | Lenovo Po | 1234567890 |
| poLine | String | Y | 50 | Lenovo Po Line | 00010 |
| deliveryNote | String | Y | 50 | DN | 5000 |
| cartons | String | Y | 50 | Cartons | CODE0000001 |
| grossWeight | Number | Y | 50 | Gross Weight | 2000 |
| netWeight | Number | Y | 50 | Net Weight | 2000 |
| lenovoPn | String | Y | 50 | Lenovo PN | 1234567890 |
| coo | String | Y | 50 | COO | CHN |
| shippingCountry | String | Y | 16 | Shipping Country | CODE0000001 |
| pallets | String | Y | 50 | Pallets | CODE0000001 |
| declarationQty | Number | Y | 50 | Declaration QTY | 5000 |
| list | Array | Y | 50 | message list | [] |
| errors | Array | N | 50 | Return after creation failure | po poLine not found in system! |
- request example
JSON
[
{
"mrn": "110001",
"trackingId": "CODE0000001",
"mawb": "CODE0000001",
"forwarder": "CODE0000001",
"containerNo": "CODE0000001",
"containerSize": "CODE0000001",
"modeOfTransport": "Air",
"invoice": "CODE0000001",
"bond": "Y",
"portOfDischarge": "CODE0000001",
"chargeableWeight": "10.12",
"portOfLoading": "CODE0000001",
"po": "CODE0000001",
"poLine": "CODE0000001",
"deliveryNote": "CODE0000001",
"cartons": "CODE0000001",
"grossWeight": "11.1",
"netWeight": "11.2",
"lenovoPn": "CODE0000001",
"coo": "CHN",
"pallets": "CODE0000001",
"declarationQty": "123.1"
}
]- response example
JSON
{
"code": "0",
"msg": "ok",
"result": [
{
"list": [
{
"mrn": "110001",
"trackingId": "CODE0000001",
"mawb": "CODE0000001",
"forwarder": "CODE0000001",
"containerNo": "CODE0000001",
"containerSize": "CODE0000001",
"modeOfTransport": "Air",
"invoice": "CODE0000001",
"bond": "Y",
"portOfDischarge": "CODE0000001",
"chargeableWeight": "10.12",
"portOfLoading": "CODE0000001",
"po": "CODE0000001",
"poLine": "CODE0000001",
"deliveryNote": "CODE0000001",
"cartons": "CODE0000001",
"grossWeight": "11.1",
"netWeight": "11.2",
"lenovoPn": "CODE0000001",
"coo": "CHN",
"pallets": "CODE0000001",
"declarationQty": "abc",
"errors": [
"po and po line not found in system!",
"declarationQty must be number"
]
},
{
"cdaId": "rid_123456",
"cdaNo": "*****",
"mrn": "110001",
"trackingId": "CODE0000001",
"mawb": "CODE0000001",
"forwarder": "CODE0000001",
"containerNo": "CODE0000001",
"containerSize": "CODE0000001",
"modeOfTransport": "Air",
"invoice": "CODE0000001",
"bond": "Y",
"portOfDischarge": "CODE0000001",
"chargeableWeight": "10.12",
"portOfLoading": "CODE0000001",
"po": "CODE0000001",
"poLine": "CODE0000001",
"deliveryNote": "CODE0000001",
"cartons": "CODE0000001",
"grossWeight": "11.1",
"netWeight": "11.2",
"lenovoPn": "CODE0000001",
"coo": "CHN",
"pallets": "CODE0000001",
"declarationQty": "abc"
}
],
"hasError": true
}
]
}- exception example
JSON
{
"code": "-1",
"msg": "error message"
}Update CDA (REQUEST TYPE : POST)
- Request Url
| ENV | URL |
|---|---|
| UAT | https://api-cn-t.lenovo.com/uat/v1.0/supply_chain/scc/cda/bud/update |
| PRD | https://api-cn.lenovo.com/v1.0/supply_chain/scc/cda/bud/update |
- params
| params | type | required | length | desc | example |
|---|---|---|---|---|---|
| cdaId | String | N | 50 | Return after successful creation | RID_1234567 |
| cdaNo | String | N | 50 | Return after successful creation | CDA2023091100022 |
| mrn | String | N | 50 | MRN | 110001 |
| trackingId | String | Y | 50 | Tracking ID (HAWB/HBL/CMR) | CODE0000001 |
| mawb | String | N | 50 | if Mode of Transport contains air, the field 'MAWB' must not be null! | 1234 |
| forwarder | String | Y | 50 | Courier/Forwarder | CODE0000001 |
| containerNo | String | N | 50 | if Mode of Transport is sea, the field 'Container No.' must not be null! | CODE0000001 |
| containerSize | String | N | 50 | if Mode of Transport is sea, the field 'Container Size' must not be null! | CODE0000001 |
| modeOfTransport | String | Y | 50 | Mode of Transport | CODE0000001 |
| invoice | String | Y | 50 | Invoice | CODE0000001 |
| bond | String | Y | 50 | Bonded | Y/N |
| portOfDischarge | String | N | 50 | if Mode of Transport is not truck or mail, the field 'Port of discharge' must not be null! | CODE0000001 |
| chargeableWeight | Number | N | 50 | if Mode of Transport contains air, the field 'Chargeable Weight' must not be null! | 5000 |
| portOfLoading | String | N | 50 | if Mode of Transport is not truck or mail, the field 'Port of loading' must not be null! | CODE0000001 |
| po | String | Y | 50 | Lenovo Po | 1234567890 |
| poLine | String | Y | 50 | Lenovo Po Line | 00010 |
| deliveryNote | String | Y | 50 | DN | 5000 |
| cartons | String | Y | 50 | Cartons | CODE0000001 |
| grossWeight | Number | Y | 50 | Gross Weight | 2000 |
| netWeight | Number | Y | 50 | Net Weight | 2000 |
| lenovoPn | String | Y | 50 | Lenovo PN | 1234567890 |
| coo | String | Y | 50 | COO | CHN |
| shippingCountry | String | Y | 16 | Shipping Country | CODE0000001 |
| pallets | String | Y | 50 | Pallets | CODE0000001 |
| declarationQty | Number | Y | 50 | Declaration QTY | 5000 |
| list | Array | Y | 50 | message list | [] |
| errors | Array | N | 50 | Return after creation failure | po poLine not found in system! |
- request example
JSON
[
{
"mrn": "110001",
"trackingId": "CODE0000001",
"mawb": "CODE0000001",
"forwarder": "CODE0000001",
"containerNo": "CODE0000001",
"containerSize": "CODE0000001",
"modeOfTransport": "Air",
"invoice": "CODE0000001",
"bond": "Y",
"portOfDischarge": "CODE0000001",
"chargeableWeight": "10.12",
"portOfLoading": "CODE0000001",
"po": "CODE0000001",
"poLine": "CODE0000001",
"deliveryNote": "CODE0000001",
"cartons": "CODE0000001",
"grossWeight": "11.1",
"netWeight": "11.2",
"lenovoPn": "CODE0000001",
"coo": "CHN",
"pallets": "CODE0000001",
"declarationQty": "123.1"
}
]- response example
JSON
{
"code": "0",
"msg": "ok",
"result": [
{
"list": [
{
"mrn": "110001",
"trackingId": "CODE0000001",
"mawb": "CODE0000001",
"forwarder": "CODE0000001",
"containerNo": "CODE0000001",
"containerSize": "CODE0000001",
"modeOfTransport": "Air",
"invoice": "CODE0000001",
"bond": "Y",
"portOfDischarge": "CODE0000001",
"chargeableWeight": "10.12",
"portOfLoading": "CODE0000001",
"po": "CODE0000001",
"poLine": "CODE0000001",
"deliveryNote": "CODE0000001",
"cartons": "CODE0000001",
"grossWeight": "11.1",
"netWeight": "11.2",
"lenovoPn": "CODE0000001",
"coo": "CHN",
"pallets": "CODE0000001",
"declarationQty": "abc",
"errors": [
"po and po line not found in system!",
"declarationQty must be number"
]
},
{
"cdaId": "rid_123456",
"cdaNo": "*****",
"mrn": "110001",
"trackingId": "CODE0000001",
"mawb": "CODE0000001",
"forwarder": "CODE0000001",
"containerNo": "CODE0000001",
"containerSize": "CODE0000001",
"modeOfTransport": "Air",
"invoice": "CODE0000001",
"bond": "Y",
"portOfDischarge": "CODE0000001",
"chargeableWeight": "0.00",
"portOfLoading": "CODE0000001",
"po": "CODE0000001",
"poLine": "CODE0000001",
"deliveryNote": "CODE0000001",
"cartons": "CODE0000001",
"grossWeight": "0.0",
"netWeight": "00.0",
"lenovoPn": "CODE0000001",
"coo": "CHN",
"pallets": "CODE0000001",
"declarationQty": "abc"
}
],
"hasError": true
}
]
}- exception example
JSON
{
"code": "-1",
"msg": "error message"
}Delete CDA (REQUEST TYPE : DELETE)
- request url
| ENV | URL |
|---|---|
| UAT | https://api-cn-t.lenovo.com/uat/v1.0/supply_chain/scc/cda/bud/delete |
| PRD | https://api-cn.lenovo.com/v1.0/supply_chain/scc/cda/bud/delete |
- params
| params | type | required | length | desc | example |
|---|---|---|---|---|---|
| cdaIds | Array | Y | 50 |
- request example
JSON
{
"cdaId":[
"cdaId12345",
"cdaId67890"
]
}- response example
JSON
{
"code": "0",
"msg": "ok"
}- exception example
JSON
{
"code": "-1",
"msg": "'1234' cannot be deleted in the 'Submitted' state"
}Query CDA (REQUEST TYPE : POST)
- request url
| ENV | URL |
|---|---|
| UAT | https://api-cn-t.lenovo.com/uat/v1.0/supply_chain/scc/cda/bud/query |
| PRD | https://api-cn.lenovo.com/v1.0/supply_chain/scc/cda/bud/query |
- 请求参数
| params | required | length | desc | example |
|---|---|---|---|---|
| cdaNo | N | List of CDA NO. | ||
| status | N | you can choose the status what you want | "Hold", "Submitted", "Rejected", "Approve", "Close" |
- 响应参数
| params | type | required | length | desc | example |
|---|---|---|---|---|---|
| code | String | Y | 10 | "0" | |
| msg | String | Y | 10 | "ok"/"error" | |
| result | Array | N | |||
| status | String | Y |
- 请求示例
JSON
{
"cdaNo": ["*****"],
"status": ["Hold", "Submitted", "Rejected", "Approve", "Close"]
}- 响应示例
JSON
{
"code": "0",
"msg": "ok",
"result": [
{
"cdaId": "*****",
"cdaNo": "*****",
"status": "Hold",
"mrn": "1",
"modeOfTransport": "Air",
"portOfDischarge": "AAL Aalborg Airport",
"mawb": "3",
"bond": "N",
"groupKey": "*****",
"createBy": "*****",
"chargeableWeight": "9",
"cdaType": "NORMAL",
"forwarder": "APEX",
"invoice": "4",
"portOfLoading": "AAL Aalborg Airport",
"containerSize": "7",
"createDate": "2023-09-12 10:18:14",
"trackingId": "2"
}
]
}- exception example
JSON
{
"code": "-1",
"msg": "CDA No. NOT FOUND IN SYSTEM"
}Submit CDA (REQUEST TYPE : POST)
- request url
| ENV | URL |
|---|---|
| UAT | https://api-cn-t.lenovo.com/uat/v1.0/supply_chain/scc/cda/bud/submit |
| PRD | https://api-cn.lenovo.com/v1.0/supply_chain/scc/cda/bud/submit |
- 请求参数
| params | required | length | desc | example |
|---|---|---|---|---|
| cdaIds | Y | List of cdaId |
- 响应参数
| params | type | required | length | desc | example |
|---|---|---|---|---|---|
| code | String | Y | 10 | "0" | |
| msg | String | Y | 10 | "ok"/"error" |
- 请求示例
JSON
{
"cdaIds": ["rid_1234567"]
}- 响应示例
JSON
{
"code": "0",
"msg": "ok"
}- exception example
JSON
{
"code": "-1",
"msg": "CDA 'XXX' cannot submit due to status 'Approved' "
}CDA Attachment (REQUEST TYPE : POST)
- request url
| ENV | URL |
|---|---|
| UAT | https://api-cn-t.lenovo.com/uat/v1.0/supply_chain/scc/cda/bud/uploadFile |
| PRD | https://api-cn.lenovo.com/v1.0/supply_chain/scc/cda/bud/uploadFile |
- 请求参数
| params | required | length | desc | example |
|---|---|---|---|---|
| cdaId | Y | |||
| file | Y | file |
- 响应参数
| params | type | required | length | desc | example |
|---|---|---|---|---|---|
| code | String | Y | 10 | "0" | |
| msg | String | Y | 10 | "ok"/"error" |
- 请求示例
JSON
{
"cdaId": "cdaId123456",
"file": ["file1", "file2"]
}- 响应示例
JSON
{
"code": "0",
"msg": "ok"
}- exception example
JSON
{
"code": "-1",
"msg": "CDA 'XXX' cannot upload due to status 'Approved' "
}