Back to Documentation

API Reference

Complete API reference with examples and response formats

Base URL

https://api.payment-gateway.com

All API endpoints are relative to this base URL

Authentication Endpoints

User authentication and authorization endpoints

POST/api/v1/auth/signup

Create a new user account

curl -X POST "https://api.payment-gateway.com/api/v1/auth/signup" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securePassword123",
    "username": "johndoe"
  }'
POST/api/v1/auth/login

Authenticate user and receive JWT token

curl -X POST "https://api.payment-gateway.com/api/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "securePassword123"
  }'

Project Management Endpoints

Create and manage payment projects

POST/api/v1/createprojectAuth Required

Create a new payment project

curl -X POST "https://api.payment-gateway.com/api/v1/createproject" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "paymentGetWay": ["STRIPE", "TELEBIRR"],
    "title": "My E-commerce Store",
    "discription": "Payment integration for my online store"
  }'
POST/api/v1/accessKey/createAuth Required

Generate API access key for project

curl -X POST "https://api.payment-gateway.com/api/v1/accessKey/create" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": 1
  }'

Stripe Integration Endpoints

Stripe payment gateway integration

POST/api/v1/stripe/createAuth Required

Configure Stripe API key

curl -X POST "https://api.payment-gateway.com/api/v1/stripe/create" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "stripeApiKey": "sk_test_...",
    "projectId": "1"
  }'
POST/api/v1/stripe/create_sessionAuth Required

Create Stripe checkout session

curl -X POST "https://api.payment-gateway.com/api/v1/stripe/create_session" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "priceId": "price_1234567890",
    "success_url": "https://yoursite.com/success",
    "quantity": "1",
    "mode": "subscription"
  }'

Telebirr Integration Endpoints

Telebirr mobile money integration

POST/api/v1/telebirr/createConfigAuth Required

Configure Telebirr credentials

curl -X POST "https://api.payment-gateway.com/api/v1/telebirr/createConfig" \
  -H "Authorization: Bearer YOUR_JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": 15,
    "MerchantAppId": "*************",
    "FabricAppId": "*************",
    "ShortCode": "*************",
    "AppSecret": "*************",
    "PrivateKey": "YOUR_PRIVATE_KEY"
  }'
POST/api/v1/telebirr/createorderAccess Key Required

Create Telebirr payment order

curl -X POST "https://api.payment-gateway.com/api/v1/telebirr/createorder" \
  -H "Authorization: Bearer YOUR_ACCESS_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Product Purchase",
    "amount": "100.00",
    "telebirrConfigId": "2",
    "redirect_url": "https://yoursite.com/success",
    "notify_url": "https://yoursite.com/notify"
  }'

HTTP Status Codes

Common HTTP status codes returned by the API

200OK - Request successful
201Created - Resource created
400Bad Request - Invalid request
401Unauthorized - Invalid token
403Forbidden - Access denied
404Not Found - Resource not found
429Too Many Requests - Rate limited
500Internal Server Error