P2P
P2P (Peer to Peer) APIs can be used to obtain P2P Transfer details, or reverse a disbursement.
P2P API Endpoints
Reverse a Disbursement
The transferAuthorizationType reverse may be used to reverse a disbursement and move the funds from a target back to a source. Reversals are not allowed if an account is closed or locked without a cure (i.e., kycPendingGate is none).
Things to Remember
- Currently, disbursementIn Reversals are allowed on restricted accounts.
- However, a disbursementIn reversal is not allowed if the account has insufficient funds to cover the reversal.
- A disbursementOut reversal is not allowed if the account’s maximum balance will be exceeded by the reversal.
- Reversals must be explicitly requested by the Partner, using the PUT /transfers API.
API Call Structure
PUT /programs/{programCode}/transfers/{transferIdentifier}
Sample Request Body
{
"transferAuthorizationType": "reverse"
}
Sample Response Body
Note: Only the balance of the consumer account is returned in the response.
{
"transfer":{
"transferIdentifier":"408e8bd7-414b-44c3-a6d0-8d9070d33b24",
"transferStatus":"reversed"
},
"accounts":[
{
"accountIdentifier":"27e8f86b-2e15-4095-a233-cc178540d50a",
"purses":[
{
"purseIdentifier":"168bdf64-6a79-449d-b742-25166b2764f1",
"purseType":"primary",
"availableBalance":150.0,
"ledgerBalance":150.0,
"availableBalanceAsOfDateTime":"2018-06-11T06:47:10.6294192Z",
"ledgerBalanceAsOfDateTime":"2018-06-11T06:47:10.6294192Z"
}
]
}
],
"responseDetails":[
{
"code":0,
"description":"API operation was successful.",
"url":"http://tbd"
}
]
}
Currency Response Codes
Scenario | Code | subCode | Description |
---|---|---|---|
An invalid ISO currency code is provided. | 650 | 0 | Invalid Currency Code |
A valid ISO currency code is provided, but it is not valid for the program. | 650 | 430 | This product does not support this currency |
Retry Process
A retry process has been implemented for disbursementIn and disbursementOut transfer requests and reversals.
How it Works
- If PUT /transfers (disbursementIn and disbursementOut only) is called for a reversal request when a timeout with a downstream service has occurred, then the:
- Transfer status is initially pending AND
- The retry service will try to successfully complete the transaction every 30 minutes, for up to 24 hours.
- If the transaction is not completed successfully after 24 hours, the transfer will be canceled. If an error occurs while the retry service is trying to cancel the transfer, then the transfer status will be marked as failed.
- Note: When the transfer is in pending status due to a timeout AND the retry service fails to complete the transaction within 24 hours, then the status will be updated to canceled instead of failed.
- A Webhook alert will be published.
Updated 11 months ago