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

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:

1

Get Your Credentials

Contact your account manager to receive your Agent ID and Secret Key

2

Generate JWT Token

Use the authentication code above to create your JWT token

3

Test Your Connection

Use the Get Balance API to verify your authentication

4

Start Building

Begin integrating deposit and withdrawal functionality