Merchant-Funded Credit .: Get

API Reference / v15

*** THIS ENDPOINT HAS BEEN DEPRECATED - USE MERCHANT FUNDED GIFT CARD CREDIT INSTEAD ***

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

This endpoint allows you to check if a user has any Merchant-Funded Credit available to use at a particular location. This credit may include credit from campaigns, gift cards, and more. Note that this is a POST request as it has required body data. This body data is used to determine if the customer is eligibile for any item-related discounts.

To get merchant funded credit, you must have a user access token with the manage_user_campaigns permission and a merchant access token with the manage_merchant_orders permission.

As an alternative to using a user access token to authorize the user, you can include the user’s QR code in the body of the request.

Request Endpoint

POST /v15/locations/:location_id/merchant_funded_credit

Authorization Required – Merchant and User Token in Header

Authorization: token merchant="982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73", user="123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R"

OR

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

Authorization: token merchant="982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73"

Request Body

{
  "credit_query": {
    "payment_token_data": "LU0200018SECH4O89A4NBOT7030000LU",
    "identifier_from_merchant": "001001",
    "items": [
      {
        "item": {
          "charged_price_amount": 299,
          "description": "Shredded potatoes griddled to perfection",
          "name": "Hashbrowns",
          "quantity": 1,
          "sku": "01abc192",
          "category": "Breakfast Sides",
          "standard_price_amount": 299,
          "children": [
            {
              "item": {
                "charged_price_amount": 0,
                "name": "Special Instructions",
                "description": "Scattered"
              }
            },
            {
              "item": {
                "charged_price_amount": 50,
                "name": "Onions",
                "description": "Smothered"
              }
            },
            {
              "item": {
                "charged_price_amount": 100,
                "name": "Cheese",
                "quantity": 2,
                "description": "Covered"
              }
            },
            {
              "item": {
                "charged_price_amount": 50,
                "name": "Ham",
                "description": "Chunked"
              }
            }
          ]
        }
      },
      {
        "item": {
          "charged_price_amount": 398,
          "description": "12oz Can of Coca-Cola",
          "name": "Can Coke",
          "quantity": 2,
          "sku": "291soo01",
          "category": "Drinks",
          "standard_price_amount": 199,
          "upc": "04963406"
        }
      }
    ]
  }
}

Request Parameters

Parameters Type Required Description
payment_token_data String Yes Customer QR code data (input from the LevelUp Scanner). Only required if user token is not passed in the Authorization header.
identifier_from_
merchant
String No The order ID or number for the check. Should be usable to find the check on the POS. Max 10 characters.
location_id Integer Yes LevelUp Location ID that is placing the order.
items[] JSON Array No An array of items in the order.
item JSON Hash Yes Object representing an order item.
item[children] JSON Array No Array of sub-items. Usually modifiers or add-on items.
item[charged_price_
amount]
Integer Yes The price for the item(s) that was charged to the customer (in cents). (Unit price * quantity - non-LevelUp discounts)
item[description] String Yes The description of the item.
item[name] String Yes The name of the item.
item[quantity] Integer Yes The number of this item sold. Not required for child items.
item[sku] String No SKU (Stock Keeping Unit) code of this item.
item[category] String No Category of the item.
item[standard_price_
amount]
Integer No Standard price for the item(s). (Unit price * quantity)
item[upc] String No UPC (Universal Product Code) of the item.

cURL Example using QR Code

curl -X POST https://sandbox.thelevelup.com/v15/locations/19/merchant_funded_credit \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization: token merchant=982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73' \
  -d '{
        "credit_query": {
          "payment_token_data": "LU0200018SECH4O89A4NBOT7030000LU",
          "identifier_from_merchant": "001001",
          "items": [{
            "item": {
                "charged_price_amount": 299,
                "description": "Shredded potatoes griddled to perfection",
                "name": "Hashbrowns",
                "quantity": 1,
                "sku": "01abc192",
                "category": "Breakfast Sides",
                "standard_price_amount": 299,
                "children": [{
                    "item": {
                        "charged_price_amount": 0,
                        "name": "Special Instructions",
                        "description": "Scattered"
                    }
                }, {
                    "item": {
                        "charged_price_amount": 50,
                        "name": "Onions",
                        "description": "Smothered"
                    }
                }, {
                    "item": {
                        "charged_price_amount": 100,
                        "name": "Cheese",
                        "quantity": 2,
                        "description": "Covered"
                    }
                }, {
                    "item": {
                        "charged_price_amount": 50,
                        "name": "Ham",
                        "description": "Chunked"
                    }
                }]
            }
          }, {
            "item": {
                "charged_price_amount": 398,
                "description": "12oz Can of Coca-Cola",
                "name": "Can Coke",
                "quantity": 2,
                "sku": "291soo01",
                "category": "Drinks",
                "standard_price_amount": 199,
                "upc": "04963406"
            }
          }]
        }
      }'

cURL Example using User Token

curl -X POST https://sandbox.thelevelup.com/v15/locations/19/merchant_funded_credit \
  -H Accept:application/json \
  -H Content-Type:application/json \
  -H 'Authorization: token merchant=982-9a4218e4b6714b7b6b47890d0bf2f46544c99ff7a5957f72ef5637eaafdc73,user=123897-99SCvr3kSe3TqqQid3DyPXfo2Kq98MyhF6CaNPqoDeMhJ18Uopq19uddcznu6R' \
  -d '{
        "credit_query": {
          "identifier_from_merchant": "001001",
          "items": [{
            "item": {
                "charged_price_amount": 299,
                "description": "Shredded potatoes griddled to perfection",
                "name": "Hashbrowns",
                "quantity": 1,
                "sku": "01abc192",
                "category": "Breakfast Sides",
                "standard_price_amount": 299,
                "children": [{
                    "item": {
                        "charged_price_amount": 0,
                        "name": "Special Instructions",
                        "description": "Scattered"
                    }
                }, {
                    "item": {
                        "charged_price_amount": 50,
                        "name": "Onions",
                        "description": "Smothered"
                    }
                }, {
                    "item": {
                        "charged_price_amount": 100,
                        "name": "Cheese",
                        "quantity": 2,
                        "description": "Covered"
                    }
                }, {
                    "item": {
                        "charged_price_amount": 50,
                        "name": "Ham",
                        "description": "Chunked"
                    }
                }]
            }
          }, {
            "item": {
                "charged_price_amount": 398,
                "description": "12oz Can of Coca-Cola",
                "name": "Can Coke",
                "quantity": 2,
                "sku": "291soo01",
                "category": "Drinks",
                "standard_price_amount": 199,
                "upc": "04963406"
            }
          }]
        }
      }'

Example Response

{
  "merchant_funded_credit": {
    "discount_amount": 2578,
    "gift_card_amount": 0,
    "total_amount": 2578
  }
}

Response Parameters

Parameters Type Description
total_amount Integer The total amount of gift card and merchant-funded credit available (in cents)
discount_amount Integer The amount (in cents) of merchant-funded credit available (in cents)
gift_card_amount Integer The amount (in cents) 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 invalid or not valid for the chosen location