Working with Customers

You can retrieve your customer data through the TicketSource API. This guide will go through the necessary call to retrieve this information which can be used for mail merges or syncing with external CRM systems.

If you haven't already, you should go through our getting started guide for instructions on obtaining credentials and how to authenticate with the API.

Customers

You can retrieve a list of all Customer resources on your TicketSource account by querying the /customers endpoint.

Sample Request:

$curl = curl_init('https://api.ticketsource.io/customers');
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Authorization: Bearer '.'skl-xxxxxxxxxx'
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($curl);
$customers = json_decode($response);

Sample Response:

{
    "data": [
        {
            "id": "cst-xxxxxxxxxx1",
            "type": "customer",
            "attributes": {
                "title": null,
                "first_name": "Sample",
                "last_name": "Customer",
                "address": {
                    "line_1": "Off Edge",
                    "line_2": "Station Approach",
                    "line_3": "Penarth",
                    "line_4": "United Kingdom",
                    "postcode": "CF64 3EE"
                },
                "telephone": "03336664466",
                "email": "support@ticketsource.co.uk",
                "membership": {
                    "identifier": null,
                    "start_date": null,
                    "end_date": null
                },
                "consent": {
                    "email": true,
                    "post": false,
                    "sms": false
                },
                "created_at": "2019-02-12T10:58:34+00:00",
                "updated_at": null
            },
            "links": {
                "self": "https://api.ticketsource.io/customers/cst-xxxxxxxxxx1"
            }
        },
        {
            ...
        }
    ],
    "links": {
        "first": "https://api.ticketsource.io/customers?page=1",
        "last": null,
        "prev": null,
        "next": "https://api.ticketsource.io/customers?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.ticketsource.io/customers",
        "per_page": 10,
        "to": 10
    }
}
Menu