Skip to main content
Rewards sweep moves an account’s available rewards into a spend account on another Fluz account, once a day, with no action from the user. Your app connects the user’s account to an approved target account. Fluz runs the sweep. Use it when your platform collects the rewards your users earn on Fluz. For example, sweep the cashback your members earn into your platform’s operating spend account. This page covers the TGS GraphQL surface:

How it works

  1. Fluz approves your target account, sets the spend account the rewards land in, and allowlists your app.
  2. The user authorizes your app. Your app calls createRewardsSweepConnection with the user’s access token and your target account ID.
  3. Once each New York calendar day, Fluz moves the user’s full available rewards balance into your target spend account.
  4. To stop, your app calls deleteRewardsSweepConnection with the user’s access token.
In this page, the source account is the user’s account whose rewards are swept. The target account is the account that receives the money. The spend account is the target’s spend account the money lands in.
Only available rewards are swept.The sweep takes the spendable rewards balance at the moment it runs. Pending or locked rewards stay on the source account until a later sweep picks them up. Nothing is held in advance: the user can spend their rewards normally until the sweep runs.

Before you start

Contact your Fluz account manager to:
  • allowlist your app for rewards sweep
  • register your target account and the spend account the rewards should land in
Each target account has one destination spend account, and that spend account must belong to the target account.

Connect an account

Call createRewardsSweepConnection with the user’s access token. The source account always comes from the token. Pass your target account ID, not a spend account ID.
Rules
  • A source account can be connected to one target at a time.
  • Calling create again with the same target is safe. It returns the existing connection.
  • Calling create with a different target fails while a connection exists. To change targets, disconnect first, then connect to the new target.
  • The source and target must be different accounts.
  • Fluz can also create a connection for an account from its dashboard. That connection behaves the same way and can be removed with deleteRewardsSweepConnection.

Disconnect an account

Call deleteRewardsSweepConnection with the user’s access token. It takes no input. It removes the connection for the account on the token.
disconnected is false when the account had no connection. That is not an error, so the call is safe to repeat. If you disconnect after the day’s sweep is scheduled but before the money moves, that day’s sweep is cancelled and nothing is debited.

Sweep behavior


What the accounts see

Each sweep is one account-to-account transfer. It appears in both accounts’ activity with the description Rewards transfer.

Checking a connection

There is no query to read a connection or past sweeps today. Store the connection on your side from the createRewardsSweepConnection and deleteRewardsSweepConnection responses. Confirm sweeps from the target account’s transaction activity.

Errors

Failures use the standard GraphQL error envelope.
Errors are checked in this order: A missing, invalid or expired access token is rejected before GraphQL runs and returns an HTTP error, not a GraphQL error. See Authentication.