API documentation POST /users/new | POST /users/{id}
Create a new user in the system by providing detailed offer information through a POST request.
POST https://demo.trafficmanager.com/api/v1/users/new | https://demo.trafficmanager.com/api/v1/users/{id}
This endpoint allows the creation or updating of a user in the system. The request must include a JSON object with the user details to be created or updated.
Authentication:
The request must be authenticated with the following HTTP headers:x-api-key: Your API key, found in the Security pagex-user-id: Your User ID, found in the Security page
POST Body Parameters:
The request body must be a JSON object with the following structure, including detailed specifications of the user to be created:
{
"id": 123, // Optional. It can be set to create a new user with a specific ID. It cannot be used on update.
"username": "johndoe_9232", // Required for new user
"email": "john.doe.da2v@example.com", // Required for new user
"password": "securepassword123", // Required for new user
"isPasswordHashed": "0", // Optional, default is 0, meaning the password is in plain text. Set it to 1 if the password is already hashed. Supported algorithms: bcrypt, argon2i, argon2id
"referrer": 42, // Optional, ID of the referring user.
"affiliate_manager_id": 15, // Optional, ID of the main affiliate manager. Send an empty string ("") to unset it, or to promote the only assigned affiliate manager when affiliateManagers contains exactly one ID.
"affiliateManagers": [15, 16], // Optional. List of IDs of assigned affiliate managers. Use an empty array ([]) to clear all, unless a valid affiliate_manager_id is also sent.
"status": 1, // Optional, default can be active or pending approval, depending on the network referrer policy. Allowed statuses are: -1 (pending approval), 1 (active), 3 (inactive), 0 (banned), -2 (unapproved), -3 (inactive and banned), -4 (pending deletion)
"profile": {
"firstName": "John",
"lastName": "Doe",
"birthDate": "1992-05-14",
"address": "123 Main St, Springfield",
"zip": "62704",
"country": "US",
"SSN": "123-45-6789",
"passportNo": "X12345678",
"phone": "+1-555-123-4567",
"skype": "live:john.doe92",
"partnerCode": "ABC123",
// Additional custom fields as needed
},
"paymentMethods": {
"Wire transfer": [
{
"id" : 17, // optional, required for editing if not provided will create a new payment account
"IBAN": "US12345678901234567890",
"Account holder name": "John Does Not",
"Account holder address": "123 Main St, Springfield",
"SWIFT/BIC": "ABCDEF12",
"Bank name": "Bank of Springfield",
"Bank address": "456 Elm St, Springfield",
"Intermediary Bank": "Global Bank",
"Intermediary bank SWIFT": "GB123456",
"Intermediary bank address": "789 Oak St, Metropolis"
},
{
"IBAN": "US12345678901234567891",
"Account holder name": "John Does",
"Account holder address": "123 Main St, Springfield",
"SWIFT/BIC": "ABCDEF12",
"Bank name": "Bank of Springfield",
"Bank address": "456 Elm St, Springfield",
"Intermediary Bank": "Global Bank",
"Intermediary bank SWIFT": "GB123456",
"Intermediary bank address": "789 Oak St, Metropolis"
}
],
"PayPal": [
{
"Paypal email": "john@doe.com"
}
]
}
}
Note: This JSON structure is a simplified example. Replace placeholder text with actual data for the user being created/updated.
When affiliateManagers is present on edit, it replaces the assigned affiliate manager list. If the submitted array is not empty and affiliate_manager_id is omitted, the current main affiliate manager from the database is preserved, even if it is missing from the array. If affiliateManagers is an empty array, all assigned affiliate managers are cleared, including the main affiliate manager. If affiliate_manager_id is an empty value and the final affiliateManagers list contains exactly one manager, that manager becomes the main affiliate manager. If affiliate_manager_id is provided with a valid user ID, that manager is also ensured to be included in the assigned affiliate manager list.
Success Response:
{
"message": "User created successfully with ID 123" or "User edited successfully",
}
This response indicates that the user was successfully created or updated in the system.
Error Response:
{
"status": [error code],
"message": [error message]
}
Explains why the request failed, such as missing required fields, authentication issues, or invalid parameters.
English
العربية
Dansk
Deutsch
Español
Suomi
Italiano
Português
Русский
Svenska
中文