Skip to Content

Payments

Payment processing, billing, and financial services.

Overview

Financial operations are handled by five services:

ServicePortPurpose
payment_service8207Stripe, crypto, payment intents
wallet_service8208Virtual wallets, balances
billing_service8216Invoicing, usage billing
subscription_service8228Subscription lifecycle
credit_service8229Credit system, redemption

Payment Service (8207)

Create Payment Intent

curl -X POST "http://localhost:8207/api/v1/payments/intent" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "amount": 2999, "currency": "usd", "description": "Pro Plan - Monthly" }'

Confirm Payment

curl -X POST "http://localhost:8207/api/v1/payments/intent/pi_abc123/confirm" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"payment_method_id": "pm_card_visa"}'

Process Refund

curl -X POST "http://localhost:8207/api/v1/payments/pi_abc123/refund" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"amount": 2999, "reason": "customer_request"}'

Wallet Service (8208)

Get Wallet Balance

curl "http://localhost:8208/api/v1/wallets/me" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Add Funds

curl -X POST "http://localhost:8208/api/v1/wallets/me/deposit" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "amount": 5000, "currency": "usd", "payment_method_id": "pm_card_visa" }'

Subscription Service (8228)

Create Subscription

curl -X POST "http://localhost:8228/api/v1/subscriptions" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "plan_id": "plan_pro_monthly", "payment_method_id": "pm_card_visa" }'

Cancel Subscription

curl -X POST "http://localhost:8228/api/v1/subscriptions/me/cancel" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{"at_period_end": true}'

Credit Service (8229)

Get Credits

curl "http://localhost:8229/api/v1/credits/me" \ -H "Authorization: Bearer YOUR_JWT_TOKEN"

Purchase Credits

curl -X POST "http://localhost:8229/api/v1/credits/purchase" \ -H "Authorization: Bearer YOUR_JWT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "package": "credits_1000", "payment_method_id": "pm_card_visa" }'

Credit Packages

PackageCreditsPrice
Starter100$10
Standard500$45
Pro1000$80
Enterprise5000$350

Webhook Events

EventDescription
payment.succeededPayment completed
payment.failedPayment failed
subscription.createdNew subscription
subscription.canceledSubscription canceled
invoice.paidInvoice paid

Python SDK

from isa_user import PaymentClient, WalletClient payment = PaymentClient("http://localhost:8207") wallet = WalletClient("http://localhost:8208") # Create payment intent intent = await payment.create_intent( token=access_token, amount=2999, currency="usd" ) # Check wallet balance balance = await wallet.get_balance(token=access_token)

Next Steps