Skip to content

Payment Claims

Dhali uses layer-2 blockchain payment channels to monetise APIs. A payment claim is a base64-encoded off-chain payment that authorizes Dhali to withdraw up to a certain amount from a payment channel.

API users can create these payments in different ways:


Methods of Generating Payment Claims

The Dhali Payment Terminal lets your end users create payment claims (i.e. “API keys”) directly from your site. You can embed it in your landing pages, dashboards, etc.

Basic embed example:

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

Query Parameters & Customization

You can control the behavior and context of the terminal by passing query parameters in the URL:

Parameter Description
uuids (Optional) A comma-separated list of API UUIDs. The terminal will show networks and instructions specific to those APIs.
(default) If omitted, it defaults to showing XRPL.MAINNET and generic instructions.

Example:

https://pay.dhali.io/?uuids=YOUR_API_UUID,ANOTHER_UUID

To install:

npm install dhali-js

Please visit dhali-js for usage examples.


To install:

pip install dhali-py

Please visit dhali-py for usage examples.