Skip to main content

Invoice create

POST /api/merchant/invoices

Request params

NameTypeDescription
typeDirectionTypeDirection type: in - payin, out - payout
amountstringAmount, for example: 2000.00
currencystringCurrency, for example: RUB
notificationUrlstringURL to receive invoice status changes via notifications
notificationTokenstringToken for notification validation
internalIdstring (optional)ID in merchant's system
userIdstring (optional)Client ID in the merchant's system
paymentOptionPaymentOption (optional)Type of payment, mandatory for type out
paymentMethodPaymentMethod (optional)Bank code, mandatory for type out
paymentRequisitesRequisitesDTO (optional)Payment details to which the payment should be made, mandatory for out type
startDealboolean (optional)true if it is necessary to create a deal transaction, only for type in

Request example

curl --request POST \
--url https://{{domain}}/api/merchant/invoices \
--header 'Content-Type: application/json' \
--header 'X-Identity: {{api_key}}' \
--header 'X-Signature: {{sign}}' \
-d '{
"type": "in",
"amount": "1000",
"currency": "RUB",
"notificationUrl": "https://webhook.site/0ee5347c-c0c1-41aa-a4ca-c87173be8bf2",
"notificationToken": "merchant_notification_token",
"internalId": "00001",
"userId": "uid-1",
"paymentOption": null,
"paymentMethod": "sberbank",
"startDeal": true
}'

Response Structure

The answer is returned as an array of objects InvoiceDTO.

Response example

{
"id": "991a0e40-8cbd-405a-80fa-c84f2e4d5c6a",
"internalId": "00001",
"userId": "uid-1",
"type": "in",
"status": "new",
"paymentMethod": "sberbank",
"paymentOption": null,
"paymentRequisites": null,
"sum": {
"amount": "1000.00",
"currency": "RUB",
"subunit": 2
},
"storeId": 1,
"storeName": "Demo Test",
"receivedSumFromTaker": null,
"receivedSumFromMaker": null,
"serviceFeeSum": null,
"payoutSum": null,
"createdAt": "2024-11-04T13:55:45+00:00",
"expireAt": "2024-11-04T14:55:45+00:00",
"updatedAt": "2024-11-04T13:58:34+00:00",
"invoiceUrl": "http:\/\/pay.doamin.com\/invoice?id=991a0e40-8cbd-405a-80fa-c84f2e4d5c6a",
"deals": [
{
"id": "595af0e7-261d-4451-b651-3cfeecc0755c",
"type": "in",
"status": "transfer_waiting",
"paymentMethod": "sberbank",
"paymentOption": "SBP",
"requisites": {
"requisites": "+7(996)777-99-77",
"holder": "holder name"
},
"canceledAt": "2024-11-04T14:25:48+00:00",
"disputeAttachment": null,
"disputeReason": null,
"disputeReasonData": [],
"payment": null,
"rate": "99.23",
"isActive": true,
"qrCodeLink": "https:\/\/www.sberbank.com\/sms\/pbpn?requisiteNumber=79967779977"
}
]
}