Soprano Exchange Payment Service
Powerful payment gateway for your applications
Base URL: https://soprano-exch.info/api/v1
Getting Started
To start using the API, follow these steps:
- Get API Key - Contact administrator for API key
- Include API Key - Add X-API-Key header to requests
- Create Merchant - Create a merchant account
- Create Payments - Use API to create payments
- Setup Webhooks - Receive payment notifications
Requirements
- HTTPS for all requests
- JSON data format
- UTF-8 encoding
- API key in request header
Authentication
All API requests must include API key in X-API-Key header.
Example header:
POST /api/v1/payment/create
X-API-Key: your-api-key-here
Content-Type: application/json
API Endpoints
Health Check
GET /health
Create Payment
POST /payment/create
Get Payment
GET /payment/{payment_id}
Webhook
POST /webhook/paymoon
Payments
Create Payment
POST /api/v1/payment/create
X-API-Key: your-api-key-here
Content-Type: application/json
{
"merchant_id": 1,
"amount": 1000.00,
"currency": "RUB",
"description": "Payment for order #12345"
}
Response:
{
"id": 1,
"merchant_id": 1,
"payment_id": "pay_abc123...",
"amount": 1000.0,
"currency": "RUB",
"status": "pending",
"payment_url": "https://payment.example.com/pay/abc123"
}
Webhooks
Webhooks allow you to receive notifications about payment status changes.
Webhook Format:
POST https://your-domain.com/webhook
X-Webhook-Secret: your-webhook-secret
{
"payment_id": "pay_abc123...",
"status": "success",
"amount": 1000.0,
"currency": "RUB",
"timestamp": "2024-01-01T12:00:00Z"
}
Errors
| Code | Description |
|---|---|
| 400 | Bad Request |
| 401 | Unauthorized |
| 404 | Not Found |
| 500 | Server Error |
Python Example
import requests
API_KEY = "your-api-key"
BASE_URL = "https://soprano-exch.info/api/v1"
def create_payment(amount):
response = requests.post(
f"{BASE_URL}/payment/create",
headers={"X-API-Key": API_KEY},
json={"merchant_id": 1, "amount": amount}
)
return response.json()
JavaScript Example
const API_KEY = "your-api-key";
const BASE_URL = "https://soprano-exch.info/api/v1";
async function createPayment(amount) {
const response = await fetch(`${BASE_URL}/payment/create`, {
method: "POST",
headers: {"X-API-Key": API_KEY, "Content-Type": "application/json"},
body: JSON.stringify({merchant_id: 1, amount})
});
return await response.json();
}
PHP Example
<?php
$API_KEY = "your-api-key";
$BASE_URL = "https://soprano-exch.info/api/v1";
function createPayment($amount) {
$ch = curl_init("$BASE_URL/payment/create");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
"merchant_id" => 1,
"amount" => $amount
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: $API_KEY",
"Content-Type: application/json"
]);
return json_decode(curl_exec($ch), true);
}
?>