Fiat Onramp
📄 Session-Based Integration
Wert’s fiat onramp is initialised through a session-based integration flow, designed to give you full control over the transaction experience.
This flow consists of two simple steps:
- Create a session via API, including all necessary transaction and user details
- Initialise the widget using the session_id returned from the API
This allows you to tailor how the onramp behaves — from fully user-driven to fully preconfigured — depending on your use case.
1. Create session
Please click on the dropdown below to see how to create session_id from our API.
Create Session Instruction
To start the widget, you must create a new session via our Partner API. The available endpoints for this are:
| Environment | URL | Method |
|---|---|---|
Sandbox | https://partner-sandbox.wert.io/api/external/hpp/create-session | POST |
Production | https://partner.wert.io/api/external/hpp/create-session | POST |
Authentication
To authenticate your requests, include your API key in the HTTP header of every request.
| Header Key | Value |
|---|---|
| X-Api-Key | your-unique-api-key |
Your API Key carries many privileges, so be sure to keep it secure!
Your API key is provided exclusively by Wert during onboarding. Store this safely in your backend.
Never share your key; if you suspect a compromise, contact us immediately to issue a new one.
Note: Sandbox and Production keys are unique to their respective environments and are not interchangeable.
Parameters
flow_type:
simple_full_restrictensures all parameters are locked and cannot be edited by users.
| Property | Required | Description | Data Type | Default value | Possible values |
|---|---|---|---|---|---|
flow_type | Yes | Determines widget behaviour. simple: Users choose. simple_full_restrict: Partner defined options. | string | simple | simple, simple_full_restrict |
user_id | No | The User ID for the associated profile | string | - | 01KQWHEJNSY |
commodity | * | Default crypto asset selected. | string | BTC | See docs |
commodity_amount | * | Pre-filled crypto amount (ignored if currency_amount set). | numeric | - | - |
network | * | Network for the default asset. | string | bitcoin | See docs |
wallet_address | * | User’s wallet address. Validated based on commodity. | string | - | - |
currency | * | Fiat currency (required if currency_amount used). EUR is not available in sandbox. | string | - | USD, EUR |
currency_amount | * | Pre-filled fiat amount ($1 min / $30 min for BTC). | numeric | - | - |
- (*) Requirement: All properties marked with an asterisk are required when flow_type is set to
simple_full_restrict. - Use either
commodity_amountorcurrency_amount, but not both.
Examples
curl -X POST "https://partner-sandbox.wert.io/api/external/hpp/create-session" \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"flow_type": "simple", // flow_type is always required
}'In sandbox, please use only USD and sandbox commodities
Responses
{
"sessionId": "string",
"requestId": "string"
}The
sessionIdis valid for 30 seconds after being created and can only be used once.
2. Initialise the widget
You can integrate the Wert Widget into your web app using our SDK, this is the recommended way to initialise the widget. For React projects, we provide this wrapper.
You can find examples of the integration on GitHub.
Once the SDK is installed, you can use the following code snippet to initialize the payment module:
// Import the SDK
import WertWidget from '@wert-io/widget-initializer';
import type { Options } from '@wert-io/widget-initializer/types';
// Initialize the payment module
const options: Options = {
partner_id: 'YourPartnerID',
session_id: 'SessionID', // session id recieved from partner.wert.io/api/
origin: 'https://sandbox.wert.io', // this option needed only in sandbox
}
const wertWidget = new WertWidget(options);
wertWidget.open();
// Further code to handle widget events and interactionsOptions
Here are the options you can pass to the widget.
General options
| Property | Required | Description | Data Type | Default value | Possible values |
|---|---|---|---|---|---|
partner_id |
Yes | Provided when you register as a partner. | string | - | - |
session_id |
Yes | session_id returned from the API | string | - | - |
origin |
In sandbox | Initializes the module in a sandbox/production environment. | string | https://widget.wert.io | https://sandbox.wert.io |
click_id |
No | A unique identifier created by you. Can be used to help you reconcile the order on your side. | string | click_id | uuid_v4(). Try to avoid using special characters like % or pass them encoded. |
phone |
No | User’s phone number in international format (E.164 standard). The ‘+’ is optional. | string | - | +11014321111 |
redirect_url |
No | Includes a button 'Back to {Partner Name}' (not available in iFrame). Also redirects users from KYC emails. | string | - | https://origin.us/item_id |
support_url |
No | Used for helping users with failed orders. | string | - | https://partner.com/support |
listeners |
No | Used to listen to module events and react to them. | object | - | See the listeners object. |
commodities |
No | Stringified JSON array of objects with commodity and network options. | string | By default, all assets are displayed. | See Limiting assets |
extra |
No | Passing multiple wallet addresses to the widget. | string | - | See Multiple addresses |
payment_method |
No | Pre-selected payment method shown first in the list. | string | card | card, apple-pay, google-pay, sepa |
payment_method_restriction |
No | If true, shows only the method specified in payment_method. |
boolean | false | true, false |
display_currency |
No | ISO currency code to display approximate estimated amounts. | string | - | AUD, SGD, HKD, THB, MYR, VND |
hide_fee_breakdown |
No |
Hides fee details for all payment methods and only the fee value is shown. |
boolean |
false |
true |
Pre-filled user data
| Property | Required | Description | Data Type | Default value | Possible values |
|---|---|---|---|---|---|
country_of_residence |
No | User’s country of residence. | string | - | alpha2 code of the country |
state_of_residence |
No | User’s state of residence (for USA). | string | - | alpha2 code of the state |
date_of_birth |
No | User’s date of birth. | string | - | DD/MM/YYYYMM/DD/YYYY (USA) |
email |
No | User’s email address. | string | - | [email protected] |
full_name |
No | The user’s first and last name. | string | - | min 3, max 69 letters; RegExp(/(w+s)w+/) |
card_country_code |
No | Card billing address alpha2 code of the country | country code.string | - | US |
card_city |
No | Card billing address city. | string | - | Los Angeles |
card_state_code |
No | Card billing address alpha2 state code (For US). | string | - | CA |
card_post_code |
No | Card billing address postal code. | string | - | 12345 |
card_street |
No | Card billing address street. | string | - | Main street 1 |
Appearance and restrictions
| Property | Required | Description | Data Type | Default value | Possible values |
|---|---|---|---|---|---|
lang |
No | Language of the widget. | string | en | ** |
skip_init_navigation |
No | By default, the module suggests the nearest purchase route. Setting to true skips this logic. |
boolean | undefined | true |
theme |
No | Module’s theme color. | string | undefined | dark |
brand_color |
No | Custom brand color for primary buttons, tooltips, steppers, tabs, checkboxes, toasts, and pie countdowns. | string | - | #FF0000 |
(**) Supported Languages: en - English, fr - French, ja - Japanese, es - Spanish, ko - Korean, zh - Chinese, tr - Turkish
Updated 3 days ago
