This guide will walk you through setting up our payment gateway API in just a few steps. You'll learn how to create an account, set up a project, configure payment gateways, and process your first payment.
Create account
Set up project
Add payment gateways
Process payments
Sign up for a new account to get started
First, you'll need to create an account. This will give you access to the API and dashboard.
curl -X POST "https://api.payment-gateway.com/api/v1/auth/signup" \
-H "Content-Type: application/json" \
-d '{
"email": "your-email@example.com",
"password": "your-secure-password",
"username": "your-username"
}'You'll receive a JWT token that you'll use for authentication in subsequent requests.
Set up a new payment project with supported gateways
Create a project to organize your payment integrations. You can choose which payment gateways to enable (Stripe, Telebirr, or both).
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"
}'Currently supported: STRIPE and TELEBIRR
Create an API access key for your project
Generate an access key that you'll use to authenticate payment-related API calls. This key is specific to your project and provides secure access to payment endpoints.
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
}'Store your access key securely. You'll need it for all payment-related API calls.
Set up Stripe and/or Telebirr for your project
Configure the payment gateways you want to use. You can set up both Stripe and Telebirr, or just one depending on your needs.
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_51QAXbWG6BCNmT58Ggt2pEDQ5eC3TEy3tCchtFPtw216TJB87Cxqem3WLkKA7Jn5MNf28m7K0LE1zc5suxA2EFslC00xPo2jXZL",
"projectId": "1"
}'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",
"notifyUrl": "https://yoursite.com/notify"
}'Test the integration with a sample payment
Now you're ready to process payments! Here are examples for both payment gateways.
curl -X POST "https://api.payment-gateway.com/api/v1/stripe/create_session" \
-H "Authorization: Bearer YOUR_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"priceId": "price_1234567890",
"success_url": "https://yoursite.com/success",
"quantity": "1",
"mode": "subscription"
}'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": "Test Payment",
"amount": "100.00",
"telebirrConfigId": "2",
"redirect_url": "https://yoursite.com/success",
"notify_url": "https://yoursite.com/notify"
}'What to do after your first successful payment
Use our test environment to verify your integration