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 a merchant access token with the manage_merchant_orders permission included in the Authorization header and the user’s QR code included in the body of the request in the payment_token_data field.

Request Endpoint

POST /v15/locations/:location_id/get_merchant_funded_gift_card_credit

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": "LU0200018SECH4O89A4NBOT7030000LU"
  }
}

Request Parameters

Parameters Type Required Description
payment_token_data String Yes Customer QR code data (input from the LevelUp scanner).
location_id Integer Yes LevelUp location ID that is placing the order.

cURL Example

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": "LU0200018SECH4O89A4NBOT7030000LU"
        }
      }'

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