Layer 231
PaymentsGetOnrampLimits
Get the minimum and maximum purchase amounts, in both fiat and crypto, that an on-ramp provider accepts for a currency pair and payment method. Use it to validate the amount the user enters before calling payments. get Onramp Quote or payments. create Onramp Session.
method
payments.getOnrampLimits#80e851fd flags:# provider:string crypto_currency:string base_currency:string payment_method:flags.0?string = OnrampLimits;
Parameters
| Name | Type | Description |
|---|---|---|
| Provider | string | On-ramp provider ID, from payments. get Onramp Providers |
| CryptoCurrency | string | Cryptocurrency to buy, e. g. TON |
| BaseCurrency | string | Fiat currency to pay with, ISO 4217 code |
| PaymentMethod | flags.0?string | Payment method, as returned by payments. get Onramp Availability |
Returns
OnrampLimitsGogram Example
// paymentMethod is one of the methods listed by payments.getOnrampAvailability. providers, _ := client.PaymentsGetOnrampProviders("TON") limits, err := client.PaymentsGetOnrampLimits(providers[0].ID, "TON", "USD", paymentMethod) if err != nil { log.Fatal(err) } fmt.Println("USD:", limits.BaseMinAmount, "-", limits.BaseMaxAmount) fmt.Println("TON:", limits.CryptoMinAmount, "-", limits.CryptoMaxAmount)