Lấy chi tiết của đơn hàng bằng Client_Order_Code

API Lấy chi tiết đơn hàng bằng client_order_code

 

Sử dụng API này để lấy chi tiết thông tin của đơn hàng bằng client_order_code.

Lưu ý : API này cần truyền token ở header.

post/get
https://online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/detail-by-client-code
https://dev-online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/detail-by-client-code
curl --location --request POST 'https://dev-online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/detail-by-client-code' \
--header 'Content-Type: application/json' \
--header 'Token: f48a8928-9fcb-11ea-b2e69541627f' \
--data-raw '{
    "client_order_code": "Tin1234567"
}'
            
            

Cấu trúc Request

Trường dữ liệu Kiểu dữ liệu Mô tả
token String

Dùng để xác định định danh của tài khoản và dùng cho các trường hợp gọi tới các API.

client_order_code String

Mã đơn hàng riêng của Khách hàng.

{
                "code": 200,
                "message": "Success",
                "data":[
                {
                "shop_id":855,
                "client_id":500379,
                "return_name":"Lastmile",
                "return_phone":0332190458,
                "return_address":"310 Quan Nhân",
                "return_ward_code":"1A0710",
                "return_district_id":1493,
                "return_location":{
                    "lat":20.998386,
                    "long":105.80931,
                    "cell_code":"AHQAZZJE",
                    "place_id":EkIzMTAgUXVhbiBOaMOibiwgVGhhbmggWHXDom4gVHJ1bmcsIFRoYW5oIFh1w6JuLCBIw6AgTuG7mWksIFZpZXRuYW0iGxIZChQKEgkRLtUSl6w1MREaWf6DtHtu2hC2Ag,
                    "trust_level":5,
                    "wardcode":"1A0710"
                    },
                "from_name":"Nguyen",
                "from_phone":0332190458,
                "from_address":"310 Quan Nhân"",
                "from_ward_code":"1A0710",
                "from_district_id":1493,
                "from_location":{
                    "lat":20.998386,
                    "long":105.80931,
                    "cell_code":"AHQAZZJE",
                    "place_id":EkIzMTAgUXVhbiBOaMOibiwgVGhhbmggWHXDom4gVHJ1bmcsIFRoYW5oIFh1w6JuLCBIw6AgTuG7mWksIFZpZXRuYW0iGxIZChQKEgkRLtUSl6w1MREaWf6DtHtu2hC2Ag,
                    "trust_level":5,
                    "wardcode":"1A0710",
                    },
                "deliver_station_id":0,
                "to_name":"Tindeptrai",
                "to_phone":0987654321,
                "to_address":"48 Bùi Thị Xuân",
                "to_ward_code":"21302",
                "to_district_id":1461,
                "to_location":{
                    "lat":10.810695,,
                    "long":106.682046,,
                    "cell_code":"AJIAEQJQ",
                    "place_id":"ChIJz-YRGgQvdTERoKHzo8O2L8g",
                    "trust_level":5,
                    "wardcode":"21302",
                    },
                "weight":2,
                "length":10,
                "width":10,
                "height":10,
                "converted_weight":200,
                "image_ids":"null",
                "service_type_id":2,
                "service_id":53321,
                "payment_type_id":2,
                "payment_type_ids":[
                    2
                ],
                "custom_service_fee":0,
                "sort_code":"0-000-0-A4",
                "cod_amount":0,
                "cod_collect_date":"null",
                "cod_transfer_date":"null",
                "is_cod_transferred":"false",
                "is_cod_collected":"false",
                "insurance_value":0,
                "order_value":0,
                "pick_station_id":0,
                "client_order_code":"Tin1234567",
                "required_note":"KHONGCHOXEMHANG",
                "content":"Tindeptrai",
                "note":"",
                "employee_note":"",
                "seal_code":"",
                "pickup_time":"2021-11-11T03:04:23.928Z",
                "items":[
                {
                    name:"test",
                    quantity:1,
                    category:{},
                    weight:2,
                }
                ],
                "coupon":"",
                "_id":"5ed11d4f1eb594a402473300",
                "order_code":"Z82T1",
                "version_no":"c01697ec-6190-4b2a-aed9-dd5938a9cf11",
                "updated_ip":35.247.155.234,
                "updated_employee":1005,
                "updated_client":0,
                "updated_source":"lastmile",
                "updated_date":"2021-11-11T03:07:56.882Z",
                "updated_warehouse":0,
                "created_ip":35.247.155.234,
                "created_employee":0,
                "created_client":500379,
                "created_source":"shiip/5sao",
                "created_date":"2021-11-11T03:04:23.461Z",
                "status":"return",
                "pick_warehouse_id":2461,
                "deliver_warehouse_id":1364,
                "current_warehouse_id":2461,
                "return_warehouse_id":2271,
                "next_warehouse_id":0,
                "leadtime":"2021-11-13T23:59:59Z",
                "order_date":"2021-11-11T03:04:23.928Z",
                "data":"{}",
                "soc_id":"5ed121cb1eb594a402473301",
                "s2r_time":"2021-11-11T03:07:53.64Z",
                "return_time":"2021-11-11T03:07:53.64Z",
        
                "finish_date":"null",
                "tag":[
                "air"
                ],
                 "log":[
                 {
                 "status": "picking",
                 "payment_type_id": "2",
                 "updated_date": "2021-11-11T03:04:48.053Z"
                },
                {
                 "status": "picked",
                 "payment_type_id": "2",
                 "updated_date": "2021-11-11T03:04:48.053Z"
                },
                {
                    "status": "delivering",
                    "payment_type_id": "2",
                    "updated_date": "2021-11-11T03:07:47.245Z"
                },
                {
                    "status": "delivery_fail",
                    "payment_type_id": "2",
                    "updated_date": "2021-11-11T03:07:53.554Z"
                },
                {
                    "status": "waiting_to_return",
                    "payment_type_id": "2",
                    "updated_date": "2021-11-11T03:07:53.64Z"
                },
                {
                    "status": "return",
                    "payment_type_id": "2",
                    "updated_date": "2021-11-11T03:07:56.882Z"
                }
                ],
                "is_partial_return": "false",
                "is_partial_return": [
                        "FA87OAE"
                ]
                 }
            }

Cấu trúc Response

Trường dữ liệu Mô tả
shop_id

Mã cửa hàng.

client_id

Thông tin cá nhân.

return_name

Tên người nhận hoàn hàng.

return_phone

Số điện thoại người nhận hoàn hàng.

return_address

Địa chỉ người nhận hoàn hàng.

return_ward_code

Phường/Xã người nhận hoàn hàng.

return_district_id

Quận/Huyện người nhận hoàn hàng.

from_name

Tên người gửi.

from_phone

Số điện thoại người gửi.

from_address

Địa chỉ người gửi.

from_ward_code

Phường/Xã người gửi.

from_district_id

Quận/Huyện người gửi.

deliver_station_id

Mã bưu cục giao hàng.

to_name

Tên người nhận.

to_phone

Số điện thoại người nhận.

to_address

Địa chỉ người nhận.

to_ward_code

Phường/Xã người nhận.

to_district_id

Quận/Huyện người nhận.

weight

Cân nặng.

length

Chiều dài.

width

Chiều rộng.

height

Chiều cao.

converted_weight

Khối lượng quy đổi.

service_type_id

Mã loại hình dịch vụ.

service_id

Mã dịch vụ.

payment_type_id

Mã người thanh toán phí dịch vụ.

cod_amount

Tiền thu hộ.

cod_collect_date

Ngày thu tiền thu hộ

cod_transfer_date

Ngày chuyển tiền thu hộ.

insurance_value

Phí khai giá hàng hóa.

pick_station_id

Mã bưu cục để gửi hàng tại điểm.

client_order_code

Mã đơn hàng riêng của Khách hàng.

required_note

Ghi chú bắt buộc.

content

Nội dung.

pickup_time

Thời gian lấy dự kiến.

note

Ghi chú.

employee_note

Nhân viên ghi chú.

coupon

Giá trị khuyến mãi.

order_code

Mã đơn hàng.

sort_code

Mã vận hành.

updated_ip

Ip cập nhật.

updated_employee

Nhân viên cập nhật.

updated_client

Client cập nhật.

updated_source

Nguồn cập nhật.

updated_date

Ngày cập nhật.

updated_warehouse

Bưu cục cập nhật.

created_ip

Ip tạo.

created_employee

Nhân viên tạo.

created_client

Client tạo.

created_source

Nguồn tạo.

created_date

Ngày tạo.

status

Trạng thái.

pick_warehouse_id

Kho lấy.

deliver_warehouse_id

Kho giao.

current_warehouse_id

Kho hiện tại.

return_warehouse_id

Kho trả.

next_warehouse_id

Kho kế tiếp

leadtime

Thời gian giao dự kiến.

order_date

Ngày tạo đơn.

finish_date

Ngày giao hàng thành công.

{
                "code": 400,
                "message": "code=401, message=Token is not valid!",
                "data": null
            }