BSC Mainnet: Online
โ†โ†’ Navigate tabs Ctrl+K Search
PTDT Home
Peether PTDT
PTDT API Documentation - Developer Integration Guide

Developer Documentation

PTDT โ€“ Live Developer API Guide

Complete documentation for integrating with the Peether PTDT Ecosystem. REST endpoints, smart contract methods, authentication, and SDK examples.

v1.0.0 โ— BSC MAINNET โ— LIVE

๐Ÿ“– Introduction

Welcome to the PTDT API documentation. This API allows you to interact with the Peether PTDT Token Ecosystem, including token operations, staking, ride payments, and loyalty programs.

๐Ÿ”— Base URLs

+
Endpoints
// REST API REST API: https://api.ptdt.taxi/v1 // BSC RPC Endpoint BSC RPC: https://bsc-dataseed.binance.org/ // PTDT Token Contract Address PTDT Contract: 0x66c6Fc5E7F99272134a52DF9E88D94eD83E89278

๐Ÿš€ Quick Start

+
JavaScript
const { ethers } = require('ethers'); // Connect to BSC const provider = new ethers.providers.JsonRpcProvider( 'https://bsc-dataseed.binance.org/' ); // PTDT Token Contract const PTDT_ADDRESS = '0x66c6Fc5E7F99272134a52DF9E88D94eD83E89278'; const PTDT_ABI = [/* ABI */]; const ptdtContract = new ethers.Contract(PTDT_ADDRESS, PTDT_ABI, provider); // Get token balance const balance = await ptdtContract.balanceOf(address); console.log(`Balance: ${ethers.utils.formatEther(balance)} PTDT`);
๐Ÿงช

Try It Live

Test the balance endpoint right here
โœ“ 200 OK
127ms
Response

๐Ÿ” Authentication

PTDT API uses API keys and wallet signatures for authentication depending on the endpoint type.

๐Ÿ”‘ API Key Authentication

+

For REST API endpoints, include your API key in the request headers:

HTTP Headers
Authorization: Bearer YOUR_API_KEY X-API-Key: YOUR_API_KEY Content-Type: application/json

๐Ÿ‘› Web3 Wallet Authentication

+

For blockchain interactions, authenticate using wallet signatures:

JavaScript
const signer = provider.getSigner(); const address = await signer.getAddress(); const message = `Sign this message to authenticate with PTDT API. Nonce: ${Date.now()}`; const signature = await signer.signMessage(message); // Send authentication request const response = await fetch('https://api.ptdt.taxi/v1/auth', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address, message, signature }) });

๐Ÿ“ Obtaining API Keys

+
Production API Access:
  1. Register at dapp.ptdt.taxi/developers
  2. Complete KYC verification
  3. Generate your API keys from the dashboard
  4. Securely store your keys (never commit to version control)

โš ๏ธ Security Best Practices:

  • Never share your API keys publicly
  • Rotate keys every 90 days
  • Use environment variables for key storage
  • Implement IP whitelisting when possible
  • Monitor API usage for suspicious activity

โฑ๏ธ Rate Limits

To ensure fair usage and system stability, PTDT API implements rate limiting on all endpoints.

๐Ÿ“Š Rate Limit Tiers

+
TierRequests/MinRequests/HourBurst Limit
Free601,00010/sec
Developer30010,00050/sec
Business1,00050,000100/sec
EnterpriseCustomCustomCustom

๐Ÿ“‹ Rate Limit Headers

+

Every API response includes rate limit information:

HTTP Headers
X-RateLimit-Limit: 60 X-RateLimit-Remaining: 45 X-RateLimit-Reset: 1704830400 Retry-After: 60

๐Ÿ”„ Handling Rate Limits

+
JavaScript
async function makeAPIRequest(url, options) { const response = await fetch(url, options); if (response.status === 429) { const retryAfter = response.headers.get('Retry-After'); console.log(`Rate limited. Retrying after ${retryAfter}s`); await new Promise(r => setTimeout(r, retryAfter * 1000)); return makeAPIRequest(url, options); } return response; }

๐Ÿ’ก Pro Tips:

  • Implement exponential backoff for retries
  • Cache responses when possible
  • Batch requests to reduce API calls
  • Use webhooks instead of polling
  • Monitor rate limit headers proactively

๐Ÿช™ Smart Contracts

๐Ÿ“ PTDT Token Contract

+

Approve a spender to transfer tokens on your behalf.

โš ๏ธ Security Warning:

Never approve unlimited amounts. Always approve only what you need.

Parameters

ParameterTypeDescription
spender REQUIREDaddressThe address authorized to spend tokens
amount REQUIREDuint256The exact amount to approve (in wei)

Example

JavaScript
// Approve 100 PTDT for staking const amount = ethers.utils.parseEther('100'); const stakingAddress = '0x...'; const tx = await ptdtContract.approve(stakingAddress, amount); await tx.wait(); console.log('Approval successful!');

๐Ÿ’Ž Staking Pool Contract

+

Stake PTDT tokens to earn rewards. Requires prior approval.

Parameters

ParameterTypeDescription
amount REQUIREDuint256Amount to stake (minimum: 100 PTDT)
lockPeriod REQUIREDuint256Lock period: 0 (30d), 1 (90d), 2 (180d)

๐Ÿ’ฐ Staking Rewards APY

5%
30 Days
8%
90 Days
12%
180 Days

๐Ÿš– Ride Payment Contract

+

Handle ride bookings and payments using PTDT tokens.

Book Ride

ParameterTypeDescription
rideId REQUIREDbytes32Unique ride identifier
driver REQUIREDaddressDriver's wallet address
estimatedFare REQUIREDuint256Fare in PTDT (wei format)

Payment Breakdown

  • Platform Fee: 5%
  • Driver Earnings: 95%
  • All fees collected in PTDT tokens

โญ Loyalty Program Contract

+

Reward users with loyalty points for using Peether PTDT Token Ecosystem.

Loyalty Tiers

TierPoints RequiredBenefits
Bronze0 - 9991x points per PTDT
Silver1,000 - 4,9991.5x points + 5% discount
Gold5,000 - 19,9992x points + 10% discount
Platinum20,000+3x points + 15% + Priority

How to Earn Points

  • 1 point per 1 PTDT spent on rides
  • Daily login bonus: 10 points
  • Refer a friend: 500 points
  • Complete 7-day ride streak: 1,000 points
  • Multipliers based on loyalty tier

๐Ÿ’ฐ REST API Endpoints

๐Ÿ’ต Get Balance

+

Retrieve PTDT token balance for a specific address.

Parameters

ParameterTypeDescription
address REQUIREDstringWallet address (path parameter)
formatted OPTIONALbooleanReturn formatted balance (default: false)

Response Example

JSON
{ "address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb4", "balance": "1000000000000000000000", "balanceFormatted": "1000.00", "symbol": "PTDT", "decimals": 18, "timestamp": 1704830400 }

cURL Example

cURL
curl -X GET \ 'https://api.ptdt.taxi/v1/balance/0x742d35Cc...?formatted=true' \ -H 'Authorization: Bearer YOUR_API_KEY'

โœ… Get Approvals

+

Get all token approvals for an address.

Parameters

ParameterTypeDescription
address REQUIREDstringWallet address to check
active_only OPTIONALbooleanShow only active approvals (default: true)

โš ๏ธ Security Recommendation:

Regularly audit your approvals and revoke any that are no longer needed. Unlimited approvals pose significant security risks.

๐Ÿ”’ Stake Tokens

+

Initiate a staking transaction via the REST API.

Request Parameters

ParameterTypeDescription
address REQUIREDstringUser's wallet address
amount REQUIREDstringAmount to stake in PTDT
lockPeriod REQUIREDnumberLock period: 30, 90, or 180
autoCompound OPTIONALbooleanEnable auto-compounding (default: false)
๐Ÿงช

Try It Live

Simulate a staking request
โœ“ 200 OK
89ms
Response

๐Ÿ”ง Resources & Error Handling

โš ๏ธ Error Codes

+
CodeMessageDescription
E001Insufficient balanceUser doesn't have enough PTDT
E002Insufficient allowanceContract not approved to spend
E003Below minimumAmount below minimum threshold
E004Lock period activeCannot withdraw during lock
E005Invalid lock periodMust be 30, 90, or 180
E006Rate limit exceededToo many requests
E007Invalid addressBad wallet address format
E008UnauthorizedInvalid or missing API key

๐Ÿ”” Webhooks

+

Register webhooks to receive real-time notifications for token events.

Register Webhook

JSON
{ "url": "https://your-domain.com/webhook", "events": ["transfer", "approval", "stake", "unstake", "reward_claimed"], "secret": "your_webhook_secret" }

Webhook Payload Example

JSON
{ "event": "stake", "timestamp": 1704830400, "txHash": "0xabc123...", "data": { "user": "0x742d35Cc...", "amount": "1000000000000000000000", "lockPeriod": 90, "apy": 8 } }

๐Ÿ“ฆ Official SDKs

JavaScript/TypeScript

+
JavaScript
// Install npm install @ptdt/sdk ethers import { PTDTClient } from '@ptdt/sdk'; const client = new PTDTClient({ network: 'mainnet', provider: window.ethereum }); // Check balance const balance = await client.getBalance(address); // Stake tokens const result = await client.stake({ amount: '1000', lockPeriod: 90 });

Python

+
Python
# Install pip install ptdt-sdk web3 from ptdt import PTDTClient client = PTDTClient( network='mainnet', provider_url='https://bsc-dataseed.binance.org/' ) # Get token info balance = client.get_balance(address) print(f'Balance: {balance} PTDT')

๐Ÿš€ Next Steps

+

Ready to integrate?

  1. Get API Key: Contact the Peether PTDT Dev Team for production access
  2. Test on Testnet: Try all endpoints on BSC Testnet first
  3. Review Security: Follow our security best practices guide
  4. Join Community: Connect with developers on Telegram

๐Ÿ“š For Additional Resources, please visit Quick Links and Resources section below.