Метод для створення інвойсу
...
Method for creating an invoice
Tip |
---|
URLPOST api/invoicer/invoices/create |
ЗапитRequest:
КлючKey | ОписDescription | ТипType | Обов'язковістьMandatory | ПрикладExample |
---|---|---|---|---|
params | ||||
sessionId | client session id сесії клієнта | string, uuid | такyes | "613f7045-03a2-4bbb-8ff8-e2202e71d41f" |
systemTypeтип системи оплати | type of payment system | string | такyes | "ECOM" або or "P2P" |
data | ||||
externalId | зовнішній external id (ідентифікатор в системі партнераidentifier in the partner system) | string | такyes | "1500383075" |
typeтип операції | type of operation | string | такyes | "PAY", "HOLD", "SUBSCRIBE" |
cardTo{}.id | id карткиcard | string, uuid | так yes (якщо if systemType = "P2P") | "b8220f46-8c28-4068-9488-2e1b37359b06" |
reusabilityпараметр багаторазового використання інвойсу | reusable invoice parameter | boolean | ніno | true/false |
descriptionопис призначення інвойсу | description of the purpose of the invoice | string | такyes | "тестовый платiжtest payment" |
amount | сума платежу (у копійкахpayment amount (in kopecks) | integer | так yes (якщо type if type = "SUBSCRIBE") | 100 |
recurringInterval | інтервал проведення рекурентних платежів (в днях, до interval of recurrent payments (in days, up to 366) | integer | так yes (якщо type if type = "SUBSCRIBE") | 1 |
expiresAtдата закінчення дії рекуретних платежів | expiration date of recurrent payments | integer | так yes (якщо type if type = "SUBSCRIBE") | 1539345600000 |
redirectUrlадреса перенаправлення; якщо не передавати - не буде виводитися користувачу кнопка “Перейти на сайт“ | redirection address; if not passed - the user will not see the button "Go to website" | string | ніno | |
extraInfoполе для передачі додаткової інформації щодо інвойсу | field for transmitting additional information about the invoice | json | ніno | "extraInfo":"{\"phoneFrom\":\"380971112233\",\"phoneTo\":\"380631112233\",\"cardToId\":\"216f8390-9abc-428d-89d6-7be50183afb5\"}" |
emailелектронна | пошта, на яку автоматично відправиться квитанція після успішної оплати, тільки для email to which the receipt will be automatically sent after successful payment, only for reusability = false | string | ніno | "test@uapay.ua" |
callbackUrl | адреса для відправки address to send callback, деталі details тут | string | ніno | |
payExpiresAtдата терміну дії оплати інвойсу | the date of validity of the invoice payment | string | ніno | "2021-07-28 15:00:00" |
services | ніno | |||
serviceIdід | сервісуservice id | integer | ніno | |
destinationопис призначення платежу | description of the purpose of payment | string | ніno | "Призначення платежа Purpose of payment 1" |
destinationNameдодатковий опис, на користь кого здійснюється оплата | additional description in whose favor the payment is made | string | ніno | "Отримувач1Recipient1" |
descriptionопис замовлення, відображається в квитанції | the description of the order; is displayed in the receipt | string | ніno | "Опис призначення замовленняDescription of the purpose of the order" |
amountсума в копійках | amount in kopecks | integer | ніno | 1000 |
...
Example of a query with ECOM type
Code Block | ||
---|---|---|
| ||
{ "params": { "sessionId": "613f7045-03a2-4bbb-8ff8-e2202e71d41f", "systemType": "ECOM" }, "data": { "externalId": "1500383075", "reusability": false, "description": "тестовыйTest платiжpayment", "amount": 100, "redirectUrl": "https://uapay.ua", "type": "PAY", "extraInfo":"{\"phoneFrom\":\"380971112233\",\"phoneTo\":\"380631112233\",\"cardToId\":\"216f8390-9abc-428d-89d6-7be50183afb5\"}" } } |
...
Example of a query with ECOM type (multiservice)
Code Block | ||
---|---|---|
| ||
{ "params": { "sessionId": "613f7045-03a2-4bbb-8ff8-e2202e71d41f", "systemType": "ECOM" }, "data": { "externalId": "1500383075", "reusability": false, "description": "Опис призначення замовленняDescription of the purpose of the payment", "redirectUrl": "https://uapay.ua", "type": "PAY", "services": [ { "serviceId": 1, "destination": "ПризначенняPurpose of платежаpayment 1", "destinationName": "Отримувач1Recipient1", "description": "Опис призначення замовлення (відображається в квитанціїDescription of the purpose of the payment (displayed in the receipt)", "amount": 1000 }, { "serviceId": 2, "destination": "ПризначенняPurpose of платежаpayment 2", "destinationName": "Отримувач2Recipient2", "description": "Опис призначення замовлення (відображається в квитанціїDescription of the purpose of the payment (displayed in the receipt)", "amount": 2000 } ] } } |
...
Example of a query with ECOM type (dynamic)
Code Block | ||
---|---|---|
| ||
{ "params": { "sessionId": "613f7045-03a2-4bbb-8ff8-e2202e71d41f", "systemType": "ECOM" }, "data": { "externalId": "1500383075", "reusability": false, "description": "тестовыйTest платiжpayment", "redirectUrl": "https://uapay.ua", "type": "PAY", "services": [ { "serviceId": 1, "iban": "UA461234560000026002001304675", "okpo": "12345678", "destination": "АдміністративнийAdministrative збір1fee1", "destinationName": "Отримувач1Recipient1", "bankName": "ПАТPJSC БанкBank", "description": "АдміністративнийAdministrative збір1fee1", "amount": 1000 } ] } } |
...
Example of a query with ECOM type (recurrent payment, type = "SUBSCRIBE")
Code Block | ||
---|---|---|
| ||
{ "params":{ "sessionId":"613f7045-03a2-4bbb-8ff8-e2202e71d41f", "systemType":"ECOM" }, "data":{ "externalId":"1500383075", "description":"тестовыйTest платiжpayment", "amount":15000, "type":"SUBSCRIBE", "recurringInterval":30, "expiresAt": 1539345600000 } } |
...
Example of a query with ECOM type (open amount)
Code Block | ||
---|---|---|
| ||
{ "params": { "sessionId": "613f7045-03a2-4bbb-8ff8-e2202e71d41f", "systemType": "ECOM" }, "data": { "externalId": "1500383075", "reusability": false, "description": "тестовыйTest платiжpayment зwith відкритоюopen сумоюamount", "redirectUrl": "https://uapay.ua", "type": "PAY", "extraInfo":"{\"phoneFrom\":\"380971112233\",\"phoneTo\":\"380631112233\",\"cardToId\":\"216f8390-9abc-428d-89d6-7be50183afb5\"}" } } |
...
Example of a query with P2P type
Code Block | ||
---|---|---|
| ||
{ "params": { "sessionId": "000ab70b-ef76-4385-a0f5-a98693c716f1", "systemType": "P2P" }, "data": { "type": "PAY", "externalId": "1500383075", "cardTo": { "id": "b8220f46-8c28-4068-9488-2e1b37359b06" }, "reusability": false, "description": "тестовыйTest платiжpayment", "amount": 100, "redirectUrl": "https://uapay.ua" } } |
ВідповідьReply:
КлючKey | ОписDescription | ТипType | ПрикладExample |
---|---|---|---|
status | СтатусStatus. 0 - помилкаerror, 1 - успіхsuccess | integer | 1 |
data | |||
id | invoice id інвойсу | string, uuid | "d754517b-7138-46c3-9ce2-f4857910b120" |
paymentPageUrlадреса сторінки платежу | payment page address | string | "https://payment.demo.uapay.ua/i/d754517b-7138-46c3-9ce2-f4857910b120" |
paymentPageUrlQR | адреса page QR коду сторінкиcode address | string | "https://api.demo.uapay.ua/api/qr/invoicer/d754517b-7138-46c3-9ce2-f4857910b120" |
...
Example of an answer
Code Block | ||
---|---|---|
| ||
{ "status": 1, "data": { "id": "d754517b-7138-46c3-9ce2-f4857910b120", "paymentPageUrl": "https://payment.demo.uapay.ua/i/d754517b-7138-46c3-9ce2-f4857910b120", "paymentPageUrlQR": "https://api.demo.uapay.ua/api/qr/invoicer/d754517b-7138-46c3-9ce2-f4857910b120" } } |
...