请求描述 温馨提示: 1、请注意必填字段,创建订单时,必填字段未填会报错。 2、如遇到下单被拦截提示报错的情况,请及时反馈飞鸟客服协助处理。 Python_requests请求格式: Code Block |
---|
| import requests
import time
url = "https://test.birdsystem.com/client/Consignment/Post-Pending-Consignment-With-Products-Json"
payload="[\r\n {\r\n \"contact\": \"yuhao\",\r\n \"business_name\": null,\r\n \"address_line1\": \"DPF4\",\r\n \"address_line2\": \"D474\",\r\n \"address_line3\": null,\r\n \"city\": \"Atlanta\",\r\n \"county\": \"Georgia\",\r\n \"post_code\": \"30309\",\r\n \"country_iso\": \"GB\",\r\n \"telephone\": \"01704 226830\",\r\n \"email\": null,\r\n \"delivery_service_id\": \"2709\",\r\n \"sales_reference\": \"2\",\r\n \"sales_order_id\": \"110222319566-0\",\r\n \"special_instruction\": null,\r\n \"products\":[\r\n {\"id\":2685282,\"quantity\":1,\"ebay_transaction_id\":\"ebay_id\",\"ebay_item_no\":\"ebay_product_id\"}\r\n ],\r\n \"sales_order_id\": \"1234567654\",\r\n\r\n \"omp_name\": \"ebay\",\r\n\r\n \"omp_vat_number\": \"239\",\r\n \r\n \"shipper_eori\": \"1616407137\",\r\n \r\n \"reason_for_export\": \"Sale\",\r\n \"content_type\": \"Gift\"\r\n \r\n }\r\n]"
"""data注释"""
#payload="[\r\n {\r\n \"contact\": \"yuhao\",\r\n \"business_name\": null,\r\n \"address_line1\": \"DPF4\",\r\n \"address_line2\": \"D474\",\r\n \"address_line3\": null,\r\n \"city\": \"Atlanta\",\r\n \"county\": \"Georgia\",\r\n \"post_code\": \"30309\",\r\n \"country_iso\": \"GB\",\r\n \"telephone\": \"01704 226830\",\r\n \"email\": null,\r\n \"delivery_service_id\": \"2709\",\r\n \"sales_reference\": \"2\",\r\n \"sales_order_id\": \"110222319566-0\",\r\n \"special_instruction\": null, \r\n \"products\":[\r\n {\"id\":2685282,\"quantity\":1,\"ebay_transaction_id\":\"ebay_id\",\"ebay_item_no\":\"ebay_product_id\"}\r\n ],\r\n \"#\":\" // 新增 销售订单ID 【yodel 出口必填】\",\r\n \"sales_order_id\": \"1234567654\",\r\n \"#\":\"// 新增 销售平台名称 (必须是英文), ebay, amazon 等 【royal mail,yodel 出口必填】\",\r\n \"omp_name\": \"ebay\",\r\n \"#\":\"// 新增 销售平台的vat号 【yodel 出口必填】\",\r\n \"omp_vat_number\": \"617\",\r\n \"#\":\"// 新增 客户的eori号 【royal mail,dpd 出口必填】\",\r\n \"shipper_eori\": \"1616407583\",\r\n \"#\":\"// 新增 出口原因: (Sale:销售; ReturnReplacement:退换; Gift:礼物),【dpd 出口必填】\",\r\n \"reason_for_export\": \"Sale\",\r\n \"#\":\"// 新增 包裹类型: (Gift:礼物;Documents:文件,Other:其他),【royalmail 出口必填】\",\r\n \"content_type\": \"Gift\"\r\n }\r\n]"
headers = {
'company_id': '36',
'api_key': '7a8ec5ff51bc45e26a11a54a755adcd8',
'Content-Type': 'application/json',
'Cookie': 'PHPSESSID=iunfg3velvm9tl67t3mg182lg4'
}
response = requests.request("POST", url, headers=headers, data=payload)
print("url:","\n",response.url)
print("text:","\n",response.text)
print(response.json) |
返回结果: Code Block |
---|
| {
"success": true,
"data": [
{
"id": 2103220360000003,
"company_id": 36,
"client_id": 47,
"warehouse_id": null,
"consignment_product_quantity": "1",
"consignment_product_reference": "2685282",
"delivery_service_id": 2709,
"delivery_service_id_internal": 2709,
"delivery_package_size_id": 617,
"total_price": "0.00",
"total_sales_price": "6.00",
"total_delivery_fee": "0.00",
"total_handling_fee": "0.50",
"length": "0.00",
"width": "0.00",
"depth": "0.00",
"total_weight": "250.00",
"total_volume": "2097152.00",
"total_volume_weight": "2097152.0000",
"total_fee_weight": "250.0000",
"guarantee_percentage": "0.00",
"contact": "yuhao",
"business_name": null,
"address_line1": "DPF4",
"address_line2": "D474",
"address_line3": null,
"city": "Atlanta",
"county": "Georgia",
"post_code": "30309",
"country_iso": "GB",
"telephone": "01704 226830",
"email": null,
"sender_contact": null,
"sender_business_name": null,
"sender_address_line1": null,
"sender_address_line2": null,
"sender_address_line3": null,
"sender_city": null,
"sender_county": null,
"sender_post_code": null,
"sender_country_iso": null,
"sender_email": null,
"sender_telephone": null,
"sales_reference": "2",
"sales_price": "0.000",
"customs_price": "2.000",
"custom_identity_reference": null,
"sales_order_id": 1234567654,
"payment_reference": null,
"delivery_reference": null,
"tracking_reference": null,
"special_instruction": null,
"neighbour_instruction": null,
"omp_name": "ebay",
"omp_vat_number": "527",
"shipper_eori": "1616407132",
"temp_consignment_info_id": null,
"is_urgent": "0",
"is_forced_delivery_service": "0",
"create_time": "2021-03-22 17:58:51",
"finish_time": null,
"arrive_time": null,
"update_time": "2021-03-22 17:58:52",
"type": "LOCAL",
"status": "PENDING",
"stock_status": "ONLY_ORI_STOCK_ENOUGH",
"reason_for_export": "SALE",
"content_type": "GIFT",
"is_hide_delivery_reference_to_consignment": "0",
"delivery_service_is_signature": "0",
"delivery_service_is_tracking": "0"
}
],
"moduleName": "client"
} |
|