
What you get
Each project you select receives these environment variables:
Use the token server-side only. It’s scoped to the permissions you approve, and you can revoke it from your HitPay dashboard at any time.
Prerequisites
- A Vercel account or team
- A HitPay account where you’re an Owner or Admin
Install the integration
1
Add the integration
Open the HitPay integration on Vercel and click Connect Account. Choose your Vercel team and the projects to connect.
2
Connect your HitPay account
Vercel opens the HitPay setup page. Click Connect HitPay, sign in to HitPay, choose your business, and approve access.

3
Choose your projects
Select the Vercel projects that should receive HitPay credentials, then click Save env vars to projects.

4
Redeploy
Click Return to Vercel, then redeploy your projects. Vercel only applies new environment variables to new deployments.

Accept a payment
Call the HitPay API from your server with the token as a Bearer token. Requests and responses are the same as with an API key; only theAuthorization header changes.

1
Create a payment request
app/api/checkout/route.ts
2
Send the customer to checkout
Redirect the customer to the returned
url. HitPay’s hosted checkout shows the payment methods enabled on your account, such as PayNow, GrabPay and cards.3
Confirm the payment
When the customer returns to your
redirect_url, read the payment request from HitPay and check that its status is completed:webhook URL when you create the payment request to have HitPay notify your server when the payment completes.
Use with v0 and other AI coding tools
AI coding tools such as v0 can’t run the integration’s install flow, so they may ask you to pasteHITPAY_ACCESS_TOKEN or HITPAY_API_BASE into an environment variable form. Skip that form. The token only comes from installing the integration:
1
Install HitPay on the project
Find the Vercel project your v0 chat deploys to. Open the HitPay integration, click Connect Account, choose that project, and connect your HitPay account.
2
Redeploy
Deploy again from v0 or Vercel. The deployed app reads
HITPAY_ACCESS_TOKEN from the project.HITPAY_API_BASE: the code above defaults it to https://api.hit-pay.com.
What the token can do
The token covers the scopes approved on the HitPay app:- Payments: create and read payment requests, charges, refunds and recurring billing
- Commerce: products, orders and invoices
- Customers
Local development
Vercel doesn’t allow sensitive variables in the Development environment, sovercel env pull doesn’t download HITPAY_ACCESS_TOKEN. Add a token to .env.local for local work:
.env.local
The integration currently connects live HitPay accounts only, so payments made while testing are real. Use a small amount and refund it from your HitPay dashboard.
Manage the integration
Change projects or reconnect: In your Vercel dashboard, go to Integrations, open HitPay, and click Configure. Open it in the same browser you installed with. Token refresh: Access tokens last one year. The integration refreshes them 30 days before they expire and updatesHITPAY_ACCESS_TOKEN on your projects. Redeploy to pick up the new token.
Revoke access: In your HitPay dashboard, go to Developers > Connected Apps and remove the app. Calls made with the token fail immediately afterwards.
Uninstall: Remove the integration from your Vercel dashboard. The integration deletes the HitPay environment variables it added to your projects.
Troubleshooting
Connecting HitPay fails after you approve access
Connecting HitPay fails after you approve access
Only business Owners and Admins can approve access. Sign in to HitPay with one of those roles and try again.
v0 asks you to enter HITPAY_ACCESS_TOKEN
v0 asks you to enter HITPAY_ACCESS_TOKEN
Skip the form. Install the integration on the project the chat deploys to, then redeploy. See Use with v0 and other AI coding tools.
Your app can't find the environment variables
Your app can't find the environment variables
Redeploy the project. Environment variables only reach deployments created after they’re added.