Comment on page
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 initiate buy endpoint. 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.
Please find below the request body for the endpoint.
You can pass either the
receiver_amountwhen initializing the widget but not both.
receiver_amountshow 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, get transaction state.
After collecting the necessary payment details for the transaction. Make a POST request to our initiate buy endpoint.
With the following header
This endpoint is protected by secret key authentication. So when calling it, append the
x-auth-tokenheader with your secret key.
If the API call is successful, LocalRamp returns the following response:
"msg": "Transaction(buy) initiated successfully",
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
The transaction reference will be appended as a query parameter to your
In a situation where no
callback_urlis passed, the user will be redirected to your business website.
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 webhook section.