Introduction
Welcome to the P2N API Documentation. Our API provides seamless access to payment services including deposits, withdrawals, and transaction management.
API Interface Overview
The Web Service API interface is for accessing the payment service
Please send information to us:
- Operator Callback URL
- Operator JWT Secret (Optional, if not send to us, we will generate it for you)
and ask us for the following information:
- Payment Url
- Secret Key
- Agent Id
馃挵 Payment Processing
Secure deposit and withdrawal processing with multiple bank support
馃搳 Transaction Management
Complete transaction history and status tracking
馃敀 JWT Authentication
Secure API access with JSON Web Token authentication
馃摫 Mobile Ready
Responsive API design for mobile and desktop applications
Authentication
All API requests require JWT (JSON Web Token) authentication. Include your JWT token in the Authorization header of each request.
JWT Token Structure
Your JWT token should contain the following payload:
// Install: composer require firebase/php-jwt
use Firebase\JWT\JWT;
$secretKey = 'YOUR_SECRET_KEY';
$agentId = '1000';
$userId = 1;
$payload = [
'userId' => $userId,
'agentId' => $agentId,
'iat' => time(),
'exp' => time() + (60 * 60 * 24) // 24 hours
];
$jwt = JWT::encode($payload, $secretKey, 'HS256');
echo $jwt;
// Install: npm install jsonwebtoken
const jwt = require('jsonwebtoken');
const secretKey = 'YOUR_SECRET_KEY';
const agentId = '1000';
const userId = 1;
const payload = {
userId: userId,
agentId: agentId,
iat: Math.floor(Date.now() / 1000),
exp: Math.floor(Date.now() / 1000) + (60 * 60 * 24) // 24 hours
};
const token = jwt.sign(payload, secretKey);
console.log(token);
馃攽 JWT Token Manager
JWT Token (Used for all API requests)
Token will be saved in browser and used for all test requests below
Quick Start
Get started with the P2N API in just a few steps:
Get Your Credentials
Contact your account manager to receive your Agent ID and Secret Key
Generate JWT Token
Use the authentication code above to create your JWT token
Test Your Connection
Use the Get Balance API to verify your authentication
Start Building
Begin integrating deposit and withdrawal functionality