Index user

In order to make your users resolvable on the SDK, you need to index them on Thepeer. Your identifier must match the identifier type registered on your business. At the time of writing, we support username and email.

What is identifier type?

An identifier type is the primary means of user identification on your platform. There are various types of identifier types which range from email, username, phone number, Account ID etc. However, we currently support username and email.

Endpoint

POST

https://api.thepeer.co/users

Sample body

{
"name": "Steve Jobs",
"identifier": "steve",
"email": "steve@apple.com"
}

Field requirements

Field nameData typeRequired
namestringtrue
identifierstringtrue
emailstringtrue

Sample response

{
"indexed_user": {
"name": "Steve Jobs",
"identifier": "steve",
"identifier_type": "username",
"email": "steve@apple.com",
"reference": "stay-foolish-stay-hungry"
}
}

👀

NOTE

  • identifier types will be validated according to what was selected for your business on signup.
  • identifiers and emails are unique to your business.
  • Save the reference returned, it will be used by you in the future to find the user a transaction belongs to.