Hello 👋🏼 How can we help?

Get a single customer

Fetch the details of a single customer by their id
Written by Konstantine
Updated 2 months ago

You can get all the details of a single customer by their id.

Use Get all customers method if you want to retrieve all customers from your account. You can also search for a specific customer or a bunch of customers with the Search for customers method.

➡️ Request

URL https://api.helpcrunch.com/v1/customers/<customer_id>
Method GET
Headers Authorization: Bearer <your_api_key>

<customer_id> is the identifier for the customer as given by HelpCrunch. It is required for this method and looks like a combination of numbers, for example 1568834.

Read more about authorization header here.


✅ Successful Response

If your request has succeeded, you'll get a 200 OK success status code together with the following response body.

{
    "id": 8737843,
    "name": "Cindy Mindy",
    "email": "cindy.mindy@example.com",
    "userId": "example_6268",
    "company": "example",
    "phone": null,
    "firstSeen": 1588927354,
    "lastSeen": 1591627673,
    "location": {
        "regionCode": "CA",
        "countryCode": "US",
        "city": "San Francisco"
    },
    "device": {
        "id": 28883192,
        "ip": "192.168.1.1",
        "timezone": "America/Los Angeles",
        "platform": "desktop",
        "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
    },
    "unsubscribed": false,
    "blocked": false,
    "source": "http://helpcrunch.com/blog/best-live-chat-software/",
    "referer": "https://www.google.com/",
    "locale": "en",
    "notes": null,
    "lastPage": "https://example.helpcrunch.com/v2/chats",
    "tags": [
        {
            "name": "lead",
            "color": "#00c2e0"
        }
    ],
    "customData": [
        {
            "property": "Role",
            "value": "admin"
        },
        {
            "property": "Plan",
            "value": "Enterprise (Unlimited) $9999/mo"
        },
        {
            "property": "segment",
            "value": "PotentialChurn_premium_seg1"
        },
            "property": "Currency", 
            "value": "USD"
        },
        {
            "property": "Emails sent",
            "value": 621
        },
        {
            "property": "Trial end date",
            "value": "2017-07-24 14:30:00"
        },
        {
            "property": "Became payer at",
            "value": "2017-09-13 00:00:00"
        },
        {
            "property": "Registered date", 
            "value": "2017-07-10 14:30:00"
        },
        {
            "property": "Next payment date",
            "value": "2020-09-01 00:40:00"
        },
        {
            "property":  "Billing info added", 
            "value": true
        },
        {
            "property": "Number of payments",
            "value": 35
        },
        {
            "property": "Subscription status", 
            "value": "active"
        }
    ]
}
You can get details on every Customer Object field in the Customer model article.

🛑 Error Responses

You may get one of the following error status codes and responses. More info on the errors is available here.

401 Unauthorized

{
    "errors": [
        {
            "code": "invalid_token",
            "message": "Invalid token"
        }
    ]
}

404 Not Found

{
    "errors": [
        {
            "code": "entity_not_found",
            "message": "Customer not found"
        }
    ]
}

429 Too Many Requests

{
    "errors": [
        {
            "code": "too_many_requests",
            "message": "You have exceeded your requests limit"
        }
    ]
}

If you have any questions regarding the REST API, feel free to chat us any time.

👩‍💻 Happy Coding! 👨‍💻

Did this answer your question?