API Billing (v1 – Simple Charges API)
API Billing lets your backend create billable charges for your customers with a single HTTP call.
You:
- Configure where to receive payments (Receiver Configs)
- Get an API key
- Call
POST /v1/chargeswith the final amount you want to charge - Verify payments with
POST /v1/charges/verifybefore showing content - Receive webhooks when payments succeed or fail
- See all charges under API Billing → Transactions and in your payout ledger
Meshpay does not calculate your prices. Your backend always decides the amount.
Core Concepts
Organization
Your account / company in Meshpay. All charges and transactions belong to an organization.
Receiver Configs
Configure where and how you want to receive payments. Define blockchain network, asset, and wallet address. You can create multiple configs and set a default.
Transaction (billing_transactions)
A single charge created for one of your customers via the billing API. Each charge returns x402 payment requirements that buyers use to pay on-chain.
API Key (api_keys)
Secret key used to authenticate your server → Meshpay calls. There is no sandbox/live split in v1. If you want to "test", just use small amounts or your staging Meshpay account.
Billing Flows (Coming Soon)
Advanced grouping with flowcharts and conditional logic. For now, you can create standalone charges without flows.
Quick Start
Seller Integration
Complete guide for accepting payments
- Create charges
- Verify payments
- Gate content access
Create Charges
Charge customers with a single API call
- Standalone charges (no flow required)
- x402 payment requirements
- Simple API
Verify Payments
Confirm payments before showing content
- Real-time verification
- Anti-cheat protection
- Reference matching
Four-Step Workflow
- Get an API Key - Go to Developers / Settings → API keys and create a server-side key
- Create a Receiver Config - Configure where to receive payments (or use connected Solana wallet)
- Create Charges - Call
POST /v1/chargeswith amount, currency, and payment config - Verify & Deliver - Call
POST /v1/charges/verifyto confirm payment before showing content
Payment & Payout Flow
Your backend calls POST /v1/charges with the final amount. Meshpay:
- Resolves x402 payment configuration (receiver config → default → connected wallet)
- Returns x402 payment requirements to your API
- Buyer pays on-chain using the x402 requirements
- Facilitator webhook confirms the payment
- Transaction status updates to
succeeded - Your backend receives webhook (
billing.transaction.succeeded) - Your backend verifies via
POST /v1/charges/verifybefore showing content - Payouts module uses these transactions for settlement
You don't need to manage ledgers or reconciliation manually – just create charges; Meshpay handles aggregation and payout logic.
Seller Integration Patterns
402 Mode (API Clients)
User Request → 402 Payment Required → User Pays → Verify Payment → Show Content
↓ ↓
Create Charge /v1/charges/verify
(returns x402) (returns verified: true)
Hosted Checkout Mode (Web Apps)
User Request → Redirect to pay.orvion.sh → User Pays → Redirect Back → Verify → Show Content
↓ ↓
Wallet Connect ?charge_id=xxx
USDC Payment &status=succeeded
For sellers accepting payments:
- 402 Mode: Best for API clients and programmatic access
- Hosted Checkout: Best for web apps with browser-based users
- Real-time verification: Call
/v1/charges/verifybefore showing paid content - Background processing: Receive
billing.transaction.succeededwebhooks for bookkeeping
See the Seller Integration Guide and Hosted Checkout Guide for complete examples.
Documentation Pages
Seller Integration
Complete guide for sellers - create charges, verify payments, gate content
Hosted Checkout
Redirect-based payment flow for web apps using pay.orvion.sh
Payment Verification
Real-time payment verification API reference
Webhooks
Receive notifications when payments succeed or fail
Charges API
Complete reference for creating standalone charges
Receiver Configs
Configure where and how to receive payments
Billing Flows
Advanced grouping with flowcharts and conditions (coming soon)
Transactions
List, filter, and inspect charges via Dashboard or API
SDK Examples
Node.js and Python SDK usage examples
Related Documentation
- API Keys & Auth - Managing API keys
- Payouts Overview - Understanding payout distribution
- Collections Overview - Payment collection concepts