This page covers the events that our V5 webhooks send. Currently, they are only sent to apps.

We also provide Typescript interfaces for each webhook event, which you can use to safely parse the webhook data.


membership.went_valid

This webhook will fire when a membership becomes valid, typically when a membership is created or a user checks out.

Business Logic Example: Mark a user’s subscription as valid, which allows them to access a gated section of my app.

Important Attributes: id, valid, status, user_id, product_id

{
  "action": "membership.went_valid",
  "data": {
   "id": "string", // The ID of the membership
   "product_id": "string",
   "user_id": "string",
   "plan_id": "string",
   "page_id": "string",
   "created_at": "number", // The time at which the Membership was created. Measured in seconds since the Unix epoch.
   "expires_at": "number", // The time at which the Membership expires. Measured in seconds since the Unix epoch.
   "renewal_period_start": "number", //The UTC timestamp of when the Membership will begin
   "renewal_period_end": "number", //The UTC timestamp of when the Membership will end
   "quantity": "number",
   "status": "string", // The status of the Membership. Available options: trialing, active, past_due, completed, canceled, expired, unresolved 
   "valid": "boolean", // Whether the Membership is active or not
   "cancel_at_period_end": "boolean", // Whether the Membership will be canceled at the end of the current billing period
   "license_key": "string", // The license key for the Membership
   "metadata": "object", // The metadata for the Membership
   "checkout_id": "string", The ID of the checkout used to first purchase / generate the membership.
   }
}

membership.went_invalid

This webhook will fire when a membership becomes invalid, typically when a subscription is canceled or the membership expires.

Business Logic Example: Mark a user’s subscription as invalid, which blocks them from accessing a gated section of my app.

Important Attributes: id, valid, status, user_id, product_id

{
  "action": "membership.went_valid",
  "data": {
   "id": "string", // The ID of the membership
   "product_id": "string",
   "user_id": "string",
   "plan_id": "string",
   "page_id": "string",
   "created_at": "number", // The time at which the Membership was created. Measured in seconds since the Unix epoch.
   "expires_at": "number", // The time at which the Membership expires. Measured in seconds since the Unix epoch.
   "renewal_period_start": "number", //The UTC timestamp of when the Membership will begin
   "renewal_period_end": "number", //The UTC timestamp of when the Membership will end
   "quantity": "number",
   "status": "string", // The status of the Membership. Available options: trialing, active, past_due, completed, canceled, expired, unresolved 
   "valid": "boolean", // Whether the Membership is active or not
   "cancel_at_period_end": "boolean", // Whether the Membership will be canceled at the end of the current billing period
   "license_key": "string", // The license key for the Membership
   "metadata": "object", // The metadata for the Membership
   "checkout_id": "string", The ID of the checkout used to first purchase / generate the membership.
   }
}

payment.succeeded

This webhook will fire when a payment is successful, for both new and existing memberships.

Business Logic Example: Update a user’s credit balance with the amount of the payment and send them a receipt via email.

Important Attributes: id, membership_id, status, final_amount, user_id, product_id

{
  "action": "payment.succeeded",
  "data": {
    "id": "string", // The ID of the payment
    "membership_id": "string",
    "product_id": "string",
    "user_id": "string",
    "plan_id": "string",
    "company_id": "string",
    "line_item_id": "string",
    "created_at": "number", // The time at which the Payment was created. Measured in seconds since the Unix epoch. Does not necessarily reflect the time the Payment was successful.
    "paid_at": "number" | nil, // The time at which the Payment was successful. Measured in seconds since the Unix epoch.
    "refunded_at": "number" | nil, //The time at which the Payment was refunded. Measured in seconds since the Unix epoch.
    "last_payment_attempt": "number" | nil, // The time at which the last payment attempt was made. Measured in seconds since the Unix epoch.
    "next_payment_attempt": "number" | nil, // The time at which the next payment attempt will be made. Measured in seconds since the Unix epoch.
    "status": "string", // The status of the Payment. Available options: paid, open, void, draft, uncollectible
    "subtotal": "number", // The amount paid by the User, before any discounts or taxes
    "final_amount": "number", // The amount paid by the User, including any discounts or taxes
    "currency": "string", // The three letter currency the Payment was made in
    "refunded_amount": "number", // The amount refunded to the User
    "payments_failed": "number", // The number of failed payment attempts
    "checkout_id": "string" //The ID of the checkout used to execute this payment, if applicable.
  }
}

payment.failed

This webhook will fire whenever a payment attempt fails. This is usually due to a card having insufficient funds, or a crypto payment not having a proper allowance or balance.

Business Logic Example: Record the failed payment attempt so that you can remind the user with an overlay inside of your app to have them update their payment method.

Important Attributes: id, membership_id, status, final_amount, user_id, product_id

{
  "action": "payment.failed",
  "data": {
    "id": "string", // The ID of the payment
    "membership_id": "string",
    "product_id": "string",
    "user_id": "string",
    "plan_id": "string",
    "company_id": "string",
    "line_item_id": "string",
    "created_at": "number", // The time at which the Payment was created. Measured in seconds since the Unix epoch. Does not necessarily reflect the time the Payment was successful.
    "paid_at": "number" | nil, // The time at which the Payment was successful. Measured in seconds since the Unix epoch.
    "refunded_at": "number" | nil, //The time at which the Payment was refunded. Measured in seconds since the Unix epoch.
    "last_payment_attempt": "number" | nil, // The time at which the last payment attempt was made. Measured in seconds since the Unix epoch.
    "next_payment_attempt": "number" | nil, // The time at which the next payment attempt will be made. Measured in seconds since the Unix epoch.
    "status": "string", // The status of the Payment. Available options: paid, open, void, draft, uncollectible
    "subtotal": "number", // The amount paid by the User, before any discounts or taxes
    "final_amount": "number", // The amount paid by the User, including any discounts or taxes
    "currency": "string", // The three letter currency the Payment was made in
    "refunded_amount": "number", // The amount refunded to the User
    "payments_failed": "number", // The number of failed payment attempts
    "checkout_id": "string" //The ID of the checkout used to execute this payment, if applicable.
  }
}