上传文件到销售税分析 API
可以用 URLRead 上传文件到网络服务器.
创建云对象,分析一个网络零售商的销售税报告.
显示完整的 Wolfram 语言输入
访问 https://www.amazon.com/gp/b2b/reports 去运行一个时间段内的订单报告. 下载 CSV 文件. 或者用演示数据创建文件.
In[2]:=
Export["orders.csv",
"Order Date,Order ID,Payment Instrument Type,Website,Purchase Order \
Number,Ordering Customer Email,Shipment Date,Shipping Address \
Name,Shipping Address Street 1,Shipping Address Street 2,Shipping \
Address City,Shipping Address State,Shipping Address Zip,Order \
Status,Carrier Name & Tracking Number,Subtotal,Shipping Charge,Tax \
Before Promotions,Total Promotions,Tax Charged,Total Charged,Buyer \
Name,Group Name
01/12/16,610,Visa - \
2493,Amazon.com,,customer@example.com,01/14/16,Alf B. Charlie,34 W \
Reindeer Tr,,Slaterock,KS,66083,Shipped,SUREPOST(1ZW532553XVFG),$36.\
11,$5.55,$0.00,$5.55,$0.00,$36.11,Alf B. Charlie,none
01/22/16,111,Visa - \
2493,Amazon.com,,customer@example.com,01/23/16,Alf B. Charlie,34 W \
Reindeer Tr,,Slaterock,KS,66083,Shipped,QUICKSHIP(28zvW),$215.90,$3.\
86,$0.00,$3.86,$0.00,$215.90,Alf B. Charlie,none
03/07/16,729,Visa - \
0832,Amazon.com,,customer@example.com,03/07/16,Alf B. Charlie,34 W \
Reindeer Tr,,Slaterock,KS,66083,Shipped,QUIKSHIP(29xcdQ),$48.95,$3.86,\
$4.28,$3.86,$4.28,$48.95,Alf B. Charlie,none
08/25/16,729,Visa - \
0832,Amazon.com,,customer@example.com,08/25/16,Alf B. Charlie,34 W \
Reindeer Tr,,Slaterock,KS,66083,Shipped,QUIKSHIP(53fGkM),$69.48,$3.86,\
$6.08,$3.86,$6.08,$69.48,Alf B. Charlie,none", "Text"]
Out[2]=
调用该报告 API,通过上传订单数据文件提供输入.
In[3]:=
URLRead[HTTPRequest[
orders, <|"Body" -> {"orders" -> File["orders.csv"]}|>], "Body"]
Out[3]=