Skip to content

Overview

Any HTTPS API can be linked to Dhali.

Requirements:

  1. An HTTPS base URL + a header secret allowing your server to authenticate requests from Dhali,
  2. An XRP Ledger or Xahau wallet.

Linking your API

  1. Click here: API portal
  2. Link your wallet.
  3. Go to "My APIs", click "Monetise my API".
  4. A template API is now in your "My APIs" page; click it. You will now need to configure your API.
  5. After editing your new API, give your users the URL from the bottom of your API's page so they can pay using nano-payments. See here for more information on creating nano-payments to use your API.

Add the payment terminal

You can allow your users to create API keys right from your landing page using the payment terminal: https://pay.dhali.io/.

This button gives you access to it:

Pay with Dhali

Use the following code in your website to embed this button as a pop-out window:

<button onclick="openDhaliPaymentDialog()">Pay with Dhali</button>
<script>
    function openDhaliPaymentDialog() {
        var myWindow = window.open("https://pay.dhali.io/", "MsgWindow", "width=500,height=500");
        myWindow.focus();
    }
</script>

Customizing the Payment Terminal

The payment terminal accepts the following query parameters, allowing you to customize the instructions and behavior for your API. Check out our examples here. This means you can:

  1. Provide users with clear instructions tailored to your API.
  2. Control which networks or protocols users can use for payments.
Parameter Description
uuids
Note: Your API's uuid is embedded in its base URL
(Optional) A comma-separated list of the UUIDs of your APIs. The payment terminal will display the payment networks for these APIs and provide custom instructions for these APIs.
Default Behavior If no uuids parameter is provided, the payment terminal defaults to XRPL.MAINNET and default instructions.