Vezmo App

Get started

Authentication

Every API call carries a short-lived access token. Get one by sending your key ID and secret to Create token, then send it as Authorization: Bearer <token>.

Authentication and token lifecycle

Create a token, reuse it until it expires, then create the next one. Older keys keep their 30-minute token and 7-day refresh token.

Test & live API keys

Every merchant can hold two kinds of keys, created under VezmoPay → Developers → API keys:

Test key Sandbox

Runs your entire integration — sessions, checkout, webhooks, refunds — against an isolated sandbox. No real money ever moves, sandbox activity never appears in your live dashboard (flip the Test mode toggle in the VezmoPay console to see it), and it works before your account is approved. Webhooks for sandbox events carry livemode: false.

Paylinks, invoices and proposals work the same way: a test key's are sandbox ones, paid with test cards (a sandbox proposal's invoice too), and a test key can't see a live one (404). In test mode, emails go only to your team's addresses: a sandbox invoice, proposal, payment receipt or subscription email reaches only you and your team members (marked TEST MODE), never a real client.

Live key

Moves real money. Requires an approved, charges-enabled VezmoPay account: you can generate one in Developers once VezmoPay is approved, and until then the dashboard offers test keys only. Keys and data are mode-locked: a test key can never act on live payments (and vice versa) — crossing modes returns a 404. For an object your business has in the other mode, its message says so ("No such invoice: a similar object exists in live mode, but a test mode key was used to make this request.").

Both key types use the same base URL and the same authentication flow below — going live is just swapping the key. A key's test or live is fixed when you create it and shows in its key ID; it can't be changed later.

Key ID and secret

Two parts, shown once

A key has a key ID, which is not secret (it shows in your dashboard), and a secret, shown once when you create or roll the key. Send them only to Create token, in the x-api-key and x-api-secret headers. Keep the secret in a secrets manager or an environment variable, never in your code, a browser, an app or CI logs.

PartLooks like
Key IDvzm_ + live or test + the key type (ro or rq) + 16 characters, e.g. vzm_test_rq_4fT9kQ2mZx7LpB1c
Secretvzs_ + live or test + 46 characters, e.g. vzs_test_…. The last 6 are a checksum, so secret scanners can recognise a leaked Vezmo secret.
Key typeWhat it means
ro Read-onlyEvery permission only reads. It can't create, change or refund anything.
rq Read and writeAt least one permission makes changes. paylink.read counts as one: it can also take a payment through a link.

Older keys (vzm_ and 16 characters, with a 32-character secret) keep working. Roll one to move it to the new format.

Permissions

A new key starts with no permissions. You choose them when you create it, by resource (None, Read or Write) or one by one. Give each key only what its system needs: most integrations never need payment.refund.

  • Permissions are fixed once the key exists. To give more, create a new key.
  • Anyone on your team who can change API keys can take a permission off a key at any time (Developers → the key → Permissions). It applies to the next call.
  • A call the key has no permission for returns 403 Insufficient API permissions, naming the permission in errors[0].required (see Errors).
ResourcePermissions
Paymentspayment.read, payment.refund, payment.cancel, payment.verify, secure-payment.create, secure-payment.read
Payment linkspaylink.read, paylink.create, paylink.update
Invoices, proposals.read, .create, .update, .delete, .send (invoices also .restore)
Subscriptionssubscription.read, subscription.create
Agreementsagreement.read, agreement.create, agreement.send, agreement.void
Clients, client projects, products, categories, contracts.read, .create, .update, .delete (contracts also .restore)
Business profile, account security (3D Secure and which payment methods are on)profile.read, account.read, account.update

IP limits

Limit a key to your servers' addresses, so a copied key can't be used from anywhere else. Set them in Developers → the key → Allowed IP addresses: up to 20 IPv4 or IPv6 addresses or ranges, each with a label. An IPv4 range can be /24 or narrower, an IPv6 range /48 or narrower. Changing them is confirmed with a code we email and your passkey or authenticator app.

We check the caller's address when the key gets a token and on every call, so a stolen token is stopped too. From anywhere else the answer is 403:

403 ip_not_allowed
{
  "success": false,
  "message": "This API key can't be used from this IP address. Add the address to the key's allowed IP addresses in Settings › Developers › API keys.",
  "errors": [
    {
      "code": "ip_not_allowed",
      "message": "This API key can't be used from this IP address. …"
    }
  ],
  "data": null,
  "requestId": "…",
  "timestamp": "…"
}

A key with no IP limits works from any address.

Access tokens

15 minutes, no refresh token

A key whose ID starts vzm_live_ or vzm_test_ gets a token that lasts 15 minutes (expiresIn: 900) and no refresh token. Reuse it until it is about to expire, then call Create token again. Create token allows 5 requests a minute from one IP address. A token from a dashboard sign-in doesn't work here and returns 401.

When a key changes (a permission removed, its IP limits changed, another teammate taking it over), its tokens stop at once with 401 token_outdated. Create a new token and carry on. A key that is switched off, revoked or expired answers 401 without that code, and a new token won't help.

Reuse one token
// One token at a time: reuse it until shortly before it expires, then create a new one.
let cached = null; // { token, expiresAt }

async function accessToken() {
  if (cached && Date.now() < cached.expiresAt - 60_000) return cached.token;
  const res = await fetch(`${BASE_URL}/merchant/api-auth/login`, {
    method: 'POST',
    headers: {
      'x-api-key': process.env.VEZMO_KEY_ID,        // vzm_live_rq_…
      'x-api-secret': process.env.VEZMO_KEY_SECRET, // vzs_live_…
    },
  });
  const { data } = await res.json();
  cached = {
    token: data.accessToken.token,
    expiresAt: Date.now() + data.accessToken.expiresIn * 1000, // 900 s
  };
  return cached.token;
}

// On a 401 with errors[0].code === 'token_outdated' (the key changed), drop the cache and try once more.

Older keys keep a 30-minute token and a 7-day refresh token (see Refresh token).

Roll a key

Rolling a key (Developers → the key → Roll key) makes a new key ID and secret with the same permissions, IP limits and expiry. The old key keeps working for the time you choose, 1 hour, 24 hours or 7 days, then stops. Put the new key on your servers within that time. Roll a key when someone who had the secret leaves, when you think it was exposed, or on a schedule.

You can hold several active keys of each kind, so creating a new key no longer switches the old one off. Revoke a key you no longer use: it stops at once.

Who answers for a key

Keys belong to your business. Each has a responsible person: the teammate who created it, until someone takes it over. If that person can no longer manage API keys, the key keeps working and shows Needs a new owner; another admin takes it over in Developers. If they leave the team or their account is switched off, the key stops working: create a new key, or have another admin take it over. While they have a security hold, the key can read but its changes wait (423).

Errors keys return

The code is in errors[0].code; message is a sentence you can log or show.

StatusCodeWhat happened
401—A wrong key ID or secret, or a key that is revoked or expired.
401token_outdatedThe key changed after this token was made. Create a new token.
403ip_not_allowedThe call came from an address outside the key's IP limits.
403—Insufficient API permissions: the key lacks the permission in errors[0].required.
423SECURITY_HOLDThe key's responsible person has a security hold after a sign-in change. Reads work; changes wait until the time in the message.
423BUSINESS_HOLDChanges through the API are paused for your business while our team reviews it. Reads work. Contact Vezmo support.
429rate_limitedToo many calls with this key. Wait for Retry-After seconds (see Limits).

In the dashboard, you may also see:

CodeWhat happened
environment_immutableA key's test or live can't be changed. Create a new key instead.
scope_not_availableThe permission can't be given to an API key.
revoked_by_vezmoOur team revoked the key, so it can't be switched back on. Create a new key.

See what a key did

Developers → API requests lists every call made with your keys in the last 90 days: time, method, path, status, error code, request ID, IP address and country, idempotency key and response time. Filter by key, status, path, IP address or day. We keep no request or response bodies. Quote the request ID (the requestId in every response) when you contact support.

When you replace a key

Roll the key rather than revoking it, so the old one keeps working while you move over. Once a key is revoked or its overlap ends, its tokens stop at once and return 401. Then create a new token with your current key ID and secret.