Создание инвойса
Создание инвойса после выбора метода.
POST
https://pipay.su/api/v2/orders/:order_id/paymentsСоздаёт инвойс после выбора пользователем метода оплаты.
Параметры пути:
Параметры тела запроса:
Card Data (H2H Flow):
For methods that require card data (e.g., ecom), you can pass card details directly. This is used for Host-to-Host integrations where card data is collected on your side.
Option 1 - Flat structure:
Option 2 - Nested card object:
*Обязательно only for H2H card payment methods.
Example with card data:
{
"method": "ecom",
"card": {
"number": "4111111111111111",
"cvv": "123",
"expiry": "12/25",
"holder": "JOHN DOE"
}
}
Ответ:
Returns payment details with invoice information including address, bank, rate, etc.
Пример тела запроса
json
{
"method": "az_ecom",
"card": {
"number": "4111111111111111",
"cvv": "123",
"expiry": "12/25",
"holder": "JOHN DOE"
},
"payer": {
"userIp": "188.11.55.10",
"customerName": "John Doe",
"phone": "+3734343434",
"email": "email@mail.ru",
"fingerprint": "device_id"
}
}Примеры ответов
Success (P2P method) (200)
json
{
"status": true,
"result": {
"id": "a71de0e7d-b38f-4c63-9116-cf0e46390bc2g",
"state": "pending",
"address": "2202208438626294",
"bank": "sber",
"recipient": "Иван Иванович И",
"rate": 92.5,
"amount": "5000.00",
"init_amount": "5000.00",
"bankName": "Сбербанк",
"commission": 7,
"method": "c2c"
},
"url": "https://checkout.example.com/a71de0e7d-b38f-4c63-9116-cf0e46390bc2g"
}Success (ECOM with card data) (200)
json
{
"status": true,
"result": {
"id": "a71de0e7d-b38f-4c63-9116-cf0e46390bc2g",
"state": "pending",
"rate": 92.5,
"amount": "5000.00",
"init_amount": "5000.00",
"commission": 5,
"method": "ecom"
},
"url": "https://3ds-acs.example.com/verify?id=abc123"
}Invoice already exists (409)
json
{
"status": false,
"error": {
"code": 40901,
"message": "Invoice already exists",
"details": "An invoice is already associated with this payment."
}
}