The customer object

This entity allows you to:

  • store customer details in Voucherify,
  • link redemptions and validations to a particular customer,
  • build customer segments and use them in validation rules.

Go to Customers to understand segmentation and tracking.

Attribute

Description

Example

id
string

cust_AIVa5X5fmcJJgcyBem8TeLdB

object string

Type of the object represented by JSON. Value is customer.

source_id
string

A unique customer identifier. You can provide your own (e.g. CRM id) or use the one returned by Voucherify, see tracking_id from Validate Voucher (client-side).

john_doe_7134234

name
string

John Doe

email
string

[email protected]

description
string

An arbitrary string that you can attach to a customer object. It is displayed alongside a customer in the dashboard.

Lorem ipsum

address
object

A set of key/value pairs which describes address. Allowed keys: city, state, line_1, line_2, country, postal_code.

"address": {
  "city": "Melbourne",
  "state": "FL",
  "line_1": "226 E Fee Ave",
  "line_2": null,
  "country": "Australia",
  "postal_code": "32901"
}

phone

+48 123456789

metadata
object

A set of custom key/value pairs that you can attach to a customer object for segment building.

"metadata": { 
  "lang": "en"
}

created_at
string, ISO 8601 date format

2016-11-16T14:14:31Z

2021**-04-12T12:51:27Z"

birthdate
string

Optional string with customer's birthdate

"birthdate": "1974-07-04"

summary
object

Summary presents current customer's statistics.

Child attributes:

  • redemptions object - returns summary of customer's redemptions, gift cards balance, and current loyalty card score

  • orders object - returns the summary of customer's orders including total amount, and details of a customer's last order.

"summary": {
        "redemptions": {
            "total_redeemed": 5,
            "total_failed": 0,
            "total_succeeded": 5,
            "total_rolled_back": 0,
            "total_rollback_failed": 0,
            "total_rollback_succeeded": 0,
            "gift": {
                "redeemed_amount": 0,
                "amount_to_go": 0
            },
            "loyalty_card": {
                "redeemed_points": 0,
                "points_to_go": 200
            }
        },
        "orders": {
            "total_amount": 148800,
            "total_count": 5,
            "average_amount": 49600,
            "last_order_amount": 0,
            "last_order_date": "2021-04-12T12:51:26Z"
        }
    }

loyalty
object

Returns current customer's loyalty and referral statistics. You can see the summary of loyalty activity and the following details:

  • how many loyalty points were already redeemed ,
    what is the customer's cards
  • score in the particular loyalty campaigns,
  • number of referrals assigned to customer profile (number of referred customers)
"loyalty": {
        "points": 340,
        "referred_customers": 1,
        "campaigns": {
            "loyalty easy": {
                "points": 200,
                "referred_customers": 0
            },
            "Loyalty Upgrade 01/2021": {
                "points": 140,
                "referred_customers": 0
            },
            "Referral campaign v_20210219": {
                "points": 0,
                "referred_customers": 1
            }
        }
    }

referrals
object

This object returns details of a referral campaign in which the customer was referred.

"referrals": {
        "campaigns": [
            {
                "campaign_id": "camp_E2g0p1efx6wgpyF9Evkr5khL",
                "referrer_id": "cust_squ42iWjpBdRBMyJQre7tfLZ",
                "related_object_id": "r_oQCQjy86OIhmn8icxKUm3sFv",
                "related_object_type": "redemption",
                "date": "2021-04-16T11:49:44Z"
            }
        ],
        "total": 1
    }

system_metadata
object

System metadata returns information about marketing consents assigned to a customer's profile.

"system_metadata": {
        "consents": {
            "unsubscribed": {
                "date": "2021-04-08T11:50:07.466Z",
                "value": false
            },
            "cnst_61uGQeWeTGYxQHwkt6QiF2Xe": {
                "date": "2021-04-08T11:50:07.466Z",
                "value": false
            },
            "cnst_7HDZvdVymgWhUO9nh19m1cxw": {
                "date": "2021-04-08T11:50:07.466Z",
                "value": false
            }
        }
    }

assets
object

Returns customer's cockpit URL

"assets": {
        "cockpit_url": "https://dev.cockpits.voucherify.io/customers?token=U2FsdGVkX1%2FUSiIJbW7IHhgYFezTdSyo%2BApQTEp%2Fx0%2BLdOjqduJXDJ1aeokHMIPCaQD8GuMzfpiCqepJ7dhHlPQphOcmh2O%2FWfwkxkn0EsG2Lst7qgQlMiPWCk3%2Fz080k66nvslYfkoglYmVhvCVUi1ncbqgUiXMzcnaN100Trb6LF2nOzYTYQMRZ8%2Fp4iY730L0WDDpskf1aDVWlDWdkQ%3D%3D"
    }
{
    "id": "cust_cwzFQcb3C5XgbgVknYPUNb1p",
    "source_id": "trackcust5432",
    "name": "Andy Tonic",
    "email": "[email protected]",
    "address": {
        "city": null,
        "state": null,
        "line_1": null,
        "line_2": null,
        "country": null,
        "postal_code": null
    },
    "birthdate": "1974-07-04",
    "summary": {
        "redemptions": {
            "total_redeemed": 5,
            "total_failed": 0,
            "total_succeeded": 5,
            "total_rolled_back": 0,
            "total_rollback_failed": 0,
            "total_rollback_succeeded": 0,
            "gift": {
                "redeemed_amount": 0,
                "amount_to_go": 0
            },
            "loyalty_card": {
                "redeemed_points": 0,
                "points_to_go": 200
            }
        },
        "orders": {
            "total_amount": 148800,
            "total_count": 5,
            "average_amount": 49600,
            "last_order_amount": 0,
            "last_order_date": "2021-04-12T12:51:26Z"
        }
    },
    "loyalty": {
        "points": 340,
        "referred_customers": 1,
        "campaigns": {
            "loyalty easy": {
                "points": 200,
                "referred_customers": 0
            },
            "Loyalty Upgrade 01/2021": {
                "points": 140,
                "referred_customers": 0
            },
            "Referral campaign v_20210219": {
                "points": 0,
                "referred_customers": 1
            }
        }
    },
    "metadata": {
        "lang": "en"
    },
    "system_metadata": {
        "consents": {
            "unsubscribed": {
                "date": "2021-04-08T11:50:07.466Z",
                "value": false
            },
            "cnst_61uGQeWeTGYxQHwkt6QiF2Xe": {
                "date": "2021-04-08T11:50:07.466Z",
                "value": false
            },
            "cnst_7HDZvdVymgWhUO9nh19m1cxw": {
                "date": "2021-04-08T11:50:07.466Z",
                "value": false
            }
        }
    },
    "created_at": "2021-04-07T08:04:03Z",
    "updated_at": "2021-04-12T12:51:27Z",
    "object": "customer",
    "referrals": {
        "campaigns": [
            {
                "campaign_id": "camp_E2g0p1efx6wgpyF9Evkr5khL",
                "referrer_id": "cust_squ42iWjpBdRBMyJQre7tfLZ",
                "related_object_id": "r_oQCQjy86OIhmn8icxKUm3sFv",
                "related_object_type": "redemption",
                "date": "2021-04-16T11:49:44Z"
            }
        ],
        "total": 1
    },
    "assets": {
        "cockpit_url": "https://dev.cockpits.voucherify.io/customers?token=U2FsdGVkX1%2FUSiIJbW7IHhgYFezTdSyo%2BApQTEp%2Fx0%2BLdOjqduJXDJ1aeokHMIPCaQD8GuMzfpiCqepJ7dhHlPQphOcmh2O%2FWfwkxkn0EsG2Lst7qgQlMiPWCk3%2Fz080k66nvslYfkoglYmVhvCVUi1ncbqgUiXMzcnaN100Trb6LF2nOzYTYQMRZ8%2Fp4iY730L0WDDpskf1aDVWlDWdkQ%3D%3D"
    }
}