Reading Progress:
0%

Admin API

Administrative REST API for managing your AffiliatePro platform

Admin Only
RESTful Design JSON Responses
Authentication

All endpoints require a valid admin JWT token. Use the raw token — do not include a Bearer prefix.

Authorization: <your-admin-jwt-token>
Obtain a token via the User Login API with admin credentials.
Base URL

All Admin API endpoints are relative to this base URL.

https://demo.affiliatepro.org/Admin_Api/
Error Codes Reference
200
Success

Request completed successfully

401
Unauthorized

Invalid or missing token

403
Forbidden

Valid token but not admin

422
Unprocessable

Validation failed

Quick Start
1
Login as Admin

Use the User Login API with admin credentials to obtain a JWT token.

2
Add Authorization Header

Include the raw JWT in the Authorization header (no Bearer prefix).

3
Call Endpoints

Send requests to https://demo.affiliatepro.org/Admin_Api/ + endpoint path.

Sub-admin roles & permissions

The Admin API uses the same permission slugs as the website (Admin panel → Manage Roles). There is no separate mobile permission list.

  • Super admin (users.id = 1) can call every endpoint.
  • Admins with an assigned role may only call endpoints whose required slug appears in that role’s JSON (admin_roles.permissions).
  • Admins with no role and no custom users.admin_permissions JSON behave as full access (same as the web panel).
  • Admins with custom perms on the user row are limited to those slugs.

GET Admin_Api/profile is always allowed for a valid admin JWT so clients can load the account. Its data includes:

Field Type Description
admin_full_access bool true when this account is treated as unrestricted (super admin or legacy full-access rule above).
admin_permission_slugs array of string Explicit slugs for this admin (sorted). When admin_full_access is true, this lists all defined slugs for UI convenience.
admin_role_name string or omitted Human-readable role name from admin_roles.name when a role is assigned.

All other Admin API methods enforce one required slug per action. If the caller lacks it, the HTTP status is still 200 with JSON like:

{
  "status": false,
  "message": "Access Denied! Insufficient permissions.",
  "required_permission": "users"
}

Developer reference: the mapping from PHP method name → slug is in application/config/admin_permissions.php under $config['admin_api_method_permissions'], aligned with the web admin_permission_map where the feature exists on both sides.

Currency Settings

Every API endpoint that returns monetary values automatically includes the platform's currency settings. Use these to format amounts correctly in your app instead of hardcoding $.

Field Type Example Description
currency_symbol string $ The default currency symbol from the platform settings
currency_code string USD ISO 4217 currency code
enable_shorten_numbers integer 1 If 1, format large amounts as $3.9k / $1.2M. If 0, show full numbers like $3900.00
Tip: These fields are included in: dashboard, users, user_details, withdrawals, wallet, reports, and the login response. Never hardcode a currency symbol — always read it from the API response.
Delivered

Mobile admin companion

All planned optional mobile admin areas are now delivered. The Admin API described in this reference covers every endpoint the mobile app uses.

Admin Dashboard

Retrieve admin dashboard statistics with HTTP GET request.

Returns a comprehensive overview of your platform: total users, affiliates (active non-vendor users), vendors, pending items, today's activity, admin balance with growth, store & vendor sales, commissions (admin + affiliate), click commissions, currency settings (symbol, code, shorten formatting), and recent user registrations. All data uses the same source as the web admin dashboard.

Request

GET https://demo.affiliatepro.org/Admin_Api/dashboard
Parameter Type Position Description
Authorization string Header Admin JWT token obtained from login API

Response

{"status":true,"data":{"total_users":150,"total_affiliates":120,"total_vendors":30,"pending_users":5,"pending_withdrawals":3,"total_withdrawals_amount":"1250.00","admin_balance":"3900.50","admin_balance_growth":12.5,"store_sales":"8500.00","store_commission":"850.00","store_orders":42,"vendor_sales":"3200.00","vendor_commission":"320.00","vendor_orders":18,"click_commission":"450.00","total_clicks":1250,"today_clicks":45,"today_sales":8,"currency_symbol":"$","currency_code":"USD","enable_shorten_numbers":1,"recent_users":[{"id":"88","firstname":"John","lastname":"Doe","username":"johndoe","email":"john@example.com","type":"user","status":"1","created_at":"2025-06-11 16:44:16"},{"id":"87","firstname":"Jane","lastname":"Smith","username":"janesmith","email":"jane@example.com","type":"user","status":"0","created_at":"2025-06-10 14:22:08"}]}}
Admin - Users Management

Manage all users/affiliates on your platform. List users with pagination and filters, view detailed user information, and update user status (approve, block, set to pending).

Users List

Retrieve a paginated list of users with optional search and status filters.

GET https://demo.affiliatepro.org/Admin_Api/users
Parameters
Parameter Type Position Description
Authorization string Header Admin JWT token
start_from integer Query Pagination offset (default: 0)
limit integer Query Number of results per page (default: 20)
search string Query Search by username, email, firstname, or lastname
status string Query all, active, pending, or blocked (default: all)
account string Query all, affiliate (non-vendor users), or vendor (is_vendor=1)
Response
{"status":true,"data":{"users":[{"id":"88","firstname":"John","lastname":"Doe","username":"johndoe","email":"john@example.com","status":"1","is_vendor":"0","account_type":"affiliate","balance":"150.00","total_clicks":230,"total_sales":15}],"total_count":150,"has_more":true,"currency_symbol":"$","currency_code":"USD","enable_shorten_numbers":1}}
User Details

Retrieve detailed information for a specific user including balance, clicks, and sales. Response includes account_type: vendor or affiliate. When is_vendor is 1, the payload also includes read-only vendor_profile_extras: store (name, slug, email, address, contact fields, meta), optional vendor_setting (commission-related columns from vendor_setting), and counts (integration_programs, integration_tools, store_products).

GET https://demo.affiliatepro.org/Admin_Api/user_details
Parameters
Parameter Type Position Description
Authorization string Header Admin JWT token
user_id integer Query The ID of the user to retrieve (required)
Response
{"status":true,"data":{"id":"88","firstname":"John","lastname":"Doe","status":"1","is_vendor":"0","account_type":"affiliate","balance":"150.00","total_clicks":230,"total_sales":15,"total_revenue":"450.00","total_referrals":3,"recent_clicks":[],"recent_sales":[],"currency_symbol":"$","currency_code":"USD","enable_shorten_numbers":1}}
Toggle User Status

Toggle a user's account status between enabled (status=1) and disabled (status=0). Works exactly like the / button on the web admin Users List page. A disabled user cannot login.

POST https://demo.affiliatepro.org/Admin_Api/update_user_status
Body Parameters
Parameter Type Required Description
Authorization string true Admin JWT token (Header)
user_id integer true The ID of the user to toggle
Toggle behavior: If user status=1 (enabled), it becomes 0 (disabled). If status=0, it becomes 1. The response includes the new_status value.
Response
{"status":true,"message":"User status disabled successfully","new_status":0}
Admin — team (read-only)

Read-only views for admin panel accounts (users.type = 'admin') and admin roles, aligned with web admincontrol/admin_user and admincontrol/admin_roles. All three endpoints require the same permission as the web screens: admin.admins (Manage Admin Users). No create, update, or delete via API.

Admin staff list

Paginated list of admin accounts with optional search (firstname, lastname, username, email). When admin_roles exists, each row includes role_name and role_slug.

GET https://demo.affiliatepro.org/Admin_Api/admin_staff
Parameters
Parameter Type Description
AuthorizationHeaderAdmin JWT
start_fromintOffset (default 0)
limitintPage size, max 100 (default 20)
searchstringOptional
Response data
{"staff":[],"total_count":0,"start_from":0,"limit":20,"has_more":false}
Admin staff details

Single admin row (no password or token). Includes admin_role_label, admin_permissions (slug array when resolved from role), and is_super_admin when id === 1, same resolution as web helper when admin_roles exists.

GET https://demo.affiliatepro.org/Admin_Api/admin_staff_details
Parameters
AuthorizationHeader — Admin JWT
user_idRequired — admin user id
Errors

status: false — missing user_id, not found, forbidden without admin.admins, or not an admin account.

Admin roles list

All rows from admin_roles with permissions as a JSON array of slugs and admin_user_count (admins assigned to that role). If the table is missing, admin_roles_table_exists is false and roles is empty.

GET https://demo.affiliatepro.org/Admin_Api/admin_roles
Parameters

Authorization header only.

Response data
{"admin_roles_table_exists":true,"roles":[{"id":"1","name":"Support","slug":"support","permissions":["dashboard"],"admin_user_count":2,"created_at":""}]}
Admin

Notifications (admin inbox)

Rows where notification_viewfor = 'admin' in the notification table. Titles and descriptions are sanitized for API clients. admin_web_url points at the web admin (admincontrol/…) when the stored link is relative.

Notifications list
GET https://demo.affiliatepro.org/Admin_Api/notifications
Parameters
ParameterTypeDescription
AuthorizationHeaderAdmin JWT
start_fromintegerOffset (default 0)
limitintegerPage size, max 100 (default 20)
searchstringTitle, description, or type
readstringall, unread, or read
typestringall or exact notification_type

When start_from is 0, the response includes counts: all, unread, and read (same search / type scope as the list). Omitted on later pages to avoid extra aggregate queries while paginating.

Notification details
GET https://demo.affiliatepro.org/Admin_Api/notification_details?notification_id=
Mark one as read
POST https://demo.affiliatepro.org/Admin_Api/notification_read

JSON body: notification_id (integer).

Mark all as read
POST https://demo.affiliatepro.org/Admin_Api/notifications_mark_all_read

No body. Updates every admin notification where notification_is_read is not 1.

Admin - Profile Management

Manage the admin user's own profile. Get full profile details including country information and available countries list, and update profile fields including avatar upload. GET profile also returns role permission slugs for sub-admins (see Introduction → Sub-admin roles).

Get Admin Profile

Retrieve the authenticated admin's full profile details. Also returns a list of all available countries for use in country selection dropdowns.

GET https://demo.affiliatepro.org/Admin_Api/profile
Parameters
Parameter Type Position Description
Authorization string Header Admin JWT token
No additional parameters required. The admin user is identified from the JWT token.
Response
{
  "status": true,
  "message": "Admin profile loaded successfully",
  "data": {
    "firstname": "John",
    "lastname": "Doe",
    "email": "admin@example.com",
    "username": "admin",
    "PhoneNumber": "+1 201-555-0123",
    "city": "New York",
    "pincode": "10001",
    "country_id": "231",
    "country_code": "US",
    "country_name": "United States",
    "country_flag": "https://yoursite.com/assets/template/images/flags/us.png",
    "profile_avatar": "https://yoursite.com/assets/images/users/avatar.jpg",
    "role": "admin",
    "admin_full_access": false,
    "admin_permission_slugs": [ "dashboard", "users" ],
    "admin_role_name": "Support",
    "countries": [
      {"id": "1", "name": "Afghanistan"},
      {"id": "2", "name": "Albania"},
      "..."
    ]
  }
}
Response Fields
Field Type Description
firstname string Admin first name
lastname string Admin last name
email string Admin email address
username string Admin username
PhoneNumber string Phone number
city string City name
pincode string Postal / ZIP code
country_id string Selected country ID
country_code string ISO country code (e.g. US, GB)
country_name string Full country name
country_flag string URL to country flag image
profile_avatar string URL to profile avatar image
role string User role (always admin)
admin_full_access boolean true if this account bypasses slug checks (super admin or full-access rule). See Sub-admin roles.
admin_permission_slugs array List of permission slugs for this admin (same strings as web Manage Roles).
admin_role_name string or null Assigned role display name from admin_roles, if any.
countries array List of all available countries (each with id and name)
Update Admin Profile

Update the authenticated admin's profile information. Supports text fields and avatar image upload. Only provided fields will be updated. Requires the settings permission slug for sub-admins (same as general settings access on the web).

POST https://demo.affiliatepro.org/Admin_Api/update_profile
multipart/form-data
Body Parameters
Parameter Type Required Description
Authorization string true Admin JWT token (Header)
firstname string true First name
lastname string true Last name
email string true Email address
phone string false Phone number
country_id integer false Country ID from the countries list
city string false City name
pincode string false Postal / ZIP code
password string false New password (leave empty to keep current)
avatar file false Profile image (png, gif, jpeg, jpg — max 2MB)
Response
{
  "status": true,
  "message": "Profile updated successfully",
  "data": {
    "firstname": "John",
    "lastname": "Doe",
    "email": "admin@example.com",
    "username": "admin",
    "PhoneNumber": "+1 201-555-0123",
    "city": "New York",
    "pincode": "10001",
    "country_id": "231",
    "country_code": "US",
    "country_name": "United States",
    "country_flag": "https://yoursite.com/assets/template/images/flags/us.png",
    "profile_avatar": "https://yoursite.com/assets/images/users/avatar.jpg",
    "role": "admin"
  }
}
Note: When sending avatar, use multipart/form-data content type. Fields firstname, lastname, and email are required; all other fields are optional.
Admin

Withdrawals

Manage withdrawal requests from affiliates. View pending/paid/rejected requests and approve or reject them.

Withdrawal Requests List

Retrieve a paginated list of withdrawal requests with status filter.

GET https://demo.affiliatepro.org/Admin_Api/withdrawals
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
start_fromintegerQueryPagination offset (default: 0)
limitintegerQueryResults per page (default: 20)
statusstringQueryunpaid, paid, or rejected (default: unpaid)
Response
{
  "status": true,
  "data": {
    "requests": [
      {
        "id": "3",
        "tran_ids": "17",
        "amount": "37.5",
        "status": "0",
        "user_id": "4",
        "payment_method": "bank_transfer",
        "status_label": "Received",
        "payment_details": {
          "bank_name": "My Bank",
          "account_number": "123456789",
          "account_name": "John Doe"
        },
        "created_at": "2026-02-23 08:43:20",
        "username": "johndoe",
        "email": "john@example.com",
        "firstname": "John",
        "lastname": "Doe"
      }
    ],
    "total_count": 2,
    "start_from": 0,
    "limit": 20,
    "has_more": false,
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 1
  }
}
Status Codes
CodeLabelDescription
0ReceivedPending / waiting for admin action
1PaidPayment completed
2ProcessingPayment in progress
3CancelledRequest cancelled
4DeclinedRequest declined by admin
Update Withdrawal Status

Approve or reject a withdrawal request by its ID. Optionally include an admin note.

POST https://demo.affiliatepro.org/Admin_Api/update_withdrawal_status
Parameters
ParameterTypeRequiredDescription
AuthorizationstringtrueAdmin JWT token (Header)
request_idintegertrueThe ID of the withdrawal request
statusstringtruepaid or rejected
admin_notestringfalseOptional note from admin
Response
{"status":true,"message":"Withdrawal request approved successfully"}
Admin

Reports & Analytics

Retrieve analytics data for your platform within a date range. Includes clicks by day, sales by day, and top-performing affiliates.

If no date range is provided, defaults to the current month (first day of month to today).

Reports
GET https://demo.affiliatepro.org/Admin_Api/reports
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
date_fromstringQueryStart date in YYYY-MM-DD format (default: first day of current month)
date_tostringQueryEnd date in YYYY-MM-DD format (default: today)
Response
{"status":true,"data":{"date_from":"2025-06-01","date_to":"2025-06-15","clicks_by_day":[{"date":"2025-06-01","count":"12"},{"date":"2025-06-02","count":"18"},{"date":"2025-06-03","count":"25"}],"sales_by_day":[{"date":"2025-06-01","count":"3","total":"450.00"},{"date":"2025-06-02","count":"5","total":"780.00"},{"date":"2025-06-03","count":"2","total":"200.00"}],"top_affiliates":[{"id":"88","firstname":"John","lastname":"Doe","username":"johndoe","total_sales":"15","total_revenue":"3500.00"},{"id":"65","firstname":"Jane","lastname":"Smith","username":"janesmith","total_sales":"12","total_revenue":"2800.00"}],"currency_symbol":"$","currency_code":"USD","enable_shorten_numbers":1}}
Admin

Wallet Overview

Retrieve the admin wallet overview including balance, sale totals, click totals, commissions across all channels, and recent transactions.

Wallet
GET https://demo.affiliatepro.org/Admin_Api/wallet
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
Response
{"status":true,"data":{"admin_balance":"12500.00","sale_localstore_total":"8500.00","sale_localstore_vendor_total":"3200.00","order_external_total":"4500.00","click_action_total":120,"click_action_commission":"360.00","click_localstore_total":450,"click_integration_total":280,"click_form_total":95,"click_localstore_commission":"225.00","click_integration_commission":"140.00","click_form_commission":"47.50","transactions":[{"id":"234","user_id":"88","amount":"150.00","type":"sale","status":"paid","created_date":"2025-06-11 14:30:00","firstname":"John","lastname":"Doe"},{"id":"233","user_id":"65","amount":"75.00","type":"click","status":"unpaid","created_date":"2025-06-10 09:15:00","firstname":"Jane","lastname":"Smith"}],"currency_symbol":"$","currency_code":"USD","enable_shorten_numbers":1}}
Response Fields
FieldTypeDescription
admin_balancestringTotal admin balance
sale_localstore_totalstringTotal local store sales amount
sale_localstore_vendor_totalstringTotal local store vendor sales amount
order_external_totalstringTotal external order amount (integration campaigns)
click_action_totalintegerTotal action/lead clicks
click_action_commissionstringTotal commission from action clicks
click_localstore_totalintegerTotal local store clicks
click_integration_totalintegerTotal integration/external clicks
click_form_totalintegerTotal form/lead clicks
click_localstore_commissionstringTotal commission from local store clicks
click_integration_commissionstringTotal commission from integration clicks
click_form_commissionstringTotal commission from form clicks
transactionsarrayRecent wallet transactions (up to 50, includes user details)
Admin

Integration Programs

Browse and inspect integration programs (vendor affiliate programs). Each program defines commission rules for sales and clicks that apply to its campaigns.

Programs List

Retrieve a paginated, searchable list of integration programs with optional status filter.

GET https://demo.affiliatepro.org/Admin_Api/programs
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
start_fromintegerQueryPagination offset (default: 0)
limitintegerQueryResults per page, max 100 (default: 20)
searchstringQuerySearch by program name or vendor username
statusstringQueryall, active, or inactive (default: all)
Response
{
  "status": true,
  "data": {
    "programs": [
      {
        "id": "5",
        "name": "Fashion Affiliate Program",
        "status": "1",
        "vendor_id": "12",
        "username": "vendor_user",
        "commission_type": "percentage",
        "commission_sale": "10",
        "sale_status": "1",
        "click_status": "0",
        "associate_programns": "3"
      }
    ],
    "total_count": 12,
    "start_from": 0,
    "limit": 20,
    "has_more": false,
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 1
  }
}
Program Status Codes
CodeLabelDescription
0In ReviewAwaiting admin approval
1Approved / ActiveProgram is live
2DeniedRejected by admin
3Ask to EditReturned to vendor for changes
Program Details

Retrieve full details for a single program including commission settings and vendor information.

GET https://demo.affiliatepro.org/Admin_Api/program_details
Parameters
ParameterTypeRequiredDescription
AuthorizationstringtrueAdmin JWT token (Header)
program_idintegertrueThe ID of the program
Response
{
  "status": true,
  "data": {
    "id": "5",
    "name": "Fashion Affiliate Program",
    "status": "1",
    "vendor_id": "12",
    "username": "vendor_user",
    "email": "vendor@example.com",
    "vendor_name": "John Doe",
    "firstname": "John",
    "lastname": "Doe",
    "commission_type": "percentage",
    "commission_sale": "10",
    "sale_status": "1",
    "click_status": "0",
    "tools_count": 3,
    "currency_symbol": "$",
    "currency_code": "USD"
  }
}
Admin

Integration Campaigns

Browse and inspect integration campaigns (marketing tools / ads). Each campaign belongs to a program and inherits commission settings from that program.

Campaigns List

Retrieve a paginated, searchable list of integration campaigns (integration_tools) with optional status filter.

GET https://demo.affiliatepro.org/Admin_Api/campaigns
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
start_fromintegerQueryPagination offset (default: 0)
limitintegerQueryResults per page, max 100 (default: 20)
searchstringQuerySearch by campaign name, program name, or vendor username
statusstringQueryall, active, or inactive (default: all)
Response
{
  "status": true,
  "data": {
    "campaigns": [
      {
        "id": "18",
        "program_id": "5",
        "vendor_id": "12",
        "name": "Summer Sale Banner",
        "type": "banner_ads",
        "tool_type": "banner",
        "status": "1",
        "created_at": "2025-06-01 10:00:00",
        "program_name": "Fashion Affiliate Program",
        "vendor_username": "vendor_user",
        "stat_sales_count": "12",
        "stat_clicks_count": "340",
        "stat_orders_total": "1250.50"
      }
    ],
    "total_count": 45,
    "start_from": 0,
    "limit": 20,
    "has_more": true,
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 1
  }
}

List rows include stat_sales_count (rows in integration_orders), stat_clicks_count (_af_product_click in integration_clicks_action), and stat_orders_total (sum of integration_orders.total).

Campaign Details

Retrieve full details for a single campaign including ad creatives, program commission fields, and vendor info.

GET https://demo.affiliatepro.org/Admin_Api/campaign_details
Parameters
ParameterTypeRequiredDescription
AuthorizationstringtrueAdmin JWT token (Header)
campaign_idintegertrueThe ID of the campaign (integration_tools.id)
Response
{
  "status": true,
  "data": {
    "id": "18",
    "name": "Summer Sale Banner",
    "type": "banner_ads",
    "tool_type": "banner",
    "status": "1",
    "program_id": "5",
    "program_name": "Fashion Affiliate Program",
    "vendor_id": "12",
    "vendor_name": "John Doe",
    "username": "vendor_user",
    "commission_type": "percentage",
    "commission_sale": "10",
    "sale_status": "1",
    "commission": {},
    "ads": [],
    "created_at": "2025-06-01 10:00:00",
    "currency_symbol": "$",
    "currency_code": "USD"
  }
}
Admin

Integration Categories

Read-only list and detail for integration marketing categories (integration_category). Used to classify programs in the integration marketplace.

Categories List

Paginated list with optional search on category or parent name. Timestamps are returned as stored in the database (ISO-style strings).

GET https://demo.affiliatepro.org/Admin_Api/categories
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
start_fromintegerQueryPagination offset (default: 0)
limitintegerQueryResults per page, max 100 (default: 20)
searchstringQuerySearch by category name or parent category name
Response
{
  "status": true,
  "data": {
    "categories": [
      {
        "id": 3,
        "name": "Electronics",
        "parent_id": 0,
        "created_at": "2025-01-15 12:30:00",
        "parent_name": null
      }
    ],
    "total_count": 8,
    "start_from": 0,
    "limit": 20,
    "has_more": false,
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 1
  }
}
Category Details

Single category row plus children_count (direct child categories).

GET https://demo.affiliatepro.org/Admin_Api/category_details
Parameters
ParameterTypeRequiredDescription
AuthorizationstringtrueAdmin JWT token (Header)
category_idintegertrueintegration_category.id
Response
{
  "status": true,
  "data": {
    "id": 3,
    "name": "Electronics",
    "parent_id": 0,
    "created_at": "2025-01-15 12:30:00",
    "parent_name": null,
    "children_count": 2,
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 1
  }
}
Admin

Orders

Read-only combined view of local store orders (order) and integration / external orders (integration_orders). List rows are lightweight; use order_details for line items and history.

Orders List

Each row includes order_type: store (local store) or ex (integration). external_reference is the payment / external reference (txn_id for store, order_id for integration).

GET https://demo.affiliatepro.org/Admin_Api/orders
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
start_fromintegerQueryPagination offset (default: 0)
limitintegerQueryResults per page, max 100 (default: 20)
searchstringQuerySearch id, references, customer username / email / name; for ex also base_url and script_name
typestringQueryall, store, or ex (default: all)
statusstringQueryall or numeric order status code (same field on both order types)
Response
{
  "status": true,
  "data": {
    "orders": [
      {
        "order_type": "store",
        "id": 120,
        "status": 1,
        "user_id": 45,
        "total": "99.00",
        "currency_code": "USD",
        "payment_method": "stripe",
        "external_reference": "pi_abc123",
        "created_at": "2025-06-10 14:22:01",
        "firstname": "Jane",
        "lastname": "Doe",
        "username": "jane",
        "email": "jane@example.com"
      },
      {
        "order_type": "ex",
        "id": 88,
        "status": 1,
        "user_id": 12,
        "total": "45.00",
        "currency_code": "USD",
        "payment_method": "",
        "external_reference": "EXT-7788",
        "created_at": "2025-06-09 09:15:00",
        "firstname": "John",
        "lastname": "Smith",
        "username": "john",
        "email": "john@example.com"
      }
    ],
    "total_count": 200,
    "start_from": 0,
    "limit": 20,
    "has_more": true,
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 1
  }
}
Order Details

For store, includes products, decoded files / comment where applicable, and payment / order history. For ex, includes integration fields, optional campaign_name and program_name, and decoded custom_data.

GET https://demo.affiliatepro.org/Admin_Api/order_details
Parameters
ParameterTypeRequiredDescription
AuthorizationstringtrueAdmin JWT token (Header)
order_typestringtruestore or ex (must match list row)
idintegertruePrimary key in order or integration_orders
Notes
  • Store status labels follow Order_model::$status (complete, pending, refunded, etc.).
  • Integration orders use the same numeric status column; meaning aligns with your integration / wallet workflow.
Admin

Support tickets

List and manage support tickets (tickets, tickets_reply, tickets_subject). GET endpoints are read-only; POST ticket_reply and ticket_status mirror web admin behaviour (email + in-app notifications where configured).

Ticket subjects

Lookup list for filter dropdowns (id + subject label).

GET https://demo.affiliatepro.org/Admin_Api/ticket_subjects
Response (excerpt)
{
  "status": true,
  "data": {
    "subjects": [ { "id": 1, "subject": "Billing" } ],
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 1
  }
}
Tickets list
GET https://demo.affiliatepro.org/Admin_Api/tickets
Parameters
ParameterTypeDescription
AuthorizationHeaderAdmin JWT
start_fromintegerOffset (default 0)
limitintegerPage size, max 100 (default 20)
searchstringTicket id, user name, email, username, subject text
statusstringall or 1 open, 2 pending, 3 closed
subject_idstringall or numeric tickets_subject.id
Ticket details & thread

Returns ticket (header row) and replies in chronological order. user_type on a reply: 1 = admin/staff, 2 = end user. attachments exposes safe filenames + absolute url (web uploads).

GET https://demo.affiliatepro.org/Admin_Api/ticket_details?ticket_id=
Admin reply

Plain-text body only (no multipart upload). Re-opens a closed ticket to open when the admin replies, same as web admin.

POST https://demo.affiliatepro.org/Admin_Api/ticket_reply

JSON body: ticket_id (string), message (string).

Ticket status

Sets tickets.status and triggers the same mail / notification hooks as the web admin.

POST https://demo.affiliatepro.org/Admin_Api/ticket_status

JSON body: ticket_id (string), status1 open, 2 pending, 3 closed.

Admin

Settings summary

Read-only overview of public-safe configuration (no SMTP secrets, payment keys, or Telegram tokens). Intended for the mobile admin app. Access: valid admin JWT and admin user type — same as other Admin API GET endpoints.

Settings summary

Returns grouped site, store, modules, and default language, merged with the same currency helpers as other admin endpoints: currency_symbol, currency_code, enable_shorten_numbers.

Most module and store flags are string "0" / "1" as stored in settings — clients should map them to labels (off/on) if needed. site.favicon_url is only present when a favicon is configured.

GET https://demo.affiliatepro.org/Admin_Api/settings_summary
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
Response (sample)
{
  "status": true,
  "data": {
    "summary": {
      "site": {
        "name": "My Store",
        "time_zone": "UTC",
        "session_timeout": "1800",
        "hide_currency_from": "0",
        "block_click_across_browser": "0",
        "cookies_consent": "0",
        "notify_email": "admin@example.com",
        "telegram_enable": "0",
        "favicon_url": "https://example.com/assets/images/site/favicon.ico"
      },
      "store": {
        "status": "1",
        "theme": "0",
        "store_mode": "cart",
        "affiliate_cookie": "30",
        "registration_status": "1",
        "registration_approval": "0",
        "mail_verifiy": "0"
      },
      "modules": {
        "market_tools": "1",
        "referlevel": "1",
        "membership": "0",
        "award_level": "0",
        "vendor_store": "1",
        "vendor_deposit": "0",
        "market_vendor_status": "1",
        "saas_enable": "1"
      },
      "language": { "id": "1", "name": "English", "code": "en" }
    },
    "currency_symbol": "$",
    "currency_code": "USD",
    "enable_shorten_numbers": 0
  }
}

Language object: id is the internal database primary key for the default language row (for integrations/debug only). End-user apps often show only name and, when present, code (included if your language table has a code column).

Admin

Membership

Read-only access to membership plans and purchase orders. Permission: reports.orders (same as web admin Membership Orders). Super admin (id 1) always has access.

Plans list

Returns all membership plans in the database (no paging — the list is typically small). Sorted newest-first.

GET https://demo.affiliatepro.org/Admin_Api/membership_plans
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
Response (sample)
{
  "status": true,
  "data": {
    "plans": [
      {
        "id": 2,
        "name": "Pro Monthly",
        "price": "29.00",
        "special_price": "19.00",
        "bonus": "5.00",
        "total_day": 30,
        "billing_period": "monthly",
        "billing_label": "Per Month",
        "is_lifetime": 0,
        "has_trial": 1,
        "trial_days": 7,
        "plan_level": 2,
        "status": 1
      }
    ],
    "total": 1
  }
}
FieldTypeDescription
idintPlan ID
namestringPlan name
pricestringRegular price
special_pricestring|nullDiscounted price when set
bonusstringWallet bonus on activation
total_dayintPlan duration in days (0 = lifetime)
billing_periodstringRaw period key (e.g. monthly, yearly, lifetime_free, custom)
billing_labelstringHuman-readable period label
is_lifetimeint1 when billing_period is lifetime_free
has_trialint1 when a trial period is configured
trial_daysintNumber of free trial days
plan_levelint|nullAward level number linked to this plan
statusintPlan status: 1 = active
Orders list

Paginated membership purchase history with user and plan info. Mirrors web admin → Membership → Orders.

GET https://demo.affiliatepro.org/Admin_Api/membership_orders
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
start_fromintQueryOffset (default 0)
limitintQueryPage size, max 100 (default 20)
searchstringQuerySearch by user name / username
statusstringQueryall (default) or a numeric status_id: 0=pending, 1=active, 3=denied, 4=expired, 5=failed, 7=processed, 8=refunded
user_idintQueryFilter orders for a specific user
Response (sample)
{
  "status": true,
  "data": {
    "orders": [
      {
        "id": 14,
        "user_id": 3,
        "user_name": "Jane Doe",
        "user_username": "jane",
        "plan_id": 2,
        "plan_name": "Pro Monthly",
        "plan_billing": "monthly",
        "total": "19.00",
        "bonus_commission": "5.00",
        "status_id": 1,
        "status_label": "active",
        "is_active": 1,
        "is_lifetime": 0,
        "total_day": 30,
        "payment_method": "stripe",
        "started_at": "2026-03-01 10:00:00",
        "expire_at": "2026-04-01 10:00:00",
        "created_at": "2026-03-01 09:59:45"
      }
    ],
    "total": 1,
    "has_more": false
  }
}
Admin

Click / traffic logs

Read-only access to the integration click log (integration_clicks_logs). Permission: reports.statistics (same as web admin Income Report). Super admin (id 1) always has access.

Click logs list

Paginated log of all affiliate link clicks / actions / views. Newest-first. Each row includes visitor device and geo info joined to the affiliate user.

GET https://demo.affiliatepro.org/Admin_Api/click_logs
Parameters
ParameterTypePositionDescription
AuthorizationstringHeaderAdmin JWT token
start_fromintQueryOffset (default 0)
limitintQueryPage size, max 100 (default 20)
searchstringQuerySearch by user name, username, IP, or country code
typestringQueryall (default), click, action, view
user_idintQueryFilter logs for a specific affiliate
Response (sample)
{
  "status": true,
  "data": {
    "logs": [
      {
        "id": 501,
        "click_type": "click",
        "ip": "203.0.113.42",
        "country_code": "US",
        "browser": "Chrome",
        "is_mobile": 0,
        "mobile_name": "",
        "link": "https://example.com/product-page",
        "page_open_time": "1.23",
        "created_at": "2026-03-19 14:22:01",
        "user_id": 5,
        "user_name": "John Smith",
        "user_username": "johnsmith"
      }
    ],
    "total": 2048,
    "has_more": true
  }
}
FieldTypeDescription
idintLog entry ID
click_typestringclick | action | view
ipstringVisitor IP address
country_codestring2-letter ISO country (empty if not resolved)
browserstringBrowser name
is_mobileint1 if visitor used a mobile device
mobile_namestringMobile device name when is_mobile = 1
linkstringDestination URL of the click
page_open_timestringTime the page was open (seconds), if captured
created_atstringTimestamp of the click
user_idintAffiliate user ID
user_namestringAffiliate full name
user_usernamestringAffiliate username

Live Implementation Examples

Working demos connected to your Admin API - login and see real data

Step 1: Connect to your API
Dashboard Stats Cards
Waiting for connection
Total Admin Balance

--

--% this week

--

Total Users

--

Affiliates

--

Vendors

--

Pending Users

--

Store Sales -- orders

--

Vendor Sales -- orders

--

Store Commissions (admin + affiliate)

--

Click Commission -- clicks

--

Today's Clicks

--

Today's Sales

--

Pending Payouts

--

Total Withdrawals
Users Management
Waiting for connection
NameEmailBalanceClicksSalesTypeStatusAction
Connect to API first
Withdrawal Requests
UserAmountMethodDateActions
Connect to API first
Reports & Analytics
Wallet Overview
Admin Balance

--

External Orders

--

Store Sales

--

Integration Clicks --
Store Clicks --
Action Clicks --
Form Clicks --
Recent Transactions
UserAmountTypeStatusDate
Connect to API first
Admin Profile
Waiting for connection
--
--
Username --
Phone --
Country --
City --
Pincode --
Edit Profile