Loyalty API
Read CallQueryOrderDetails1
Retrieves loyalty point details for an existing order by ID.
| Kind | Read API call |
|---|---|
| Method | GET or POST |
| URL | https://app.bubblehouse.com/api/v2023061/<shop>/QueryOrderDetails1 |
| Authentication | AnonymousCustomer TokenShop Token |
This function allows you to get detailed information about points earned for an existing order. It returns the same data structure as EstimateAccrual1, but works with placed orders using their order ID instead of requiring an Order2 object.
This is useful for displaying point earning details to customers after an order has been placed.
Input
-
order_idstring requiredThe ID of the existing order to retrieve point details for.
Output
-
ptsinteger requiredThe number of order-accrual points earned for this order.
This only includes points from the order amount. It does not include bonus points from achievements or ways-to-earn triggered by the order (see pts_from_rewards).
-
pts_from_rewardsinteger requiredPoints earned from achievements and ways-to-earn triggered by this order.
The sum of pts_earned across all entries in the assets array. Does not include the standard order-accrual points (the pts field). The total points earned from this order is pts + pts_from_rewards.
-
Detailed breakdown of point calculations for each order line item.
Each line item includes information about the subtotal, accrual amount, points, and any applicable multipliers or discounts.
-
Assets (achievements and ways-to-earn) that were unlocked by this order.
Each entry includes the asset definition and the points the customer earned from unlocking it. This shows which achievements or bonus point rewards the customer received when the order was processed.
-
accrual_debug_infostring requiredDebug information about how the points were calculated.
This is intended for development and troubleshooting, not for displaying to end users.
Specific Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 404 | order not found |
The specified order ID does not exist. |
API-wide Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 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. |
| 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. |
| 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. |
| 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. |
| 404 | no_customers_match_customer_identity |
The customer identity ('customer' input parameter) does not match a known customer. |
Global Errors
| Status | Error | Reason & Examples |
|---|---|---|
| 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. |
| 400 | obsolete_global_api_version |
The global API version you are trying to use is no longer supported. |
| 400 | invalid_global_api_version |
The global API version you are trying to use has never existed. |
| 401 | invalid_token |
The provided authentication token is invalid or has expired. |
| 400 | inaccessible_global_api_version |
The global API version you are trying to use is not enabled on your account. |