Skip to main content

Prerequisites

To generate payment portal URLs, you’ll need your organisational API credentials. See Authentication Guide. Use an organisational bearer token when calling the rewards endpoints. Your API credentials also need payments access. Without it, requests to generate a payment portal URL are refused. Ask your Axle representative to enable payments access in both Sandbox and Production.

User email

A user email is required to process payments through our provider, Stripe. We also send payment-failure notifications and, if enabled, two-factor authentication codes to this address. The right place to supply the email depends on how you’re integrated with us — check the integration guide for the product you’re using (Smart Charging, Flex Lite, VPP, etc.) for the field to set when you create or onboard the user.

Flow overview

  1. Call the Get Balance Info endpoint. It returns the user’s current balance, the minimum withdrawal amount and other account details.
  2. Use that information to set your UI:
    • Show or enable a Withdraw button if the balance is at or above the minimum.
    • Grey out or hide the button if it’s below, and tell the user why.
  3. Call Get Balance Withdrawal URL when the user taps the enabled button.
This stops users entering the withdrawal flow only to find they can’t withdraw.

Configuring your payment scheme

Your Axle representative sets up your payment scheme with you. Together we agree:
  • How much your users earn
  • How often and when we pay them
  • The minimum withdrawal amount
  • Any wait before a user’s first withdrawal
If you don’t set the last two, these defaults apply: We recommend £10 as the minimum withdrawal amount for most clients. Lower minimums are supported, but each payout has a fixed transaction cost on our side whatever its size, so very low minimums (e.g. a few pence) make small payouts uneconomical to process. We also apply manual review thresholds to larger withdrawals, as an extra safeguard on users’ funds.

How it works

  1. You generate a payment portal URL for the user from our API.
  2. You open the URL in your app.
  3. The user views their balance, links a bank account, which we check with Confirmation of Payee, and withdraws. See User flow.
  4. We pay out the withdrawal through Stripe.
  5. The user returns to your app.
You can also hide the transaction history, or send users straight to bank account setup. See Optional portal behaviour. If you prefer a sequence diagram, this is how it looks across services:

Generating payment portal URLs

Use the Get Balance Withdrawal URL endpoint to generate a URL for users to access their payments portal. Response:
Treat the URL as opaque and open it as-is. It contains a short-lived access token, so don’t log it or share it.

Session lifetime and expiry

A URL is valid for 60 minutes from generation and can be reused within that window. Generate a fresh URL each time the user opens the portal, so they never start on a token that is about to expire.

Security

  • Anyone with the URL can withdraw the user’s balance until it expires, so treat it like a password.
  • Generating URLs requires an organisational bearer token.
  • Links in payment failure emails use tokens that last 48 hours.
  • We check bank account details with Confirmation of Payee before we process any withdrawal.
  • You can require email verification before a user links a bank account. See Two-factor authentication.

Embedding in your app

You can open the portal in one of two ways:
  • External browser: the portal opens outside your app. Set redirect_uri to a deep link back into your app.
  • In-app web view or modal: the portal opens inside your app. Set redirect_uri to a value your app watches for, so it can close the web view.

Handling the redirect

The redirect_uri parameter sets where we send users when they finish in the payments portal. How you set it depends on how you open the portal URL:
  • If you open it in a browser outside your app, redirect_uri should be a deep link back to your app.
  • If you open it in a modal browser pop-up within your app, it should be a ‘magic string’ that lets the user exit the modal.
We don’t append extra information (such as success or failure status, or transaction IDs) to the redirect URI. If something specific would help your app, let us know and we’ll look at adding it.