Case A - Direct requisites request
Direct request of bank details involves creating an API request Invoice create
POST /api/merchant/invoices
with required parameters:
- type - type of request
in
- 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 - startDeal -
true
- this parameter indicates that within the request it is mandatory to create a deal with the trader. Bank details for the created deal will be in the response.
In case paymentOption
or paymentMethod
are set as null
- you will receive the first available bank details.
Bank details for transfer are returned in the response in the array deals
. There will be either 1 element or an empty array.
If the array deals
is empty, it means that there are no avalible bank details at the moment.
Otherwise, the requisites
object will contain the bank details for the transfer, the paymentOption
the payment type of the details, and the paymentMethod
the payment bank code.
Request params
Name | Type | Description |
---|---|---|
type | DirectionType | Direction Type - in |
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 |
paymentMethod | PaymentMethod (optional) | Bank code |
startDeal | boolean (optional) | true for this type of request |
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 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"
}
]
}