Create a Spendback
To make a spendback transfer, send a POST
request to the /transfers
endpoint and include the transfer details in JSON format in the request body. Each spendback will be represented by an auto-generated, non-editable token
that can be used to retrieve the spendback resource.
ATTRIBUTES | |
---|---|
tokenstring | The unique, auto-generated transfer identifier. Max 64 characters, prefixed with "trf-". |
statusstring | The transfer status. The only possible value returned is:
|
createdOnstring | The datetime the status changed in ISO 8601 format (YYYY-MM-DDThh:mm:ss). Note that the timezone used is UTC, therefore there is no time offset. |
clientTransferIdstring | A client defined transfer identifier. This is the unique ID assigned to the transfer on your system. Max 50 characters. |
sourceTokenstring | A token identifying the source of funds. It can be a prepaid card token prefixed with "trm-" or user token prefixed with "usr-". |
sourceAmountstring | The payment amount in the specified currency that is debited from the sourceToken. |
sourceCurrencystringrequired | The currency of the payment amount debited from the sourceToken in ISO 4217 format. Required if more than one currency option is available for partial balance transfers. |
destinationTokenstring | A token identifying where the funds have been sent. It is your merchant account token prefixed with "act-". |
destinationAmountstring | The payment amount in the specified currency loaded into your merchant account. |
destinationCurrencystring | The currency of the payment amount loaded into your merchant account in ISO 4217 format. |
foreignExchangesstring | An array of foreign exchange transactions. A transfer could have more than one foreign exchange transaction. Foreign exchange fields are as follows:
|
notesstring | A description for the spendback transfer. |
memostring | An internal memo for the spendback transfer (will not be visible to the user making the payment). |
expiresOnstring | The date and time which the created transfer expires. The REST API user (Payer) has 120 seconds from the creation time to complete the transfer, otherwise the created transfer expires and payer needs to re-initiate the transfer. (YYYY-MMDDThh:mm:ss) |
POST "https://qamaster.aws.paylution.net/rest/v3/transfers"
curl -X "POST" "https://qamaster.aws.paylution.net/rest/v3/transfers" \ -u testuser@12345678:myAccPassw0rd \ -H "Content-Type: application/json" \ -H "Accept: application/json" \ -d "
{ "clientTransferId": "6712348070812", "destinationAmount": "125", "destinationCurrency": "USD", "notes": "Partial-Balance Transfer", "memo": "TransferClientId56387", "sourceToken": "usr-ac5727ac-8fe7-42fb-b69d-977ebdd7b48b", "destinationToken": "act-e3af62b4-24d5-100f-a4eb-ada857b8fc30" }
"
{
"token": "trf-aa308d58-75b4-432b-dec1-eb6b9e341111",
"status": "QUOTED",
"createdOn": "2020-05-01T00:00:00",
"clientTransferId": "6712348070812",
"sourceToken": "usr-ac5727ac-8fe7-42fb-b69d-977ebdd7b48b",
"sourceAmount": "80",
"sourceCurrency": "CAD",
"destinationToken": "act-e3af62b4-24d5-100f-a4eb-ada857b8fc30",
"destinationAmount": "62.29",
"destinationFeeAmount": "1.20",
"destinationCurrency": "USD",
"foreignExchanges": [
{
"sourceAmount": "100.00",
"sourceCurrency": "CAD",
"destinationAmount": "63.49",
"destinationCurrency": "USD",
"rate": "0.79"
}
],
"notes": "Partial-Balance Transfer",
"memo": "TransferClientId56387",
"expiresOn": "2020-05-01T00:02:00",
"links": [
{
"params": {
"rel": "self"
},
"href": "https://uat-api.paylution.com/rest/v3/transfers/trf-aa308d58-75b4-432b-dec1-eb6b9e341111"
}
]
}