Invoice create
POST /api/merchant/invoices
Request params
Name | Type | Description |
---|---|---|
type | DirectionType | Direction type: in - payin, out - payout |
amount | string | Amount, for example: 2000.00 |
currency | string | Currency, for example: RUB |
notificationUrl | string | URL to receive invoice status changes via notifications |
notificationToken | string | Token for notification validation |
internalId | string (optional) | ID in merchant's system |
userId | string (optional) | Client ID in the merchant's system |
paymentOption | PaymentOption (optional) | Type of payment, mandatory for type out |
paymentMethod | PaymentMethod (optional) | Bank code, mandatory for type out |
paymentRequisites | RequisitesDTO (optional) | Payment details to which the payment should be made, mandatory for out type |
startDeal | boolean (optional) | true if it is necessary to create a deal transaction, only for type in |
Request example
- CURL
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"
}
]
}