Creating pay out invoices
To create payout, you heve to send an API request Create Invoice
POST /api/merchant/invoices
with required parameters:
- type - type of request
out
- paymentOption - payment type, for example,
TO_CARD
. A full list of available payment types can be found here - paymentMethod - payment bank code, for example
sberbank
. A full list of supported banks can be reached via the Public API and here - paymentRequisites - bank details to which the payment should be made.
In case paymentOption
is specified as SBP
- it is necessary to specify paymentMethod
- code of the recipient bank
If paymentOption
is specified as TO_CARD
and the paymentMethod
specified as unknown
, the bank code will be identified by the BIN of the card number.
Request params
Name | Type | Direction |
---|---|---|
type | DirectionType | Direction Type - out |
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 | Type of payment |
paymentMethod | PaymentMethod | Bank code |
paymentRequisites | RequisitesDTO | Bank requisites for payout |
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": "TO_CARD",
"paymentMethod": "sberbank",
"paymentRequisites": {
"requisites": "4444 4444 4444 4444",
"holder": "holder name"
}
}'
Response example
{
"id": "991a0e40-8cbd-405a-80fa-c84f2e4d5c6a",
"internalId": "00001",
"userId": "uid-1",
"type": "out",
"status": "new",
"paymentMethod": "sberbank",
"paymentOption": "TO_CARD",
"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",
"deals": [
{
"id": "595af0e7-261d-4451-b651-3cfeecc0755c",
"type": "out",
"status": "new",
"paymentMethod": "sberbank",
"paymentOption": "TO_CARD",
"requisites": {
"requisites": "4444 4444 4444 4444",
"holder": "holder name"
},
"canceledAt": "2024-11-04T14:25:48+00:00",
"disputeAttachment": null,
"disputeReason": null,
"disputeReasonData": [],
"payment": null,
"rate": "99.23",
"isActive": true
}
]
}