Tạo vận đơn

Request

  • URL: /shippingorders
  • Method: POST
  • Header:
    • Content-type: application/json

Request Body

Đối tượng JSON request (Content-Type: application/json)
Tên Mô tả Kiểu dữ liệu Mặc định
cod Tiền cần thu hộ Float  
cod_status Trạng thái thu tiền COD (Xem danh sách)  (Chưa hỗ trợ) Interger  
company_id Company ID Interger  
creator_id User ID người tạo Interger  
date_completed Ngày tạo hoàn thành vận đơn Integer - Unix timestamp  
date_started Ngày bắt đầu giao Integer - Unix timestamp  
file_id_list Mảng ID của tập tin đính kèm (hình ảnh) vận đơn Interger[]  
foreign_id ID tham chiếu của hệ thống khác Integer  
from_warehouse_id ID kho lấy hàng của đối tác Interger  
invoice_id Mã đơn hàng String  
merchant_id ID đối tác Interger  
office_id ID bưu cục xuất phát Interger  
office_id_to ID bưu cục nhận hàng (Luân chuyển nội bộ) Interger  
order_customer_email Email người nhận String  
order_customer_fullname Họ tên người nhận String  
order_customer_phone Số điện thoại người nhận String  
order_height Kích thước chiều cao gói hàng Interger  
order_length Kích thước chiều dài gói hàng Interger  
order_note Ghi chú thông tin đơn hàng String  
order_price_final Giá trị đơn hàng Float  
order_shipping_address Địa chỉ người nhận hàng String  
order_shipping_lat Tọa độ vĩ độ của địa chỉ giao hàng Float  
order_shipping_long Tọa độ kinh độ của địa chỉ giao hàng Float  
order_shipping_region ID Tỉnh thành phố người nhận Interger  
order_shipping_subregion ID quận / huyện của người nhận Integer  
order_weight Trọng lượng gói hàng Integer  
order_width Chiều rộng gói hàng Integer  
pickup_status Trạng thái lấy hàng(Xem danh sách) Integer  
price_final Phí vận chuyển Float  
product_type Loại hàng hóa(Xem danh sách) Integer  
random_code Mã vận đơn String  
return_status Trạng thái chuyển hoàn (Xem danh sách) Interger  
shipping_type ID Loại dịch vụ Integer  
source Nguồn tạo vận đơn(Xem danh sách) Integer  
status Trạng thái vận đơn(Xem danh sách) Integer  
type Loại vận đơn (Xem danh sách) Integer  
ymd Ngày nhận hàng Integer - Unix timestamp  

 

Ví dụ một request json object:

{ "company_id": 1, "creator_id": 15308, "id": 73886, "route_id": 0, "shipper_id": 0, "random_code": "73886605681", "type": 0, "from_warehouse_id": 346, "merchant_id": 9, "office_id": 643, "office_id_to": 0, "foreign_id": 0, "invoice_id": "ORDER00123", "cod": 780000, "shipping_type": 236, "product_type": 1, "order_price_sell": 0, "order_price_discount": 0, "order_price_shipping": 0, "order_price_tax": 0, "order_price_final": 790000, "order_note": "đơn hàng giao hàng nhanh chóng", "order_customer_fullname": "Thành Lâm Tấn", "order_customer_email": "lamtanthanhtc@gmail.com", "order_customer_phone": "0939864464", "order_shipping_address": "242 Trần Bình Trọng, Phường 4, Quận 5, Hồ Chí Minh, Việt Nam", "order_shipping_country": "", "order_shipping_region": 3, "order_shipping_subregion": 802, "order_shipping_lat": 10.7620808, "order_shipping_long": 106.6794759, "order_detail": "", "order_length": 10, "order_width": 20, "order_height": 30, "order_weight": 5000, "price_final": 40000, "source": 0, "pickup_status": 9, "return_status": 1, "cod_status": 0, "status": 1, "ymd": 20191009, "date_started": 0, "date_completed": 0, "file_id_list": [] } 

Response 

Success response

Status Code: 201

Content-Type: application/json

Cấu trúc theo cấu trúc của một vận đơn trong phần danh sách vận đơn. Nhấn vào đây để xem cấu trúc response.

 

Error response

Nếu response có lỗi thì có thể tham khảo bảng bên dưới để biết các lỗi có thể xuất hiện khi gửi request này:

HTTP Status Mã lỗi Mô tả
403 error_not_permission Không có quyền truy cập
422 error_random_code_character_invalid Mã vận đơn có ký tự không hợp lệ. Chỉ cho phép chữ số, chữ cái.
422 error_random_code_existed Mã vận đơn đã tồn tại
422 error_status_is_require Trạng thái vận đơn là bắt buộc
422 error_status_invalid Trạng thái vận đơn không hợp lệ
422 error_type_invalid Loại vận đơn không hợp lệ
422 error_product_type_is_require Loại hàng hóa là bắt buộc
422 error_product_type_invalid Loại hàng hóa không hợp lệ
422 error_pickup_status_invalid Trạng thái lấy hàng không hợp lệ
422 error_return_status_invalid Trạng thái trả hàng không hợp lệ
422 error_source_invalid Nguồn vận đơn không hợp lệ
422 error_cod_status_invalid Trạng thái COD không hợp lệ
422 error_merchant_id_invalid ID Đối tác không đúng
422 error_from_warehouse_id_invalid ID Kho lấy hàng không hợp lệ
422 error_route_id_invalid Lượt giao hàng không hợp lệ
422 error_office_id_invalid Bưu cục xuất phát không hợp lệ
422 error_office_id_required Bưu cục xuất phát là bắt buộc
422 error_office_id_to_invalid Bưu cục nhận hàng không hợp lệ
422 error_office_id_to_must_not_be_same_with_office_id Bưu cục nhận hàng không được giống với bưu cục xuất phát
422 error_office_id_to_required_for_internal_type Bưu cục nhận hàng là bắt buộc cho loại vận đơn luân chuyển nội bộ
422 error_shipping_type_id_invalid Loại dịch vụ giao hàng không hợp lệ
422 error_order_shipping_region_invalid Tỉnh / Thành phố không hợp lệ
422 error_order_shipping_sub_region_invalid Quận / Huyện không hợp lệ
422 error_file_id_list_must_be_array file_id_list phải là kiểu mảng (Array)
422 error_file_not_found_{ID} Không tìm thấy file id với ID là {ID}
500 error_add Có lỗi khi thêm vận đơn