Skip to main content

Get Agent Profile Products API

Overview

Retrieve a list of products assigned to a specific agent profile with their commission configurations. This API returns all products that an agent profile is authorized to offer, including commission rates, types, and ranges.

API Details

Endpoint

GET https://api.gafapay.com:8443/gafapay/v3/agent_profile_threshold/agent_profile_products

Headers

authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzYxNjg1MjcyfQ.N0etwbg_yOKecFRslpjFWG8Eba1mwLsnIDa0BS4T9tA
companyid: 59388167894b4d10a04fe5da3b8a2104
requestid: d08792fa-237a-4588-be16-aceebfdca7e5

Query Parameters

Required Parameters

  • agent_profile_id (String): The unique identifier of the agent profile
    • Example: c71b094eba994557a43eadb5d6d22044

Optional Parameters

  • search_keyword (String): Search term to filter products by name or code
    • Example: Cash
  • skip (Integer): Number of records to skip (pagination)
    • Default: 0
    • Example: 0, 10, 20
  • limit (Integer): Maximum number of records to return (pagination)
    • Default: 10
    • Example: 10, 25, 50

Response

{
"success": 1,
"error": [],
"data": {
"agent_profile_products": [
{
"id": "68b020dda8454f35acac2f99871924f4",
"agent_profile_id": "c71b094eba994557a43eadb5d6d22044",
"product_id": "6bd1645460a24f8e9c487cbb558bcb6f",
"product_name": "Agent Settlement",
"product_code": "AS",
"product_type": 1,
"commission_type": null,
"commission_value": 0.0,
"commission_value_type": 1,
"commission_range": null,
"updated_by": null,
"updated_date": 1702046277
},
{
"id": "5a93c60ce9434e4caf729438c5edc1cc",
"agent_profile_id": "c71b094eba994557a43eadb5d6d22044",
"product_id": "2ced9f4018004cdda5dc2846575282ac",
"product_name": "Cash Transfer via Agent",
"product_code": "CTA",
"product_type": 1,
"commission_type": 1,
"commission_value": 7.0,
"commission_value_type": 1,
"commission_range": null,
"updated_by": null,
"updated_date": 1702046277
}
]
}
}

Response Fields

  • success (integer): Response status indicator
    • 1 = Success
    • 0 = Failure
  • error (array): Array of error messages (empty on success)
  • data (object): Response data object
    • agent_profile_products (array): List of agent profile product objects

Agent Profile Product Object Fields

  • id (string): Profile product unique identifier
    • The primary ID of this profile-product association record
  • agent_profile_id (string): Agent profile unique identifier
    • References the agent profile this product belongs to
  • product_id (string): Product unique identifier
    • The ID of the product/service
  • product_name (string): Name of the product
    • Human-readable product name
    • Examples: "Cash Transfer via Agent", "Agent Settlement", "Cash-In for customer via agent"
  • product_code (string): Product code/abbreviation
    • Short code used for product identification
    • Examples: "CTA" (Cash Transfer via Agent), "CIC" (Cash-In for customer), "COC" (Cash-Out for customer)
  • product_type (integer): Type of product
    • 1 = Transaction product
    • 2 = Service product
    • Determines how the product is processed
  • commission_type (integer|null): Type of commission calculation
    • null = No commission
    • 1 = Fixed commission
    • 2 = Percentage-based commission
    • 3 = Tiered/range-based commission
  • commission_value (double): Commission amount or percentage
    • If commission_type is 1: Fixed amount (e.g., 7.0 = 7 currency units)
    • If commission_type is 2: Percentage (e.g., 7.0 = 7%)
    • If commission_type is 3: Base value for tiered calculation
    • Default: 0.0 (no commission)
  • commission_value_type (integer|null): Type of commission value
    • null = No commission value type
    • 1 = Fixed amount
    • 2 = Percentage
    • Clarifies how to interpret the commission_value
  • commission_range (array|null): Commission tier/range configuration
    • null = No tiered commission
    • Array of commission range objects for tiered commission structures
    • Example: Different commission rates for different transaction amounts
    • Structure: [{"min": 0, "max": 1000, "value": 5}, {"min": 1001, "max": 5000, "value": 10}]
  • updated_by (string|null): Last updater user unique identifier
    • The ID of the user who last modified this record
    • null if never updated
  • updated_date (long): Last update timestamp
    • Unix epoch timestamp of the last update
    • Example: 1702046277

Example Usage

Basic Request

curl --location 'https://api.gafapay.com:8443/gafapay/v3/agent_profile_threshold/agent_profile_products?agent_profile_id=c71b094eba994557a43eadb5d6d22044' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzYxNjg1MjcyfQ.N0etwbg_yOKecFRslpjFWG8Eba1mwLsnIDa0BS4T9tA' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: d08792fa-237a-4588-be16-aceebfdca7e5'
curl --location 'https://api.gafapay.com:8443/gafapay/v3/agent_profile_threshold/agent_profile_products?agent_profile_id=c71b094eba994557a43eadb5d6d22044&search_keyword=Cash&skip=0&limit=25' \
--header 'authorization: Token YOUR_TOKEN_HERE' \
--header 'companyid: 59388167894b4d10a04fe5da3b8a2104' \
--header 'requestid: YOUR_REQUEST_ID'

Error Responses

Products Not Found

{
"success": 0,
"error": ["AGENT_PROFILE_THRESHOLD_PROFILE_PRODUCT_DATA_NOT_FOUND"],
"data": {}
}

Bad Request (Missing Agent Profile ID)

{
"success": 0,
"error": ["BAD_REQUEST"],
"data": {}
}

Invalid Search Keyword

{
"success": 0,
"error": ["AGENT_PROFILE_THRESHOLD_PLEASE_ENTER_VALID_SEARCH_KEYWORD"],
"data": {}
}

Notes

  • The agent_profile_id query parameter is required
  • This API returns the product-profile associations, showing which products an agent profile can offer
  • Each product has its own commission configuration which determines how agents earn from transactions
  • Products with commission_type = null or commission_value = 0.0 do not generate commission
  • The product_code is used throughout the system to identify products in transactions
  • Commission calculations:
    • Fixed Commission (commission_type = 1): Agent earns a fixed amount per transaction
    • Percentage Commission (commission_type = 2): Agent earns a percentage of transaction amount
    • Tiered Commission (commission_type = 3): Commission varies based on transaction amount ranges
  • The commission_range field allows for complex commission structures where different amounts earn different commissions
  • Products can be filtered using the search_keyword parameter which searches both product name and code
  • Pagination is supported via skip and limit parameters for large product lists
  • Authentication token must be valid and have appropriate permissions to view agent profile products
  • The companyid header is mandatory and must match the company the profile belongs to

Commission Calculation Examples

Fixed Commission

{
"commission_type": 1,
"commission_value": 7.0,
"commission_value_type": 1
}

Result: Agent earns 7 currency units per transaction, regardless of amount.

Percentage Commission

{
"commission_type": 2,
"commission_value": 2.5,
"commission_value_type": 2
}

Result: Agent earns 2.5% of the transaction amount.
Example: For a 1000 currency transaction, agent earns 25 currency units.

Tiered Commission

{
"commission_type": 3,
"commission_range": [
{"min": 0, "max": 1000, "value": 5, "type": 1},
{"min": 1001, "max": 5000, "value": 10, "type": 1},
{"min": 5001, "max": 999999, "value": 2, "type": 2}
]
}

Result:

  • Transactions 0-1000: Agent earns 5 currency units
  • Transactions 1001-5000: Agent earns 10 currency units
  • Transactions 5001+: Agent earns 2% of transaction amount

Product Types Explained

Common product types in the system:

Product CodeProduct NameCommission TypeDescription
CICCash-In for customer via agentFixed/PercentageCustomer deposits cash with agent
COCCash-Out for customer via agentFixed/PercentageCustomer withdraws cash from agent
CTACash Transfer via AgentFixed/PercentageTransfer money via agent
ASAgent SettlementNoneAgent settlement operations
AWTAdmin Wallet TopupNoneAdmin wallet top-up
CTWCommission Transfer To WalletNoneTransfer commission to wallet
ACIBAgent Cash In Bank/CardNoneAgent deposits to bank
ACOBAgent Cash out BankNoneAgent withdraws from bank
CTBCommission To BankNoneCommission transfer to bank