Skip to content

[TRI-1642] Add Stripe invoice triggers #747

@matt-aitken

Description

@matt-aitken

How to add a new trigger

  1. Add an event specification for each: https://github.com/triggerdotdev/trigger.dev/blob/main/integrations/stripe/src/events.ts
  2. Add a function for each, referencing the event:
    onPayout(params?: TriggerParams & { events?: PayoutEventNames }) {
  3. Test the trigger works by adding it to the job-catalog, running it and triggering a webhook using Stripe's CLI:

List of events to add:

invoice.created
data.object is an invoice
Occurs whenever a new invoice is created. To learn how webhooks can be used with this event, and how they can affect it, see Using Webhooks with Subscriptions.

invoice.deleted
data.object is an invoice
Occurs whenever a draft invoice is deleted.

invoice.finalization_failed
data.object is an invoice
Occurs whenever a draft invoice cannot be finalized. See the invoice’s last finalization error for details.

invoice.finalized
data.object is an invoice
Occurs whenever a draft invoice is finalized and updated to be an open invoice.

invoice.marked_uncollectible
data.object is an invoice
Occurs whenever an invoice is marked uncollectible.

invoice.paid
data.object is an invoice
Occurs whenever an invoice payment attempt succeeds or an invoice is marked as paid out-of-band.

invoice.payment_action_required
data.object is an invoice
Occurs whenever an invoice payment attempt requires further user action to complete.

invoice.payment_failed
data.object is an invoice
Occurs whenever an invoice payment attempt fails, due either to a declined payment or to the lack of a stored payment method.

invoice.payment_succeeded
data.object is an invoice
Occurs whenever an invoice payment attempt succeeds.

invoice.sent
data.object is an invoice
Occurs whenever an invoice email is sent out.

invoice.upcoming
data.object is an invoice
Occurs X number of days before a subscription is scheduled to create an invoice that is automatically charged—where X is determined by your subscriptions settings. Note: The received Invoice object will not have an invoice ID.

invoice.updated
data.object is an invoice
Occurs whenever an invoice changes (e.g., the invoice amount).

invoice.voided
data.object is an invoice
Occurs whenever an invoice is voided.

invoiceitem.created
data.object is an invoiceitem
Occurs whenever an invoice item is created.

invoiceitem.deleted
data.object is an invoiceitem
Occurs whenever an invoice item is deleted.

TRI-1642

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions