Order API
TypeSubscription1
A full current snapshot of one subscription.
Send the complete current values for all required fields whenever the subscription changes. Cycle information is optional and supports three forms described in the custom subscription programs guide.
| Kind | Type |
|---|---|
| Used in | UpdateSubscriptions1 |
Properties
-
idstring requiredStable primary subscription ID assigned by the subscription system.
-
ecomm_idstring optionalDistinct ID assigned to the same subscription by a separate ecommerce system.
Omit this field when there is no separate ecommerce system or it does not assign a different subscription ID.
-
Time when the subscription was created.
-
Time of this subscription revision. Advance it whenever the subscription changes.
When Bubblehouse uses your subscription data to calculate milestone progress, each changed subscription snapshot must have a newer
updated_at. Bubblehouse uses this timestamp to order changes to status, completed-cycle count, next billing date, and identities inlines. For lines, products, variants, and selling plans, both subscription-system and ecommerce IDs are compared; for groups, only the subscription-system ID is compared. Line order does not matter. Preserve the original timestamp when retrying the same revision; use enough precision to distinguish changes made within the same second.A newer timestamp allows progress to change. An older timestamp leaves the accepted progress unchanged. The same timestamp with identical progress is a safe replay; the same timestamp with different progress is rejected with
conflicting subscription progress at the accepted updated_at. This prevents delayed or out-of-order snapshots from overwriting newer progress.Refunds and count corrections require a newer
updated_at, even if no other subscription fields change. A webhook'soccurred_atdoes not replace the subscription snapshot'supdated_at.See update timestamps and refunds for an example and the distinction between a successful request and an accepted subscription update.
-
Time when the subscription was cancelled.
-
Time of the latest billing attempt.
-
Expected time of the next billing attempt.
-
Time when the subscription was paused.
-
Time when the paused subscription is expected to resume.
-
Time when payment-recovery attempts started.
-
Time when payment-recovery attempts ended.
-
Time when the subscription churned.
-
Customer who owns the subscription.
Provide a stable customer ID and any current customer data available to your integration.
-
Current subscription lines. Send an empty array when the subscription has no lines.
-
currencystring optionalISO 4217 currency code for subscription amounts.
-
Current subscription status.
-
cycles_completedinteger optionalKnown number of successfully billed cycles.
Zero is a known value. Omit this field when cycle progress is unknown. When supplied with
cycles, this count is authoritative and the detailed list may be incomplete. -
non_ecommerceboolean optionalWhether detailed cycles act as the purchase source instead of ecommerce orders.
Use this only when subscription charges are not also sent through the order API. Bubblehouse can use cycle amounts for spend and point accrual when configured for this mode.
-
referral_codestring optionalReferral correlation code captured from the friend's referral link.
Send the code generated by Bubblehouse with an active subscription to attribute the referral. Customer identity can consist of
customer.idalone; email and other personal data are not required.This field only matches referral codes. It does not create or redeem a discount in the subscription system and does not require
discount_codes, orders, or cycle details.The last non-empty code is retained when omitted or empty in later snapshots. A code received while the subscription is inactive can qualify when an active snapshot arrives. Unknown codes, self-referrals, and blocked referral contacts do not qualify. An existing referral is not reassigned by a later code.
Configured referral eligibility rules and reward delays still apply. For an ID-only subscription program, configure internal referral codes and subscription-appropriate eligibility rules; configure a 30-day reward delay if required by the program.
A
cancelledsnapshot voids a pending referral linked to that subscription, including when this field is omitted. A rejected referral does not revive on reactivation. Cancelling another subscription does not void the referral. Rewards already released are not reversed, and a refund alone is not represented by this field. -
discount_codesarray of string optionalCoupon codes used by the subscription.
Include these only when the same codes are not sent on matching orders.
-
Known completed and scheduled cycle details.
Include upcoming scheduled cycles when available. If
cycles_completedis omitted, Bubblehouse derives it from completed entries and therefore expects the completed details to be cumulative. An explicit empty array withoutcycles_completedmeans zero successful cycles.