API tạo đơn hàng
Nhập đơn hàng từ file CSV
API : /api/integration/orders/import.json
Method: POST
Request Header
| key | value |
|---|---|
| X-pawdo-access-token | API KEY |
Request body
| key | type |
|---|---|
| order_name | string |
| name | string |
| quantity | uint64 |
| mockup1 | string |
| mockup2 | string |
| mockup3 | string |
| mockup4 | string |
| design1 | string |
| design2 | string |
| design3 | string |
| design4 | string |
| string | |
| address1 | string |
| address2 | string |
| city | string |
| country | string |
| full_name | string |
| phone | string |
| province | string |
| zip | string |
| company | string |
| province_code | string |
| ioss_num | string |
| sku_code | string |
| properties | string |
| variant_id | string |
| variant_option1 | string |
| variant_option2 | string |
| variant_option3 | string |
| financial_status | string |
| shipping_line | string |
| note | string |
| resource | string |
Example
json
{
"data": [
{
"mockup1": "https://example.com/mockup1.jpg",
"mockup2": "https://example.com/mockup2.jpg",
"mockup3": "https://example.com/mockup3.jpg",
"mockup4": "https://example.com/mockup4.jpg",
"design1": "https://example.com/design1.jpg",
"design2": "https://example.com/design2.jpg",
"design3": "https://example.com/design3.jpg",
"design4": "https://example.com/design4.jpg",
"order_number": "ORDER-10001",
"type": "tshirt",
"title": "Custom T-Shirt",
"sku": "TS-RED-M",
"system_sku": "SYS-TS-0001",
"quantity": 2,
"tag": "summer-collection",
"option1": "Red",
"option2": "Medium",
"option3": "Cotton",
"name": "Nguyen Van A",
"option_ship": "standard",
"label_ship": "https://example.pdf",
"address1": "123 Nguyen Trai",
"address2": "Ward 5",
"city": "Ho Chi Minh",
"state": "District 1",
"province_code": "HCM",
"country": "Vietnam",
"country_code": "VN",
"postal_code": "700000",
"email": "[email protected]",
"phone": "012345678",
"tax": 1.5,
"thank_card": "Yes",
"brand_kit_a5": "Included",
"brand_kit_a5_clothes": "Included",
"brand_kit_a6": "Not Included",
"note": "Please print logo on front side.",
"external_transaction_id": "TXN-123456789",
"reference_id2": "REF-ABC-001"
}
],
"note": ""
}Example (Response)
Trường hợp tất cả đơn hợp lệ:
json
{
"status": true,
"data": {
"total": 1,
"valid": 1,
"invalid": 0,
"invalid_orders": []
}
}Trường hợp có đơn hàng không hợp lệ:
json
{
"status": true,
"data": {
"total": 2,
"valid": 1,
"invalid": 1,
"invalid_orders": [
{
"mockup1": "https://example.com/mockup1.jpg",
"order_number": "ORDER-10002",
"type": "tshirt",
"title": "Custom T-Shirt",
"sku": "TS-RED-M",
"system_sku": "SYS-TS-0001",
"quantity": 1,
"tag": "summer-collection",
"option1": "Red",
"option2": "Medium",
"option3": "Cotton",
"name": "Nguyen Van B",
"option_ship": "standard",
"label_ship": "",
"address1": "123 Nguyen Trai",
"address2": "",
"city": "Ho Chi Minh",
"state": "District 1",
"province_code": "",
"country": "Vietnam",
"country_code": "VN",
"postal_code": "700000",
"email": "[email protected]",
"phone": "012345678",
"tax": 0,
"thank_card": "",
"brand_kit_a5": "",
"brand_kit_a5_clothes": "",
"brand_kit_a6": "",
"note": "",
"external_transaction_id": "",
"reference_id2": "",
"error": "Invalid data: ProvinceCode is required"
}
]
}
}- Sau khi tạo đơn hàng thành công, người dùng vào giao diện Danh sách đơn hàng để kiểm tra thông tin
- Hoặc sử dụng api dưới đây để lấy danh sách thông tin order
Tạo đơn hàng thủ công
API : /api/integration/orders.json
Method: POST
Request Header
| key | value |
|---|---|
| X-pawdo-access-token | API KEY |
Request Body (JSON - raw)
- Content-Type: application/json
| key | type | required | note |
|---|---|---|---|
| order_number | string | Required | Mã đơn hàng, phải unique |
| external_transaction_id | string | Optional | ID giao dịch từ hệ thống ngoài |
| skip_verify_address | boolean | Optional | Bỏ qua bước verify địa chỉ |
| line_items | array object | Required | Danh sách sản phẩm, tối đa 500 items |
| address | object | Required | Thông tin địa chỉ giao hàng |
Chi tiết field
address
| key | type | required | note |
|---|---|---|---|
| name | string | Required | Tên người nhận |
| option_ship | string | Required | Phương thức vận chuyển: standard, express, fast, tiktok |
| label_ship | url | Conditional | Nhãn giao hàng: Bắt buộc cho option tiktok |
| address1 | string | Optional | Địa chỉ dòng 1 |
| address2 | string | Optional | Địa chỉ dòng 2 |
| city | string | Optional | Thành phố |
| state | string | Optional | Bang /Tỉnh |
| province_code | string | Optional | Mã bang / tỉnh |
| country | string | Optional | Quốc gia |
| country_code | string | Required | Mã quốc gia (ISO) |
| postal_code | string | Optional | Mã bưu điện |
| string | Optional | Email người nhận | |
| phone | string | Optional | Số điện thoại |
line_items
| key | type | required | note |
|---|---|---|---|
| sku | string | Optional | SKU từ hệ thống ngoài |
| system_sku | string | Optional | SKU nội bộ hệ thống |
| quantity | number | Required | min > 0 và max < 1000 |
| title | string | Optional | Tên sản phẩm |
| note | string | Optional | Ghi chú |
| mockup1..mockup4 | url | Optional | URL hình mockup |
| design1..design4 | url | Optional | URL file thiết kế |
| option1..option3 | string | Optional | Tùy chọn sản phẩm |
| external_line_item_id | string | Optional | ID line item từ hệ thống ngoài |
Ràng buộc / Validation
| key | rule |
|---|---|
| order_number | Phải unique, dùng như idempotency key |
| line_items | Tối đa 500 items |
| line_items[].quantity | min > 0 và max < 1000 |
Example (Request)
json
{
"order_number": "#ORDER-056487",
"external_transaction_id": "TS-9283023921",
"skip_verify_address": true,
"line_items": [
{
"sku": "QTR-XS2",
"system_sku": "QTR-XS2",
"quantity": 5,
"title": "",
"note": "",
"mockup1": "https://example.com/mockup1.png",
"mockup2": "",
"mockup3": "",
"mockup4": "",
"design1": "https://example.com/design1.png",
"design2": "",
"design3": "",
"design4": "",
"option1": "",
"option2": "",
"option3": "",
"external_line_item_id": "LI-1048273842"
}
],
"address": {
"name": "John Doe",
"option_ship": "standard",
"label_ship": "",
"address1": "123 Main Street",
"address2": "Apartment 4B",
"city": "Los Angeles",
"province_code": "CA",
"country": "United States",
"country_code": "US",
"postal_code": "90001",
"email": "[email protected]",
"phone": ""
}
}Example (Response thành công)
json
{
"data": {
"order_id": "d33e0745-***-9fb1-01ac3e5135c3"
},
"message": "ok",
"status": true
}Nếu có bất kỳ vấn đề nào liên quan đến api đơn hàng, vui lòng liên hệ với bộ phận support của Pawdo qua Facebook để được hỗ trợ.