Hooks API
Web HookApplySubscriptionDiscount1
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 who redeemed the points.
-
subscription_idstring requiredStable primary subscription ID assigned by the subscription system.
-
subscription_ecomm_idstring optionalDistinct ID assigned to the same subscription by a separate ecommerce system.
-
Monetary value to apply to the subscription.
-
discount_titlestring requiredHuman-readable description of the points redemption.
-
codestring optionalBubblehouse-generated reference code for this redemption.
-
code_prefixstring optionalConfigured prefix for Bubblehouse subscription-redemption codes.
-
Optional provider-specific destination selected by the customer.
Output
-
appliedboolean requiredWhether the monetary benefit was applied successfully.
-
target_titlestring optionalHuman-readable subscription or destination title for customer-facing confirmation.
-
failure_reasonstring optionalMachine-readable reason when applied is false.
Supported values are
no_subscriptions,already_discounted_or_applied,already_discounted, andalready_applied. -
debug_infostring optionalDiagnostic details for Bubblehouse operators. Do not include secrets or unnecessary customer data.
-
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"
}