Payouts to bank card
To initiate payouts, you need to send a request to the cardhttps://api.1payment.com/init_payout
with the following parameters:
payout_type
- card (see types of payouts)partner_id
- 1234 (partner ID)project_id
- 5678 (project ID)amount
- 50 (amount in the project currency)destination
- (card number)first_name
- the name of the recipient (check with the manager if you need to pass this parameter)last_name
- recipient's last name (check with the manager if this parameter needs to be passed)user_data
- (a unique value, for example, the payouts identifier on the partner's side)year
- the expiration year of the bank card, the last two digits (optional, example: 21)month
- month of expiration of the bank card (optional, example: 01)sign
- (signature)
Example:
https://api.1payment.com/init_payout?payout_type=card&partner_id=1234&project_id=5678&amount=50&destination=1234123412341234&user_data=1&sign=d724e1e6453a43397bb2aa6d6be9cc06
The signature (sign) is calculated as follows: md5 from the string init_payout + concatenation of all parameters = value in alphabetical ascending order with a separator & + API Key (except for the sign parameter)
For the query above, the string from which md5 will be taken has the form:
init_payoutamount=50&destination=123412341234&partner_id=1234&payout_type=card&project_id=5678&user_data=1[API_Key]
In response, the system will output an order_id in JSON, example:
{"order_id":"8p3brmb19gfg0sg8gcwhws8kgc748s87"}
This is the id of this payout, you can use it to find out the status.
After receiving the final status of the payout, a notification about the status of payouts will be sent to your notify_url specified in the payouts settings. POST JSON notification format with the following parameters:
payout_type
- type of payouts (see types of payouts)project_id
- project IDorder_id
- payment ID from the requeststatus
- payment status (2 - pending, 3 - successful payout, 4 - refusal in payout)status_description
- text description of the status (PENDING, SUCCESS, FAILURE, respectively)init_time
- time of payment creationstatus_time
- time of receiving the statusamount
- the amount of payoutsbalance_amount
- the amount of debiting from the balancedestination
- recipient (in the case of payouts to bank cards, this field will contain the mask of the card number)status_code
- the field will contain an error code (if possible) in case of payment refusalpaid_amount
- this parameter will be present only for payouts in status 2 PENDING for which partial payout has been made . It will contain the sum of these partial payouts at the momentinit_amount
- this parameter will be present only for payouts with the status 3 SUCCESS for which the initiation amount differs from the amount of payouts. It will contain the amount of initiation, and the parametersamount
andbalance_amount
will contain the real amount and the amount of debiting from the balance to which the payout passed