User Registration

Create a new user account programmatically via the API.

Create a new user account programmatically via the API. This mutation provisions a complete user with account, network seat, balances, and referral capabilities.

🔒 Restricted Access

This endpoint requires special permission from Fluz. Contact your account manager or [email protected] to enable user registration for your application.

mutation RegisterUser(
  $firstName: String!
  $lastName: String!
  $phoneNumber: String!
  $regionCode: String!
  $emailAddress: String!
  $dateOfBirth: String!
) {
  registerUser(
    firstName: $firstName
    lastName: $lastName
    phoneNumber: $phoneNumber
    regionCode: $regionCode
    emailAddress: $emailAddress
    dateOfBirth: $dateOfBirth
  ) {
    success
    error
  }
}

Parameters

ParameterTypeRequiredDescription
firstNameStringYesThe user's first name
lastNameStringYesThe user's last name
phoneNumberStringYesThe user's phone number (digits and - accepted). e.g., "5551234567" or "555-123-4567"
regionCodeStringYESISO 3166-1 alpha-2 country code for the phone number (e.g., "US", "CA")
emailAddressStringYesThe user's email address
dateOfBirthStringYesThe user's date of birth in YYYY-MM-DD format

Response

Success Response

{
  "data": {
    "registerUser": {
      "success": true,
      "error": null
    }
  }
}

Response Fields

FieldTypeDescription
successBooleantrue if the user was successfully registered
errorRegisterUserErrorIf success is false, will return an Error object that holds the message and code

Note: This mutation returns errors in the response data, not as GraphQL errors. Always check the success field and handle the error object when success is false.

Example Request

curl -X POST https://transactional-graph.staging.fluzapp.com/api/v1/graphql \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your_access_token>" \
  -d '{
  "query": "mutation RegisterUser($firstName: String!, $lastName: String!, $phoneNumber: String!, $regionCode: String!, $emailAddress: String!, $dateOfBirth: String!) { registerUser(firstName: $firstName, lastName: $lastName, phoneNumber: $phoneNumber, regionCode: $regionCode, emailAddress: $emailAddress, dateOfBirth: $dateOfBirth) { success error { code message } } }",
  "variables": {
    "firstName": "Jane",
    "lastName": "Doe",
    "phoneNumber": "5551234567",
    "regionCode": "US",
    "emailAddress": "[email protected]",
    "dateOfBirth": "1990-05-15"
  }
}'
const response = await fetch('https://transactional-graph.staging.fluzapp.com/api/v1/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${accessToken}`
  },
  body: JSON.stringify({
    query: `
      mutation RegisterUser(
        $firstName: String!
        $lastName: String!
        $phoneNumber: String!
        $regionCode: String!
        $emailAddress: String!
        $dateOfBirth: String!
      ) {
        registerUser(
          firstName: $firstName
          lastName: $lastName
          phoneNumber: $phoneNumber
          regionCode: $regionCode
          emailAddress: $emailAddress
          dateOfBirth: $dateOfBirth
        ) {
          success
          error {
            code
            message
          }
        }
      }
    `,
    variables: {
      firstName: "Jane",
      lastName: "Doe",
      phoneNumber: "5551234567",
      regionCode: "US",
      emailAddress: "[email protected]",
      dateOfBirth: "1990-05-15"
    }
  })
});

const data = await response.json();

if (data.data.registerUser.success) {
  console.log('User registered successfully!');
} else {
  console.error('Registration failed:', data.data.registerUser.error);
}

Error Codes

CodeMessageDescription
AUTH-0004Invalid phone numberThe phone number format is invalid or cannot be parsed with the given region code.
AUTH-0022Registration not allowed, please contact customer support!Your application does not have permission to register users. Contact Fluz support to enable this capability.
AUTH-0025Please try again or contact support.A general registration failure occurred. Please retry or contact support.
AUTH-0026The phone number you chose is already in use.The phone number is already associated with an existing account.
AUTH-0027The email address you chose is already in use.The email address is already associated with an existing account.
AUTH-0030Your application is not active.Your application is not active and cannot register users.