README

De SILADEL
Aller à : navigation, rechercher

STRIPEACCOUNTING FOR Dolibarr ERP CRM

StripeAccounting reconciles real Stripe movements — per-transaction and subscription/service fees, refunds, disputes (chargebacks) and payouts — with Dolibarr's Stripe intermediary financial account, and automatically generates the missing entries or bank movements.

This module is complementary to the official Stripe module: it never creates payments, invoices, checkout sessions or payment webhooks. It only reads the Stripe API and posts the accounting entries the official module doesn't cover.

How it works

  1. The module pulls Stripe's Balance Transactions, Charges, Refunds, Disputes and Payouts through the Stripe API, reusing the API key and mode (test/live) already configured by the official Stripe module.
  2. Every Stripe object is stored once in its own table (llx_stripeaccounting_transaction), keyed by its Stripe id, so a transaction is never processed twice even if the sync runs repeatedly.
  3. For each new object, the matching accounting treatment is triggered automatically:
  • Per-transaction fees and subscription/service fees (Radar, Billing, Connect...):
    The module creates the matching bank movement on the Stripe account (with its accounting counterpart already set), but does not post the ledger entry itself.
    Dolibarr's own native "Transfer to accounting" button generates it afterwards, exactly like any other bank movement.
    Exception: under French VAT mode, the full entry (fee + VAT) is still posted directly by the module, with no dedicated bank movement.
  • Payouts:
    The module creates a real internal bank transfer between the Stripe account and the main bank account.
    Dolibarr's native transfer-to-accounting step posts the entry on both sides.
  • Refunds:
    Reverse the original charge's entry when the related invoice/payment can be traced back.
    Otherwise the transaction is flagged for manual review instead of guessing an account.
  • Disputes / chargebacks:
    The disputed amount is posted immediately to a dedicated loss account, plus the dispute's own Stripe fee.
  • Stripe balance corrections (adjustment, an automatic refund after a payment ultimately failed):
    Recorded so they stay visible, but never posted automatically — their sign and cause vary too much to be posted reliably without human review.
  • Optional VAT handling on fees:
    No VAT, French VAT, or intracommunity reverse charge.
    The reverse charge mode posts a symmetric, zero-net VAT pair immediately.
  1. A dashboard shows:
    • Stripe balance
    • unreconciled transactions
    • monthly fees
    • pending payouts
    • manual "Sync now" action
  1. A cron job runs the same reconciliation on a schedule.
  1. For a Stripe account not connected through the API (for example another storefront with its own merchant account), a CSV import page processes Stripe's "Balance history" export (one file covering every movement type) under the same idempotency guarantees.
    The import button stays disabled until the minimal configuration is complete, exactly like the sync button.

Setup

Home > Setup > Modules > StripeAccounting

  • Stripe financial account and Main bank account
    Editable selectors that write directly to the official Stripe module's own constants (no local copy, so no risk of drift).
  • Fees account
    Accounting account for Stripe commissions (example: 627xxx).
  • Disputes account
    Accounting account for chargeback losses (example: 658xxx).
  • Stripe supplier thirdparty
    Used to post subscription/service fees (Radar, Billing...) against this thirdparty's own supplier accounting code.
  • VAT mode
    None, French VAT, or intracommunity reverse charge, with a configurable rate.
  • Sync frequency
    How often the scheduled job runs.

The module refuses to run any synchronization while the minimal configuration above is incomplete — it aborts up-front rather than posting partial or guessed entries.

⚠️ Warning

Do not enable "Enable the auto recording of Stripe payouts" on the official Stripe module's setup page (Setup > Modules > Stripe).

It makes the official module's own webhook create a bank movement for every Stripe payout — exactly what this module already does, but without any idempotency of its own.

Having both mechanisms enabled at once would each create their own bank movement for the same payout, resulting in a duplicate.

Scheduled task (cron)

Activating the module registers a scheduled job (StripeAccountingSync) in:

Home > Setup > Modules > Scheduled jobs

However, two things are required for it to actually run unattended:

1. Enable the job

Dolibarr creates it disabled by default.

Open it from the scheduled jobs list and tick Active.

2. Trigger Dolibarr's scheduler periodically

Nothing calls it automatically.

You need an external cron hitting one of the following:

Module standalone CLI script:

*/15 * * * * php /path/to/htdocs/custom/stripeaccounting/cron/stripe_sync.php >> /var/log/stripeaccounting.log 2>&1

Dolibarr generic URL-based job runner:

*/15 * * * * curl "https://your-dolibarr-url/public/cron/cron_run_jobs_by_url.php?securitykey=YOUR_KEY&userlogin=YOUR_LOGIN"

Without one of these two crontab entries, synchronization only happens when someone clicks "Sync now" on the dashboard.

Requirements

  • Dolibarr 17+
  • PHP 7.2 to 8.5 (no syntax specific to a recent PHP version is used, to stay compatible across that whole range)
  • Official Stripe module enabled and configured:
    • API keys
    • financial account
  • Double-entry Accounting module, for the llx_accounting_bookkeeping table

Credits

StripeAccounting is developed and maintained by SILADEL.

License

GPL v3 or any later version.

SILADEL

SILADEL 7 ch des coquelicots 81990 Cambon France

E-mail: info@siladel.fr

Website: www.siladel.fr

Documentation

Support request

Support request


SILADEL


Developed by SILADEL — Author: IGREJA David