Loyalty API
Read CallCustomerDocuments3
Returns receipt and document submissions linked to the given customer.
| Kind | Read API call |
|---|---|
| Method | GET or POST |
| URL | https://app.bubblehouse.com/api/v2023061/<shop>/CustomerDocuments3 |
| Authentication | Customer TokenShop Token |
Returns all receipt/document submissions whose Bubblehouse document record is linked to the resolved customer. The method does not match on receipt form email or AI-extracted receipt email.
Rows are returned newest first in one JSON response. There is no pagination, streaming, CSV, or JSONL output. The method is intended for normal account history sizes and returns an error instead of building an unusually large one-customer response.
By default, customer-token callers receive a customer-facing field set: bhid, public_id, status, upload_time, doc_time, number, url, resubmit_url, individual_urls, amount, pts, pub_comment, rejection_reason, items, and campaign.
The default resubmit_url field is a receipt resubmission link for rejected documents with an available source configuration, active campaign, and enabled receipt page. Otherwise it is null. It uses the document's source campaign and market, not the viewing market. The URL preserves the configured HTTPS host and includes an opaque action token for prefilling the existing upload form. Treat it as sensitive; it is not a customer sign-in token. A removed or disabled remote page suppresses new links. Redirecting a previously issued URL whose page has been removed from the external site remains the responsibility of that site.
Shop tokens and customer-admin customer tokens may use fields and status. Plain customer tokens cannot use those inputs. Ordinary customer tokens may pass market.
The optional market object is a viewing context for translating campaign.title. It does not filter documents or change each document's upload market. Omit it, or pass an empty object, to return source campaign titles. Nested campaign is the stored campaign API name and title; extra form fields such as campaign_id and campaign_name are independent and may disagree. Missing campaigns are null. A present campaign with a blank API name or title uses empty strings, not null. Disabled or expired campaigns still resolve from retained configuration.
Input
-
A customer to operate upon, when using a shop token.
If you're using a customer token and decide to pass this field (which we do not recommend), it must match the customer from the token.
-
fieldsstring optionalShop/customer-admin only. Which nested document fields to include in each row.
Use the same nested JSON field names as ListDocuments3, such as
bhid,status,customer(email),items.CSV-only flat field names such as
doc_bhidandcustomer_emailare not supported here. -
Shop/customer-admin only. Only return documents with the specified receipt status.
-
Optional viewing market used only to translate campaign titles.
Uses the same nested market selector as ListOffers1 and CustomerHistory2.
Unlike those methods, omitting
marketor passing{}does not resolve a default market. Source campaign titles are returned.A supplied selector is resolved normally. Unknown selectors fall back to the default market's translations.
Output
-
documentsarray of object requiredThe customer's receipt/document submissions.
The exact fields in each document depend on the caller and optional
fieldsinput. Values use the same shapes as nested JSON rows from ListDocuments3.
API-wide Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 404 | no_customers_match_customer_identity |
The customer identity ('customer' input parameter) does not match a known customer. |
| 404 | empty_customer_identity |
All fields of the customer identity ('customer' input parameter) have been empty when using a shop token. You need to either specify a non-empty value for one of the customer identity fields, or use a customer token. |
| 403 | customer_identity_does_not_match_token |
API call is using a customer token, but the customer identity in API params does not match the customer from the token. |
| 404 | customer_identity_partially_mismatches_matched_customer |
A customer has been matched by one of the fields of the customer identity ('customer' input parameter), but some non-empty fields do not match Bubblehouse data on that customer. |
| 400 | missing_customer_identity |
The customer identity ('customer' input parameter) has not been specified when using a shop token. You need to either specify a non-empty value for one of the customer identity fields, or use a customer token. |
Global Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 400 | obsolete_global_api_version |
The global API version you are trying to use is no longer supported. |
| 400 | inaccessible_global_api_version |
The global API version you are trying to use is not enabled on your account. |
| 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. |
| 401 | invalid_token |
The provided authentication token is invalid or has expired. |
| 400 | invalid_global_api_version |
The global API version you are trying to use has never existed. |