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. Collect payment details
  • 2 - Initialize the transaction
  • 3. Verifying the transaction status
  • 4. Receive confirmation via webhook
  1. Crypto On-ramp

Full-page checkout

Hosted pages

PreviousWidget Pop-upNextGet Limits

Last updated 1 year ago

This allows you to redirect your users to a separate fiat on-ramp checkout page.

With the Checkout Redirect option, you can access the LocalRamp payment gateway by making a request from your server to our . We would return a response that includes a Checkout URL that loads the payment page where your users can purchase crypto. After payment is completed or canceled, the customer is returned to any URL specified by you.

1. Collect payment details

Collect payment/purchase details from your user. These details are passed to the .

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

Optional e.g "customer@example.com"

sender_currency

String

Optionally Required - The currency your user would be paying in. It becomes required only if sender_amount or receiver_amount is provided. e.g "NGN"

country_code

String

Optionally Required - The country_code of the user paying in. It becomes required only if sender_currencyis provided. e.g "NG", "KE", "GH", "ZM"

receiver_currency

String

Optionally Required - The cryptocurrency that would be received. It becomes required only if sender_amount , receiver_amount or destination_address is provided. e.g "USDT_BSC"

sender_amount

String

Optional - amount your user would be paying in sender_currency unit. e.g "20000.00". If this is present, then receiver_amount should be omitted

receiver_amount

String

Optional - crypto amount that should be received in receiver_currency unit. e.g "0.78728772". If this is present, then sender_amount should be omitted

destination_address

String

Optional - crypto address where payments will be sent to. e.g "0xC637255611b0A70259722c35D419077Da4cACcfF"

destination_tag

String

Optionally required - For coins that require a memo or tag. It is only required if address provided supports tags/memos e.g "3239783255"

payment_method

String

widget_color

String

Optional - Hex color code to customize widget e.g "#DA70D6"

callback_url

String

Optional - The url to redirect your users to, when the transaction is complete

You can pass either the sender_amount or receiver_amount when initializing the widget but not both.

Before passing in either the sender_amount or receiver_amount, you'll need to know the maximum and minimum values allowed for each field. See .

2 - Initialize the transaction

After collecting the necessary payment details for the transaction. Make a POST request to our initiate buy endpoint.

https://api.localramp.co/v1/transaction/buy/initiate

With the following header

x-auth-token: <SECRET_KEY>

This endpoint is protected by secret key authentication. So when calling it, append the x-auth-token header with your secret key.

If the API call is successful, LocalRamp returns the following response:


{
    "status": "success",
    "msg": "Transaction(buy) initiated successfully",
    "data": {
        "reference": "your-unique-reference",
        "checkout_link": "https://checkout.localramp.co/bTYUBjkns"
    }
}

You should then redirect your user to the Checkout URL provided in the response to enable them to complete their payment.

You can also choose to open the checkout link in an iframe

<iframe src="https://checkout.localramp.co/bTYUBjkns" frameborder="0" width="350" height="500" allow="clipboard-read; clipboard-write self *"></iframe>

Once the purchase is complete or the checkout is closed, LocalRamp will redirect your user to your specified callback_url.

3. Verifying the transaction status

The transaction reference will be appended as a query parameter to your callback_url as well.

https://website_callback_url/?reference=YOUR_REFERENCE

In a situation where no callback_url is passed, the user will be redirected to your business website.

4. Receive confirmation via webhook

Optional - Specify a particular e.g instant_p2p

To get the list of supported currencies and country codes for both sender_currency and receiver_currency see the

sender_amount and receiver_amount show payment intent and does not guarantee the exact value that would be received at the end of the transaction. To see the exact amounts received, .

This endpoint takes the as the request body.

You can now verify the status of the transaction. See

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

Get currencies section
get transaction state
verify section
webhook section
limit section
initiate buy endpoint
initiate buy endpoint
payment details
payment method