Skip to main content

Signup API Overview

The Signup API handles the registration of new users or companies in GNet Connect. This endpoint supports both dry mode and live mode for flexible registration workflows.
  • Dry Mode: Simulates the registration process, providing a preview of the data without saving it to the database.
  • Live Mode: Commits the registration data, creating the user or company record.

Endpoint

POST /api/company/register

Request Body Schema

const SignupSchema = z.object({
  name: z.string().min(1).max(250),
  mainPhone: z.string(),
  countryCode: z.string(),
  mainEmail: z.string().email(),
  address: z.string().nullish(),
  coType: z.enum(["IO", "CO"]),
  vendor_platform: z.string().nullish(),
  password: z.string().min(8).max(100),
  confirmPassword: z.string().min(8).max(100),
  mode: z.enum(["dry", "live"]),
  notes: z.string().nullish(),
});

Required Fields

FieldTypeDescriptionValidation
namestringCompany or full nameMin 1, Max 250 characters
mainEmailstringPrimary email addressMust be a valid email
mainPhonestringPrimary phone numberRequired
countryCodestringCountry codeRequired
coType”IO” or “CO”Company typeRequired
addressstringCompany addressOptional
mode”dry” or “live”Registration modeRequired
passwordstringPasswordMin 8, Max 100 characters
confirmPasswordstringPassword confirmationMust match password

Optional Fields

FieldTypeDescriptionValidation
vendor_platformstringVendor platformOptional
notesstringHow did you hear about usOptional

Example Request Body

{
  "name": "Company Name",
  "mainEmail": "email@example.com",
  "mainPhone": "+1234567890",
  "countryCode": "+1",
  "password": "securepassword",
  "confirmPassword": "securepassword",
  "address": "123 Main St, City, State",
  "notes": "Found through TranspoApp",
  "coType": "IO",
  "mode": "live"
}

Success Responses

200 - Success

Returned for both successful company registration and successful dry run validation. Standard Success Response:
{
  "success": true,
  "status": 200,
  "error": ""
}
Dry Run Success Response:
{
  "success": true,
  "status": 200,
  "error": "",
  "verification": {
    // Verification score details
  },
  "mode": "dry",
  "griddid": "company-slug",
  "data": {
    // Submitted payload data
  }
}

Error Responses

422 - Unprocessable Entity

Occurs when the request payload fails schema validation.
{
  "success": false,
  "error": "Invalid payload"
}

428 - Precondition Required

Returned when the AI verification score is below the required threshold.
{
  "success": false,
  "error": "Verification failed"
}

409 - Conflict

Indicates that a user or company with the given email or phone already exists.
{
  "success": false,
  "status": 409,
  "error": "For given email or phone, we found at least one registered entity: {contextid}"
}

424 - Failed Dependency

Occurs when an issue with dependent services or database operations prevents registration.
{
  "success": false,
  "status": 424,
  "error": "{specific error message}"
}

501 - Not Implemented

Occurs when an invalid company type is provided or when an unimplemented registration path is used.
{
  "success": false
}

502 - Bad Gateway

Returned for server-side errors during Independent Operator (IO) registration.
{
  "success": false,
  "status": 502,
  "error": "{error details}"
}

503 - Service Unavailable

Returned for server-side errors during Company (CO) registration.
{
  "success": false,
  "status": 503,
  "error": "{error details}"
}

Response Format

All responses follow a consistent structure:
FieldTypeDescription
successbooleanIndicates whether the operation succeeded
statusnumberHTTP status code
errorstringError message (if applicable)
additional fieldsvariesContext-specific fields like griddid

Notes

  • Fields marked as nullish in the schema are optional.
  • password and confirmPassword must match.
  • The API automatically generates fields like griddid and createdAt.
  • Default AI verification score threshold is 30.
  • The payment object, if needed, is handled through separate endpoints.

For additional details, please refer to the complete API documentation.
I