Modern FastAPI REST API for payment processing with Payme, Click, and Atmos integration.
pip install -r requirements.txtCopy .env.example to .env and update with your credentials:
cp .env.example .env./run.sh
# or
uvicorn main:app --reload --host 0.0.0.0 --port 8000Create Order with Payment
POST /api/v1/orders
Content-Type: application/json
{
"product_name": "Test Product",
"amount": 100.00,
"payment_method": "payme"
}Response:
{
"id": 1,
"amount": 100.00,
"payment_method": "payme",
"payment_link": "https://test.paycom.uz/..."
}Fields:
id- Order IDamount- Payment amountpayment_method- Gateway name (payme, click, atmos)payment_link- Payment URL to redirect user
POST /api/v1/webhooks/payme- Payme webhookPOST /api/v1/webhooks/click- Click webhookPOST /api/v1/webhooks/atmos- Atmos webhook
Payme Payment:
curl -X POST http://127.0.0.1:8000/api/v1/orders \
-H "Content-Type: application/json" \
-d '{
"product_name": "Premium Subscription",
"amount": 50000.00,
"payment_method": "payme"
}'Response:
{
"id": 1,
"amount": 50000.00,
"payment_method": "payme",
"payment_link": "https://test.paycom.uz/..."
}Click Payment:
curl -X POST http://127.0.0.1:8000/api/v1/orders \
-H "Content-Type: application/json" \
-d '{
"product_name": "Monthly Plan",
"amount": 25000.00,
"payment_method": "click"
}'Response:
{
"id": 2,
"amount": 25000.00,
"payment_method": "click",
"payment_link": "https://my.click.uz/services/pay?..."
}Atmos Payment:
curl -X POST http://127.0.0.1:8000/api/v1/orders \
-H "Content-Type: application/json" \
-d '{
"product_name": "Annual Subscription",
"amount": 500000.00,
"payment_method": "atmos"
}'Response:
{
"id": 3,
"amount": 500000.00,
"payment_method": "atmos",
"payment_link": "https://partner.atmos.uz/..."
}Use jprq or ngrok to expose your local server:
# Using jprq
jprq http 8000
# Using ngrok
ngrok http 8000Configure webhook URLs in payment gateway admin panels:
- Payme:
https://your-domain.com/api/v1/webhooks/payme - Click:
https://your-domain.com/api/v1/webhooks/click - Atmos:
https://your-domain.com/api/v1/webhooks/atmos