Hooks API

Web Hook

ApplySubscriptionDiscount1

Apply a monetary loyalty-points benefit to a customer's subscription.

Kind Mutation Hook
Method POST
URL The webhook URL you specify, with :name replaced by ApplySubscriptionDiscount1
Authentication JWT HS256 Bearer token

Subscribe to this hook from Hello1 when your custom subscription platform can apply redeemed loyalty points to a specific subscription.

Bubblehouse calls this hook during a customer redemption and waits for the result. Return applied: true only after confirming the amount was applied. Use the subscription-system subscription_id as the primary lookup key; subscription_ecomm_id identifies the same subscription in a separate ecommerce system when available.

Return applied: false with a supported failure reason when the request is valid but cannot be applied. Return a non-2xx response for a temporary service or network failure. The failed invocation is recorded; a later customer attempt is a new invocation and can have a different X-Request-ID.

Input

  • customer CustomerIdentity1 required

    Customer who redeemed the points.

  • subscription_id string required

    Stable primary subscription ID assigned by the subscription system.

  • subscription_ecomm_id string optional

    Distinct ID assigned to the same subscription by a separate ecommerce system.

  • amount monetary required

    Monetary value to apply to the subscription.

  • discount_title string required

    Human-readable description of the points redemption.

  • code string optional

    Bubblehouse-generated reference code for this redemption.

  • code_prefix string optional

    Configured prefix for Bubblehouse subscription-redemption codes.

  • destination RedeemDestination1 optional

    Optional provider-specific destination selected by the customer.

Output

  • applied boolean required

    Whether the monetary benefit was applied successfully.

  • target_title string optional

    Human-readable subscription or destination title for customer-facing confirmation.

  • failure_reason string optional

    Machine-readable reason when applied is false.

    Supported values are no_subscriptions, already_discounted_or_applied, already_discounted, and already_applied.

  • debug_info string optional

    Diagnostic details for Bubblehouse operators. Do not include secrets or unnecessary customer data.

  • coupon Coupon1 optional

    External coupon record created while applying the benefit, when Bubblehouse should track it.

Usage Examples

Apply points to one subscription

Request

{
  "amount": "15.000000",
  "code": "BH-SUB-15",
  "code_prefix": "BH-SUB-",
  "customer": {
    "email": "alice@example.com",
    "shopid": "CUSTOMER-501"
  },
  "discount_title": "$15.00 off spending 150 points",
  "subscription_ecomm_id": "ECOMM-SUB-1001",
  "subscription_id": "SUB-1001"
}

Response

{
  "applied": true,
  "target_title": "Monthly coffee subscription"
}
Previous
AddProductToSubscription1