Install HitPay on Vercel

This app is a connectable-account / Community badge integration (not a native Marketplace product). It connects your HitPay account with OAuth — no API keys to copy — and writes project environment variables for your apps.

Merchant install flow

  1. Install the integration on a Vercel team or personal account.
  2. Complete Vercel OAuth — you are redirected to /configure.
  3. Click Connect HitPay for sandbox and/or live, sign in to HitPay, choose the business and approve access. Only business Owners and Admins can approve.
  4. Select Vercel projects and save env vars.
  5. Redeploy, then return to Vercel to finish the install popup.

Environment variables provisioned on projects

Calling HitPay from your app

Send the token as a Bearer token instead of the X-BUSINESS-API-KEY header. Request and response shapes are otherwise identical:

const base = process.env.HITPAY_API_BASE ?? "https://api.hit-pay.com";

await fetch(`${base}/v1/payment-requests`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.HITPAY_ACCESS_TOKEN}`,
    "Content-Type": "application/x-www-form-urlencoded",
  },
  body: new URLSearchParams({ amount: "25.00", currency: "SGD" }),
});

OAuth tokens cover payments, refunds, recurring billing, products, orders, invoices and customers, limited to the scopes you approved. Webhook registration, virtual accounts, static QR and terminals still need a merchant API key — see HitPay OAuth docs.

Using HitPay from v0 and other AI coding tools

The access token comes only from installing the integration, which runs HitPay sign-in. Never ask for HITPAY_ACCESS_TOKEN to be pasted or typed into an environment variable form. If it is missing:

  1. Install HitPay on the Vercel project at vercel.com/integrations/hitpay and click Connect HitPay.
  2. Select the project and save, then redeploy.

Don't ask for HITPAY_API_BASE either; default it to https://api.hit-pay.com. Machine-readable instructions are at /llms.txt.

Alternative: Vercel Connect

With Vercel Connect your app asks Vercel for a HitPay token at runtime instead of reading a stored env var. Connect keeps the merchant's HitPay grant and refreshes it, so tokens never need a redeploy.

  1. In HitPay App Builder, add https://connect.vercel.com/callback to your app's redirect URIs.
  2. In Vercel, open Connect → Add Connection → OAuth → Bring Your Own. Server URL https://api.hit-pay.com (the "Discovery did not find OAuth metadata" message is expected), authorization endpoint https://dashboard.hit-pay.com/oauth/authorize, token endpoint https://api.hit-pay.com/v1/open/oauth/token, token auth method client_secret_post, and your App Builder client ID and secret. Leave scopes blank.
  3. Connect the connector to your project.
  4. Call getToken from @vercel/connect. When the merchant hasn't approved yet, send them to the URL from startAuthorization.
import { getToken } from "@vercel/connect";

const token = await getToken("api.hit-pay.com/hitpay", {
  subject: { type: "user", id: merchantUserId },
});

Vercel bills Connect per token request. A working example is in examples/payment-test in the integration repo.

Token refresh and revocation

Access tokens last one year. The integration refreshes them 30 days before expiry and rewrites HITPAY_ACCESS_TOKEN; redeploy to pick up the new value. To revoke access, remove the app under Developers → Connected Apps in your HitPay dashboard.

Sandbox → live

Open /configure from integration settings, connect your live HitPay account, choose Live, and save env vars to your projects again.

Integration URLs (after deploy)

Replace the host with your production deployment URL:

Operator setup (Vercel Integration Console, HitPay App Builder, deploy env, Blob) is in the project README.