v1

latestOpenAPI 3.0.1Apache 2.02026-07-248286406.8 KB
Spend Back

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.

post/payout/spendback/{user_token}

Headers

Idempotency-Keystring

Unique key to prevent duplicate processing

Request body

client_spendback_idstring required

A client defined spend back identifier. This is the unique ID assigned to the load on your system. Max 50 characters.

source_tokenstring uuid required

Token that represents the funding source i.e. bank account, wallet. 36 characters long

source_currency_codestring required

The currency originating balance is stored in. Using ISO 4217 format. In most cases this value will be USD, and therefore the defaut value if none is provided

amountnumber required

The amount to debit the user's wallet in source currency

notesstring

A description for the spend back

metadataobject

Optional JSON object with attributes that can later be searched to locate this spendback. Do not include PII as this object is not encrypted. There are two special attributes that can be provided in the metadata field: batch_identifier and batch_name. Either of those values, would group transactions in the ledger under the same description.

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.

spendback_tokenstring uuid required

Token that represents the spend back that was just created.

client_spendback_idstring required

A client defined spend back identifier. This is the unique ID assigned to the load on your system. Max 50 characters.

status'success' | 'failure' required

Status that indicates whether the transaction was successfully processed. If success, everything was processed correctly. failure indicates a generic error.

metadataobject

Optional JSON object with attributes that can later be searched to locate this load. Do not include PII as this object is not encrypted.

Example response

{
  "spendback_token": "123e4567-e89b-12d3-a456-426614174000",
  "client_spendback_id": "aEjn345",
  "status": "success",
  "metadata": {
    "group_id": 541
  }
}