Skip to main content
The payment flow is the recommended approach for handling payments in OnDB. The SDK automatically manages the entire payment process.

How It Works

Basic Implementation

Payment Quote Structure

The quote object passed to your callback contains:

Callback Return Value

Your callback must return a payment result:

Payment Result

Wait for Confirmation Options

With Confirmation (Blocking)

Waits for blockchain confirmation before returning:

Without Confirmation (Non-Blocking)

Returns immediately with a task ticket:

Payment Callback Example

Error Handling

Next Steps

PriceIndex

Value-based payment model

Paid Reads

HTTP 402 for read operations