PayMate/PROJECT DOCSOpen app
PAYMATE / PROJECT DETAILS
PROJECT DOCUMENTATIONv0.1.0

PayMate project.

A full-stack Web3 invoicing application for creating USDC payment links, verifying settlement on GOAT Testnet3, and recording freelancer reputation on-chain.

FRONTENDNext.js 16
APINext.js route handlers
NETWORKGOAT Testnet3
STORAGEPostgres (Neon)
01
ARCHITECTURE

Project structure

The repository contains two independent parts that work together.

web/Next.js landing page, dashboard, docs, payment checkout, and the /api/* invoice, settlement, and reputation routes
contracts/Hardhat project containing the PayMate reputation registry
1Next.js clientCreates and displays invoices
2Next.js route handlersStore and verify settlement
3GOAT contractsUSDC and reputation records
02
LOCAL SETUP

Run the project

  1. Install and run
    cd web
    npm install
    npm run dev
  2. Open the application

    Visit http://localhost:3000. The API health endpoint is http://localhost:3000/api/health.

03
ENVIRONMENT

Required configuration

Copy web/.env.example to web/.env.local and set the deployment-specific values.

VariablePurpose
OPENAI_API_KEYOptional intelligent drafting
OPENAI_MODELDrafting model name
RPC_GOAT_TESTNETGOAT Testnet3 RPC
USDC_TOKENSettlement token address
REPUTATION_CONTRACTDeployed registry address
PRIVATE_KEYAuthorized reputation issuer
DATABASE_URLPostgres connection string for invoice storage (e.g. Neon)
NEXT_PUBLIC_WALLETCONNECT_PROJECT_IDOptional — enables the WalletConnect connector for mobile/QR wallets
04
API ROUTES

Backend endpoints

GET/api/healthService health
POST/api/invoices/draftGenerate a reviewable intelligent draft
POST/api/invoicesCreate an approved invoice
GET/api/invoices?freelancer=0x…List wallet invoices
GET/api/invoices/{id}Load one invoice
POST/api/pay/{id}/settleGet 402 requirements or verify payment
GET/api/reputation/{address}Read reputation data
Settlement verification

The API checks transaction success, USDC token address, recipient wallet, and transferred amount before marking an invoice paid.

05
FRONTEND ROUTES

Application pages

PAGE/Product landing page
PAGE/dashboardInvoice and reputation workspace
PAGE/pay/{invoice-id}Client wallet checkout
PAGE/docsProject documentation
06
REPUTATION CONTRACT

PayMateReputation.sol

The issuer records a completed job only after verified payment. Anyone can read a freelancer’s completed jobs, total settled value, and score.

recordJob(address freelancer, uint256 amountUsd)
getReputation(address freelancer) returns (Rep)

Deploy from the contracts/ directory with the configured GOAT Testnet3 RPC and issuer key.

ContractAddress
PayMateReputation0xc2072cc0007cA8fcB84bdA09cFE20014559285BD
TestUSDC0xeF9Ea814f011289E28f1c87FE8E0C0F68Aa82446

No official Circle USDC exists on GOAT Testnet3 yet, so USDC_TOKEN currently points at a self-deployed 6-decimal test ERC-20 (contracts/contracts/TestUSDC.sol) with an open faucet() for testing.

07
DEPLOYMENT

Production checklist

  • Reputation contract deployed on GOAT Testnet3.
  • Test settlement token deployed (no official USDC on this testnet yet).
  • Persistent invoice storage on Postgres (Neon) — replaced the earlier SQLite-on-serverless-disk approach, which didn't persist between requests.
  • ERC-8004 agent identity registration — the registry only exists on GOAT mainnet, not Testnet3.
08
FAQ

Frequently asked questions

What is PayMate?

PayMate is on-chain invoicing and settlement software for independent workers. It creates payment requests, collects payment as a direct wallet-to-wallet USDC transfer via the x402 protocol, verifies that transfer on-chain, and records a portable ERC-8004 reputation credential for the freelancer.

How is PayMate different from Stripe, PayPal, or a plain crypto payment link?

Stripe and PayPal custody the funds and settle to a bank account days later; PayMate never touches the money — payment is a direct wallet-to-wallet transfer the client's own wallet signs. A plain crypto payment link proves a transfer happened but leaves no durable record of trust; PayMate turns every verified settlement into a portable, on-chain reputation credential (ERC-8004) that follows the freelancer across platforms.

What is x402 and why does PayMate use it?

x402 is a protocol built on the HTTP 402 Payment Required status code: a server can describe exactly what payment it needs (token, amount, recipient) and a client can fulfill it programmatically, after which the server verifies the on-chain result. PayMate's settlement endpoint returns a 402 with those requirements, then verifies the resulting transaction's token, recipient, amount, and receipt status before marking an invoice paid.

What is ERC-8004 reputation and why does it matter?

ERC-8004 is an on-chain identity/reputation standard. PayMate's registry contract records a freelancer's completed job count, total settled volume, and trust score on every verified payment — a credential the freelancer owns and can carry to any other application, instead of a review buried in one platform's database.

Is PayMate custodial?

No. PayMate cannot move a client's funds. Every payment is a direct wallet-to-wallet USDC transfer that the client's own wallet signs; PayMate only verifies that the transfer already happened correctly.

What network does PayMate run on?

GOAT Network (Testnet3, chain ID 48816) for the current build. Settlement uses a 6-decimal test USDC token; the reputation registry is deployed on the same network.