Back to prompts
Code18.11.2026
Write a Python Script That Reconciles Your Payment Processor Payouts Against Your Black Friday Orders
#python#black friday#reconciliation#payouts#ecommerce#accounting#small business
You are a careful Python developer who helps small online stores check their money after busy sales weekends. After Black Friday and Cyber Monday, I want to confirm that every paid order in my store export shows up in my payment processor's payout reports, that fees and refunds make sense, and that nothing is missing or counted twice. The script must work only on CSV files I export myself. It must not call any API, must not need my passwords or keys, and must never change the original files. If anything about my export format is unclear, mark it [NEEDS INPUT] instead of guessing column names. Store platform and the orders CSV columns I have (order id, created time, status, total, currency, payment reference or transaction id, refunds): [ORDERS CSV] Payment processor and the payout or balance transaction CSV columns I have (transaction id, type, gross, fee, net, currency, payout id, payout date): [PAYOUT CSV] Date range to check, and the time zone each file uses: [DATE RANGE AND TIME ZONES] How orders and processor transactions are linked (a shared transaction id, an order number in a metadata column, or only amount and time): [MATCH KEY] Currencies involved: [CURRENCIES] Python version and whether I can install pandas: [PYTHON SETUP] Requirements: 1. Restate both CSV layouts in a short table and list every assumption I must confirm before running the script. 2. Write one script that loads both files read only, normalizes time zones and amounts, and matches orders to processor transactions using [MATCH KEY]. If only amount and time are available, use a narrow time window and clearly mark those matches as weaker. 3. Produce four output CSVs in a new folder: matched, orders with no processor transaction, processor transactions with no order, and amount mismatches with the difference shown. 4. Treat refunds, partial refunds, and disputes as their own rows. Never net them silently against sales. 5. Never add amounts from different [CURRENCIES] together. Report totals per currency. 6. Print a short summary: counts and totals per group, total fees, and the net amount I should expect across the payouts in [DATE RANGE AND TIME ZONES]. 7. Comment the code in plain language and include instructions to run it, plus a small fake sample of each CSV so I can test it before using real data. 8. List 3 common reasons for mismatches (payouts that land days later, fees taken separately, orders paid with gift cards or a second payment method) and how to check each one. 9. Remind me that this is a check, not accounting advice, and that my accountant or bookkeeper should confirm how to record fees and refunds. Deliverables: 1. Assumptions to confirm 2. Full Python script 3. Sample test CSVs 4. Output file descriptions 5. Mismatch troubleshooting list
How to use this prompt
- 1Copy the prompt using the button above.
- 2Open your AI tool (ChatGPT, Claude, Midjourney, etc.)
- 3Paste and customize any variables in the prompt.
- 4Generate your result.
Tip
Fill every placeholder before you run the prompt. Keep one clear goal per run, then refine with a follow-up if needed.
When to use this prompt
- •Good for first drafts in Code
- •Keep variables filled so the model has enough context
- •Review AI output before sending or publishing