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 this we currently support username and email.

What is identifier type

An identifier type is the primary means of user identification on your platform. There are various type of identifier types which ranges 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 would be used by you in the future to find the user a transaction belongs to.