Skip to main content

Locking fields

This page is for developers who want their users to land in the onramp’s widget with specific fields pre-filled and non-editable. Some service providers support locking the token and wallet address fields within their widgets. To do this, pass the lockFields parameter to the POST /crypto/session/widget endpoint with one or both of destinationCurrencyCode/sourceCurrencyCode (depending on buy vs sell flow) and walletAddress. The table below shows which service providers support locking which fields. Here’s a sample buy request with both the token and wallet address fields locked:
{
    "sessionData": {
        "walletAddress": "2N3oefVeg6stiTb5Kh3ozCSkaqmx91FDbsm",
        "countryCode": "US",
        "sourceCurrencyCode": "USD",
        "sourceAmount": "100",
        "destinationCurrencyCode": "USDC",
        "serviceProvider": "TRANSAK",
        "lockFields": ["destinationCurrencyCode","walletAddress"]
    },
    "externalCustomerId": "test1",
    "externalSessionId": "test1"
}