Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.m4psp.com/llms.txt

Use this file to discover all available pages before exploring further.

Process of shop payouts generation is as follows:

Withdraw Flow V1
  1. Shop executes a request for a preliminary calculation and receiving additional parameters for further creation of the payout using the method withdraw/try;
  2. If result: true, the shop sends request for a preliminary check of the existence and possibility of adding funds to the account check_account, to the specified payment way (if necessary, specify additional parameters obtained from the previous request from the account_info_config field);
  3. If result: true, verify availability of additional information in the account_info field, if available, it is necessary to pass additional parameters in the payout creation request. When getting result: false, analyse the error code in the error_code field (see description of error codes). If the error code is not fatal, then you need to start requesting the status of the transaction after a certain time (for 2 hours at 30-second intervals). If the error code is fatal the communication with our API is over.
  4. Shop submits a request for payout creation withdraw/create, specifying the required parameters and additional information from account_info (if it is required for the specified payment way);
  5. The response returns information with the generated payout request and indicating the amounts and the payout ID. In this case, the part of the balance of the shop from which the payout is made is frozen until the final payout status.
  6. After payout creation, it is necessary to make a request to get the status of the created payout withdraw/status or withdraw/shop_payment_status, before receiving the final status.
Attention: Status requests are recommended to be made at 30-second intervals.
  1. After final status is received, the payout is considered completed, and the funds are debited from the shop’s balance (or returned to the balance if the payout was not completed).

Guidelines for creation and verification of payout requests

If you received result: true after creating the payout, you should immediately check the data.status field, perhaps there will already be a final status, for example 6 (Rejected) and in this case, you do not need to make a request for the payout status. If you receive the Read timeout error at the payout creation request, then you need to make a status request by the shop’s payout number withdraw/shop_payment_status and if the response returns an error stating the absence of such a payout, you can repeat the request to create a payout. If the payout status is returned in the response, then it means that it was created and you need to focus on this status. Reason for payout rejection (getting status 6) can be clarified through the support service support@m4solutions.io.

Securing payouts idempotency

Warning: System has duplication protection for payouts, shop_payment_id must be unique within a single shop.
Withdraw Flow V1