Hooks API
Web HookAddProductToSubscription1
Add a loyalty reward product to a customer's subscription.
| Kind | Mutation Hook |
|---|---|
| Method | POST |
| URL | The webhook URL you specify, with :name replaced by AddProductToSubscription1 |
| Authentication | JWT HS256 Bearer token |
Subscribe to this hook from Hello1 when your custom subscription platform can add free or discounted reward products to a specific subscription.
Bubblehouse may call this hook during a customer redemption or while delivering a subscription milestone reward. Return added: true only after confirming the product was added. An unsuccessful direct redemption falls back to the configured customer redemption path. A milestone response with added: false and retry: true schedules another delivery attempt.
Use the subscription-system subscription_id as the primary lookup key. The product and variant use the same normalized payloads as Bubblehouse first-party integrations and Order API data.
The contract does not provide one stable idempotency key across separate delivery attempts. A later attempt is a new hook invocation and can have a different X-Request-ID. Before advertising this hook, ensure your platform can reconcile an ambiguous failure without creating an unintended duplicate line.
Input
-
Customer who owns the subscription.
-
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.
-
Optional provider-specific destination selected by the customer.
-
Product to add.
-
Specific product variant to add.
-
Final unit price requested for the added line. Zero means free.
-
Percentage discount in basis points when the provider applies a percentage-based adjustment.
Output
-
addedboolean requiredWhether the product was added successfully.
-
retryboolean optionalWhether retrying may succeed after an unsuccessful attempt.
-
subscription_line_idstring optionalStable ID of the created subscription line in the subscription system.
-
debug_infostring optionalDiagnostic details for Bubblehouse operators. Do not include secrets or unnecessary customer data.
Usage Examples
Add a free reward product
Request
{
"customer": {
"email": "alice@example.com",
"shopid": "CUSTOMER-501"
},
"destination": {},
"discount_bp": 0,
"price": "0.000000",
"product": {
"id": "PRODUCT-301",
"title": "Example product"
},
"subscription_ecomm_id": "ECOMM-SUB-1001",
"subscription_id": "SUB-1001",
"variant": {
"id": "VARIANT-401",
"price": "20.000000",
"title": "Example variant"
}
}
Response
{
"added": true,
"subscription_line_id": "SUB-LINE-9001"
}