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 - Property | Type | Value | Description |
|---|---|---|---|
| partner_ref | string | max size = 64 | Partner 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\} |
| tag | string | max size = 100 optional | Custom metadata |
| sender_wallet_id | string | max size = 64 Type: EMONEY | Id of the wallet where the amount is debited |
| receiver_wallet_id | string | max size = 64 Type:EMONEY | Id of the wallet where the amount - fees is credited |
| fees_wallet_id | string | max 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. |
| amount | double | min = 0.01 | Amount of the transfer (fees included). The sender wallet is debited of the amount. The receiver wallet is credited of the amount-fees. |
| fees | double | optional 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 status | Case | ||
|---|---|---|---|
| 201 | Success | ||
| Body - property | Type | Value | Description |
| id | string | max size= 64 | Transaction id |
| sender_balance | double | Balance of the sender wallet | |
| sender_available_balance | double | Available balance of the sender wallet (Balance deducted of any authorized debit amount) | |
| receiver_balance | double | Balance of the receiver wallet | |
| receiver_available_balance | double | Available balance of the receiver wallet (Balance deducted of any authorized debit amount) | |
| status | enum | CONFIRMED | Transaction 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 - Property | Type | Value | Description |
|---|---|---|---|
| auth_timeout_delay | integer | maximum = 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 status | Case | ||
|---|---|---|---|
| 201 | Success | ||
| Body - Property | Type | Value | Description |
| id | string | max size = 64 | Transaction id |
| sender_balance | double | Balance of the sender wallet | |
| sender_available_balance | double | Available balance of the sender wallet (Balance deducted of any authorized debit amount) | |
| receiver_balance | double | Balance of the receiver wallet | |
| receiver_available_balance | double | Available balance of the receiver wallet (Balance deducted of any authorized debit amount) | |
| status | enum | AUTHORIZED | Transaction 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 - Property | Type | Value | Description |
|---|---|---|---|
| id | string | max size = 64 | Transaction id |
Request Sample
DELETE /transfers/TX-8148254337416765
Response
| HTTP status | Case | ||
|---|---|---|---|
| 200 | Success | ||
| Body | Type | Value | Description |
| id | string | max size = 64 | Transaction id |
| sender_balance | double | Balance of the sender wallet | |
| sender_available_balance | double | Available balance of the sender wallet (Balance deducted of any authorized debit amount) | |
| receiver_balance | double | Balance of the receiver wallet | |
| receiver_available_balance | double | Available balance of the receiver wallet (Balance deducted of any authorized debit amount) | |
| status | enum | CANCELLED | Transaction 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 - Property | Type | Value | Description |
|---|---|---|---|
| id | string | max size = 64 | Transaction id |
| Body - Property | Type | Value | Description |
| amount | double | max = authorized amount min = fees amount optional | Amount of the transfer to confirm (fees included). If not provided, the authorized amount is confirmed. |
| fees | double | max = 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 status | Case | ||
|---|---|---|---|
| 200 | Success | ||
| Body | |||
| id | string | max size = 64 | Transaction id |
| sender_balance | double | Balance of the sender wallet | |
| sender_available_balance | double | Available balance of the sender wallet (Balance deducted of any authorized debit amount) | |
| receiver_balance | double | Balance of the receiver wallet | |
| receiver_available_balance | double | Available balance of the receiver wallet (Balance deducted of any authorized debit amount) | |
| status | enum | CONFIRMED | Transaction 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"
}