Class Event
- All Implemented Interfaces:
HasId,StripeActiveObject,StripeObjectInterface
Event object that contains all
the relevant information associated with that action, including the affected API resource. For
example, a successful payment triggers a charge.succeeded event, which contains the
Charge in the event's data property. Some actions trigger multiple events. For example,
if you create a new subscription for a customer, it triggers both a
customer.subscription.created event and a charge.succeeded event.
Configure an event destination in your account to listen for events that represent actions your integration needs to respond to. Additionally, you can retrieve an individual event or a list of events from the API.
Connect platforms can also receive event notifications that occur in their connected accounts. These events include an account attribute that identifies the relevant connected account.
You can access events through the Retrieve Event API for 30 days.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFor more details about Data, please refer to the API Reference.static classFor more details about Reason, please refer to the API Reference.static classFor more details about Request, please refer to the API Reference.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanThe connected account that originates the event.The Stripe API version used to renderdatawhen the event was created.Authentication context needed to fetch the event or related object.Time at which the object was created.getData()Get deserialization helper to handle failure due to schema incompatibility.getId()Unique identifier for the object.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.String representing the object's type.Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify.Information about the action that causes the event.Information on the API request that triggers the event.getType()Description of the event (for example,invoice.createdorcharge.refunded).inthashCode()static EventCollectionlist(EventListParams params) List events, going back up to 30 days.static EventCollectionlist(EventListParams params, RequestOptions options) List events, going back up to 30 days.static EventCollectionList events, going back up to 30 days.static EventCollectionlist(Map<String, Object> params, RequestOptions options) List events, going back up to 30 days.static EventRetrieves the details of an event if it was created in the last 30 days.static Eventretrieve(String id, RequestOptions options) Retrieves the details of an event if it was created in the last 30 days.static Eventretrieve(String id, EventRetrieveParams params, RequestOptions options) Retrieves the details of an event if it was created in the last 30 days.static EventRetrieves the details of an event if it was created in the last 30 days.voidsetAccount(String account) The connected account that originates the event.voidsetApiVersion(String apiVersion) The Stripe API version used to renderdatawhen the event was created.voidsetContext(String context) Authentication context needed to fetch the event or related object.voidsetCreated(Long created) Time at which the object was created.voidsetData(Event.Data data) voidUnique identifier for the object.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidString representing the object's type.voidsetPendingWebhooks(Long pendingWebhooks) Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify.voidsetReason(Event.Reason reason) Information about the action that causes the event.voidsetRequest(Event.Request request) Information on the API request that triggers the event.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidDescription of the event (for example,invoice.createdorcharge.refunded).Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
Event
public Event()
-
-
Method Details
-
list
List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in event objectapi_versionattribute (not according to your current Stripe API version orStripe-Versionheader).- Throws:
StripeException
-
list
public static EventCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionList events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in event objectapi_versionattribute (not according to your current Stripe API version orStripe-Versionheader).- Throws:
StripeException
-
list
List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in event objectapi_versionattribute (not according to your current Stripe API version orStripe-Versionheader).- Throws:
StripeException
-
list
public static EventCollection list(EventListParams params, RequestOptions options) throws StripeException List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in event objectapi_versionattribute (not according to your current Stripe API version orStripe-Versionheader).- Throws:
StripeException
-
retrieve
Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook.- Throws:
StripeException
-
retrieve
Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook.- Throws:
StripeException
-
retrieve
public static Event retrieve(String id, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook.- Throws:
StripeException
-
retrieve
public static Event retrieve(String id, EventRetrieveParams params, RequestOptions options) throws StripeException Retrieves the details of an event if it was created in the last 30 days. Supply the unique identifier of the event, which you might have received in a webhook.- Throws:
StripeException
-
getDataObjectDeserializer
Get deserialization helper to handle failure due to schema incompatibility. When event API version matches that of the library's pinned version, the following integration pattern is safe.Event event = getEvent(); // either from webhook or event endpoint EventDataObjectDeserializer deserializer = event.getDataObjectDeserializer(); Optional<StripeObject> stripeObject = deserializer.getObject();
You can ensure that webhook events has the same API version by creating webhook endpoint specifying api version](https://stripe.com/docs/api/webhook_endpoints/create) asStripe.API_VERSION. For reading from old webhook endpoints or old events with potential schema incompatibility, seeEventDataObjectDeserializer.deserialize()andEventDataObjectDeserializer.deserializeUnsafe(). -
setResponseGetter
Description copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getAccount
The connected account that originates the event. -
getApiVersion
The Stripe API version used to renderdatawhen the event was created. The contents ofdatanever change, so this value remains static regardless of the API version currently in use. This property is populated only for events created on or after October 31, 2014. -
getContext
Authentication context needed to fetch the event or related object. -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getData
-
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
event. -
getPendingWebhooks
Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. -
getReason
Information about the action that causes the event. Only present when the event is triggered by an API request or an Automation action. -
getRequest
Information on the API request that triggers the event. -
getType
Description of the event (for example,invoice.createdorcharge.refunded).One of
account.application.authorized,account.application.deauthorized,account.external_account.created,account.external_account.deleted,account.external_account.updated,account.updated,account_notice.created,account_notice.updated,application_fee.created,application_fee.refund.updated,application_fee.refunded,balance.available,balance_settings.updated,billing.alert.triggered,billing_portal.configuration.created,billing_portal.configuration.updated,billing_portal.session.created,capability.updated,capital.financing_offer.accepted,capital.financing_offer.canceled,capital.financing_offer.created,capital.financing_offer.expired,capital.financing_offer.fully_repaid,capital.financing_offer.paid_out,capital.financing_offer.rejected,capital.financing_offer.replacement_created,capital.financing_transaction.created,cash_balance.funds_available,charge.captured,charge.dispute.closed,charge.dispute.created,charge.dispute.funds_reinstated,charge.dispute.funds_withdrawn,charge.dispute.updated,charge.expired,charge.failed,charge.pending,charge.refund.updated,charge.refunded,charge.succeeded,charge.updated,checkout.session.async_payment_failed,checkout.session.async_payment_succeeded,checkout.session.completed,checkout.session.expired,climate.order.canceled,climate.order.created,climate.order.delayed,climate.order.delivered,climate.order.product_substituted,climate.product.created,climate.product.pricing_updated,coupon.created,coupon.deleted,coupon.updated,credit_note.created,credit_note.updated,credit_note.voided,customer.created,customer.deleted,customer.discount.created,customer.discount.deleted,customer.discount.updated,customer.source.created,customer.source.deleted,customer.source.expiring,customer.source.updated,customer.subscription.collection_paused,customer.subscription.collection_resumed,customer.subscription.created,customer.subscription.custom_event,customer.subscription.deleted,customer.subscription.paused,customer.subscription.pending_update_applied,customer.subscription.pending_update_expired,customer.subscription.price_migration_failed,customer.subscription.resumed,customer.subscription.trial_will_end,customer.subscription.updated,customer.tax_id.created,customer.tax_id.deleted,customer.tax_id.updated,customer.updated,customer_cash_balance_transaction.created,entitlements.active_entitlement_summary.updated,file.created,financial_connections.account.created,financial_connections.account.deactivated,financial_connections.account.disconnected,financial_connections.account.reactivated,financial_connections.account.refreshed_balance,financial_connections.account.refreshed_inferred_balances,financial_connections.account.refreshed_ownership,financial_connections.account.refreshed_transactions,financial_connections.session.updated,fx_quote.expired,identity.verification_session.canceled,identity.verification_session.created,identity.verification_session.processing,identity.verification_session.redacted,identity.verification_session.requires_input,identity.verification_session.verified,invoice.created,invoice.deleted,invoice.finalization_failed,invoice.finalized,invoice.marked_uncollectible,invoice.overdue,invoice.overpaid,invoice.paid,invoice.payment.overpaid,invoice.payment_action_required,invoice.payment_attempt_required,invoice.payment_failed,invoice.payment_succeeded,invoice.sent,invoice.upcoming,invoice.updated,invoice.voided,invoice.will_be_due,invoice_payment.paid,invoiceitem.created,invoiceitem.deleted,issuing_authorization.created,issuing_authorization.request,issuing_authorization.updated,issuing_card.created,issuing_card.updated,issuing_cardholder.created,issuing_cardholder.updated,issuing_dispute.closed,issuing_dispute.created,issuing_dispute.funds_reinstated,issuing_dispute.funds_rescinded,issuing_dispute.submitted,issuing_dispute.updated,issuing_dispute_settlement_detail.created,issuing_dispute_settlement_detail.updated,issuing_fraud_liability_debit.created,issuing_personalization_design.activated,issuing_personalization_design.deactivated,issuing_personalization_design.rejected,issuing_personalization_design.updated,issuing_settlement.created,issuing_settlement.updated,issuing_token.created,issuing_token.updated,issuing_transaction.created,issuing_transaction.purchase_details_receipt_updated,issuing_transaction.updated,mandate.updated,payment_intent.amount_capturable_updated,payment_intent.canceled,payment_intent.created,payment_intent.partially_funded,payment_intent.payment_failed,payment_intent.processing,payment_intent.requires_action,payment_intent.succeeded,payment_link.created,payment_link.updated,payment_method.attached,payment_method.automatically_updated,payment_method.detached,payment_method.updated,payout.canceled,payout.created,payout.failed,payout.paid,payout.reconciliation_completed,payout.updated,person.created,person.deleted,person.updated,plan.created,plan.deleted,plan.updated,price.created,price.deleted,price.updated,privacy.redaction_job.canceled,privacy.redaction_job.created,privacy.redaction_job.ready,privacy.redaction_job.succeeded,privacy.redaction_job.validation_error,product.created,product.deleted,product.updated,promotion_code.created,promotion_code.updated,quote.accept_failed,quote.accepted,quote.accepting,quote.canceled,quote.created,quote.draft,quote.finalized,quote.reestimate_failed,quote.reestimated,quote.stale,radar.early_fraud_warning.created,radar.early_fraud_warning.updated,refund.created,refund.failed,refund.updated,reporting.report_run.failed,reporting.report_run.succeeded,reporting.report_type.updated,review.closed,review.opened,setup_intent.canceled,setup_intent.created,setup_intent.requires_action,setup_intent.setup_failed,setup_intent.succeeded,sigma.scheduled_query_run.created,source.canceled,source.chargeable,source.failed,source.mandate_notification,source.refund_attributes_required,source.transaction.created,source.transaction.updated,subscription_schedule.aborted,subscription_schedule.canceled,subscription_schedule.completed,subscription_schedule.created,subscription_schedule.expiring,subscription_schedule.price_migration_failed,subscription_schedule.released,subscription_schedule.updated,tax.form.updated,tax.settings.updated,tax_rate.created,tax_rate.updated,terminal.reader.action_failed,terminal.reader.action_succeeded,terminal.reader.action_updated,test_helpers.test_clock.advancing,test_helpers.test_clock.created,test_helpers.test_clock.deleted,test_helpers.test_clock.internal_failure,test_helpers.test_clock.ready,topup.canceled,topup.created,topup.failed,topup.reversed,topup.succeeded,transfer.created,transfer.reversed,transfer.updated,treasury.credit_reversal.created,treasury.credit_reversal.posted,treasury.debit_reversal.completed,treasury.debit_reversal.created,treasury.debit_reversal.initial_credit_granted,treasury.financial_account.closed,treasury.financial_account.created,treasury.financial_account.features_status_updated,treasury.inbound_transfer.canceled,treasury.inbound_transfer.created,treasury.inbound_transfer.failed,treasury.inbound_transfer.succeeded,treasury.outbound_payment.canceled,treasury.outbound_payment.created,treasury.outbound_payment.expected_arrival_date_updated,treasury.outbound_payment.failed,treasury.outbound_payment.posted,treasury.outbound_payment.returned,treasury.outbound_payment.tracking_details_updated,treasury.outbound_transfer.canceled,treasury.outbound_transfer.created,treasury.outbound_transfer.expected_arrival_date_updated,treasury.outbound_transfer.failed,treasury.outbound_transfer.posted,treasury.outbound_transfer.returned,treasury.outbound_transfer.tracking_details_updated,treasury.received_credit.created,treasury.received_credit.failed,treasury.received_credit.succeeded,treasury.received_debit.created,billing.credit_balance_transaction.created,billing.credit_grant.created,billing.credit_grant.updated,billing.meter.created,billing.meter.deactivated,billing.meter.reactivated, orbilling.meter.updated. -
setAccount
The connected account that originates the event. -
setApiVersion
The Stripe API version used to renderdatawhen the event was created. The contents ofdatanever change, so this value remains static regardless of the API version currently in use. This property is populated only for events created on or after October 31, 2014. -
setContext
Authentication context needed to fetch the event or related object. -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setData
-
setId
Unique identifier for the object. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
event. -
setPendingWebhooks
Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. -
setReason
Information about the action that causes the event. Only present when the event is triggered by an API request or an Automation action. -
setRequest
Information on the API request that triggers the event. -
setType
Description of the event (for example,invoice.createdorcharge.refunded).One of
account.application.authorized,account.application.deauthorized,account.external_account.created,account.external_account.deleted,account.external_account.updated,account.updated,account_notice.created,account_notice.updated,application_fee.created,application_fee.refund.updated,application_fee.refunded,balance.available,balance_settings.updated,billing.alert.triggered,billing_portal.configuration.created,billing_portal.configuration.updated,billing_portal.session.created,capability.updated,capital.financing_offer.accepted,capital.financing_offer.canceled,capital.financing_offer.created,capital.financing_offer.expired,capital.financing_offer.fully_repaid,capital.financing_offer.paid_out,capital.financing_offer.rejected,capital.financing_offer.replacement_created,capital.financing_transaction.created,cash_balance.funds_available,charge.captured,charge.dispute.closed,charge.dispute.created,charge.dispute.funds_reinstated,charge.dispute.funds_withdrawn,charge.dispute.updated,charge.expired,charge.failed,charge.pending,charge.refund.updated,charge.refunded,charge.succeeded,charge.updated,checkout.session.async_payment_failed,checkout.session.async_payment_succeeded,checkout.session.completed,checkout.session.expired,climate.order.canceled,climate.order.created,climate.order.delayed,climate.order.delivered,climate.order.product_substituted,climate.product.created,climate.product.pricing_updated,coupon.created,coupon.deleted,coupon.updated,credit_note.created,credit_note.updated,credit_note.voided,customer.created,customer.deleted,customer.discount.created,customer.discount.deleted,customer.discount.updated,customer.source.created,customer.source.deleted,customer.source.expiring,customer.source.updated,customer.subscription.collection_paused,customer.subscription.collection_resumed,customer.subscription.created,customer.subscription.custom_event,customer.subscription.deleted,customer.subscription.paused,customer.subscription.pending_update_applied,customer.subscription.pending_update_expired,customer.subscription.price_migration_failed,customer.subscription.resumed,customer.subscription.trial_will_end,customer.subscription.updated,customer.tax_id.created,customer.tax_id.deleted,customer.tax_id.updated,customer.updated,customer_cash_balance_transaction.created,entitlements.active_entitlement_summary.updated,file.created,financial_connections.account.created,financial_connections.account.deactivated,financial_connections.account.disconnected,financial_connections.account.reactivated,financial_connections.account.refreshed_balance,financial_connections.account.refreshed_inferred_balances,financial_connections.account.refreshed_ownership,financial_connections.account.refreshed_transactions,financial_connections.session.updated,fx_quote.expired,identity.verification_session.canceled,identity.verification_session.created,identity.verification_session.processing,identity.verification_session.redacted,identity.verification_session.requires_input,identity.verification_session.verified,invoice.created,invoice.deleted,invoice.finalization_failed,invoice.finalized,invoice.marked_uncollectible,invoice.overdue,invoice.overpaid,invoice.paid,invoice.payment.overpaid,invoice.payment_action_required,invoice.payment_attempt_required,invoice.payment_failed,invoice.payment_succeeded,invoice.sent,invoice.upcoming,invoice.updated,invoice.voided,invoice.will_be_due,invoice_payment.paid,invoiceitem.created,invoiceitem.deleted,issuing_authorization.created,issuing_authorization.request,issuing_authorization.updated,issuing_card.created,issuing_card.updated,issuing_cardholder.created,issuing_cardholder.updated,issuing_dispute.closed,issuing_dispute.created,issuing_dispute.funds_reinstated,issuing_dispute.funds_rescinded,issuing_dispute.submitted,issuing_dispute.updated,issuing_dispute_settlement_detail.created,issuing_dispute_settlement_detail.updated,issuing_fraud_liability_debit.created,issuing_personalization_design.activated,issuing_personalization_design.deactivated,issuing_personalization_design.rejected,issuing_personalization_design.updated,issuing_settlement.created,issuing_settlement.updated,issuing_token.created,issuing_token.updated,issuing_transaction.created,issuing_transaction.purchase_details_receipt_updated,issuing_transaction.updated,mandate.updated,payment_intent.amount_capturable_updated,payment_intent.canceled,payment_intent.created,payment_intent.partially_funded,payment_intent.payment_failed,payment_intent.processing,payment_intent.requires_action,payment_intent.succeeded,payment_link.created,payment_link.updated,payment_method.attached,payment_method.automatically_updated,payment_method.detached,payment_method.updated,payout.canceled,payout.created,payout.failed,payout.paid,payout.reconciliation_completed,payout.updated,person.created,person.deleted,person.updated,plan.created,plan.deleted,plan.updated,price.created,price.deleted,price.updated,privacy.redaction_job.canceled,privacy.redaction_job.created,privacy.redaction_job.ready,privacy.redaction_job.succeeded,privacy.redaction_job.validation_error,product.created,product.deleted,product.updated,promotion_code.created,promotion_code.updated,quote.accept_failed,quote.accepted,quote.accepting,quote.canceled,quote.created,quote.draft,quote.finalized,quote.reestimate_failed,quote.reestimated,quote.stale,radar.early_fraud_warning.created,radar.early_fraud_warning.updated,refund.created,refund.failed,refund.updated,reporting.report_run.failed,reporting.report_run.succeeded,reporting.report_type.updated,review.closed,review.opened,setup_intent.canceled,setup_intent.created,setup_intent.requires_action,setup_intent.setup_failed,setup_intent.succeeded,sigma.scheduled_query_run.created,source.canceled,source.chargeable,source.failed,source.mandate_notification,source.refund_attributes_required,source.transaction.created,source.transaction.updated,subscription_schedule.aborted,subscription_schedule.canceled,subscription_schedule.completed,subscription_schedule.created,subscription_schedule.expiring,subscription_schedule.price_migration_failed,subscription_schedule.released,subscription_schedule.updated,tax.form.updated,tax.settings.updated,tax_rate.created,tax_rate.updated,terminal.reader.action_failed,terminal.reader.action_succeeded,terminal.reader.action_updated,test_helpers.test_clock.advancing,test_helpers.test_clock.created,test_helpers.test_clock.deleted,test_helpers.test_clock.internal_failure,test_helpers.test_clock.ready,topup.canceled,topup.created,topup.failed,topup.reversed,topup.succeeded,transfer.created,transfer.reversed,transfer.updated,treasury.credit_reversal.created,treasury.credit_reversal.posted,treasury.debit_reversal.completed,treasury.debit_reversal.created,treasury.debit_reversal.initial_credit_granted,treasury.financial_account.closed,treasury.financial_account.created,treasury.financial_account.features_status_updated,treasury.inbound_transfer.canceled,treasury.inbound_transfer.created,treasury.inbound_transfer.failed,treasury.inbound_transfer.succeeded,treasury.outbound_payment.canceled,treasury.outbound_payment.created,treasury.outbound_payment.expected_arrival_date_updated,treasury.outbound_payment.failed,treasury.outbound_payment.posted,treasury.outbound_payment.returned,treasury.outbound_payment.tracking_details_updated,treasury.outbound_transfer.canceled,treasury.outbound_transfer.created,treasury.outbound_transfer.expected_arrival_date_updated,treasury.outbound_transfer.failed,treasury.outbound_transfer.posted,treasury.outbound_transfer.returned,treasury.outbound_transfer.tracking_details_updated,treasury.received_credit.created,treasury.received_credit.failed,treasury.received_credit.succeeded,treasury.received_debit.created,billing.credit_balance_transaction.created,billing.credit_grant.created,billing.credit_grant.updated,billing.meter.created,billing.meter.deactivated,billing.meter.reactivated, orbilling.meter.updated. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object.
-