Initiate a spend back transaction
This POST endpoint is used to initiate a spendback transaction to a provided user token. <br> You can use this endpoint to enable spendback transactions for your users and help them manage their funds more effectively. <br> To use this endpoint, you need to provide the user_token as a parameter in the URL Path, along with the required parameters in the request Body, including client_spendback_id, source_token, source_currency_code and amount. <br> The endpoint will then initiate the spendback transaction, transferring funds from the user token to the source token. The response will contain a JSON object indicating the status of the request and any relevant transaction details.
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.
Headers
Unique key to prevent duplicate processing
Request body
Example request
{
"client_spendback_id": "aEjn345",
"source_token": "123e4567-e89b-12d3-a456-426614174000",
"source_currency_code": "USD",
"amount": 100.5,
"notes": "Purchase of Candles. Order #14930",
"metadata": {
"group_id": 541
}
}Response
Succesfully created.
Example response
{
"spendback_token": "123e4567-e89b-12d3-a456-426614174000",
"client_spendback_id": "aEjn345",
"status": "success",
"metadata": {
"group_id": 541
}
}Changes
No recorded changes to this operation across all 2 revisions of this API.