Skip to main content
The HitPay integration for Vercel connects your HitPay account to your Vercel projects. You approve access once with HitPay sign-in, choose the projects that take payments, and the integration writes your HitPay credentials to those projects as environment variables. There are no API keys to copy.
HitPay checkout with PayNow, GrabPay, GCash, DuitNow and card logos, shown next to the HitPay × Vercel lockup

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.
Connect your HitPay account card showing a live connection and the approved access scopes
3

Choose your projects

Select the Vercel projects that should receive HitPay credentials, then click Save env vars to projects.
Project picker with storefront and checkout-api selected
4

Redeploy

Click Return to Vercel, then redeploy your projects. Vercel only applies new environment variables to new deployments.
Environment variables written by the integration: HITPAY_ACCESS_TOKEN, HITPAY_API_BASE, HITPAY_API_MODE and HITPAY_BUSINESS_ID

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 the Authorization header changes.
Code that creates a HitPay payment request using HITPAY_API_BASE and HITPAY_ACCESS_TOKEN
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:
Don’t treat the redirect itself as proof of payment. Always confirm the status with the API.
You can also pass a 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 paste HITPAY_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.
You don’t need HITPAY_API_BASE: the code above defaults it to https://api.hit-pay.com.
Point your agent at vercel-connect.hitpay.dev/llms.txt. It tells AI coding tools to send you to the install link instead of asking for credentials.

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
Webhook registration, virtual accounts, static QR codes and terminals still need a HitPay API key. See Connect Merchant Accounts (OAuth) for details.

Local development

Vercel doesn’t allow sensitive variables in the Development environment, so vercel 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 updates HITPAY_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

The setup page only opens in the browser you installed the integration with. Open Configure from the integration in your Vercel dashboard in that browser, or reinstall the integration.
Only business Owners and Admins can approve access. Sign in to HitPay with one of those roles and try again.
Skip the form. Install the integration on the project the chat deploys to, then redeploy. See Use with v0 and other AI coding tools.
Redeploy the project. Environment variables only reach deployments created after they’re added.
The token was revoked or has expired. Open Configure on the integration, click Reconnect, save the env vars to your projects again, and redeploy.
Last modified on October 20, 2026