Developer Documentation
Complete documentation for integrating with the Peether PTDT Ecosystem. REST endpoints, smart contract methods, authentication, and SDK examples.
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.
PTDT API uses API keys and wallet signatures for authentication depending on the endpoint type.
For REST API endpoints, include your API key in the request headers:
For blockchain interactions, authenticate using wallet signatures:
To ensure fair usage and system stability, PTDT API implements rate limiting on all endpoints.
| Tier | Requests/Min | Requests/Hour | Burst Limit |
|---|---|---|---|
| Free | 60 | 1,000 | 10/sec |
| Developer | 300 | 10,000 | 50/sec |
| Business | 1,000 | 50,000 | 100/sec |
| Enterprise | Custom | Custom | Custom |
Every API response includes rate limit information:
Approve a spender to transfer tokens on your behalf.
Never approve unlimited amounts. Always approve only what you need.
| Parameter | Type | Description |
|---|---|---|
spender REQUIRED | address | The address authorized to spend tokens |
amount REQUIRED | uint256 | The exact amount to approve (in wei) |
Stake PTDT tokens to earn rewards. Requires prior approval.
| Parameter | Type | Description |
|---|---|---|
amount REQUIRED | uint256 | Amount to stake (minimum: 100 PTDT) |
lockPeriod REQUIRED | uint256 | Lock period: 0 (30d), 1 (90d), 2 (180d) |
Handle ride bookings and payments using PTDT tokens.
| Parameter | Type | Description |
|---|---|---|
rideId REQUIRED | bytes32 | Unique ride identifier |
driver REQUIRED | address | Driver's wallet address |
estimatedFare REQUIRED | uint256 | Fare in PTDT (wei format) |
Reward users with loyalty points for using Peether PTDT Token Ecosystem.
| Tier | Points Required | Benefits |
|---|---|---|
| Bronze | 0 - 999 | 1x points per PTDT |
| Silver | 1,000 - 4,999 | 1.5x points + 5% discount |
| Gold | 5,000 - 19,999 | 2x points + 10% discount |
| Platinum | 20,000+ | 3x points + 15% + Priority |
Retrieve PTDT token balance for a specific address.
| Parameter | Type | Description |
|---|---|---|
address REQUIRED | string | Wallet address (path parameter) |
formatted OPTIONAL | boolean | Return formatted balance (default: false) |
Get all token approvals for an address.
| Parameter | Type | Description |
|---|---|---|
address REQUIRED | string | Wallet address to check |
active_only OPTIONAL | boolean | Show only active approvals (default: true) |
Regularly audit your approvals and revoke any that are no longer needed. Unlimited approvals pose significant security risks.
Initiate a staking transaction via the REST API.
| Parameter | Type | Description |
|---|---|---|
address REQUIRED | string | User's wallet address |
amount REQUIRED | string | Amount to stake in PTDT |
lockPeriod REQUIRED | number | Lock period: 30, 90, or 180 |
autoCompound OPTIONAL | boolean | Enable auto-compounding (default: false) |
| Code | Message | Description |
|---|---|---|
E001 | Insufficient balance | User doesn't have enough PTDT |
E002 | Insufficient allowance | Contract not approved to spend |
E003 | Below minimum | Amount below minimum threshold |
E004 | Lock period active | Cannot withdraw during lock |
E005 | Invalid lock period | Must be 30, 90, or 180 |
E006 | Rate limit exceeded | Too many requests |
E007 | Invalid address | Bad wallet address format |
E008 | Unauthorized | Invalid or missing API key |
Register webhooks to receive real-time notifications for token events.
Ready to integrate?