1. Documentation
Vortex
  • Documentation
    • Overview
    • Quick Start With The SDK
    • Authentication And Partner Keys
    • Ramp Lifecycle
    • Ephemeral Key Custody
    • Quotes And Pricing
    • Webhooks
    • Widget Integration
    • BRL / KYC notes
    • Sandbox
    • Production Checklist
    • AI Agent Integration
  • API Endpoints
    • Vortex Widget
      • Create widget session
    • Quotes
      • Create a new quote
      • Get existing quote
      • Create a quote for the best network
    • Ramp
      • Get ramp status
      • Get ramp error logs
      • Get ramp history for wallet address
      • Register new ramp process
      • Start ramp process
      • Update ramp process
    • Reference Data
      • Supported Countries
      • Supported Cryptocurrencies
      • Supported Fiat Currencies
      • Supported Payment Methods
    • Public Key
      • Public Key
    • Webhooks
      • Register Webhook
      • Delete Webhook
    • Account Management
      • Create user or retry KYC
      • Get user's KYC status
      • Get selfie liveness URL
      • Get KYC document upload URLs
      • Get user information
      • Get user's remaining transaction limits
      • Submit KYC level 1 data
      • Validate Pix key
    • Schemas
      • AccountMeta
      • AveniaDocumentType
      • AveniaKYCDataUploadRequest
      • AveniaKYCDataUploadResponse
      • BrlaAddress
      • BrlaErrorResponse
      • BrlaGetSelfieLivenessUrlResponse
      • BrlaValidatePixKeyResponse
      • CleanupPhase
      • CountryCode
      • CreateBestQuoteRequest
      • CreateQuoteRequest
      • CreateSubaccountRequest
      • CreateSubaccountResponse
      • DestinationType
      • DocumentUploadEntry
      • ErrorResponse
      • FiatToken
      • GetKycStatusResponse
      • GetRampErrorLogsResponse
      • GetRampHistoryResponse
      • GetRampHistoryTransaction
      • GetUserRemainingLimitResponse
      • GetUserResponse
      • GetWidgetUrlLocked
      • GetWidgetUrlRefresh
      • KYCDataUploadFileFiles
      • KYCDocType
      • KycLevel1Payload
      • KycLevel1Response
      • Networks
      • OnChainToken
      • PaymentData
      • PaymentMethod
      • PresignedTx
      • QuoteResponse
      • RampCurrency
      • RampDirection
      • RampErrorLog
      • RampPhase
      • RampProcess
      • RegisterRampRequest
      • SimpleStatus
      • StartKYC2Request
      • StartKYC2Response
      • StartRampRequest
      • TaxIdType
      • TriggerOfframpRequest
      • TriggerOfframpResponse
      • UnsignedTx
      • UpdateRampRequest
      • ValidatePixKeyResponse
  1. Documentation

Widget Integration

The Vortex Widget is a hosted checkout that handles the user-facing ramp UX, signing, and ephemeral key custody for you. It is the recommended path when your application runs in a browser, mobile WebView, or anywhere you cannot run @vortexfi/sdk server-side.

Endpoint#

POST /v1/session/create
This single endpoint creates a widget session and returns a hosted URL. It supports two mutually exclusive request shapes depending on whether you already have a quote.
Authentication: pass your partner public key (pk_live_* / pk_test_*) as apiKey in the body for attribution. No secret key is required to create a session.
externalSessionId is required in both modes. It is your own opaque identifier for the session and is echoed back in webhook payloads so you can correlate events to your records.

Mode A: Fixed Quote#

Use this when your application has already created a quote via POST /v1/quotes and wants the widget to lock in that exact price.
{
  "quoteId": "quote_01HXY...",
  "externalSessionId": "my-session-id",
  "callbackUrl": "https://partner.example.com/ramp/complete",
  "walletAddressLocked": "0x1234567890123456789012345678901234567890"
}

Fields#

FieldRequiredDescription
quoteIdyesID of an existing quote (POST /v1/quotes). The widget locks in this quote and will not refresh it.
externalSessionIdyesYour opaque session identifier. Returned in webhook payloads.
callbackUrlnoURL the widget redirects to after the user successfully creates the transaction.
walletAddressLockednoLock the destination wallet address in the widget UI so the user cannot edit it.
The quote does not refresh automatically. If it expires before the user completes checkout, the user must close the widget and your application must create a fresh quote and a fresh session.
Response: 200 OK
{ "url": "https://widget.vortexfinance.co/?externalSessionId=my-session-id&quoteId=quote_01HXY..." }

Mode B: Auto-Refresh#

Use this when you want the widget to handle quoting for you. You pass the route definition; the widget creates and refreshes quotes on demand for the user.
{
  "externalSessionId": "my-session-id",
  "rampType": "BUY",
  "network": "polygon",
  "inputAmount": "150",
  "fiat": "BRL",
  "cryptoLocked": "USDC",
  "paymentMethod": "pix",
  "apiKey": "pk_live_...",
  "callbackUrl": "https://partner.example.com/ramp/complete",
  "walletAddressLocked": "0x1234567890123456789012345678901234567890"
}

Fields#

FieldRequiredDescription
externalSessionIdyesYour opaque session identifier. Returned in webhook payloads.
rampTypeyes"BUY" (fiat → crypto) or "SELL" (crypto → fiat).
networkyesEVM or Substrate network for the crypto leg (e.g. "polygon", "base", "assethub").
inputAmountyesDecimal string in the smallest commonly used unit of the input currency (e.g. "150" for 150 BRL).
fiatnoFiat currency for the fiat leg (e.g. "BRL"). Required in practice for fiat-side ramps.
cryptoLockednoPre-selects and locks the crypto asset in the widget (e.g. "USDC").
paymentMethodnoPayment rail (e.g. "pix"). Required in practice for buy flows.
apiKeynoPartner public key pk_live_* / pk_test_* used for attribution and partner pricing on the quotes the widget creates.
countryCodenoISO-3166 alpha-2 country code to pre-filter eligible options.
partnerIdnoPartner identifier for attribution.
callbackUrlnoURL the widget redirects to after the user successfully creates the transaction.
walletAddressLockednoLock the destination wallet address in the widget UI so the user cannot edit it.
Vortex validates the route on session creation by attempting to create a probe quote with the supplied parameters; invalid combinations return 400.
Response: 201 Created
{ "url": "https://widget.vortexfinance.co/?externalSessionId=my-session-id&rampType=BUY&network=polygon&inputAmount=150&fiat=BRL&cryptoLocked=USDC&paymentMethod=pix" }

Which Mode Goes With Which Fields#

If you have a quoteIdUse Mode A (Fixed Quote). Do not include any auto-refresh route fields.
If you do not have a quoteIdUse Mode B (Auto-Refresh). You must include the route definition fields.
The request body shape is detected by the presence of quoteId. Mixing fields between the two modes is not supported.

Embed The Widget URL#

Open the returned URL in a popup, iframe, or top-level redirect.

Receiving Results#

Subscribe to widget events through webhooks using the session identifier:
{
  "url": "https://partner.example.com/vortex/webhook",
  "sessionId": "my-session-id",
  "events": ["TRANSACTION_CREATED", "STATUS_CHANGE"]
}
Webhook payloads include the sessionId so you can correlate events back to your externalSessionId.

When To Use The Widget#

ScenarioUse
Browser / mobile app, no trusted backendWidget
Trusted Node.js backend, custom UX@vortexfi/sdk
Trusted Python backendvortex-sdk-python
Other backend stacksDirect API (AI Agent Integration)

Modified at 2026-05-19 08:55:53
Previous
Webhooks
Next
BRL / KYC notes
Built with