P3P Quickstart – Build Agent-Native Payment Flows
Official Pine Labs developer documentation for integrating the Pine Labs Payment Protocol (P3P).
Supported rails
- UPI ReservePay (available now) — Customer approves a mandate; each paid request debits the approved reserve
- Cards (future scope) — P3P challenge/receipt unchanged; funding becomes card-specific
- Crypto (future scope) — Wallet, signature, and settlement become rail-specific
Integration flow
- Merchant onboarding yields
PINELABS_CLIENT_IDandPINELABS_CLIENT_SECRET - Create mandate via server SDK before client paid routes
- Customer approves mandate via UPI deep link in their banking app
decidePayment()wraps routes with challenge → verify → capture cycle- On HTTP 402, client SDK decodes challenge, creates one-time token, retries with
P3P-Credential: Payment - Store
Payment-Receiptwith order/audit records
Environments
Sandbox credentials pair with P3PEnvironment.SANDBOX; production credentials with P3PEnvironment.PRODUCTION.
Security requirements
PINELABS_CLIENT_SECRET derives the local challenge HMAC key and must be stored securely. Confirm mandate limits, refund behavior, and receipt storage with Pine Labs integration owners before production launch.
Agent-native design
Documentation targets trusted backends and AI agents using client credentials or customer-key mode for customer API token integrations.