# Full-page checkout

This allows you to redirect your users to a separate payment checkout page.

With the Checkout Redirect option, you can access the LocalRamp payment gateway by making a request from your server to our [initiate checkout endpoint](#2-initialize-the-transaction). 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 [initiate checkout endpoint](#2-initialize-the-transaction).

Please find below the request body for the endpoint.

<table><thead><tr><th width="201">Field</th><th width="109">Data Type</th><th>Description</th></tr></thead><tbody><tr><td>reference</td><td>String</td><td><strong>Required</strong> - Your unique transaction reference. <em>Must be unique for every transaction</em>. e.g "Abc123"</td></tr><tr><td>email</td><td>String</td><td><strong>Required</strong> e.g "customer@example.com"</td></tr><tr><td>sender_currency</td><td>String</td><td><strong>Required</strong> - The currency your user would be paying in. e.g "NGN"</td></tr><tr><td>country_code</td><td>String</td><td><strong>Required</strong> - The country_code of the user paying in e.g "NG", "KE", "GH", "ZM"</td></tr><tr><td>usdt_amount</td><td>String</td><td><strong>Required</strong> - usdt amount you want to receive e.g "200.00". </td></tr><tr><td>callback_url</td><td>String</td><td><strong>Optional</strong> - The url to redirect your users to, when the transaction is complete</td></tr></tbody></table>

{% hint style="info" %}
Before passing in`usdt_amount`, you'll need to know the **maximum** and **minimum** values allowed for a `sender_currency`. See[ limit section.](/payments-on-ramp/get-limits.md)
{% endhint %}

{% hint style="info" %}
To get the list of supported currencies and country codes see the [Get currencies section](/payments-on-ramp/get-supported-currencies.md)
{% endhint %}

### 2 - Initialize the transaction

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

{% code overflow="wrap" %}

```
https://api.localramp.co/v1/transaction/pay/checkout
```

{% endcode %}

This endpoint takes the [payment details](#1.-collect-payment-details) as the request body.

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:

<pre class="language-javascript"><code class="lang-javascript"><strong>
</strong><strong>{
</strong>    "status": "success",
    "data": {
        "reference": "ref27",
        "checkout_link": "https://pay.localramp.co/too8909gY"
    }
}

</code></pre>

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

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

{% code overflow="wrap" %}

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

{% endcode %}

Once the purchase is complete or the checkout is closed, LocalRamp will redirect your user to your specified `callback_url`.&#x20;

### 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`

You can now verify the status of the transaction. See [verify section](/crypto-on-ramp/get-transaction-state.md)

In a situation where no `callback_url` is passed, the user will be redirected to your business website.&#x20;

### 4. Receive confirmation via webhook

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  [webhook section](/webhooks/introduction.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.localramp.co/payments-on-ramp/full-page-checkout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
