Merchant-Funded Gift Card Credit .: Get

API Reference / v15

Check if a User Has Merchant-Funded Gift Card Credit Available at a Given Location

This endpoint allows you to check if a user has any merchant-funded gift card credit available to use at a particular location. Note that this is a POST request as it has required body data.

To get merchant-funded gift card credit, you must have either:

  • a user access token with the manage_user_campaigns permission

OR

  • a user’s QR code data

You will also need (in either above case) a merchant access token with the manage_merchant_orders permission.

Request Endpoint

POST /v15/locations/:location_id/get_merchant_funded_gift_card_credit

Authorization Required – Merchant and User Token in Header

Authorization: token merchant="982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73", user="1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e"

OR

Authorization Required – Merchant Token in Header and User QR Code Data in Body

Authorization: token merchant="982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73"

Request Body

{
  "get_merchant_funded_gift_card_credit": {
    "payment_token_data": "LU02000008ZS9OJFUBNEL6ZM030000LU"
  }
}

Request Parameters

Parameters Type Required Description
payment_token_data String Yes Customer QR code data (input from the LevelUp scanner). Omitted if user token is included in header.
location_id Integer Yes LevelUp location ID that is placing the order.

cURL Example using QR Code

curl -X POST https://sandbox.thelevelup.com/v15/locations/19/get_merchant_funded_gift_card_credit \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization: token merchant=982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73' \
  -d '{
        "get_merchant_funded_gift_card_credit": {
          "payment_token_data": "LU02000008ZS9OJFUBNEL6ZM030000LU"
        }
      }'

cURL Example using User Token

curl -X POST https://sandbox.thelevelup.com/v15/locations/19/get_merchant_funded_gift_card_credit \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization: token merchant=982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73,user=1123-15d2aeedc9f4e0e7094a9d283868f8fbe873cb85ceaa0c511727245aec8c9e' \

Example Response

{
  "merchant_funded_gift_card_credit": {
    "total_amount": 2000
  }
}

Response Parameters

Parameters Type Description
total_amount Integer The total amount of gift card credit available (in cents)

Errors

HTTP/1.1 error 404 Not Found - QR Code is invalid

HTTP/1.1 error 401 Unauthorized - Merchant token is not valid for the chosen location or user token is invalid