# Transak - Fiat On/ Off Ramp

## Transak - Fiat On/Off Ramp

## Available To

Free for the following exchange plans:

* **Cloud Plans:**
  * Enterprise
* **On-Premise Plans:**
  * Enterprise Unlimited

## What Is It?

The **Transak Plugin** connects a HollaEx exchange to [Transak](https://transak.com) so users can **buy** and **sell** crypto with cards, bank transfers, and local payment methods directly from inside the exchange interface.

The plugin adds a `Buy/Sell crypto` page at `/buy-crypto` (rendered by the bundled web view) and exposes the server-side endpoints that the page needs to:

* Discover which fiat currencies, cryptocurrencies, and payment methods Transak currently supports for your account.
* Build a live quote (`POST /plugins/transak/estimate`) using the Transak pricing API.
* Open a fully hosted Transak widget session (`POST /plugins/transak/transaction`) — pre-filled with the user's account, network, deposit address (for BUY), wallet redirection (for SELL), and a partner order id, so the rest of the flow happens on Transak's checkout.
* Show the user the status of their recent Transak orders (`GET /plugins/transak/status`) by querying Transak with the user's `network_id` and wallet addresses.

KYC, payment processing, fraud checks, fiat settlement, and crypto delivery are all handled by Transak. The exchange only needs to provide the user identity, the deposit address (BUY) or sell origin (SELL), and the redirect URL.

## Who Needs It?

This plugin is suitable for any HollaEx exchange operator that:

* Wants to offer card and bank transfer crypto purchases without becoming a regulated fiat processor.
* Wants to give users a one-click off-ramp (sell crypto to fiat) that lands money in the user's bank account or card.
* Needs broad coverage of regional payment methods (SEPA, UPI, PIX, Apple Pay, Google Pay, debit/credit cards, local bank transfers, etc.).
* Wants to keep the buy/sell experience inside the exchange UI (the page is registered at `/buy-crypto` and shows up in the appbar/sidebar/menu by default).

## How to Use It?

Install the plugin from the **Plugins** section inside the Operator Control, then configure it with your Transak partner credentials and the environment you want to run against.

#### 1. Get your Transak partner credentials

1. Apply for a partner account on the [Transak Partner Portal](https://partners.transak.com).
2. Once approved, open **Settings → API Keys** and generate:
   * **API Key** — sent on every public pricing/quote request as `partnerApiKey` and used to load the widget.
   * **Access Token** — sent as the `access-token` header on the partner-authenticated endpoints (widget session creation and order lookup).
3. Pick which environment you want to integrate against first. Transak provides both:

   * **Staging** — `https://global-stg.transak.com`, `https://api-stg.transak.com`, `https://api-gateway-stg.transak.com`.
   * **Production** — `https://global.transak.com`, `https://api.transak.com`, `https://api-gateway.transak.com`.

   The plugin ships with **staging** values by default, so you can test before going live. The credentials issued for staging are different from production credentials — make sure the API key/access token you paste in matches the environment the URLs are pointing at.

#### 2. Whitelist your exchange domain on Transak

Transak validates the `referrerDomain` of every widget session. In the Transak Partner Portal, add your exchange's hostname (e.g. `exchange.example.com`) to the **Allowed Domains** list for both staging and production. Without this, widget sessions will be created, but Transak will refuse to render the checkout.

#### 3. Configure the plugin

Open the plugin in the Operator Control and set the following fields:

| Field                          | Required | Default                               | Description                                                                                                                                                                                                    |
| ------------------------------ | -------- | ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `transak_environment` (public) | **yes**  | `STAGING`                             | Environment identifier — `STAGING` or `PRODUCTION`. Used by the plugin to derive the correct fallback URLs and by the widget to label the session.                                                             |
| `transak_api_url` (public)     | **yes**  | `https://api-stg.transak.com`         | Transak public API base URL (used for fiat list, crypto list, and pricing). Use `https://api.transak.com` for production.                                                                                      |
| `transak_gateway_url` (public) | **yes**  | `https://api-gateway-stg.transak.com` | Transak gateway API base URL used to create authenticated widget sessions. Use `https://api-gateway.transak.com` for production.                                                                               |
| `transak_widget_url` (public)  | **yes**  | `https://global-stg.transak.com`      | Base URL for the Transak hosted widget. Use `https://global.transak.com` for production.                                                                                                                       |
| `api_key`                      | **yes**  | —                                     | Transak partner API key (sent as `partnerApiKey` and used to load the widget).                                                                                                                                 |
| `access_token`                 | **yes**  | —                                     | Transak partner access token (sent as the `access-token` header for session creation and order lookup). Keep this secret — it lets the bearer create widget sessions and read orders for your partner account. |

The plugin's `init()` will throw if any of these values are missing, retrying once a minute until they are set, so it is safe to install the plugin first and fill in the credentials afterwards.

#### 4. (Optional) Customize the user-facing page

The bundled web view registers a page at:

```
https://<your exchange url>/buy-crypto
```

Defaults set in the manifest:

* `is_page: true`, `is_public: true` — Anyone can land on the page; the plugin endpoints themselves still require a user bearer token.
* `hide_from_appbar`, `hide_from_sidebar`, `hide_from_menulist`, `hide_from_bottom_nav` are all `false`, so the entry point is visible in every navigation surface by default. Flip any of them to `true` from the plugin meta to remove the entry from that surface.
* The page title (`"Buy/Sell crypto"`) and disclaimer copy live in `web_view[0].meta.strings.en` — Edit those values on the plugin to relabel the page or swap the disclaimer wording per market.

#### 5. Endpoints exposed by the plugin

All endpoints below are mounted under `https://<your exchange url>/plugins/transak/`. Calls that touch user data require the standard HollaEx user bearer token.

| Method | Path                                                           | Auth | Purpose                                                                                                                                                                                                                                                                                    |
| ------ | -------------------------------------------------------------- | ---- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `GET`  | `/currencies`                                                  | none | Lists fiat and crypto symbols Transak supports for your partner account *and* are present on the exchange. Cached for 1 hour.                                                                                                                                                              |
| `GET`  | `/market_pair?pair=<fiat>_<crypto>&transaction_type=buy\|sell` | user | Returns the resolved Transak network and the active payment methods (with min/max limits) for that pair and direction.                                                                                                                                                                     |
| `POST` | `/estimate`                                                    | user | Builds a Transak quote without creating a session. Body: `fiat_currency`, `digital_currency`, `requested_amount`, `payment_method_id?`, `transaction_type`.                                                                                                                                |
| `POST` | `/transaction`                                                 | user | Creates a Transak widget session for the requested order, returns a `widget_url` the front-end can open in an iframe / new tab. Falls back to the public widget URL with `apiKey` if the gateway session call fails. Body: same fields as `/estimate` plus a required `payment_method_id`. |
| `GET`  | `/status`                                                      | user | Returns the user's last 90 days of Transak orders (matched by `partnerCustomerId = user.network_id` and by the user's wallet addresses).                                                                                                                                                   |

#### 6. How a buy or sell flows

When the user submits the form on `/buy-crypto`:

1. `POST /plugins/transak/transaction` is called with the chosen pair, amount, payment method, and direction.
2. The plugin resolves the right Transak crypto record (preferring the network the kit already configures for that coin), generates a fresh `partnerOrderId`, and looks up — or creates — the user's wallet address for that currency/ network (BUY only).
3. It calls `POST <gateway>/api/v2/auth/session` with the partner access token to mint a **signed widget session**, which keeps the API key off the front-end. If the gateway is unreachable for any reason, it falls back to a plain widget URL with the `apiKey` query parameter.
4. The user is redirected to the hosted Transak widget, where KYC, payment, and crypto delivery happen. On completion, Transak redirects back to your exchange URL.
5. The exchange UI shows live order status by polling `GET /plugins/transak/status`.

#### Supported networks

Network identifiers between HollaEx and Transak are mapped automatically with aliases for the common chains:

* Ethereum (ERC20)
* Tron (TRC20)
* Bitcoin
* BNB Smart Chain (BEP20)
* Polygon
* Arbitrum
* Optimism
* Avalanche C-Chain
* Solana
* Litecoin
* Dogecoin
* Ripple (XRP)
* Stellar (XLM)

If a coin exists on Transak under a network that is not in the alias list, the plugin will still try a best-effort name match. Coins Transak does not list at all (or that the kit does not have configured) are filtered out of `/currencies`.

***

**Benefits for HollaEx Operators**

The Transak plugin lets exchange operators offer fiat-to-crypto and crypto-to-fiat without holding a payment license, building card processing, or integrating each regional payment method individually. Users get a familiar checkout (cards, bank transfers, local rails, mobile wallets) inside the exchange UI; the exchange gets a deposit address pre-filled buy flow, an automatic sell flow that pays the user out to their bank, and a partner-authenticated session model that keeps the API key off the front-end. Switching between staging and production is a single environment + URL change in the plugin meta.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hollaex.com/plugins/use-plugins/transak-fiat-on-off-ramp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
