"Look Up Member by Barcode" API Documentation

Overview

This endpoint is used to look up an active member by their barcode. It provides basic information used to verify the member's identity: name, birthday, and profile image.

This endpoint accepts GET requests only, and the barcode is placed into the URL as follows: /api/look-up-member-by-barcode/<barcode>/. If the barcode corresponds to an active member, a 200 response will be returned, containing a JSON object with the member's information. If the barcode corresponds to a customer who is not an active member, a 400 response will be returned, containing the customer's information as well as an error message. See the examples below for more information.

Operations

Successful Lookup

Request
GET https://api.hellocapitan.com/api/look-up-member-by-barcode/1299035153928327/

Response
200 OK
{
    "customer": {
        "id": 1538953,
        "first_name": "Buzz",
        "last_name": "Aldrin",
        "birthday": "1930-01-20",
        "profile_image_url": "https://capitan-media-prod.s3.amazonaws.com/customer-profileimages/81bb40a3f79e4b4abb0d0f8e157aa017.jpg",
        "profile_image_small_url": "https://capitan-media-prod.s3.amazonaws.com/customer-profile-images-small/9592073e6ac6e766501b95d233eb10e1.jpg"
    }
}

Error: Customer Not Found

Request
GET https://api.hellocapitan.com/api/look-up-member-by-barcode/1299035153928327/

Response
404 Not Found
{
    "error": "No customer matching barcode."
}

Error: Customer Has No Membership

Request
GET https://api.hellocapitan.com/api/look-up-member-by-barcode/1299035153928327/

Response
400 Bad Request
{
    "customer": {
        "id": 1538953,
        "first_name": "Buzz",
        "last_name": "Aldrin",
        "birthday": "1930-01-20",
        "profile_image_url": "https://capitan-media-prod.s3.amazonaws.com/customer-profileimages/81bb40a3f79e4b4abb0d0f8e157aa017.jpg",
        "profile_image_small_url": "https://capitan-media-prod.s3.amazonaws.com/customer-profile-images-small/9592073e6ac6e766501b95d233eb10e1.jpg"
    },
    "error": "This customer does not have a membership."
}

Error: Customer's Membership Is Inactive

Request
GET https://api.hellocapitan.com/api/look-up-member-by-barcode/1299035153928327/

Response
400 Bad Request
{
    "customer": {
        "id": 1538953,
        "first_name": "Buzz",
        "last_name": "Aldrin",
        "birthday": "1930-01-20",
        "profile_image_url": "https://capitan-media-prod.s3.amazonaws.com/customer-profileimages/81bb40a3f79e4b4abb0d0f8e157aa017.jpg",
        "profile_image_small_url": "https://capitan-media-prod.s3.amazonaws.com/customer-profile-images-small/9592073e6ac6e766501b95d233eb10e1.jpg"
    },
    "error": "This customer's membership is not active."
}