Skip to content

Billing & Subscription Examples

Explore queries and mutations for managing subscriptions, rendering payment popups, and handling special offers.

1. Fetch Payment Popup Details

Retrieve the available subscription packages and payment configurations necessary to render a premium upgrade popup.

graphql
query GetPaymentPopupDetails {
  billing {
    paymentPopupDetails {
      paymentMethodName
      disclaimerEnabled
      disclaimerText
      popupTitle
      packages {
        id
        name
        price
        pricePerMonth
        displayMessage
        displayDescriptionItems
        isMarked
      }
    }
  }
}

2. Fetch a Special Offer Page

Retrieve a marketing landing page for a special subscription offer by its URL slug.

graphql
query GetSpecialOfferPage($url: String!) {
  billing {
    specialOfferPage(url: $url) {
      id
      title
      description
      iconTitle1
      package {
        id
        name
        price
        discountPrice
      }
    }
  }
}

Variables:

json
{
  "url": "summer-sale-2026"
}

3. Cancel Membership

Permanently cancel the active membership subscription for the currently authenticated user.

graphql
mutation CancelMembership($membershipId: ID!) {
  billing {
    cancelMembership(membershipId: $membershipId)
  }
}

4. Submit Cancellation Survey

Submit a survey response when a user attempts to cancel their subscription. This is often used for retention analytics.

graphql
mutation SubmitCancellationSurvey($input: BillingSubscriptionCancellationSurveyInput!) {
  billing {
    submitSubscriptionCancellationSurvey(input: $input)
  }
}

Variables:

json
{
  "input": {
    "subscriptionId": "sub_12345",
    "optionId": "opt_too_expensive",
    "details": "I found another service."
  }
}

OwlFlow Developer Portal