Stripe billing operations
v0.2.0Investigate Stripe payment failures, duplicate charges, refunds, recurring billing and disputes, and perform reviewed billing corrections.
python3
Install
emisar pack install
fetches this pack, re-validates it, and verifies its content hash against the
--hash
below — the exact bytes this page was rendered against, so a tampered copy is
rejected — before copying it into the runner's packs dir. The command reloads a
running daemon itself; no manual restart.
sudo emisar pack install stripe --hash sha256:ba0e41749a40f66e5428177c17306d7891c22d11f98122ab1315b0785557963c
Setup
Uses Python 3.10 or newer with its standard library and system CA certificates. Store credentials in the runner's private environment file and allowlist the variables below in
execution.inherit_env
. Every action uses a fixed API operation; credentials and evidence stay out of process arguments.
Environment
Set these on the runner host, then add each name to
execution.inherit_env
so the value reaches the action.
-
STRIPE_API_KEYrequiredCreate a restricted API key in Stripe API keys . Grant read permissions for the billing resources you investigate and write permissions only for enabled corrections; refunds, disputes, files, invoices, subscriptions and customer balance need their corresponding permissions.
-
STRIPE_MODEdefault testUse test or live. Must match the key prefix; every correction explicitly confirms this mode.
-
STRIPE_ACCOUNT_IDOptional connected account acct_ ID. Set this on a dedicated runner when operating a Stripe Connect account; actions cannot change the scope.
-
STRIPE_EVIDENCE_DIROptional absolute directory containing operator-reviewed evidence files readable by the runner. Needed only for evidence_file_info and upload_dispute_file; use regular files, not symlinks.
Notes
- Use customers with an exact email, then follow customer, charge, payment intent, invoice, subscription and refund IDs. Amounts are integer smallest currency units; zero-decimal currencies use whole units.
- Inspect refunds for pending/failure reasons and acquirer references. Refunding a charge leaves its subscription active; cancel separately when that is the intended correction.
- Use preview_invoice for renewal diagnostics. Use preview_credit_note before create_credit_note; allocate a paid portion to customer credit, a new refund, an already-issued refund, or an external refund. Credit-note creation suppresses customer email.
- Stripe REST is pinned to 2026-08-26.dahlia. Event summaries preserve the event's original api_version. Events are available for 30 days; list cursors must be reused with the same filters.
- Every mutating POST requires a stable operation_id. Stripe retains idempotency records for at least 24 hours; preserve identical parameters and reconcile before retrying later. No write retries run automatically. DELETE cancellation has no provider idempotency key.
- Place reviewed evidence in STRIPE_EVIDENCE_DIR, inspect it with evidence_file_info, then approve upload_dispute_file with its SHA256. Upload accepts PDF/JPEG/PNG up to 5 MB. stage_dispute_text and stage_dispute_file always send submit=false. Read evidence before separately approving submit_dispute_evidence.
- Dispute submission checks the reviewed evidence hash before submitting. Stripe has no atomic compare-and-submit; coordinate other evidence writers during that operation. Accepting a dispute forfeits the disputed funds.
- Lists return at most ten projected records per run and pagination.next_cursor. Results exclude raw metadata, client secrets, full card/bank data and signed receipt/invoice URLs. Contact and evidence reads have explicit exposure descriptions.
- Local fixtures verify request contracts and failure handling. Live provider compatibility requires a governed read against the operator's configured Stripe account.
Verify it works
Runs stripe.balance, a low-risk
read that confirms the pack can reach its target. Run it on the host once the pack
is installed; pack install runs it for
you.
sudo emisar pack verify stripe
Install and configure a pack walks through the whole sequence on a host.
Actions 58 total
View on GitHub-
stripe.accept_dispute script high High — service-affecting
Accept a dispute
Close the dispute as lost and accept the disputed amount irreversibly.
View source on GitHub -
stripe.balance script low Low — read-only or trivially reversible
Show available balance
Show available, pending, and Connect-reserved balances separately by currency.
View source on GitHub -
stripe.balance_transaction script low Low — read-only or trivially reversible
Show balance transaction
Show one Stripe balance transaction with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.balance_transactions script low Low — read-only or trivially reversible
List balance transactions
List one page of Stripe balance transactions with linkage, amounts, statuses, and an explicit continuation. Payout filtering applies only to automatic payouts.
View source on GitHub -
stripe.cancel_payment_intent script high High — service-affecting
Cancel a payment intent
Cancel a cancelable payment attempt and release its remaining authorization.
View source on GitHub -
stripe.cancel_refund script high High — service-affecting
Cancel an actionable refund
Cancel one refund only while Stripe reports requires_action. This is not a general undo for completed refunds.
View source on GitHub -
stripe.cancel_subscription script high High — service-affecting
Cancel a subscription immediately
Cancel an existing subscription immediately. Explicit invoice_now and prorate choices can create a final invoice or credit. DELETE has no Stripe idempotency support; inspect state after an uncertain response.
View source on GitHub -
stripe.capture_payment_intent script high High — service-affecting
Capture an authorization
Capture an explicit amount from a PaymentIntent and release any remaining authorization with final_capture=true.
View source on GitHub -
stripe.charge script low Low — read-only or trivially reversible
Show charge
Show one Stripe charge with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.charges script low Low — read-only or trivially reversible
List charges
List one page of Stripe charges with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.create_credit_note script high High — service-affecting
Issue a credit note
Reduce the invoice amount and apply the explicitly approved post-payment credit, refund, or external-refund allocation. Suppresses the credit-note email.
View source on GitHub -
stripe.create_refund script high High — service-affecting
Issue a refund
Refund an explicit amount from one charge to the original payment method. Does not cancel the subscription. A fraudulent reason also adds the card and email to Stripe Radar block lists; Connect flags move additional funds.
View source on GitHub -
stripe.credit_customer_balance script high High — service-affecting
Credit a customer balance
Create an immutable negative adjustment in the customer's invoice balance ledger; the positive approved amount becomes credit toward future invoices.
View source on GitHub -
stripe.credit_note script low Low — read-only or trivially reversible
Show credit note
Show one Stripe credit note with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.credit_notes script low Low — read-only or trivially reversible
List credit notes
List one page of Stripe credit notes with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.customer script medium Medium — changes state, easily reversible
Show customer
Show one Stripe customer with selected diagnostic fields. Includes customer contact details and billing defaults.
View source on GitHub -
stripe.customer_balance_transactions script low Low — read-only or trivially reversible
List customer balance ledger
List one page of customer balance ledger with useful billing links and continuation.
View source on GitHub -
stripe.customers script medium Medium — changes state, easily reversible
List customers
List one page of Stripe customers with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.dispute script low Low — read-only or trivially reversible
Show dispute
Show one Stripe dispute with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.dispute_evidence script high High — service-affecting
Show one dispute evidence field
Show one staged evidence field for review, up to 20000 characters with an explicit truncation flag. May expose sensitive customer evidence.
View source on GitHub -
stripe.disputes script low Low — read-only or trivially reversible
List disputes
List one page of Stripe disputes with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.event script low Low — read-only or trivially reversible
Show event
Show one Stripe event with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.events script low Low — read-only or trivially reversible
List events
List one page of Stripe events with linkage, amounts, statuses, and an explicit continuation. Event summaries retain their original API version and object ID; event payloads may follow an older schema.
View source on GitHub -
stripe.evidence_file_info script low Low — read-only or trivially reversible
Inspect an evidence file
Show the size, type, and SHA256 of a staged PDF, PNG, or JPEG without exposing file contents.
View source on GitHub -
stripe.file script low Low — read-only or trivially reversible
Show evidence file metadata
Show one Stripe evidence file metadata with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.finalize_invoice script high High — service-affecting
Finalize a draft invoice
Finalize one draft invoice with auto_advance=false; inspect the finalized total before separately sending or collecting it.
View source on GitHub -
stripe.invoice script low Low — read-only or trivially reversible
Show invoice
Show one Stripe invoice with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.invoice_lines script medium Medium — changes state, easily reversible
List invoice lines
List one page of invoice lines with useful billing links and continuation.
View source on GitHub -
stripe.invoice_payment script low Low — read-only or trivially reversible
Show invoice payment
Show one Stripe invoice payment with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.invoice_payments script low Low — read-only or trivially reversible
List invoice payments
List one page of invoice payments with useful billing links and continuation.
View source on GitHub -
stripe.invoices script low Low — read-only or trivially reversible
List invoices
List one page of Stripe invoices with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.pause_collection script high High — service-affecting
Pause subscription collection
Pause invoice collection with an explicit treatment of new invoices. Subscription status stays unchanged; existing invoices can continue retrying.
View source on GitHub -
stripe.pay_invoice script high High — service-affecting
Retry invoice collection
Collect the reviewed outstanding invoice balance using its default or explicitly supplied attached payment method; creates a real charge.
View source on GitHub -
stripe.payment_intent script low Low — read-only or trivially reversible
Show payment intent
Show one Stripe payment intent with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.payment_intents script low Low — read-only or trivially reversible
List payment intents
List one page of Stripe payment intents with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.payment_methods script low Low — read-only or trivially reversible
List customer payment methods
List one page of customer payment methods with useful billing links and continuation. Card output is limited to brand, last four digits, expiry, and verification results.
View source on GitHub -
stripe.payout script low Low — read-only or trivially reversible
Show payout
Show one Stripe payout with selected diagnostic fields. Returns identifiers and state without raw metadata, client secrets, or signed URLs.
View source on GitHub -
stripe.payouts script low Low — read-only or trivially reversible
List payouts
List one page of Stripe payouts with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.preview_credit_note script low Low — read-only or trivially reversible
Preview a credit note
Preview a credit note allocation before reducing an invoice or refunding a paid amount. Stripe validates that the dispositions match the post-payment amount.
View source on GitHub -
stripe.preview_invoice script low Low — read-only or trivially reversible
Preview an upcoming invoice
Show the upcoming invoice for an existing subscription without creating a payable invoice.
View source on GitHub -
stripe.record_invoice_payment script high High — service-affecting
Record an external invoice payment
Mark the reviewed invoice as paid outside Stripe. Records external receipt of payment without charging the customer.
View source on GitHub -
stripe.refund script low Low — read-only or trivially reversible
Show refund
Show one Stripe refund with selected diagnostic fields. Includes failure and acquirer-reference details to trace a missing refund.
View source on GitHub -
stripe.refunds script low Low — read-only or trivially reversible
List refunds
List one page of Stripe refunds with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.resume_collection script high High — service-affecting
Resume subscription collection
Clear pause_collection. This resumes collection of future invoices; accumulated drafts need separate handling.
View source on GitHub -
stripe.resume_subscription script high High — service-affecting
Resume a paused subscription
Resume a subscription whose status is paused; this is distinct from clearing pause_collection. Explicitly select the billing-cycle anchor; proration is disabled.
View source on GitHub -
stripe.schedule_subscription_cancel script high High — service-affecting
Schedule subscription cancellation
Cancel the subscription at the current period end; service and billing remain governed by the existing subscription until then.
View source on GitHub -
stripe.send_invoice script high High — service-affecting
Send an invoice
Send the named invoice email to the customer in live mode.
View source on GitHub -
stripe.stage_dispute_file script high High — service-affecting
Stage dispute file evidence
Attach an existing Stripe dispute-evidence file to one named evidence field with submit=false.
View source on GitHub -
stripe.stage_dispute_text script high High — service-affecting
Stage dispute text evidence
Set one named dispute evidence field with submit=false. Review the case before the separate submit_dispute_evidence action.
View source on GitHub -
stripe.submit_dispute_evidence script high High — service-affecting
Submit staged dispute evidence
Submit the currently staged dispute evidence after checking the reviewed evidence hash. The check and submission are separate provider requests; coordinate other evidence writers during submission.
View source on GitHub -
stripe.subscription script low Low — read-only or trivially reversible
Show subscription
Show one Stripe subscription with selected diagnostic fields. Includes ten subscription items and an explicit overflow flag; use subscription_items to continue.
View source on GitHub -
stripe.subscription_items script low Low — read-only or trivially reversible
List subscription items
List one page of subscription items with useful billing links and continuation.
View source on GitHub -
stripe.subscriptions script low Low — read-only or trivially reversible
List subscriptions
List one page of Stripe subscriptions with linkage, amounts, statuses, and an explicit continuation. Retrieve a returned ID for full diagnostics.
View source on GitHub -
stripe.undo_subscription_cancel script high High — service-affecting
Undo scheduled cancellation
Clear cancel_at_period_end on an existing subscription; cannot resurrect a canceled subscription.
View source on GitHub -
stripe.upload_dispute_file script high High — service-affecting
Upload a dispute evidence file
Upload one PDF, PNG, or JPEG of at most 5 MB from STRIPE_EVIDENCE_DIR. Returns its file ID for stage_dispute_file; does not submit the dispute.
View source on GitHub -
stripe.void_credit_note script high High — service-affecting
Void a credit note
Void one eligible credit note; Stripe enforces whether its invoice state permits reversal.
View source on GitHub -
stripe.void_invoice script high High — service-affecting
Void an invoice
Void one invoice irreversibly; the invoice remains in billing history.
View source on GitHub -
stripe.write_off_invoice script high High — service-affecting
Write off an invoice
Mark one invoice uncollectible and recognize the outstanding amount as bad debt.
View source on GitHub