Documentation Index
Fetch the complete documentation index at: https://docs.oumla.com/llms.txt
Use this file to discover all available pages before exploring further.
Manage user profiles (User, Department, Merchant) in your organization.
Methods
getProfiles()
Get a paginated list of profiles.
Signature:
getProfiles(
request?: GetProfilesRequest,
requestOptions?: RequestOptions
): Promise<ProfilesResponse>
Parameters:
| Parameter | Type | Required | Description |
|---|
request.skip | number | No | Number of records to skip (default: 0) |
request.take | number | No | Number of records to retrieve (default: 10, max: 100) |
Example:
// Get first 10 profiles
const profiles = await client.profiles.getProfiles();
// Get profiles with pagination
const profiles = await client.profiles.getProfiles({
skip: 0,
take: 25
});
console.log('Profiles:', profiles.data.data);
console.log('Pagination:', profiles.data.pagination);
Response:
{
data: {
data: Profile[],
pagination: {
skip: number,
take: number,
totalElements: number,
totalPages: number
}
}
}
createProfile()
Create a new profile.
Signature:
createProfile(
request: CreateProfileRequest,
requestOptions?: RequestOptions
): Promise<CreateProfileResponse>
Parameters:
| Parameter | Type | Required | Description |
|---|
request.reference | string | Yes | Unique identifier for the profile in your system |
request.type | 'User' | 'Department' | 'Merchant' | Yes | Type of profile |
Example:
// Create a User profile
const profile = await client.profiles.createProfile({
reference: 'user-123',
type: 'User'
});
console.log('Created profile:', profile.data.data);
Response:
{
data: {
data: {
reference: string,
type: 'User' | 'Department' | 'Merchant'
}
}
}
Throws:
BadRequestError - Invalid request parameters
UnauthorizedError - Missing or invalid API key
InternalServerError - Server error
Profile Types
- User: Individual users in your system
- Department: Organizational units or departments
- Merchant: Business entities or merchants
Complete Example
import { OumlaSdkApiClient, OumlaSdkApiEnvironment } from '@oumla/sdk';
const client = new OumlaSdkApiClient({
environment: OumlaSdkApiEnvironment.Sandbox,
apiKey: 'your-api-key'
});
async function manageProfiles() {
// Create a profile
const newProfile = await client.profiles.createProfile({
reference: 'merchant-001',
type: 'Merchant'
});
console.log('Created:', newProfile.data.data);
// List all profiles
const allProfiles = await client.profiles.getProfiles({
skip: 0,
take: 100
});
console.log('Total profiles:', allProfiles.data.pagination?.totalElements);
console.log('Profiles:', allProfiles.data.data);
}