Connect Button
Add a "Connect with ePay" button to your product and show each customer's connection status.
Connect with ePay button
Put a Connect with ePay button where your customers set up payments in your product, for example Settings → Payments. One click takes them through ePay's sign-in and consent screen and back to you, connected.
How the button works
The button links to your own server, for example GET /connect/epay,
not to ePay directly.
Your server builds the authorize URL. It creates a fresh state and
PKCE code_verifier, keeps both in the user's session and redirects the
browser to ePay. See Connect a Business.
The business approves on ePay. It signs in (or signs up), picks which business to connect and approves your app.
ePay redirects to your callback with a one-time code. Your server
checks state, exchanges the code and saves the
account_id on your customer's record.
Don't put the authorize URL in your HTML
state and the PKCE verifier must be new for every attempt and stay on your
server. Link the button to your own route and let it redirect.
Add the button
Copy one of these. Both link to /connect/epay, the route that redirects to ePay.
<a class="epay-connect" href="/connect/epay">
<svg width="18" height="18" viewBox="0 0 22 27" fill="currentColor" aria-hidden="true">
<path d="M20.6398 21.1673C19.1598 20.0104 16.0967 17.537 15.7701 17.537C13.4624 20.7728 7.81452 21.9146 4.35836 18.5132L0.662354 23.4353C6.18185 28.534 17.0754 27.3105 20.6398 21.1673Z"/>
<path d="M0.810059 4.48676C6.27915 -1.28175 22.973 -0.158202 21.1184 15.5026C20.9187 15.2607 3.28683 15.4639 3.28683 15.4639V10.9565C3.28683 10.9565 14.8185 10.8975 14.6663 10.8975C13.8375 6.88036 7.86961 4.91077 4.23773 9.01854L0.810059 4.48676Z"/>
</svg>
Connect with ePay
</a>
<style>
.epay-connect {
display: inline-flex;
align-items: center;
gap: 10px;
height: 44px;
padding: 0 18px;
border-radius: 10px;
background: #5700ff;
color: #ffffff;
font: 600 15px/1 Inter, system-ui, sans-serif;
text-decoration: none;
}
.epay-connect:hover { background: #4a00d9; }
.epay-connect:focus-visible { outline: 3px solid #b9a4ff; outline-offset: 2px; }
/* Outline variant, for light pages with a lot of colour around it */
.epay-connect.outline {
background: #ffffff;
color: #1a1a2e;
border: 1px solid #d9d6e8;
}
.epay-connect.outline svg { color: #5700ff; }
</style>The /connect/epay route itself is on Connect a Business, in your language.
Show the right state
After the first connection, replace the button with the connection's status. Read it with GET /v1/connect/accounts/:accountId and keep it current with webhooks.
| Situation | How you know | What to show |
|---|---|---|
| Not connected | No account_id saved for this customer | The Connect with ePay button |
| Connected and live | status: "active", livemode_enabled: true | "Connected to ePay · legal name", plus a Disconnect action |
| Waiting for ePay to verify the business | status: "pending_kyb", livemode_enabled: false | "Waiting for ePay to verify legal name. You can take test payments now." Live starts on its own; you get account.updated. |
| Live paused | account.updated with livemode_enabled: false | "ePay paused live payments for this business. Check the ePay dashboard." |
| Disconnected | account.product.deauthorized, or 403 account_not_connected | The button again, labelled Reconnect ePay. The same account_id comes back. |
Disconnect
Offer a Disconnect action next to the connected status. It calls POST /v1/connect/oauth/deauthorize. The business can also disconnect your app from its own ePay dashboard; you then receive account.product.deauthorized and your calls for that account start failing.
Guidelines
- Label: "Connect with ePay", or "Reconnect ePay" after a disconnect. Don't shorten it to "ePay" or "Pay".
- Logo: use the mark as provided, in ePay purple (
#5700FF) or white on purple. Don't stretch, recolour or redraw it. - Size: at least 36 px tall, so it stays easy to tap on phones.
- Full-page redirect: open ePay in the same tab. ePay's sign-in and consent pages can't be shown in an iframe or embedded web view.
- Mobile apps: open the link in the system browser (Android Custom Tabs, iOS
ASWebAuthenticationSession), and point your redirect URI at your backend or an app link. - One business per connection: a customer with several businesses (for example two restaurants) connects each one separately. Save one
account_idper business.
Checklist for platforms
Create your app in Developers → Apps and add your sandbox redirect URI. See Going Live for review.
/connect/epay route and your callback.account_id per business and show its status.Before showing payment options, ask which ones each business offers:
GET /v1/payment-providers with the ePay-Account header.
Set your Connect webhook URL, verify signatures and handle
account.updated and account.product.deauthorized.
cp_live_ client ID.