PayTree
DocsAPI Reference

API Reference

Complete endpoint details for PayTree API

Base URL

https://api.paytree.com

Authentication

Authenticate your API requests by including your secret API key in the Authorization header.

Authorization: Bearer sk_live_your_api_key
POST/v1/payments

Create a new payment

Parameters: amount, currency, description, customer_email
GET/v1/payments/:id

Retrieve a payment

Parameters: id
POST/v1/payments/:id/capture

Capture an authorized payment

Parameters: id, amount
POST/v1/payments/:id/refund

Refund a payment

Parameters: id, amount, reason
GET/v1/payments

List all payments

Parameters: limit, starting_after, status
POST/v1/checkout/sessions

Create a checkout session

Parameters: amount, currency, success_url, cancel_url
POST/v1/webhooks

Create a webhook endpoint

Parameters: url, events
GET/v1/webhooks

List webhook endpoints

Parameters: limit

Response Example

{
  "id": "pay_1234567890abcdef",
  "object": "payment",
  "amount": 10000,
  "currency": "usd",
  "status": "succeeded",
  "description": "Order #1234",
  "customer_email": "customer@example.com",
  "settlement": {
    "crypto": "USDC",
    "amount": "100.00",
    "network": "polygon",
    "wallet": "0x742d35Cc6634C0532925a3b844Bc9e7595f...",
    "tx_hash": "0xabc123..."
  },
  "metadata": {},
  "created": 1704067200,
  "livemode": true
}