Shopify Integration/User Management
Create User
Create a new user in the system
Create User
Create a new user in the system with the provided information.
Endpoint
POST /api/integrations/usersRequest Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Full name of the user |
firstName | string | No | First name of the user |
lastName | string | No | Last name of the user |
email | string | Yes | Email address (must be unique) |
phone | string | No | Phone number |
dob | string | No | Date of birth (ISO 8601 format) |
role | string | No | User role (default: "customer") |
Request Example
{
"name": "Jane Smith",
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+1234567890",
"dob": "1985-03-20",
"role": "customer"
}Response Format
{
"id": "user-456",
"name": "Jane Smith",
"firstName": "Jane",
"lastName": "Smith",
"email": "jane@example.com",
"phone": "+1234567890",
"dob": "1985-03-20",
"role": "customer",
"members": [],
"createdAt": "2024-01-15T14:30:00Z",
"updatedAt": "2024-01-15T14:30:00Z"
}Examples
cURL Example
curl -X POST "https://api.example.com/api/integrations/users" \
-H "X-Invois-Key: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Smith",
"email": "jane@example.com",
"role": "customer"
}'JavaScript Example
const userData = {
name: "Jane Smith",
firstName: "Jane",
lastName: "Smith",
email: "jane@example.com",
role: "customer"
};
const response = await fetch('https://api.example.com/api/integrations/users', {
method: 'POST',
headers: {
'X-Invois-Key': 'your-api-key-here',
'Content-Type': 'application/json'
},
body: JSON.stringify(userData)
});
const newUser = await response.json();Validation Rules
- Email: Must be a valid email format and unique in the system
- Name: Required, minimum 2 characters
- Role: Must be one of:
super-admin,admin,customer - Phone: Optional, must be valid phone number format if provided
- Date of Birth: Optional, must be valid ISO 8601 date if provided
Error Responses
400 Bad Request- Validation errors or missing required fields401 Unauthorized- Invalid or missing API key409 Conflict- Email already exists429 Too Many Requests- Rate limit exceeded
Validation Error Example
{
"error": "Validation Error",
"message": "The request contains invalid data",
"details": {
"email": ["Email is already taken"],
"name": ["Name is required"]
}
}Next Steps
- Get User - Retrieve user details
- Update User - Modify user information
- Error Handling - Handle validation errors