Skip to main content

List Application Profiles

Overview

Retrieve a list of all Application Profiles. Application Profiles link Applications to Fee Profiles and Risk Profiles, controlling pricing and risk management for merchant onboarding.

Resource Access

  • User Permissions: Admin users only
  • Endpoint: GET /application_profiles

Arguments

ParameterTypeRequiredDescription
limitintegerNoNumber of results per page (default: 10, max: 100)
after_cursorstringNoReturn resources created after this cursor
before_cursorstringNoReturn resources created before this cursor

Example Request

curl -X GET \
'https://api.ahrvo.network/payments/na/application_profiles?limit=20' \
-u username:password

Example Response

{
"_embedded": {
"application_profiles": [
{
"id": "PPqCt5m7AFobHUQsKxqkCEyT",
"created_at": "2024-11-14T22:25:06.78Z",
"updated_at": "2024-11-14T22:25:06.78Z",
"application": "APc9vhYcPsRuTSpKD9KpMtPe",
"card_present_fee_profile": null,
"fee_profile": "FP3X1FMA23pSsP9dJRMmQ4Pf",
"risk_profile": "RP3X1FMA23pSsP9dJRMmQ4Pf",
"tags": {
"environment": "production",
"region": "us-west"
},
"_links": {
"self": {
"href": "https://api.ahrvo.network/payments/na/application_profiles/PPqCt5m7AFobHUQsKxqkCEyT"
},
"application": {
"href": "https://api.ahrvo.network/payments/na/applications/APc9vhYcPsRuTSpKD9KpMtPe"
},
"risk_profile": {
"href": "https://api.ahrvo.network/payments/na/risk_profiles/RP3X1FMA23pSsP9dJRMmQ4Pf"
},
"fee_profile": {
"href": "https://api.ahrvo.network/payments/na/fee_profiles/FP3X1FMA23pSsP9dJRMmQ4Pf"
}
}
},
{
"id": "PP8s4Kd9m2NvLpRtQxYkFjWh",
"created_at": "2024-11-10T15:30:00.00Z",
"updated_at": "2024-11-12T10:00:00.00Z",
"application": "APz7rBcD3fGhJk5mNqPsXvYw",
"card_present_fee_profile": "CP4Y2GMB34qTtQ0eKSNnR5Qg",
"fee_profile": "FP9Z8XYC45rUuS1fLTOoS6Rh",
"risk_profile": "RP2W7VXB23pSsP8cIQLoP3Pf",
"tags": {
"environment": "staging",
"merchant_type": "retail"
},
"_links": {
"self": {
"href": "https://api.ahrvo.network/payments/na/application_profiles/PP8s4Kd9m2NvLpRtQxYkFjWh"
},
"application": {
"href": "https://api.ahrvo.network/payments/na/applications/APz7rBcD3fGhJk5mNqPsXvYw"
},
"risk_profile": {
"href": "https://api.ahrvo.network/payments/na/risk_profiles/RP2W7VXB23pSsP8cIQLoP3Pf"
},
"fee_profile": {
"href": "https://api.ahrvo.network/payments/na/fee_profiles/FP9Z8XYC45rUuS1fLTOoS6Rh"
},
"card_present_fee_profile": {
"href": "https://api.ahrvo.network/payments/na/fee_profiles/CP4Y2GMB34qTtQ0eKSNnR5Qg"
}
}
}
]
},
"_links": {
"self": {
"href": "https://api.ahrvo.network/payments/na/application_profiles?limit=20"
},
"next": {
"href": "https://api.ahrvo.network/payments/na/application_profiles?after_cursor=PP8s4Kd9m2NvLpRtQxYkFjWh&limit=20"
}
},
"page": {
"limit": 20,
"next_cursor": "PP8s4Kd9m2NvLpRtQxYkFjWh"
}
}

Response Fields

FieldTypeDescription
idstringUnique Application Profile identifier (starts with "PP")
created_atstringISO 8601 timestamp when profile was created
updated_atstringISO 8601 timestamp of last modification
applicationstringID of the associated Application
fee_profilestringID of the card-not-present fee profile
card_present_fee_profilestringID of the card-present fee profile (optional)
risk_profilestringID of the risk profile
tagsobjectKey-value metadata pairs
_linksobjectHATEOAS links to related resources

Additional Information

  • Application Profiles: Configuration layer

    • Links Application to pricing/risk settings
    • One Application can have multiple profiles
    • Profile determines merchant fees and risk rules
    • Used during merchant onboarding
    • Merchants inherit profile settings
  • Fee Profiles: Pricing configuration

    • fee_profile: Card-not-present transactions (CNP)
    • card_present_fee_profile: Card-present transactions (CP)
    • Separate profiles for different transaction types
    • Can be null if not configured
    • Determines merchant pricing
  • Risk Profile: Risk management

    • Controls transaction limits
    • Defines velocity rules
    • Sets review thresholds
    • Fraud detection settings
    • Required for all profiles
  • Pagination: Cursor-based

    • Use limit to control page size
    • after_cursor: Next page
    • before_cursor: Previous page
    • next_cursor in response for pagination
    • Efficient for large datasets
  • Tags: Custom metadata

    • Key-value pairs for organization
    • Filter by environment, region, etc.
    • Up to 50 pairs
    • Max 40 chars for keys
    • Max 500 chars for values
  • Links: Related resources

    • Self: Profile URL
    • Application: Parent application
    • Fee profiles: Pricing settings
    • Risk profile: Risk settings
    • Navigate between resources

Use Cases

List All Profiles

curl -X GET \
'https://api.ahrvo.network/payments/na/application_profiles?limit=100' \
-u username:password
  • View all configured profiles
  • Audit profile settings
  • Check fee/risk assignments
  • Find profiles by tags

Paginate Through Profiles

// Fetch all profiles using pagination
async function getAllProfiles() {
let allProfiles = [];
let nextCursor = null;

do {
const params = new URLSearchParams({
limit: 100,
...(nextCursor && { after_cursor: nextCursor })
});

const response = await fetch(
`https://api.ahrvo.network/payments/na/application_profiles?${params}`,
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
allProfiles = allProfiles.concat(data._embedded.application_profiles);
nextCursor = data.page.next_cursor;

} while (nextCursor);

console.log(`Total profiles: ${allProfiles.length}`);
return allProfiles;
}

Find Profiles by Application

// Find all profiles for a specific application
async function getProfilesByApplication(applicationId) {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const profiles = data._embedded.application_profiles.filter(
p => p.application === applicationId
);

console.log(`Found ${profiles.length} profiles for application ${applicationId}`);
profiles.forEach(p => {
console.log(`- ${p.id}: Fee=${p.fee_profile}, Risk=${p.risk_profile}`);
});

return profiles;
}

Group by Fee Profile

// See which profiles use which fee profile
async function groupByFeeProfile() {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const grouped = {};

data._embedded.application_profiles.forEach(profile => {
const feeProfileId = profile.fee_profile || 'None';
if (!grouped[feeProfileId]) {
grouped[feeProfileId] = [];
}
grouped[feeProfileId].push(profile.id);
});

console.log('Profiles grouped by fee profile:');
Object.entries(grouped).forEach(([feeProfile, profiles]) => {
console.log(`${feeProfile}: ${profiles.length} profiles`);
profiles.forEach(id => console.log(` - ${id}`));
});

return grouped;
}

Find Profiles with Card-Present Fees

// Find profiles configured for card-present transactions
async function getCardPresentProfiles() {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const cardPresentProfiles = data._embedded.application_profiles.filter(
p => p.card_present_fee_profile !== null
);

console.log(`Card-present profiles: ${cardPresentProfiles.length}`);
cardPresentProfiles.forEach(p => {
console.log(`- ${p.id}`);
console.log(` CNP Fee: ${p.fee_profile || 'None'}`);
console.log(` CP Fee: ${p.card_present_fee_profile}`);
});

return cardPresentProfiles;
}

Compare Profile Configurations

// Compare different profiles
async function compareProfiles(profileId1, profileId2) {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const profiles = data._embedded.application_profiles;

const profile1 = profiles.find(p => p.id === profileId1);
const profile2 = profiles.find(p => p.id === profileId2);

if (!profile1 || !profile2) {
console.error('One or both profiles not found');
return;
}

console.log('Profile Comparison:');
console.log(`\nProfile 1: ${profile1.id}`);
console.log(` Application: ${profile1.application}`);
console.log(` Fee Profile: ${profile1.fee_profile}`);
console.log(` CP Fee Profile: ${profile1.card_present_fee_profile || 'None'}`);
console.log(` Risk Profile: ${profile1.risk_profile}`);

console.log(`\nProfile 2: ${profile2.id}`);
console.log(` Application: ${profile2.application}`);
console.log(` Fee Profile: ${profile2.fee_profile}`);
console.log(` CP Fee Profile: ${profile2.card_present_fee_profile || 'None'}`);
console.log(` Risk Profile: ${profile2.risk_profile}`);

// Highlight differences
if (profile1.fee_profile !== profile2.fee_profile) {
console.log('\n⚠ Different CNP fee profiles');
}
if (profile1.card_present_fee_profile !== profile2.card_present_fee_profile) {
console.log('⚠ Different CP fee profiles');
}
if (profile1.risk_profile !== profile2.risk_profile) {
console.log('⚠ Different risk profiles');
}
}

Export Profile Configuration

// Export all profiles to CSV
async function exportProfilesToCSV() {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const profiles = data._embedded.application_profiles;

const csv = [
'Profile ID,Application,Fee Profile,CP Fee Profile,Risk Profile,Created,Updated',
...profiles.map(p => [
p.id,
p.application,
p.fee_profile || '',
p.card_present_fee_profile || '',
p.risk_profile,
p.created_at,
p.updated_at
].join(','))
].join('\n');

console.log(csv);
return csv;
}

Find Recently Updated Profiles

// Find profiles updated in last N days
async function getRecentlyUpdatedProfiles(days = 7) {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const cutoff = new Date();
cutoff.setDate(cutoff.getDate() - days);

const recentProfiles = data._embedded.application_profiles.filter(p => {
const updated = new Date(p.updated_at);
return updated > cutoff;
});

console.log(`Profiles updated in last ${days} days: ${recentProfiles.length}`);
recentProfiles.forEach(p => {
console.log(`- ${p.id}: Updated ${p.updated_at}`);
});

return recentProfiles;
}

Best Practices

  • Cache Results: Reduce API calls

    // Cache profile list
    let cachedProfiles = null;
    let cacheTime = null;
    const CACHE_TTL = 5 * 60 * 1000; // 5 minutes

    async function getCachedProfiles() {
    const now = Date.now();

    if (cachedProfiles && cacheTime && (now - cacheTime < CACHE_TTL)) {
    console.log('Returning cached profiles');
    return cachedProfiles;
    }

    console.log('Fetching fresh profiles');
    const response = await fetch(
    'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
    {
    headers: {
    'Authorization': 'Basic ' + btoa('username:password')
    }
    }
    );

    const data = await response.json();
    cachedProfiles = data._embedded.application_profiles;
    cacheTime = now;

    return cachedProfiles;
    }
  • Use Pagination: For large datasets

    • Don't fetch all at once
    • Use cursor pagination
    • Process in batches
    • More efficient
  • Filter Locally: When possible

    • Fetch once with high limit
    • Filter in application code
    • Reduces API calls
    • Faster for small datasets
  • Monitor Changes: Track updates

    • Store updated_at values
    • Check for changes periodically
    • Alert on unexpected changes
    • Audit trail
  • Document Profiles: Keep records

    • What each profile is for
    • Which merchants use it
    • Pricing/risk settings
    • Contact person

Common Workflows

Audit All Profiles

// Check all profiles are properly configured
async function auditProfiles() {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const profiles = data._embedded.application_profiles;

console.log(`Total profiles: ${profiles.length}`);

const issues = [];

profiles.forEach(profile => {
// Check fee profile
if (!profile.fee_profile) {
issues.push(`${profile.id}: Missing CNP fee profile`);
}

// Check risk profile
if (!profile.risk_profile) {
issues.push(`${profile.id}: Missing risk profile`);
}

// Check application
if (!profile.application) {
issues.push(`${profile.id}: Missing application`);
}
});

if (issues.length > 0) {
console.error(`\nFound ${issues.length} issues:`);
issues.forEach(issue => console.error(` - ${issue}`));
} else {
console.log('✓ All profiles properly configured');
}

return issues;
}

Find Orphaned Profiles

// Find profiles not linked to active applications
async function findOrphanedProfiles() {
// Get all profiles
const profilesResponse = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);
const profilesData = await profilesResponse.json();

// Get all applications
const appsResponse = await fetch(
'https://api.ahrvo.network/payments/na/applications?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);
const appsData = await appsResponse.json();

const activeAppIds = new Set(
appsData._embedded.applications.map(a => a.id)
);

const orphaned = profilesData._embedded.application_profiles.filter(
p => !activeAppIds.has(p.application)
);

console.log(`Orphaned profiles: ${orphaned.length}`);
orphaned.forEach(p => {
console.log(`- ${p.id}: Application ${p.application} (not found)`);
});

return orphaned;
}

Profile Distribution Report

// Generate profile distribution report
async function generateProfileReport() {
const response = await fetch(
'https://api.ahrvo.network/payments/na/application_profiles?limit=100',
{
headers: {
'Authorization': 'Basic ' + btoa('username:password')
}
}
);

const data = await response.json();
const profiles = data._embedded.application_profiles;

console.log('=== Application Profile Report ===\n');

console.log(`Total Profiles: ${profiles.length}`);

// By application
const byApp = {};
profiles.forEach(p => {
byApp[p.application] = (byApp[p.application] || 0) + 1;
});
console.log(`\nApplications with profiles: ${Object.keys(byApp).length}`);

// Fee profile coverage
const withCNP = profiles.filter(p => p.fee_profile).length;
const withCP = profiles.filter(p => p.card_present_fee_profile).length;
console.log(`\nFee Profile Coverage:`);
console.log(` CNP Fee Profiles: ${withCNP} (${(withCNP/profiles.length*100).toFixed(1)}%)`);
console.log(` CP Fee Profiles: ${withCP} (${(withCP/profiles.length*100).toFixed(1)}%)`);

// Risk profile coverage
const withRisk = profiles.filter(p => p.risk_profile).length;
console.log(`\nRisk Profile Coverage: ${withRisk} (${(withRisk/profiles.length*100).toFixed(1)}%)`);

// Tagged profiles
const tagged = profiles.filter(p => Object.keys(p.tags).length > 0).length;
console.log(`\nTagged Profiles: ${tagged} (${(tagged/profiles.length*100).toFixed(1)}%)`);
}

Security Considerations

  • API Access: Control carefully

    • Only admin users can list profiles
    • Contains configuration details
    • Links to fee/risk profiles
    • Audit access logs
  • Profile Configuration: Protect settings

    • Fee profiles determine pricing
    • Risk profiles control limits
    • Changes affect all merchants using profile
    • Review changes carefully
  • Pagination: Avoid exposing all data

    • Use appropriate page sizes
    • Don't fetch more than needed
    • Consider data sensitivity
    • Monitor access patterns
  • Tags: Avoid sensitive data

    • Don't store PII in tags
    • Use for organization only
    • Visible to all admins
    • Not encrypted

Error Responses

Unauthorized

{
"status": 401,
"message": "Unauthorized"
}
  • Invalid API credentials
  • Check username/password
  • Verify authentication

Forbidden

{
"status": 403,
"message": "Forbidden"
}
  • Not admin user
  • Insufficient permissions
  • Contact administrator

Troubleshooting

Empty Results

  • Check you have created profiles
  • Verify API credentials
  • Confirm correct environment
  • May be different Application

Missing Profiles

  • Check pagination (use higher limit)
  • Verify profile IDs
  • May be deleted
  • Check different environment

Slow Response

  • Reduce page size
  • Use pagination
  • Check network latency
  • API may be under load
  • GET /application_profiles/{id}: Fetch specific profile
  • PUT /application_profiles/{id}: Update profile configuration
  • GET /applications: List applications
  • GET /fee_profiles: List fee profiles
  • GET /risk_profiles: List risk profiles