# DeFi Checkout

XendBridge also provides a quicker way to integrate using our Defi Checkout where you get to make an order request only by sending the parameters via URL.

In order to make the request, you must already have an [account](/get-started.md) and [setup](/get-started.md#dashboard-walkthrough). Below is the web page url and parameters that contain required and optional ones needed to redirect your users.

## \&payIn=NGN\&payInNetwork=LOCAL\&receiveIn=BUSD\&receiveInNetwork=BEP20\&amt=50\&sign=signature

<mark style="color:blue;">`GET`</mark> `https://checkout-staging.xendbridge.com/transaction?pk={yourPK}&wallet={walletAddress}&allowEdit=false&id={newUuid}&orderType=buy`

#### Query Parameters

| Name                                        | Type   | Description                                                                              |
| ------------------------------------------- | ------ | ---------------------------------------------------------------------------------------- |
| pk<mark style="color:red;">\*</mark>        | string | {publicKey}                                                                              |
| id<mark style="color:red;">\*</mark>        | uuid   | 3fa85f64-5717-4562-b3fc-2c963f66afa6                                                     |
| payIn                                       | string | NGN                                                                                      |
| payInNetwork                                | string | LOCAL                                                                                    |
| receiveIn                                   | string | BUSD                                                                                     |
| receiveInNetwork                            | string | BEP-20                                                                                   |
| amt                                         | int    | 50                                                                                       |
| wallet<mark style="color:red;">\*</mark>    | string | 0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd                                               |
| sign<mark style="color:red;">\*</mark>      | uuid   | 2JI8dgtm3ZiynG6rige5z0JErd7JVadbgZzY2CvVu1/T1iAZEEDIjQbQ9k2SjomlMcnuGVadS1/fx7NCvPw91Q== |
| allowEdit<mark style="color:red;">\*</mark> | bool   | false                                                                                    |
| orderType<mark style="color:red;">\*</mark> | string | Buy                                                                                      |

<details>

<summary>Example Web URL Order</summary>

```url
https://checkout-staging.xendbridge.com/transaction?pk=XLPUK_95BAFDA4E7874C7CB9A3A0CBFF08CB90
&wallet=0x52434Ac4BE04393e020c9b16C327d04d4367Cbcd
&allowEdit=false&id=1fa85f62-5717-4562-b3fc-2c963f66afa6
&orderType=buy&payIn=NGN&payInNetwork=LOCAL
&receiveIn=BUSD&receiveInNetwork=BEP20&amt=1500
&sign=signature
```

</details>

#### Generating Signature

In order to generate the signature needed to verify the order being made, you'd have to generate a signature hash using the following data:

```csharp
string data = $"{yourApp.SecretKey}{yourApp.PublicKey}
{model.WalletAddress}{model.AllowEdit}{model.RequestId}";
```

The Hash Algorithm is ***sha512*** and the output should be in hexadecimal;

```csharp
byte[] hashBytes = sha512Hash(data);

string hashInHexFormat = ConvertByteToHexString(hashBytes);
```

{% hint style="info" %}
`{model.AllowEdit}` is a bool property which indicates whether the user can edit the order after being redirected by the web url order.
{% endhint %}

Use any library or implementations to your liking to achieve the above before passing the value as the **sign** on the URL.

After this is done, your users are redirected to our portal to continue with registration/login and finish the order request.

See [Checkout URL](/xendbridge-portal/checkout-url.md#environments) for the base urls of the different environments.


---

# 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://doc.xendbridge.com/xendbridge-portal/defi-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.
