Purchase Gift Cards

purchaseGiftCard

Once you've determined your preferred offer, use the purchaseGiftCard mutation to purchase your gift card. This mutation requires an PurchaseGiftCardInput input object.

Sample Mutation

Here's the quickest way to start purchasing a gift card.
You are able to customize your query from the UserPurchase object. See UserPurchase

mutation purchaseGiftCard($input: PurchaseGiftCardInput!) {
  purchaseGiftCard(input: $input) {
    purchaseDisplayId
    purchaseAmount
    giftCard {
      giftCardId
      status
    }
  }
}

Fields

The following fields are used to run this mutation:

idempotencyKey Required - A unique client generated UUID to ensure a request is processed only once.

offerId or merchantSlug - Required Use the offerId or merchantSlug from the getOfferQuoteto get the best offer. Using the merchantSlug will automatically purchase the best offer rate for that merchant.

amount - RequiredThe gift card amount you'd like to purchase.

Only one of the following is required. You may also choose to combine your Fluz balance with another funding source.

balanceAmount - If you want to pay for you gift card with your Fluz balance, define the amount of balance here. You can use getWalletquery to check your balances. See reference

bankAccountId - If you want to pay with a bank account, define the bank account ID.

bankCardId - If you want to pay with a bank card, define the bank card ID.

paypalVaultID - If you want to pay with a PayPal account, define the PayPal account ID.

defaultToBalance - If you want to use your Fluz balance as the fallback payment method in case your other payment methods fail, set defaultToBalance to true. By default, this is set to true. If you change this setting to false, the system will not attempt to use your Fluz balance as a backup payment method.

PurchaseGiftCardInput

{
  "idempotencyKey": "0284be6f-1a69-44f7-9da0-5b5edaf45d19",
  "offerId": "0284be6f-1a69-44f7-9da0-5b5edaf45d19",
  "amount": 987.65,
  "balanceAmount": 123.45,
  "bankAccountId": "0284be6f-1a69-44f7-9da0-5b5edaf45d19",
  "bankCardId": "0284be6f-1a69-44f7-9da0-5b5edaf45d19",
  "paypalVaultId": "0284be6f-1a69-44f7-9da0-5b5edaf45d19",
  "exclusiveRateId": "0284be6f-1a69-44f7-9da0-5b5edaf45d19",
  "merchantSlug": "xyz789"
}

Sample Response

Once your purchase is complete, you'll get a response that looks something like this:

{
  "data": {
    "purchaseGiftCard": {
      "purchaseId": "255f8245-02c7-4817-901e-15fe265f6968",
      "purchaseDisplayId":"1019688",
      "purchaseBankCardId": "255f8245-02c7-4817-901e-15fe265f6968",
      "bankAccountId": "255f8245-02c7-4817-901e-15fe265f6968",
      "purchaseAmount": 123.45,
      "fluzpayAmount": 85.00,
      "seatRewardValue": 0.05,
      "paypalVaultId": "255f8245-02c7-4817-901e-15fe265f6968",
      "createdAt": "2007-12-03T10:15:30Z",
      "giftCard": {
        "giftCardId": "85de8b3e-4e72-462c-8ed1-a6f4982e22f7",
        "purchaserUserId": "85de8b3e-4e72-462c-8ed1-a6f4982e22f7",
        "endDate": "2007-12-03T10:15:30Z",
        "status": "ACTIVE",
        "createdAt": "2007-12-03T10:15:30Z",
        "merchant": {
          "merchantId": "85de8b3e-4e72-462c-8ed1-a6f4982e22f7",
          "name": "Starbucks",
          "slug": "starbucks",
          "offers": [
            {
              "offeringMerchantId": "85de8b3e-4e72-462c-8ed1-a6f4982e22f7",
              "offerId": "85de8b3e-4e72-462c-8ed1-a6f4982e22f7",
              "type": "GIFT_CARD_OFFER",
              "hasStockInfo": false,
              "offerRates": [
                {
                  "maxUserRewardValue": 5.00,
                  "cashbackVoucherRewardValue": 1.00,
                  "boostRewardValue": 0.50,
                  "displayBoostReward": true,
                  "denominations": [25, 50, 100],
                  "allowedPaymentMethods": ["CREDIT_CARD", "PAYPAL"]
                }
              ],
              "denominationsType": "VARIABLE",
              "stockInfo": []
            }
          ]
        }
      }
    }
  }
}

🚧

Cashback rates are subject to change.

_We do our best to always give our customers the best offers available. This means that our rates change regularly. Always confirm the rate before making a purchase.

Next Steps

Now it's time to reveal your gift card details for use. Learn how to do so here:

View Gift Cards