Analytics API
Read CallListReferrals3
Returns flattened referral send and referral outcome rows for a shop.
| Kind | Read API call |
|---|---|
| Method | GET or POST |
| URL | https://app.bubblehouse.com/api/v2023061/<shop>/ListReferrals3 |
| Authentication | Shop Token |
This export is intended for tenant analytics and integrations that need a current-state referral feed.
Default mode returns one row per recorded referral, plus one sent-only row for each referral send that has not produced a recorded referral.
Set only_sent_referrals=true to return one row per referral send. This includes sends that later produced recorded referrals.
Rows are sorted by the updated cursor. The default sort is updated_desc.
Before using cursor polling for historical data, the shop must have referral update IDs initialized and the referral update indexes reindexed. Existing zero-update rows are not visible through update cursors until this rollout maintenance has run.
Note that the output is in a tabular data format determined by the format parameter.
Input
-
fieldsstring optionalWhich referral fields to include in the response.
Use a comma-separated filter string such as
default,bhid,updated,send_bhid,status,referrer(email),referee(email),attached_assets(api_name,status,coupon_code), orall.In JSON and JSONL, use nested field names such as
referrer(...),referee(...),referrer_coupon, andattached_assets(...).The
referrerandrefereesubobjects support customer field names from Customer2. Theattached_assetsarray supports fields from AttachedAssetDetails1.In CSV, customer fields are flattened as
referrer_bhid,referrer_email,referee_bhid,referee_email, etc.CSV includes one pair of dynamic fields for each enabled per-referral achievement with a configured API name:
attached_asset_<achievement_api_name>_statusandattached_asset_<achievement_api_name>_coupon_code. -
The response format you want: JSON, JSONL or CSV.
-
prettyboolean optionalIf true, pretty-prints JSON output.
-
Sort order for the
updatedcursor.Supported values are
updated_descandupdated_asc. The default isupdated_desc. -
Only return rows with update IDs strictly greater than this value.
-
Only return rows with update IDs strictly smaller than this value.
-
limitinteger optionalThe number of rows to return.
The default limit is 10000. Use JSONL or CSV for large exports.
-
only_sent_referralsboolean optionalReturn one row per referral send instead of the default flattened referral outcome feed.
When true, the response includes all referral sends, including sends that already have recorded referral rows.
Output
-
Stable row ID.
Recorded referral rows use the referral ID. Sent-only rows use the referral send ID.
-
Row update/version ID used for polling.
-
Referral send ID. Rows produced from the same send share this value.
-
When the referral send was last sent or created.
-
Referral send channel, such as
email,sms,link, ordirect. -
destinationstring optionalReferral send target or destination.
-
referral_codestring optionalActive referral code for the send, when available.
-
linkstring optionalReferral link for the send, when meaningful.
-
Customer who sent the referral.
In CSV output, this is flattened into fields such as
referrer_bhid,referrer_email, andreferrer_phone. -
When the referred customer referral row was registered.
-
When the referral was approved or rejected.
-
Public referral status:
invited,qualified,approved, orrejected. -
status_labelstring requiredHuman-readable status label, including the configured rejection reason label for rejected referrals.
-
rejection_reasonstring optionalStable rejection reason code for rejected referrals.
-
Referred customer, when a recorded referral exists.
In CSV output, this is flattened into fields such as
referee_bhid,referee_email, andreferee_phone. -
reward_ptsinteger optionalPoints awarded to the referrer for the referral.
-
reward_pts_valuemoney optionalMonetary value of
reward_ptsin the referral venue and market. -
reward_amountmoney optionalMonetary reward awarded to the referrer for the referral.
-
referrer_coupon_codestring optionalPrimary referrer reward coupon code or display value.
-
referrer_couponobject optionalStructured referrer reward coupon data in JSON and JSONL output.
Null when the referral has no referrer reward coupon. CSV output uses
referrer_coupon_codeinstead. -
Attached asset details included in JSON and JSONL output.
Only enabled per-referral achievements with a configured API name are included. Unnamed achievements are omitted.
Use
attached_assets(...)in thefieldsfilter to choose subfields. The default subfields areapi_name,title,status, andcoupon_code.coupon_codeis null when the asset has no awarded coupon data. -
CSV status column generated for each enabled per-referral achievement with an API name.
-
attached_asset_<achievement_api_name>_coupon_codestring optionalCSV awarded coupon code/display value generated for each enabled per-referral achievement with an API name.
Global Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 401 | invalid_token |
The provided authentication token is invalid or has expired. |
| 429 | rate_limit_exceeded |
Your usage is over the rate limit. Ensure that you're not making duplicate calls, and contact our team for a rate limit increase. |