Sync Customers, Items and Invoices from Stripe to ERPNext
Warning
This app is still in development and not ready for production use.
You can install this app using the bench CLI:
cd $PATH_TO_YOUR_BENCH
bench get-app $URL_OF_THIS_REPO --branch develop
bench install-app erpnext_stripeThis app only reads from Stripe. When using a restricted API key, enable Read access for:
- Customers
- Products
- Prices
- Tax Rates
Subscribe to the following webhook events in the Stripe Dashboard:
customer.createdcustomer.updatedinvoice.finalizedinvoice.paid
- Open ERPNext Stripe Settings and enter your Stripe API key.
- Click Import > Tax Rates to fetch your Stripe tax rates. Set the ERPNext Account for each rate and save.
- Click Import > Products to import your Stripe products as ERPNext Items.
- Click Import > Customers to import existing Stripe customers as ERPNext Customers.
- Configure the webhook in Stripe Dashboard (the endpoint URL is shown in the settings form). Copy the webhook signing secret into Webhook Secret and save.
Stripe acts as an intermediary bank account. Set up a Bank Account in ERPNext (e.g. "Stripe") with a dedicated GL account and configure it as the Stripe Bank Account in ERPNext Stripe Settings.
Automated by this app:
When a customer pays a Stripe invoice (invoice.paid), the app creates a Payment Entry:
- Debit: Stripe Bank Account
- Credit: Accounts Receivable
Handled manually:
When Stripe pays out to your real bank account, create a Journal Entry:
| Account | Debit | Credit |
|---|---|---|
| Real Bank Account | payout amount | |
| Stripe Bank Account | payout amount |
When Stripe charges fees (deducted from your balance), create a Journal Entry:
| Account | Debit | Credit |
|---|---|---|
| Stripe Fees (Expense) | fee amount | |
| Stripe Bank Account | fee amount |
The Stripe Bank Account balance in ERPNext should match your actual Stripe balance.
Copy Endpoint URL from ERPNext Stripe Settings and use it as the Forward URL in the Stripe CLI:
stripe login
stripe listen --forward-to http://127.0.0.1:8006/api/method/erpnext_stripe.webhook.handler
stripe trigger customer.createdThis app uses pre-commit for code formatting and linting. Please install pre-commit and enable it for this repository:
cd apps/erpnext_stripe
pre-commit installPre-commit is configured to use the following tools for checking and formatting your code:
- ruff
- eslint
- prettier
- pyupgrade
This app can use GitHub Actions for CI. The following workflows are configured:
- CI: Installs this app and runs unit tests on every push to
developbranch. - Linters: Runs Frappe Semgrep Rules and pip-audit on every pull request.
gpl-3.0