Initiate a payout transaction
Changed onThis POST endpoint is used to initiate a payout transaction from your account to a user with a specified token. <br> You can use this endpoint to pay out funds to your users, such as payments for services rendered or rewards for completing tasks. To use this endpoint, you need to provide the user token of the recipient in the URL Path. <br> The request body should include the funding source (source_token), payout destination (destination_token) and specify in which currency the payout should be made (destination_currency_code). <br> As a response API will return all details about your payout transaction.
Request
- Base URLhttps://api.masspay.io/v1.0.0
- Auth
- API key in header Authorization
- or API key in header x-api-key
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Path parameters
Token representing the user to pay out. Accepted either as a bare UUID or prefixed with usr_; both forms reference the same user. 36 characters long, or 40 with the usr_ prefix.
Query parameters
Limit amount for transaction amount + fee. If fee + amount are higher than the limit, the output will automatically adjust to maximize the possible amount sent. Amount is specified in source_currency.
When true, performs all validation checks without initiating the payout.
Headers
Unique key to prevent duplicate processing
Request body
Example request
{
"client_transfer_id": "aEjn345",
"source_currency_code": "USD",
"destination_currency_code": "MXN",
"source_token": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574",
"destination_token": "dest_d2138fd0-00be-45a8-985f-4f5bde500962",
"destination_amount": 100.5,
"source_amount": 100.5,
"attr_set_token": "attr_set_b1a867c1-6e36-4525-b6d5-a20bac80e3b0",
"metadata": {
"group_id": 541
},
"statement_description": "Merchant 4561",
"sender_user_token": "usr_7f8e9d0c-1b2a-4c3d-9e5f-6a7b8c9d0e1f",
"value_added_services": {
"account_validation": {
"validation": "SKIP"
}
}
}Response
Successfully created.
Example response
{
"payout_token": "payout_ba4275f2-bae1-488d-9d6f-20af1cd83574",
"client_transfer_id": "aEjn345",
"source_currency_code": "USD",
"destination_currency_code": "MXN",
"source_token": "clnt_wlt_ba4275f2-bae1-488d-9d6f-20af1cd83574",
"destination_token": "dest_d2138fd0-00be-45a8-985f-4f5bde500962",
"destination_amount": 100.5,
"source_amount": 100.5,
"attr_set_token": "attr_set_b1a867c1-6e36-4525-b6d5-a20bac80e3b0",
"exchange_rate": 18.55,
"fee": 2.99,
"expiration": "2026-08-22T17:40:46.881Z",
"pickup_code": "54238173",
"trace_code": "021214893903107",
"payer_logo": "U3dhZ2dlciByb2Nrcw==",
"payer_name": "Elektra",
"country_code": "MEX",
"metadata": {
"group_id": 541
},
"estimated_availability": "2020-07-21T17:32:28Z",
"sender_user_token": "usr_7f8e9d0c-1b2a-4c3d-9e5f-6a7b8c9d0e1f",
"reversible_amount": 100.5
}Changes
- breaking
for the
pathrequest parameteruser_token, the minLength was increased from0to36 - breaking
added the pattern
^(usr_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$to thepathrequest parameteruser_token - breaking
the
request property's minLength was increased from0to36 - breaking
the
request property's minLength was increased from0to3 - breaking
the
request property's minLength was increased from0to36 - breaking
the
request property's minLength was increased from0to3 - breaking
the
request property's minLength was increased from0to36 - breaking
added the pattern
^([a-z]+(_[a-z]+)*_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$to the request property - breaking
added the pattern
^(attr_set_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$to the request property - breaking
added the pattern
^(dest_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$to the request property - breaking
added the pattern
^[A-Z]{3,5}$to the request property - breaking
added the pattern
^[A-Z]{3,5}$to the request property - breaking
the
////response's property format changed fromuuidto no format for status - breaking
the
////response's property format changed fromuuidto no format for status - breaking
the
////response's property format changed fromYYYY-MMDDThh:mm:sstodate-timefor status - breaking
the
////response's property format changed fromuuidto no format for status - breaking
the
////response's property format changed fromuuidto no format for status - warning
for the
pathrequest parameteruser_token, the maxLength was set to40 - warning
for the
queryrequest parameterlimit, the min was set to0.00 - warning
the
request property's maxLength was set to45 - warning
the
request property's maxLength was set to50 - warning
the
request property's maxLength was set to5 - warning
the
request property's maxLength was set to41 - warning
the
request property's maxLength was set to5 - warning
the
request property's maxLength was set to45 - info
added the new optional request property
- info
removed the pattern
^[\d.]+$from thequeryrequest parameterlimit - info
the request property
became optional - info
the
request property format was generalized fromuuidto no format - info
the
request property format was generalized fromuuidto no format - info
the
request property format was generalized fromuuidto no format - info
added the optional property
////to the response with the status - info
the
////response's property pattern^(attr_set_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$was added for the status - info
the
////response's property pattern^[A-Z]{3}$was added for the status - info
the
////response's property pattern^[A-Z]{3,5}$was added for the status - info
the
////response's property pattern^(dest_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$was added for the status - info
the
////response's property pattern^(payout_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$was added for the status - info
the
////response's property pattern^[A-Z]{3,5}$was added for the status - info
the
////response's property pattern^([a-z]+(_[a-z]+)*_)?[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$was added for the status
- breaking