UniRate
Integrates the UniRate currency exchange and VAT API into Payload CMS v3 with four server-side endpoints and a prefilled currency select field.
Installation
pnpm add payload-plugin-unirate About
This plugin integrates the UniRate currency exchange API into Payload CMS v3. It mounts four server-side GET endpoints under `/api/unirate` for fetching exchange rates, converting amounts, listing supported currencies, and retrieving VAT rates. The API key stays on the server and is never sent to the browser, so the browser only ever talks to your own Payload endpoints. You add it through the `plugins` array in `payload.config.ts`, passing an `apiKey` or relying on the `UNIRATE_API_KEY` environment variable. Other options let you override the base URL, set a per-request timeout, and disable the plugin at runtime. When no key is configured the endpoints return `503` instead of crashing at boot, and upstream UniRate errors are mapped to matching HTTP statuses (400, 401, 403, 404, 429, 502). Beyond the endpoints, the package exports a `currencyField` helper that builds a Payload `select` field prefilled with common ISO-4217 currency codes. You can override the code list or fetch the live list from `/api/unirate/currencies`, which is handy for marking a product price's currency. The internal `UniRateClient` and typed error classes (`AuthenticationError`, `RateLimitError`, `ProRequiredError`) are also exported, so you can call the API directly from hooks or custom endpoints. The free tier covers rates, conversion, the currency list, and VAT; historical data and time series require a Pro subscription. The plugin has zero runtime dependencies (payload is a peer) and requires Payload 3.0.0 or newer and Node 18.20 or newer.
Package info
- Package name
payload-plugin-unirate- Latest version
0.1.0- Unpacked size
- 49 kB
- License
- MIT
- Weekly downloads
- 3
- Last publish
- Jul 29, 2026
Similar plugins
More in FieldsMenus
Adds a menus collection to Payload for building navigation with nested items, collection links, custom URLs, icons, and preview images.
Icon Picker
Adds an icon picker field plugin for Payload CMS with search and SVG support.
Barcodes
Adds Code 128, EAN-13 and QR code generation to Payload product collections with a printable label page and optional admin print buttons.
Shipping Classes
Adds weight, dimensions, and shipping class fields to Payload products and variants, storing values canonically in grams and millimetres for cart totalling.
Downloads
Sells digital products from a Payload store using signed, expiring download links that stop working when an order is refunded.
Order Numbers
Assigns every Payload ecommerce order a short, readable, concurrency-safe number like ORD-01042 via a reservations collection.