LocalRamp API Documentation
  • Introduction
  • Getting Started
  • Crypto On-ramp
    • Overview
    • Widget Pop-up
    • Full-page checkout
    • Get Limits
    • Get Supported currencies
    • Get Quote
    • List Payment Methods
    • Get Transaction State
  • CRYPTO OFF-RAMP
    • Overview
    • Direct API Sell
      • Instant Sell
      • Get Transaction State
      • Get Limits
      • Get Supported Currencies
      • Get Supported Payment Methods
      • Get Supported Banks
      • Get Crypto Balance
      • Get Rates
      • Verify Bank Account
    • Widget Sell
      • Full-page checkout
      • Widget Pop-up
      • Get Limits
      • Get Quote
      • Get Supported currencies
      • Get Supported Payment Methods
      • Get Transaction State
  • PAYMENTS ON-RAMP
    • Overview
    • Full-page checkout
    • Widget Pop-up
    • White-Label API (Direct Charge)
    • Rates and Fees
    • Get Limits
    • Get Supported Currencies
    • Get Supported Payment Method
    • Withdraw crypto
    • Verify crypto withdrawal
    • Verify transaction
    • Get USDT balance
    • KYC
      • BVN Verification
      • Send OTP
  • Institutional Onramp (>$100k)
    • Overview
    • Initiate transaction
    • Complete transaction
    • Fetch transation
    • Exchange Rate
  • CRYPTO SWAPS
    • Overview
    • Instant Swap
    • Get Transaction State
    • Get Limits
    • Get Supported Currencies
    • Get Rates
  • Webhooks
    • Introduction
    • Verification
    • Events
  • TEST INTEGRATION
    • Simulate Webhooks
      • Fiat received (onramp)
      • Crypto Sent (onramp)
      • Sell completed (offramp)
      • Swap completed
    • Demo transaction
      • Example Completed Buy
      • Example Completed Sell (Bank Account)
      • Example Completed Sell (Mobile Money)
      • Example Completed Swap
Powered by GitBook
On this page
  • 1. Get your public key
  • 2. Add the pay-ins/collections script
  • 3. Verifying the transaction status
  • 4. Receive confirmation via webhook
  1. PAYMENTS ON-RAMP

Widget Pop-up

Crypto on-ramp on your website

PreviousFull-page checkoutNextWhite-Label API (Direct Charge)

Last updated 1 year ago

The widget product allows you to on-ramp your users without them leaving your website/app by just initiating a pop-up.

1. Get your public key

Get your from your dashboard

2. Add the pay-ins/collections script

<form>
    <script src="https://cdn.localramp.co/onramp-inline.js"></script>
    <button type="button" onclick="payWithLocalRamp()"> Pay </button>
</form>
<script>
    function payWithLocalRamp() {
        window.LocalRampPay.initialize({
            public_key: "pk_live_*********************",
            reference: "your-unique-reference",
            sender_currency: "NGN",
            email: "richard@piedpiper.com",
            usdt_amount: "2800.12",
            country_code: "NG",
            onClose: function (ref) {
              // Handle when the modal is closed
            },
        });
    }
</script>

Avoid exposing your secret key on the client side (or front end) of your application. Requests to LocalRamp's API should be initiated from your server.

Please find below the request body for the endpoint.

Field
Data Type
Description

reference

String

Required - Your unique transaction reference. Must be unique for every transaction. e.g "Abc123"

email

String

Required e.g "customer@example.com"

sender_currency

String

Required - The currency your user would be paying in. e.g "NGN"

country_code

String

Required - The country_code of the user paying in e.g "NG", "KE", "GH", "ZM"

usdt_amount

String

Required - usdt amount you want to receive e.g "200.00".

onClose

String

Optional - Gets called whenever the user closes the modal. This could be as a result of the transaction being completed or abandoned.

3. Verifying the transaction status

Once the modal is closed, the onClose function is called with the transaction reference

onClose(reference)

4. Receive confirmation via webhook

Before passing inusdt_amount, you'll need to know the maximum and minimum values allowed for a sender_currency. See

To get the list of supported currencies and country codes see the

This is the same reference used in initializing the widget which can now be used to verify the transaction. See

In some cases, the payout might take a few minutes to arrive. If you do not want to keep querying the transaction status, you can always get informed through webhooks when the transaction is complete. See .

public key
limit section.
Get currencies section
verify section
webhook section