Skip to main content

Transfer

A transfer is a transfer of e-money between two EMONEY wallets. Optionally, some fees can be collected by the partner during the operation.

The API provides two different ways to perform a transfer transaction :

  • A single-step way : call a single service
  • A two-steps way (recommended) :
    • First step : call the service to authorize a transfer transaction.
    • Second step : call the service to confirm or to cancel the previously authorized transfer transaction.

Execute a single-step Transfer

Request

POST /transfers
Body - PropertyTypeValueDescription
partner_refstringmax size = 64Partner unique internal reference of the transaction.
N.B : This reference is useful to retrieve transaction status in case of timeout, using :
GET /transactions/partner_ref/\{partner_ref\}
tagstringmax size = 100
optional
Custom metadata
sender_wallet_idstringmax size = 64
Type: EMONEY
Id of the wallet where the amount is debited
receiver_wallet_idstringmax size = 64
Type:EMONEY
Id of the wallet where the amount - fees is credited
fees_wallet_idstringmax size = 64
optional
Type:FEES
Id of the wallet where the fees are credited.
If not set, no fees will be charged to the sender.
This wallet should be associated to the partner's account.
amountdoublemin = 0.01Amount of the transfer (fees included).
The sender wallet is debited of the amount.
The receiver wallet is credited of the amount-fees.
feesdoubleoptional
default = 0
Fees amount taken by the partner.
Take into account only if a fees_wallet_id is defined.

Request Sample

POST /transfers
{
"partner_ref": "TSF-u1594-20180310093048",
"tag": "Chuck Birthday gift",
"sender_wallet_id": "WE-4596525578456954",
"receiver_wallet_id": "WE-9876543219876543",
"fees_wallet_id": "WF-1234567891234567",
"amount": 210,
"fees": 3
}

Response

HTTP statusCase
201Success
Body - propertyTypeValueDescription
idstringmax size= 64Transaction id
sender_balancedoubleBalance of the sender wallet
sender_available_balancedoubleAvailable balance of the sender wallet (Balance deducted of any authorized debit amount)
receiver_balancedoubleBalance of the receiver wallet
receiver_available_balancedoubleAvailable balance of the receiver wallet (Balance deducted of any authorized debit amount)
statusenumCONFIRMEDTransaction status

Response Sample

HTTP/1.1 201 CREATED
{
"id": "TX-8148254337416765",
"sender_balance": 100.0,
"sender_available_balance": 100.0,
"receiver_balance": 205.0,
"receiver_available_balance": 205.0,
"status": "CONFIRMED"
}

Create a Transfer Authorization

Create a new transfer authorization. The amount are reserved on the sender wallet until a delay defined by partner. This amount is not anymore available for other transactions until the transaction is cancelled or the delay is passed.

Request

POST /transfers/authorize
tip

Same parameters as the 1-step transfer request, plus the parameters below:

Body - PropertyTypeValueDescription
auth_timeout_delayintegermaximum = 2592000 (30 days)
optional
default = maximum
Reservation delay in seconds of the transaction amount

Request Sample

POST /transfers/authorize
{
"partner_ref": "TSF-u1594-2018-03-09-193048",
"tag": "Chuck Birthday gift",
"sender_wallet_id": "WE-4596525578456954",
"receiver_wallet_id": "WE-9876543219876543",
"fees_wallet_id": "WF-1234567891234567",
"amount": 210,
"fees": 5,
"auth_timeout_delay": 86400
}

Response

HTTP statusCase
201Success
Body - PropertyTypeValueDescription
idstringmax size = 64Transaction id
sender_balancedoubleBalance of the sender wallet
sender_available_balancedoubleAvailable balance of the sender wallet (Balance deducted of any authorized debit amount)
receiver_balancedoubleBalance of the receiver wallet
receiver_available_balancedoubleAvailable balance of the receiver wallet (Balance deducted of any authorized debit amount)
statusenumAUTHORIZEDTransaction status

Response Sample

HTTP/1.1 201 CREATED
{
"id": "TX-8148254337416765",
"sender_balance": 310.0,
"sender_available_balance": 100.0,
"receiver_balance": 0.0,
"receiver_available_balance": 0.0,
"status": "AUTHORIZED"
}

Cancel an Authorized Transfer

Request

DELETE /transfers/[id]
URL - PropertyTypeValueDescription
idstringmax size = 64Transaction id

Request Sample

DELETE /transfers/TX-8148254337416765

Response

HTTP statusCase
200Success
BodyTypeValueDescription
idstringmax size = 64Transaction id
sender_balancedoubleBalance of the sender wallet
sender_available_balancedoubleAvailable balance of the sender wallet (Balance deducted of any authorized debit amount)
receiver_balancedoubleBalance of the receiver wallet
receiver_available_balancedoubleAvailable balance of the receiver wallet (Balance deducted of any authorized debit amount)
statusenumCANCELLEDTransaction status

Response Sample

HTTP/1.1 200 OK
{
"id": "TX-8148254337416765",
"sender_balance": 310.0,
"sender_available_balance": 310.0,
"receiver_balance": 0.0,
"receiver_available_balance": 0.0,
"status": "CANCELLED"
}

Confirm an Authorized Transfer

Request

PUT /transfers/[id]
URL - PropertyTypeValueDescription
idstringmax size = 64Transaction id
Body - PropertyTypeValueDescription
amountdoublemax = authorized amount min = fees amount
optional
Amount of the transfer to confirm (fees included). If not provided, the authorized amount is confirmed.
feesdoublemax = authorized fees min = 0
optional
Amount of the fees to confirm. If not provided, the authorized fees is confirmed.

Request Sample

PUT /transfers/TX-8148254337416765

Request Sample - Partial confirm (90 instead of 210)

PUT /transfers/TX-8148254337416765
{
"amount": 90.0,
"fees": 5.0
}

Response

HTTP statusCase
200Success
Body
idstringmax size = 64Transaction id
sender_balancedoubleBalance of the sender wallet
sender_available_balancedoubleAvailable balance of the sender wallet (Balance deducted of any authorized debit amount)
receiver_balancedoubleBalance of the receiver wallet
receiver_available_balancedoubleAvailable balance of the receiver wallet (Balance deducted of any authorized debit amount)
statusenumCONFIRMEDTransaction status

Response Sample

HTTP/1.1 200 OK
{
"id": "TX-8148254337416765",
"sender_balance": 100.0,
"sender_available_balance": 100.0,
"receiver_balance": 205.0,
"receiver_available_balance": 205.0,
"status": "CONFIRMED"
}

Response Sample - Partial confirm (90 instead of 210)

HTTP/1.1 200 OK
{
"id": "TX-8148254337416765",
"sender_balance": 220.0,
"sender_available_balance": 220.0,
"receiver_balance": 85.0,
"receiver_available_balance": 85.0,
"status": "CONFIRMED"
}