Upload Files to a Sales Tax Analysis API
You can upload files to a web server using URLRead.
Create a cloud object that analyzes a sales tax report from an online retailer.
show complete Wolfram Language input
Visit https://www.amazon.com/gp/b2b/reports to run a report on orders for a time range. Download the CSV file. Or create a file with demonstration data.
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]=
Call the report API, providing input by uploading the orders data file.
In[3]:=
URLRead[HTTPRequest[
orders, <|"Body" -> {"orders" -> File["orders.csv"]}|>], "Body"]
Out[3]=