---
title: "Generate an Onramper widget URL"
method: POST
path: "/api/v1/onramper/generate-widget-url"
tags: ["onramper"]
---

# Generate an Onramper widget URL

`POST /api/v1/onramper/generate-widget-url`

## Request

- Base URL: `https://swap-backend.stage.defi.ovh.gala.com`
- URL: `https://swap-backend.stage.defi.ovh.gala.com/api/v1/onramper/generate-widget-url`
- Auth: none declared
- TypeScript: <https://skmtc.dev/gala/apis/gala-defi-backend-api/docs/api/v1/onramper/generate-widget-url/post.ts> (a function with typed inputs; its response is checked against the schema)

Creates a widget URL for the requested wallet and payment configuration.

## Request body

- GenerateWidgetUrlDto
  - `walletAddress` string, required: Wallet receiving the purchased or swapped crypto.
  - `mode` 'buy' | 'sell' | 'swap': Widget transaction mode.
  - `defaultFiat` string: Fiat currency code.
  - `defaultAmount` number: Default fiat amount.
  - `sellDefaultAmount` number: Default crypto amount for sell mode.
  - `onlyCryptoNetworks` string: Allowed crypto network identifiers.
  - `defaultPaymentMethod` string: Default payment method.
  - `defaultCrypto` string: Default crypto ticker.
  - `onlyPaymentMethods` string: Allowlisted payment methods.
  - `excludePaymentMethods` string: Payment methods excluded from the widget.
  - `onlyFiat` string: Allowlisted fiat currencies.
  - `excludeFiat` string: Fiat currencies excluded from the widget.
  - `isAddressEditable` string: Whether the user can edit the wallet address, encoded as a string.
  - `networkPrefix` string: Onramper network prefix.

## Response `200`

Widget URL generated.

- GenerateWidgetUrlResponseDto
  - `status` number, required
  - `error` boolean, required
  - `message` string, required
  - `data` GenerateWidgetUrlDataDto, required
    - `url` string, required

## Other responses

- `default`: An error response using the shared backend error envelope.

---

[API](https://skmtc.dev/gala/apis/gala-defi-backend-api.md) - [All operations](https://skmtc.dev/gala/apis/gala-defi-backend-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gala/apis/gala-defi-backend-api/revisions/84f8184e2828?raw)
