Generate e-commerce orders
The e-commerce example creates one CSV of online retail orders across the United States and Canada, each tied to a customer, a shipping timeline, a payment method and an order amount.
tabalyst generate --example ecommerce -o ecommerce-orders.csvThe file has 15 columns and 20,000 rows by default; --rows changes the count
and --seed the data. The same seed gives the same file.
What the file holds
Section titled “What the file holds”The 15 columns fall into three groups. Orders placed by the same customer share
customer_id, customer_segment, country, state_province and city,
drawn from a pool of 2,000 synthetic customers.
| Group | Columns |
|---|---|
| Order (4) | order_id (ORD-000001, …), order_date, ship_date, delivery_date |
| Customer & geography (5) | customer_id (CUST-00001, …), customer_segment, country, state_province, city |
| Sale (6) | currency, channel, payment_method, category, order_amount, order_status |
Rules tie the columns together. The clean file holds no exception to them:
- Geography (
US80%,CA20%):countryisUSfor about 80% of the customers andCAfor about 20%. Within each country,state_provincefollows population weights across all 50 US states plusDC(for exampleCA,TX,FL,NYlead in the US) and all 13 Canadian provinces and territories (ON~39%,QC~22%,BC~14%,AB~12%). Eachstate_provincepicks from its main cities according to population weights. - Currency:
currencyisUSDwhencountryisUS, andCADwhenCA. - Customer segment:
customer_segmentisReturning(55%),New(30%) orVIP(15%). - Channel and payment:
channelisWeb(62%) orMobile App(38%).Apple Payappears only onMobile Apporders;Credit Card,Debit Card,PayPalandGift Cardappear on both channels. - Categories and order status:
categoryhas six values (Apparel,Home & Kitchen,Electronics,Beauty & Health,Sports & Outdoors,Books & Media).order_statusisDelivered,Shipped,ReturnedorCancelled:Apparelhas a higher return rate (14%) andBooks & Mediaa lower one (2%). - Dates:
order_dateruns from 2022 to2026-09-24with 25% annual growth, exceptShippedorders which are placed between2026-09-25and2026-09-29(in transit at the reference date2026-09-30).ship_dateis one day afterorder_dateand empty whenCancelled.delivery_dateis four days aftership_dateand empty whenCancelledorShipped. - Order amount:
order_amountis drawn from 15 to 1,200 (log-normal draw, median 65), scaled bycategory(Electronics2.6x,Home & Kitchen1.3x,Sports & Outdoors1.2x,Apparel0.9x,Beauty & Health0.7x,Books & Media0.45x) and by the month oforder_date(1.25x in November, 1.35x in December, 0.9x in January, 0.85x in February).
These are synthetic records. Nothing in them comes from an actual store.
Add defects on purpose
Section titled “Add defects on purpose”The dirty_realistic anomaly profile keeps the clean file and writes an altered
copy, a cell change log and a JSON summary (-d is required):
tabalyst generate --example ecommerce --rows 5000 -d ecom-dirty/ --anomaly-profile dirty_realistic| Column | Defect | Rate |
|---|---|---|
order_id | Copied from another row, creating duplicates | 0.5% |
order_date | Written day first, 30-09-2026 | 2% |
country | Replaced by USA (US rows) or Canada (CA rows) | 4% |
city | Written in capitals | 3% |
city | A space added at the end | 3% |
category | Written in lower case | 4% |
payment_method | Emptied | 2% |
order_amount | Written $68.50, with a currency prefix | 2.5% |
order_amount | Written with a decimal comma | 1.5% |
order_amount | Emptied | 1% |
Break the rules on purpose
Section titled “Break the rules on purpose”The rule_breaks profile leaves the formats alone and breaks the rules that tie
the columns together, each change tagged by its class in changes.csv:
tabalyst generate --example ecommerce -d ecom-rules/ --anomaly-profile rule_breaks| Class | What changes | Rate |
|---|---|---|
delivery_before_order | delivery_date set to 2021-01-15 on a Delivered order | 1.5% |
delivered_when_cancelled | delivery_date set to 2026-06-15 on a Cancelled order | 10% |
currency_vs_country | currency set to CAD on a US order | 1% |
state_vs_country | state_province set to QC on a US order | 1% |
apple_pay_on_web | payment_method set to Apple Pay on a Web order | 1.5% |
negative_amount | Minus sign added to order_amount on a Delivered order | 1% |
Next steps
Section titled “Next steps”- Tabalyst Generate explains packages and how to write your own anomaly profile.
- The CLI reference lists every option.
- Generate CRM contacts, Generate computer offers and Generate insurance customers describe the other examples.