This documentation provides a ioprehensive guide to PeoPay’s APIs, enabling developers to integrate with the PeoPay ecosystem. The APIs allow seamless access to core features such as user management, P2P payments, staking, governance, and Dynamic Contribution Scoring (DCS).
PeoPay APIs enable developers to: - Authenticate users and manage accounts. - Initiate and track transactions, including crypto-to-mobile money conversions. - Access staking, rewards, and referral systems. - Participate in governance through voting and proposal submission. - Monitor user contributions and penalties via DCS.
https://api.peopay.io/v1
https://sandbox.api.peopay.io/v1
Authenticate users and retrieve a session token for subsequent API requests.
POST
/auth/login
{
"username": "user@example.io",
"password": "securePassword123"
}
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600
}
Create a new user account.
POST
/auth/register
{
"username": "user@example.io",
"password": "securePassword123",
"mobile_number": "+1234567890"
}
{
"message": "User registered successfully. Please verify your email."
}
Retrieve user details, including DCS score and staking status.
GET
/user/profile
Authorization: Bearer <token>
{
"username": "user@example.io",
"mobile_number": "+1234567890",
"dcs_score": 1250,
"staking_balance": 500,
"referrals": 10
}
Send a peer-to-peer payment using PeoCoin.
POST
/transactions/p2p
{
"recipient": "recipient@example.io",
"amount": 50,
"message": "Payment for services"
}
{
"transaction_id": "abc123",
"status": "success",
"timestamp": "2024-01-01T12:00:00Z"
}
Convert crypto to mobile money.
POST
/transactions/convert
{
"amount": 100,
"currency": "PEO",
"mobile_number": "+1234567890"
}
{
"conversion_id": "conv123",
"status": "processing",
"mobile_money_balance": 1000,
"exchange_rate": 1.2
}
Stake PeoCoin to earn rewards.
POST
/staking/stake
{
"amount": 200
}
{
"staking_id": "stake123",
"status": "success",
"message": "You have successfully staked 200 PEO."
}
Retrieve current staking rewards.
GET
/staking/rewards
Authorization: Bearer <token>
{
"total_rewards": 50,
"next_payout": "2024-01-15T00:00:00Z"
}
Submit a governance proposal.
POST
/governance/proposals
{
"title": "Proposal to Increase Staking Yields",
"description": "This proposal suggests increasing staking yields by 5% to encourage participation.",
"category": "Staking",
"attachments": []
}
{
"proposal_id": "prop123",
"status": "submitted",
"message": "Your proposal has been submitted for review."
}
Cast a vote on an active proposal.
POST
/governance/vote
{
"proposal_id": "prop123",
"vote": "yes"
}
{
"status": "success",
"message": "Your vote has been recorded."
}
Retrieve the user’s DCS score.
GET
/dcs/score
Authorization: Bearer <token>
{
"dcs_score": 1350,
"breakdown": {
"transactions": 600,
"staking": 500,
"governance": 200,
"referrals": 50,
"penalties": -50
}
}
Error Code | Message | Description |
---|---|---|
400 | Bad Request |
Invalid or malformed request data. |
401 | Unauthorized |
Missing or invalid authentication token. |
403 | Forbidden |
Insufficient permissions. |
404 | Not Found |
Requested resource does not exist. |
500 | Internal Server Error |
An unexpected error occurred. |
Rate limit status is returned in the headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 80
X-RateLimit-Reset: 1683721200
curl -X POST https://api.peopay.io/v1/transactions/p2p \
"Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H '{
-d "recipient": "recipient@example.io",
"amount": 50,
"message": "Payment for services"
}'