Users

Endpoints for registration, query, and user management.

Quick Navigation


User Registration

Creates a new user account on the platform.

This endpoint only requires API Key, no prior authentication needed.

Endpoint

POST /user/

Headers

Content-Type: application/json
Accept: application/json
x-api-key: [API_KEY]

Request Body

FieldTypeRequiredDescription
usernamestringβœ…Must be valid email for PANEL/API
emailstringβœ…Email address (converted to lowercase)
passwordstringβœ…Password (max 100 chars)
phonestringβœ…Phone number without country code
country_codestring❌Country code (e.g., 57 for Colombia)
first_namestring❌First name (max 100 chars)
last_namestring❌Last name (max 100 chars)

Person Types

ValueTypeDescription
1NATURALNatural person
2JURIDICALJuridical person (company)
⚠️

For juridical persons (type_person=2): The country_company_incorporation field is mandatory.

Fields for Juridical Person

If type_person=2, you can send legal representative data:

FieldDescription
document_type_legalRepresentative’s document type
document_number_legalRepresentative’s document number
name_legalRepresentative’s name
last_name_legalRepresentative’s last name
date_birth_legalRepresentative’s birth date
gender_legalRepresentative’s gender

Validations

⚠️

The system validates for duplicates before creating the user.

  • βœ… Unique email β€” No other user can have the same email
  • βœ… Unique username β€” No other user can have the same username
  • βœ… Unique phone β€” No other user can have the same phone
  • βœ… Unique document β€” No other user can have the same document
  • βœ… Username = Email β€” For PANEL and API platforms, username must be a valid email

Successful Response

201 CREATED
{
  "id": 123,
  "username": "user@example.com",
  "email": "user@example.com",
  "first_name": "John",
  "last_name": "Doe"
}

Errors

CodeErrorDescription
400InvalidReferrerInvalid referral code
400ProfileAlreadyReferredProfile already has a referral assigned
404ReferalCodeNotExistReferral code doesn’t exist
400TypePersonRequiredPerson type required
400InfoBusinessDoesNotExistBusiness info doesn’t exist
400IntegrationExceptionExternal integration error

Get Profile

Gets the authenticated user’s profile information.

Endpoint

GET /user/

Headers

Authorization: Bearer [ACCESS_TOKEN]
x-api-key: [API_KEY]

Query Parameters

ParameterTypeDescription
litebooleanReturns reduced version of profile

Response

GET /user/
{
  "id": 123,
  "uuid": "abc-123-def-456",
  "username": "user@example.com",
  "email": "user@example.com",
  "first_name": "John",
  "last_name": "Doe",
  "alias": "jdoe",
  "phone": "3001234567",
  "country": "CO",
  "country_code": "57",
  "city": "BogotΓ‘",
  "address": "Street 123 #45-67",
  "document_type": "CC",
  "document_number": "1234567890",
  "phone_verified": true,
  "email_verified": true,
  "type_person": "NATURAL",
  "level": 5,
  "document_status": "APPROVED",
  "has_pin": true,
  "has_otp": false,
  "roles": ["user"],
  "last_login": "2024-01-15T10:30:00Z",
  "platform": "API"
}

Profile Fields

FieldTypeDescription
idintUnique profile ID
uuidstringUniversal UUID
usernamestringUsername (email)
emailstringEmail address
first_namestringFirst name
last_namestringLast name
phonestringPhone
country_codestringCountry code
phone_verifiedbooleanIs phone verified?
email_verifiedbooleanIs email verified?
type_personstringNATURAL or JURIDICAL
levelintValidation level (0-5)
has_pinbooleanHas PIN configured?
has_otpbooleanHas 2FA enabled?
is_merchantbooleanIs merchant?

Edit Profile

Updates the authenticated user’s profile information.

Endpoint

POST /edit_profile/

Headers

Authorization: Bearer [ACCESS_TOKEN]
Content-Type: application/json
x-api-key: [API_KEY]

Editable Fields

Edit personal data
{
  "first_name": "John Carlos",
  "last_name": "Doe Smith",
  "alias": "jcdoe",
  "phone": "3009876543",
  "gender": "M",
  "date_birth": "1990-01-15",
  "date_expiration": "2030-01-15",
  "profile_picture": "https://example.com/photo.jpg"
}

Apply Referral Code

Apply referral code
{
  "referal_code": "ABC123"
}
🎁

When applying a valid referral code, the following are automatically updated:

  • max_transaction_quantity
  • payment_methods_configuration
  • payment_methods_configuration_reload

Successful Response

200 OK
{
  "message": "Profile edited successfully"
}

Or for specific configurations:

200 OK
{
  "result": "ok"
}

Errors

CodeErrorDescription
404UNABLE_TO_GET_PROFILEProfile not found
400UserToEditExistUser to edit already exists
400UserByEmailEmail already in use by another user
400UserByPhoneExistPhone already in use by another user

Change Password

Updates the authenticated user’s password.

πŸ”’

For security, the current password is required and the new password must be confirmed.

Endpoint

PUT /profile/change-password

Headers

Authorization: Bearer [ACCESS_TOKEN]
Content-Type: application/json
x-api-key: [API_KEY]

Request

request.json
{
  "old_password": "CurrentPassword123",
  "new_password": "NewPassword456!",
  "new_password_confirmation": "NewPassword456!"
}
FieldTypeRequiredDescription
old_passwordstringβœ…Current password
new_passwordstringβœ…New password
new_password_confirmationstringβœ…New password confirmation

Validations

  • βœ… Current password must be correct
  • βœ… new_password must equal new_password_confirmation
  • βœ… Rate limiting implemented to prevent brute force attacks

Response

200 OK
{
  "message": "Password updates successfully."
}

Errors

CodeErrorDescription
429PasswordInTimeoutToo many attempts, wait before retrying
400PasswordNotMatchCurrent password incorrect

Password Recovery

Process to recover access when the user forgot their password.

This endpoint only requires API Key, no authentication needed.

Endpoint - Request Recovery

POST /password_recovery_request/

Headers

Content-Type: application/json
x-api-key: [API_KEY]

Request

request.json
{
  "email": "user@example.com"
}

Recovery Flow

Step 1: Request recovery

User sends their email to /password_recovery_request/ endpoint.

Step 2: Receive code

System sends a verification code to user’s email.

Step 3: Validate code

User enters the received code to validate their identity.

Step 4: Set new password

User can set a new password.


Validation Levels

The system handles different identity verification levels:

πŸ“Š

The level determines what operations the user can perform.

LevelStatusDescription
0πŸ”΄ UnvalidatedNewly created user
1🟑 PendingDocuments submitted, under review
2🟠 With errorsDocuments rejected
5🟒 ValidatedVerification complete

Level 0 - Unvalidated

New user, can only view their profile. Cannot perform transactions.

Level 1 - Pending

Documents submitted, awaiting compliance team approval.

Level 2 - With errors

Documents rejected for some reason. User must resubmit documentation.

Level 5 - Fully validated

Full access to all platform functionalities.


Collaborators

If the user is a collaborator (not a regular profile), the GET /user/ response returns data from ColaboratorSerializer instead of ProfileSerializer.

πŸ‘₯

Collaborators are users with special roles that belong to an organization.