Skip to main content

Admin

Platform administration endpoints. Require both authentication and admin role (requireAdmin).

GET /admin/stats/users

Get platform user statistics.

curl https://api.paylinks.ro/api/v1/admin/stats/users \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200):

{
"totalUsers": 500,
"activeUsers": 120,
"newUsersToday": 5
}

GET /admin/leaderboard

Get top sellers leaderboard.

curl https://api.paylinks.ro/api/v1/admin/leaderboard \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200):

[
{
"userId": "user-001",
"email": "[email protected]",
"totalRevenue": 2499500,
"totalTransactions": 500
}
]

GET /admin/users

List all platform users.

curl "https://api.paylinks.ro/api/v1/admin/users?limit=20" \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200): Paginated list of user objects.


POST /admin/users/:userId/impersonate

Get a JWT token for a specific user.

curl -X POST https://api.paylinks.ro/api/v1/admin/users/user-001/impersonate \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200):

{"token": "eyJhbGciOiJIUzI1NiIs..."}

GET /admin/disputes

List all disputes across the platform.

curl "https://api.paylinks.ro/api/v1/admin/disputes?limit=20&status=OPEN" \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200): Paginated list of dispute objects with total count.


GET /admin/disputes/stats

Get platform-wide dispute statistics.

curl https://api.paylinks.ro/api/v1/admin/disputes/stats \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200):

{
"total": 15,
"open": 3,
"underReview": 5,
"won": 6,
"lost": 1,
"totalAmount": 74985
}

GET /admin/disputes/:id

Get a single dispute with full details.

curl https://api.paylinks.ro/api/v1/admin/disputes/disp-001 \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200): Full dispute object.


GET /admin/analytics/dashboard

Get platform-wide analytics.

curl https://api.paylinks.ro/api/v1/admin/analytics/dashboard \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200):

{
"totalRevenue": 9999000,
"totalTransactions": 2000,
"totalUsers": 500,
"totalPayLinks": 350,
"platformFees": 399960
}

GET /admin/payouts/ready

List users with payouts ready to process.

curl https://api.paylinks.ro/api/v1/admin/payouts/ready \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200):

[
{
"userId": "user-001",
"email": "[email protected]",
"availableBalance": {
"RON": 499900,
"EUR": 100000,
"GBP": 0
}
}
]

POST /admin/payouts/:userId/:currency

Create a payout for a specific user.

curl -X POST https://api.paylinks.ro/api/v1/admin/payouts/user-001/RON \
-H "Authorization: Bearer ADMIN_TOKEN"

Response (200):

{
"id": "po_1234567890",
"amount": 499900,
"currency": "RON",
"status": "pending"
}