Quick Start Examples
Quick Start
Verify an x402 Payment
const response = await fetch('https://api.oura402.dev/v1/payments/verify', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${process.env.API_KEY}`
},
body: JSON.stringify({
payment_proof: 'BASE64_ENCODED_PAYMENT_PROOF',
amount: 1000000,
recipient: 'YOUR_WALLET_ADDRESS'
})
});
const data = await response.json();
if (data.verified) {
console.log('Payment verified! Transaction:', data.transaction_id);
} else {
console.log('Payment invalid');
}import requests
import os
response = requests.post(
'https://api.oura402.dev/v1/payments/verify',
headers={
'Content-Type': 'application/json',
'Authorization': f'Bearer {os.getenv("API_KEY")}'
},
json={
'payment_proof': 'BASE64_ENCODED_PAYMENT_PROOF',
'amount': 1000000,
'recipient': 'YOUR_WALLET_ADDRESS'
}
)
data = response.json()
if data['verified']:
print(f'Payment verified! Transaction: {data["transaction_id"]}')
else:
print('Payment invalid')Language-Specific Guides
Integration Patterns
Protect an API Endpoint
Real-Time Payment Notifications
Build a Paywall
Best Practices
Next Steps
Last updated
