Handle Batch Payouts¶
Prepare a File¶
A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas. The comma as a field separator is the source of the name for this file format. A CSV file typically stores tabular data (numbers and text) in plain text, in which case each line has the same number of fields.
The CSV file format is supported by almost all spreadsheets and database management systems, including LibreOffice Calc, Microsoft Excel, Numbers, KCells, Google Spreadsheets. Separator selection is defined when creating or importing a file.
Paymega uses a comma
, in batch payouts as the column separator and a semicolon
; as the separator for properties in objects.
The top row of the table should contain the column headings:
serviceas a payout service (payout method + currency code)
service_amountas a payout amount in the chosen currency
fields_datais an object with payment details (for example, an account or a credit card number)
reference_idis a unique payout item ID
All the following rows are the values of the associating fields.
You can also add columns for objects with client data:
customer_metadata. If either one or both these objects are present in the row, you must specify the
reference_id in the
customer object field. Thus, the customer's updated data and the corresponding payout record will be added to the customer section database.
Example of a batch payout table
service;service_amount;fields/card_number;reference_id payment_card_uah;1.9;4000000000000010;salary111 payment_card_usd;1.54;4000000000000002;salary112 payment_card_uah;0.7;5555555555554444;salary113 payment_card_usd;1;4300000000000777;salary114
Create a Batch in the Dashboard¶
Click the +New button in the Dashboard (Payouts → Batch Payouts), and upload the prepared CSV file.
- the currency account for the write-offs: if the currency of the selected payment service differs, we convert the funds on the current exchange rate
- the batch name
The single item reference ID is created by connecting two elements: the batch ID and the payout
reference_id specified in the table's corresponding CSV cell.
This final reference ID must be unique. If you use the same batch file several times without changing the
reference_id values in the rows, you should specify the different batch IDs. Or leave the ID field blank: if the batch ID is not defined, it will be set automatically by the date and time of creation (as
Check Items and Process¶
We validate the resulting payout batch at the initial stage. The platform verifies that the specified services are available for payouts and that all the parameters are rightly set. Rows with errors will be skipped at the processing stage.
Before processing, you can edit items in the batch overview line by line. To do so, choose Edit in the drop-down menu:
When all checks are completed, you can click the Process button and start processing the batch payouts.
And if a part of transactions is still in
ready status (prepared but not sent), you can stop processing with the Terminate button.
Check the Result¶
Processed transaction data are displayed in the Batch Payouts section with the batch and in the Payouts section as single payouts:
If you added a
customer object with a
reference_id property, you could also see the related payout in the customer data record.