TBUSD

Escrow API & SDK

Build escrow functionality into your apps, bots, and AI agents

Get Your API Key

Enter your email to receive an API key. We'll send a verification link.

Rate Limits: 100 read requests/day, 20 write requests/day per API key. Need more? Contact us.

Quick Start

1 SDK (Recommended)

The easiest way to integrate. Works with Node.js, browsers, and AI agents.

npm install @tbusd/escrow-sdk
import { TBUSDEscrow } from '@tbusd/escrow-sdk';

// Read operations (no API key needed)
const escrow = new TBUSDEscrow();
const details = await escrow.getEscrow('0x...');

// Write operations (API key required)
const sdk = new TBUSDEscrow({ apiKey: 'your-api-key' });
const result = await sdk.createEscrow({
  buyer: '0xBuyerAddress...',
  seller: '0xSellerAddress...',
  amount: '100',
  description: 'Payment for services'
});

2 REST API

Direct HTTP calls. Works with any language or tool.

# Health check (no auth)
curl https://tbusd.io/escrow-api/health

# Get escrow details (no auth)
curl https://tbusd.io/escrow-api/escrow/0x8920107b...

# Create escrow (requires API key)
curl -X POST https://tbusd.io/escrow-api/escrow/create \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "buyer": "0x...",
    "seller": "0x...",
    "amount": "100",
    "description": "Payment for services"
  }'

API Reference

Base URL: https://tbusd.io/escrow-api

Read Endpoints (No Auth Required)

GET /health

API health check and basic stats

GET /factory

Factory contract address and total escrow count

GET /escrows

List all escrows (returns last 100)

GET /escrow/:address

Get detailed escrow information including status, amounts, vesting schedule

GET /escrows/by-wallet/:wallet

Get all escrows for a wallet (as buyer, seller, or arbitrator)

Write Endpoints (API Key Required)

Include header: Authorization: Bearer YOUR_API_KEY

POST /escrow/create

Create a simple escrow

Request body
{
  "buyer": "0x...",      // Buyer wallet address
  "seller": "0x...",     // Seller wallet address
  "amount": "100",       // Amount in TBUSD
  "releaseType": 0,      // 0=Mutual, 1=BuyerProtected, 2=SellerProtected, 3=TimeLocked
  "description": "..."   // Optional description
}
POST /escrow/create-custom

Create escrow with all options (vesting, arbitration, deadlines)

Request body
{
  "buyer": "0x...",
  "seller": "0x...",
  "amount": "100",
  "releaseType": 0,
  "description": "...",
  "deadline": 0,                    // Unix timestamp (0 = no deadline)
  "arbitrationMode": 0,             // 0=None, 1=Optional, 2=Required
  "arbitrator": "0x...",            // Arbitrator address
  "vestingEnabled": false,
  "vestingTimestamps": [],          // Unix timestamps for each tranche
  "vestingAmounts": [],             // Amount per tranche
  "depositScheduleEnabled": false,
  "depositTimestamps": [],
  "depositAmounts": []
}
POST /escrow/:address/deposit

Deposit full amount into escrow

POST /escrow/:address/accept-terms

Accept escrow terms (buyer or seller)

POST /escrow/:address/approve-release

Approve release of funds to seller

POST /escrow/:address/approve-refund

Approve refund to buyer

POST /escrow/:address/raise-dispute

Raise a dispute (requires arbitration mode)

Escrow Types

Mutual (0)

Both buyer and seller must approve release or refund. Safest option.

Buyer Protected (1)

Buyer can refund anytime. Good for risky purchases.

Seller Protected (2)

Seller can release anytime. Good for trusted sellers.

Time Locked (3)

Auto-releases to seller after deadline passes.

Smart Contracts

Contract Address
Factory 0x1fFA195A86d7E7872EBC2D1d24899addD3f1eB8c
TBUSD Token 0x0d02E2E2a7ADaF2372ca0C69845c8b159A24a595

Network: Base Mainnet (Chain ID: 8453)

Need Help?

Questions about integration? Email [email protected]

Need higher rate limits? Contact enterprise sales