Loyalty API

Write Call

RedeemOffer1

Redeem an offer available to a currently authenticated customer.

Kind Write API call
Method POST
URL https://app.bubblehouse.com/api/v20230601/<shop>/RedeemOffer1
Authentication Customer Token
You have a choice of making this call from your server using a shop token and specifying a customer ID, or making this call from a web browser/app using a customer token you have generated on the server.

Endpoint requests redemption of an offer and will deduct points cost from the customer's loyalty points. If the customer has enough points, the offer will be redeemed and the customer's points will be deducted. If the customer doesn't have enough points, the endpoint will return an error.

Input

  • customer CustomerIdentity1 required if using a shop token

    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.

  • offer_id string required

    Unique ID of the offer in the Bubblehouse system, returned by ListOffers1.

  • destination RedeemDestination1 optional

    Destination to add the redeemed object to. Use when instructed by Bubblehouse team.

  • extras JSON object optional

    Extra information to store in the change object. Talk to Bubblehouse team about your use cases before using this.

Output

  • success bool required

    Whether the redemption was successful or not.

  • message string optional

    An optional message describing the result of the redemption.

  • offer_title string optional

    The title of the redeemed offer.

  • pts_spent integer optional

    The number of points spent to redeem the offer.

  • coupon_code CouponRedeemable1 optional

    The coupon code associated with the redeemed offer, if any.

API-wide Errors

Status Error Reason & Examples
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 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 no_customers_match_customer_identity

The customer identity ('customer' input parameter) does not match a known customer.

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.

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 invalid_global_api_version

The global API version you are trying to use has never existed.

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.

401 invalid_token

The provided authentication token is invalid or has expired.

Previous
QueryOrderDetails1