# Developers

Take payments from your own site or app with the Vezmo REST API, hosted checkout, webhooks and SDKs.

Source: https://dev.vezmo.com/docs/developers

The Vezmo API lets you create payments, payment links, invoices, clients and products from your own code, and tells
your server what happened through signed webhook events.

## Start here

- [Take your first test payment](/docs/developers/quickstart): from a test key to a paid test checkout.
- [API keys and access tokens](/docs/developers/api-keys): create test and live keys in VezmoPay › Developers.
- [Choose how to take payments](/docs/developers/integration-options): hosted checkout, embedded checkout, card fields,
  mobile apps or WooCommerce.
- [Webhooks](/docs/developers/webhooks): every event, and how to check its signature.
- [Go-live checklist](/docs/developers/go-live): what to check before your first live payment.
- [API reference](https://user.vezmo.com/docs/v1): every endpoint with examples, authentication, errors and test cards.

## Webhook events

Your endpoint receives an event when a payment changes:

| Event | When it is sent |
| --- | --- |
| `payment.success` | A payment succeeded. |
| `payment.processing` | A bank payment is on its way. |
| `payment.awaiting_verification` | The customer still has to verify their bank account. |
| `payment.failed` | A payment failed. |
| `payment.canceled` | A payment was canceled. |
| `payment.refunded` | A payment was refunded, in full or in part. |
| `dispute.created`, `dispute.updated`, `dispute.closed` | A customer disputed a payment, and what happened next. |

These are the payment and dispute events. Every event, with when it is sent: [Webhooks](/docs/developers/webhooks).

Test mode keys create test payments that never move real money.

## Plan limits

A few things count against your Vezmo plan: team members, e-sign agreements sent each month, removing "Powered by
Vezmo", and API requests a minute. Payments, invoices, payment links and subscriptions are never limited.

A limit in watch mode refuses nothing: requests past it go through and are only logged. When a limit is enforced, a
request past it answers `403` with the code `PLAN_LIMIT` (`429` for API requests a minute), and says what was used,
what your plan allows, and which plan has room, in `errors[0]`: `code`, `limit`, `used`, `allowed`, `plan` and
`upgradeTo`. An example is in [Limits](https://user.vezmo.com/docs/v1/limits).

Status codes and the error body: [Errors](https://user.vezmo.com/docs/v1/errors). Retrying safely:
[Errors, retries and idempotency](/docs/developers/errors-and-retries).

### API requests a minute

Your plan sets how many API requests your business makes a minute, all your API keys together. Live and test keys count
apart, each against the same number.

| Plan | API requests a minute |
| --- | --- |
| Free | 60 |
| Grow | 300 |
| Pro | 1,000 |
| Enterprise | By contract |

A minute is a calendar minute (UTC): the count starts again at the top of each minute. Once this limit is enforced, a
request past it answers `429 Too Many Requests` with the code `PLAN_LIMIT` and a `Retry-After` header: the seconds until
the next minute. Wait that long, then carry on. Until then it is in watch mode, so nothing is refused. Your API key's
own limit per second still applies ([Limits](https://user.vezmo.com/docs/v1/limits#rate-limits)), and **Plan & billing**
shows your number and your busiest minute today.

## Plan billing

Your dashboard pays and changes your plan through these endpoints (signed in, not with an API key). They are listed so
you know what the app does; see [Plans and billing](/docs/get-started/plans-and-billing) for how billing works.

| Endpoint | What it does |
| --- | --- |
| `GET /merchant/plan` | Your plan, prices, fees and limits, and `billing`: the next bill, a change waiting, plan credit, your card, and `pastDue` with `banner: "PLAN_PAYMENT_FAILED"` while a plan payment is unpaid. `recurring` holds the account fees: `extraCurrency` (open currencies, which are included, `monthlyCents`, `nextChargeAt`, and `ifOpenedNow`: what one more would cost; `chargeable`, or why not in `notChargeable`, when `monthlyCents` is 0 and `nextChargeAt` and `ifOpenedNow` are null) and `upkeep` (this quarter's `status`; `chargeable`, or why not in `notChargeable` with `startsFrom`, the quarter it can apply from; `moneyInCents` and `avgBalanceCents` against their targets, `chargeOn`, and `last`). |
| `GET /merchant/plan/options` | Every plan you can move to, at your business's own prices (monthly and yearly), with its limits and fees. A `null` price is set by contract. |
| `POST /merchant/plan/change` | Move to another plan or interval. Upgrades start once paid (24 hours to pay); downgrades wait for the next bill. `dryRun: true` only works out the cost. |
| `DELETE /merchant/plan/change` | Cancel a downgrade waiting for the next bill. |
| `PUT /merchant/plan/signup` | The plan picked during sign-up. It starts, and is charged, when the account is approved. |
| `POST /merchant/plan/card/setup`, `POST /merchant/plan/card`, `DELETE /merchant/plan/card` | Add, save and remove the card that pays the plan. |
| `POST /merchant/plan/pay`, `POST /merchant/plan/pay/confirm` | Pay an open plan bill now: balances first, then the card with you present. |
| `GET /merchant/plan/invoices`, `GET /merchant/plan/invoices/{id}/pdf` | Your plan invoices and their PDFs. |

`out.ach` is your business's own US ACH price. A rule with no fixed fee and no `included` count means ACH sends are
free with no monthly count.

Changing the plan, its card or paying a plan bill needs the **Change the business's plan** permission, which owners
have. Errors you may see:

| Code | Status | Meaning |
| --- | --- | --- |
| `PLAN_BILL_OPEN` | 409 | A plan payment is still open. Pay it first, then change the plan. |
| `PLAN_NOT_APPROVED` | 409 | The business isn't approved yet. Pick the plan with `PUT /merchant/plan/signup`; it starts the day the business is approved. |
| `PLAN_CHANGED` | 409 | The plan changed a moment ago (a renewal, say). Read it again, then change it. |
| `PLAN_BY_CONTRACT` | 409 | The plan is set or priced by a contract (Enterprise). |
| `PLAN_BILLING_OFF` | 409 | Changing or paying plans in the dashboard isn't open yet. |
| `PLAN_BILLING_PAUSED` | 409 | Paid plans aren't open yet for businesses in your country. |
