Onboarding API
Create Account
Create a new user account with contact information and credentials
POST
Overview
Creates a new user account with associated contact information and credentials. This is the first step in the merchant onboarding process.Account approval required: New accounts are initially registered under Packworks Merchant parent and become visible in the backoffice only after admin approval. Upon approval, a new merchant branch is created and assigned to the account.
Rate Limiting
This endpoint is rate limited to 10 requests per 60 seconds per client.
Authentication
This endpoint requires JWT Bearer Token authentication.Request Parameters
Contact Information
User’s contact information
User Information
User’s personal information and credentials
Response
Success Response
Status Code:200 OK
The unique account ID of the newly created accountUsage: Use this ID for subsequent onboarding steps (JWT token generation, merchant onboarding)Example:
12345Error Responses
401 Unauthorized
401 Unauthorized
400 Bad Request - Validation Error
400 Bad Request - Validation Error
Status Code: Solution: Ensure all parameters meet the validation requirements listed above
400Cause: Request parameters don’t meet validation rulesExamples:Invalid Password
Invalid Email
Invalid Phone
400 Bad Request - Username Not Available
400 Bad Request - Username Not Available
Status Code: Cause: The requested username is already taken by another userSolution: Choose a different username
400400 Bad Request - Database Error
400 Bad Request - Database Error
Status Code: Cause: Failed to save the account to the databaseSolution: Retry the request. If the issue persists, contact support
400429 Too Many Requests
429 Too Many Requests
Status Code: Cause: Rate limit exceeded (more than 10 requests in 60 seconds)Solution: Wait before retrying. Implement exponential backoff in your application
429500 Internal Server Error
500 Internal Server Error
Status Code: Cause: Unexpected server errorSolution: Retry the request. If the issue persists, contact support
500Validation Requirements
Name Validation
✓ 1-100 characters
✓ Unicode letters, spaces, hyphens, and apostrophes only
✓ No numbers or special characters (except hyphens and apostrophes)
Username Validation
✓ 1-50 characters
✓ Letters, numbers, dots, underscores, and hyphens only
✓ Must be unique across the system
Password Validation
✓ 12-64 characters
✓ At least 1 uppercase letter
✓ At least 1 lowercase letter
✓ At least 1 number
✓ At least 1 special character from: #?!@$%^&*-
Best Practices
Client-Side Validation
Validate all fields before submitting to avoid 400 errors
Handle Rate Limiting
Implement retry logic with exponential backoff for 429 errors
Secure Password Handling
Never log or store passwords in plain text
Save Account ID
Store the returned account ID for subsequent onboarding steps
Username Availability
Check username uniqueness before submission if possible
Error Feedback
Provide clear error messages to users when validation fails
Account Lifecycle
Security Notes
Password Security
Password Security
- Passwords are hashed using bcrypt before storage
- Passwords expire after 90 days and must be changed
- Never send passwords over unencrypted connections
- Implement strong password requirements on the client side
PIN Security
PIN Security
- PINs are encrypted using Rijndael encryption
- PINs provide additional security for sensitive operations
- Consider implementing PIN rate limiting in your application
Rate Limiting
Rate Limiting
- Maximum 10 requests per 60 seconds per client
- Implement exponential backoff when encountering 429 errors
- Consider caching account creation attempts to prevent abuse
Troubleshooting
Username Already Taken
Username Already Taken
Error:
Username is not availableSolution:- Try a different username
- Add numbers or special characters (dots, underscores, hyphens)
- Consider using email prefix or unique identifiers
Password Validation Failed
Password Validation Failed
Error:
user.password must have at least 1 uppercase and lowercase character, a number, and special characterSolution:- Ensure password is 12-64 characters long
- Include at least one uppercase letter (A-Z)
- Include at least one lowercase letter (a-z)
- Include at least one number (0-9)
- Include at least one special character from: #?!@$%^&*-
SecurePass123!Rate Limit Exceeded
Rate Limit Exceeded
Error:
ThrottlerException: Too Many RequestsSolution:- Wait 60 seconds before retrying
- Implement exponential backoff
- Don’t retry immediately on 429 errors
- Consider queueing account creation requests
Next Steps
Generate JWT Token
Create a JWT Bearer Token for authentication
Onboard Merchant
Complete merchant onboarding with the account ID
Upload Documents
Upload required KYC documents
Error Handling
Learn about error codes and handling
Authorizations
JWT Bearer token authentication
Body
application/json