There are 3 ways to activate and deactivate the Nightly Refresh (also called Scheduled or Background Refresh).
With an endpoint on the API
You can use the endpoint SetScheduledRefresh with your LoginId to set it at true to activate it or false to deactivate it.
This endpoint is for bank accounts that have been previously connected and saved, since you need the LoginId. Note that this endpoint is using with a PATCH HTTP method.
Here's an example to activate the schedule refresh for a card (account):
And here's to deactivate:
With a parameter in the API authorize endpoint
You need to add the parameter ScheduleRefresh when calling the Authorize endpoint and set it at true to activate and false to deactivate.
This parameter only works when a card is new, if you want to activate or deactivate a background refresh after being already registered, you will need either to delete the card or to use the previous endpoint to SetScheduledRefresh.
You can immediately know if your card is activated or deactivated for nightly refresh with the answer of an authorize call.
To find more on scheduling background refreshes on the API click here.
With Flinks Connect
You can use the ScheduleRefresh to schedule a nightly refresh of an account. Setting this parameter to true will activate the schedule refresh and setting it to false it will deactivate it.
You can learn more about this parameter in our documentation.
*Take special attention for the FLINKS_CODE field to catch any specific errors that happened during the refresh. Based on the error code you get, you might have to ask the user to update his credentials. If you use Flinks Connect you can simply present it to the user to do the onboarding again; our database will be updated with the latest.