Skip to content

two-inc/internal-scripts

Repository files navigation

Two Internal Scripts

Utility scripts for operations and credit management at Two.


Scripts

Folder Description
bulk_credit_check/ Bulk-check credit decisions and limits for a list of companies against a merchant
bespoke_credit_limit/ Submit bespoke credit limit requests in bulk via the admin API
bulk_invoice_download/ Download invoice or credit note PDFs in bulk and zip them

See the README in each folder for setup and usage instructions.


Setup

All scripts share the same dependencies. From the repo root:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

Getting your session cookie

All scripts authenticate with your admin session cookie:

  1. Log in to the Two admin portal
  2. Open browser DevTools → ApplicationCookies
  3. Copy the value of two-inc-cookie
  4. Paste it into the COOKIE variable at the top (or bottom) of the script

Important notes

  • Never commit real company data. Input/output CSVs are gitignored. Use the *_template.csv files as a reference.
  • Session cookies expire. If you get 401 errors, refresh your cookie from DevTools.
  • Rate limiting. Scripts include a small delay between requests. Increase it if you hit rate limit errors.
  • Staging vs production. Double-check BASE_URL / API_URL before running against production.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages