All requests made to the Yapily API require basic authentication.
Select a supported institution
Select a supported institution, either:
- See our Institution Coverage or
- Search for the institutions that support the VRP feature via
GET /institutions
Authorise
The first and most important step of the VRP flow is authorisation, but Yapily makes it very straightforward:
- Call
POST /variable-recurring-payments/sweeping/consents- Specify the correct payee and payer details
- Specify the appropriate limits (e.g. time period when the consent is valid, maximum amounts per payment and per time period)
- See the endpoint’s API specification for details
- Retrieve the Authorisation URL from the response and redirect the user to it
- There, the user will have to authorise the payment with their bank
- For testing purposes, you may use Natwest Sandbox credentials
- If the user successfully authorised, then you should retrieve the Consent Token for later
- For more details on this authorisation flow, see Redirect Payment flow
Confirm availability of funds
Prior to executing a payment, it’s best practice to ensure the availability of funds from the payer’s side. This will guard you against potentially vague error response messages during the payment execution call later.This is an optional but recommended step which serves to improve error handling and increase payment success rates.
- Call
POST /variable-recurring-payments/funds-confirmation- Specify the expected payment amount
- Verify from the response whether the payer has sufficient funds to execute the payment
- See the endpoint’s API specification for details
Execute a payment
- Call
POST /variable-recurring-payments/payments- Specify the wanted payment amount (which should be within the limits specified at authorisation, otherwise an error response will be returned)
- See the endpoint’s API specification for details
Get notified once a payment is processed
It is possible to receive a Webhook notification when a payment reaches a terminal status.
Register a Webhook
To receive a Webhook notification, it is necessary to register a Webhook first.Currently, there are two event categories for VRP payments:sweeping_vrp.payment_status.completed.v1for successfully completed paymentssweeping_vrp.payment_status.failed.v1for failed payments
Receive a Webhook Notification
After a Webhook is registered and a payment is executed, the following notification will be sent whenever a VRP payment reaches a terminal status:| Property | Value Type | Description |
|---|---|---|
| id | String | The Webhook ID used for delivering the event |
| applicationId | String | The Application ID that registered this webhook |
| type | String | The triggered event’s type |
| event.paymentId | String | The VRP Payment ID the event was triggered for |
| event.statusDetails.status | String | The VRP Payment’s terminal status |
| event.statusDetails.isoStatus.code | String | The VRP Payment’s ISO 20022 status code (as provided by the institution) |
| event.statusDetails.isoStatus.name | String | The VRP Payment’s ISO 20022 status name (as provided by the institution) |
| event.statusDetails.statusUpdateDate | Date-Time | The time when the VRP Payment’s status was last updated |
| metadata.tracingId | String | The Tracing ID of the event |
| metadata.user | Object | Optional. The metadata provided at Webhook registration |
More details on status format and meaning can be found on the Payment Status page.
Get Consent Details
CallGET /variable-recurring-payments/sweeping/consents/{consentId} to retrieve details about a particular VRP payment Consent.
See API specification
Get VRP Payment Details
CallGET /variable-recurring-payments/payments/{paymentId}/details to retrieve details about a particular VRP payment.
See API specification
It is highly advised to use the Webhook notifications described above to receive updates on VRP payment status changes instead of polling on this endpoint, because there are rate limits imposed on all endpoints.