Sponsorship API

dropless pays the XRP reserves and fees for accounts and transactions your users produce on the XRP Ledger, so they never need to hold XRP themselves. This is a reference for the public sponsor-api - the endpoints your backend calls from server-side code, authenticated with an API key minted in the dropless dashboard.

Overview

There are two active flows today. Both live under /v1/sponsor/:

Two recover endpoints return credits to your bucket when a sponsored obligation is dissolved on-chain. The refund is a configurable fraction of the original cost (funding.refund_ratio_bps, default 50 %):

TypeScript SDK

The @dropless/sdk package is a first-party wrapper over the endpoints below. It ships typed request / response models, automatic retries with jitter (429 / 5xx / network), and drop-in adapters for xrpl.js and xrpl-connect. Every code example on this page has a TypeScript SDK variant - flip the toggle above any example to switch between the SDK and raw cURL.

npm install @dropless/sdk
# for the xrpl.js / xrpl-connect adapters:
npm install xrpl ripple-binary-codec
import { createClient } from "@dropless/sdk";

const dropless = createClient({
  baseUrl: "https://your-dropless-host",
  apiKey: process.env.DLS_API_KEY!,
  defaultNetwork: "devnet", // optional
});

Full README with every option (retries, timeouts, custom fetch, error taxonomy, xrpl-connect adapter) ships with the package on npm and lives at packages/sdk-js/README.md in the repo.

Authentication

Every request must carry an API key. Two shapes are accepted; pick whichever is easier for your client:

Keys look like dls_dev_<8 chars prefix><32 chars secret>. The dev segment matches the deployment environment (dev / staging / prod). Both parts are case-sensitive.

Rotate a key by minting a new one from the dashboard's API Keys tab and revoking the old one. Revocation is instant and immediately rejects any in-flight requests still carrying the old key.

Networks

The network field on every request selects which XRPL to target. Three values are accepted:

Value XRPL endpoints XLS-68 (Sponsor) status
testnet s.altnet.rippletest.net RPC/WS. Faucet: faucet.altnet.rippletest.net. Amendment status varies; check the current activation table.
devnet s.devnet.rippletest.net RPC/WS. Faucet: faucet.devnet.rippletest.net. Active. Recommended for integration development today.
mainnet s1.ripple.com RPC/WS. Not yet activated. Sponsor operations will tel*-reject on submission until the amendment lands.

Each project independently enables or disables networks (Settings tab). Requests to a disabled network fail fast with network_disabled.

The BFF also checks XLS-68 activation on every network at boot (and refreshes every 30 minutes). If the amendment isn't live on a given network, that network is locked in project settings and paid Buy CTAs are hidden. See Network status for how to read this from your integration.

Errors

Every non-2xx response has this shape:

{
  "error": {
    "code": "policy_denied",
    "message": "no enabled policy admits this transaction",
    "trace_id": "3cfaff49-a458-486e-8c87-ac64a3b51d63"
  }
}

trace_id ties the response to the sponsor-api log entry. Include it in any support request.

HTTP Code Meaning
400 bad_request Malformed body, unknown field, unparseable r-address, etc.
400 network_disabled The target network isn't enabled on this project.
401 unauthenticated Missing, malformed, or revoked API key.
402 insufficient_credits_bucket Not enough credits in the target bucket for the requested operation. Top up (or wait for the free-plan grant to land).
403 ip_forbidden Request source IP isn't in the project's IP whitelist.
403 policy_denied No enabled policy admits this transaction. Check the Policies tab.
429 rate_limited Per-project or per-key RPS ceiling exceeded. Retry with backoff. The scope field in the message tells you which bucket tripped.
500 internal Signing, submission, RPC, or database failure. Consult ops with the trace_id.

Credit system

Every sponsor-api operation debits credits from your project's billing entity. Credits are separated into two buckets so ops with fundamentally different on-chain costs are metered independently:

Default credit costs (identical on testnet, devnet, and mainnet):

Operation Bucket Credits
create_account account_reserve 1,000,000
reserve_object other_reserve 200,000
fee_only other_reserve 100

Credit values are pegged 1:1 to XRPL drops (1 credit = 1 drop). A create_account op charges 1,000,000 credits and locks exactly 1,000,000 drops of reserve on the sponsor address - so your credit balance and your on-chain spendable balance can never diverge. If credits pass the preflight, the on-chain check passes too; you'll never see "credits left but insufficient funds".

Every successful response includes credits_charged and credits_remaining_bucket so you can display the remaining balance to your users or trigger a top-up before it hits zero.

On submit failure (rippled rejects the tx locally), credits are automatically refunded to the same bucket in a separate transaction. You will not be charged for a tx that never reached the ledger.

Rate limits

Each project has two RPS caps, tunable in the Settings tab:

Requests exceeding either cap return rate_limited with a Retry-After header (in seconds). Buckets are per-key and per-project; a single client hammering the whitelist route won't starve your sponsor-api traffic.

Free plan

The first five projects on a personal billing entity that enable at least one non-mainnet network receive:

Free-plan status is decided once at project creation. Once you top up on mainnet, new projects created after top-up are paid-plan with the higher RPS ceilings.

POSTSponsor an account (Mode A)

POST /v1/sponsor/create-account

Dropless funds a fresh r-address by sending a Payment from the project's sponsor address, tagged with the XLS-68 tfSponsorCreatedAccount flag. Debits the account_reserve bucket.

Request

Field Type Required Description
network string yes One of testnet, devnet, mainnet. Must be enabled on the project.
destination string yes The r-address of the account to create. Must be a valid classic address, not pre-existing on the ledger.
amount_drops string no Additional drops to send with the Payment (in addition to the base reserve). Defaults to "1".

Response

Field Type Description
sponsored_transaction_id uuid Internal id - join key for the sponsored_transactions log.
network string Echo of the request field.
sponsor_address string The r-address that paid the reserve.
destination string Echo of the request field.
amount_drops string Drops actually sent.
submit_tx_hash string The XRPL transaction hash. Look it up on an explorer to see the funding tx.
engine_result string rippled's preliminary result (typically tesSUCCESS).
credits_charged int Credits deducted from account_reserve.
credits_remaining_bucket int New account_reserve balance after this debit.

Example

import { createClient } from "@dropless/sdk";

const dropless = createClient({
  baseUrl: "https://your-dropless-host",
  apiKey: process.env.DLS_API_KEY!,
});

const res = await dropless.sponsorCreateAccount({
  network: "devnet",
  destination: "rNWbvi8pJxfh3pG5ddDJNimRon94fRWEDx",
});

console.log(res.submit_tx_hash, res.credits_remaining_bucket);
curl -X POST https://your-dropless-host/v1/sponsor/create-account \
  -H "Authorization: Bearer $DLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "devnet",
    "destination": "rNWbvi8pJxfh3pG5ddDJNimRon94fRWEDx"
  }'
{
  "sponsored_transaction_id": "01a09506-a116-721c-be6f-a6bfd8df2e2a",
  "network": "devnet",
  "sponsor_address": "rfmDRhoEcT5FiT6KiGHPjyGUFhkmZXPMK2",
  "destination": "rNWbvi8pJxfh3pG5ddDJNimRon94fRWEDx",
  "amount_drops": "1",
  "submit_tx_hash": "E5C70591549669EA58B87D0F8D4AAC6F4D2ECEAB15AA286CE729C6BA937CC7DB",
  "engine_result": "tesSUCCESS",
  "credits_charged": 1000,
  "credits_remaining_bucket": 499000
}

engine_result is preliminary. A tesSUCCESS here means rippled has admitted the tx to the ledger's open set; final validation may take one or two ledger closes (~4-8 seconds). Poll the tx hash on tx RPC if you need a definitive validated confirmation.

POSTCo-sign a customer transaction (Mode B)

POST /v1/sponsor/cosign

Your user signs an unsigned XRPL transaction (any type in RESERVE_SPONSORABLE_TX_TYPES: TrustSet, OfferCreate, EscrowCreate, CheckCreate, etc.), and dropless attaches a SponsorSignature that pays the fee and, where applicable, the owner reserve.

Debits other_reserve. Bucket cost depends on whether the tx type reserves an owner object: reserve_object (250) for reserve-carrying types, fee_only (10) otherwise.

Request

Field Type Required Description
network string yes Target network, as in Mode A.
unsigned_tx object yes The XRPL transaction JSON your user has prepared. Must include Account, Fee, Sequence, Sponsor (set to the project's sponsor r-address), and SponsorFlags per XLS-68. Must NOT include SponsorSignature - we produce that.

Response

Returns the sponsor signature blob. Attach it as the tx's SponsorSignature field, then submit the tx yourself from your user's side.

{
  "sponsored_transaction_id": "01a09507-...-...",
  "network": "devnet",
  "sponsor_address": "rfmDRhoEcT5FiT6KiGHPjyGUFhkmZXPMK2",
  "sponsor_signature": {
    "SigningPubKey": "ED...",
    "TxnSignature": "..."
  },
  "credits_charged": 250,
  "credits_remaining_bucket": 499750
}

Example

import { createClient, cosignAndSign } from "@dropless/sdk";
import { xrplWalletSigner } from "@dropless/sdk/signers/xrpl";
import { Client, Wallet } from "xrpl";
import { decode } from "ripple-binary-codec";

const dropless = createClient({
  baseUrl: "https://your-dropless-host",
  apiKey: process.env.DLS_API_KEY!,
});

const xrpl = new Client("wss://s.devnet.rippletest.net:51233");
await xrpl.connect();

const wallet = Wallet.fromSeed(userSeed);
const signer = xrplWalletSigner({ wallet, decode });

// Autofill Sequence, Fee, LastLedgerSequence - and NetworkID where
// the target network requires it (e.g. sidechains).
const unsignedTx = await xrpl.autofill({
  TransactionType: "TrustSet",
  Account: wallet.classicAddress,
  Sponsor: "rfmDRhoEcT5FiT6KiGHPjyGUFhkmZXPMK2",
  SponsorFlags: 2, // spfSponsorReserve
  LimitAmount: { currency: "USD", issuer: "rISSUER...", value: "1000" },
});

// Ask dropless to co-sign, then sign on the user side.
const { signedTx, cosign } = await cosignAndSign({
  client: dropless,
  network: "devnet",
  signer,
  unsignedTx,
});

const result = await xrpl.submitAndWait(signedTx);
console.log(result.result.hash, cosign.credits_remaining_bucket);
curl -X POST https://your-dropless-host/v1/sponsor/cosign \
  -H "Authorization: Bearer $DLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "devnet",
    "unsigned_tx": {
      "TransactionType": "TrustSet",
      "Account":      "rSPONSEE...",
      "Sponsor":      "rSPONSOR...",
      "SponsorFlags": 2,
      "LimitAmount":  { "currency": "USD", "issuer": "rISSUER...", "value": "1000" },
      "Fee":          "12",
      "Sequence":     5
    }
  }'
Why the sponsor tx isn't submitted for you. In Mode B the user's account is the primary signer, so the user (or their client) needs to hold the assembled tx and submit it. If your product prefers a server-side submit, submit it yourself after attaching the sponsor signature.

POSTRelease an account

POST /v1/sponsor/release-account

Submits an AccountDelete your user has signed on a previously-sponsored r-address. The XRPL amendment decrements the sponsor's SponsoringAccountCount, returning the 1 XRP base reserve to your project's sponsor address. On tesSUCCESS, dropless credits your account_reserve bucket with credit_costs.create_account × funding.refund_ratio_bps / 10_000 (default 500,000 credits per released account, i.e. 50 % of the 1,000,000-credit create-account cost).

Request

Field Type Required Description
network string yes Target network. Must be enabled on the project.
signed_tx object yes Fully-signed AccountDelete transaction JSON. Must include TxnSignature + SigningPubKey. TransactionType = "AccountDelete". Destination must equal the project's sponsor address on the requested network - no other destination is accepted (the reserve must flow back to dropless for the refund to be honored).

Response

Field Type Description
sponsored_transaction_id uuid Row in the sponsored_transactions log, mode = release_account.
sponsor_address string r-address that recovered the reserve.
deleted_account string The r-address that was deleted.
submit_tx_hash string XRPL transaction hash for the AccountDelete.
engine_result string tesSUCCESS on the happy path.
credits_refunded int Credits added to account_reserve.
credits_remaining_bucket int New account_reserve balance after the refund.

Example

import { signAndReleaseAccount } from "@dropless/sdk";
import { xrplWalletSigner } from "@dropless/sdk/signers/xrpl";
import { Client, Wallet } from "xrpl";
import { decode } from "ripple-binary-codec";

const xrpl = new Client("wss://s.devnet.rippletest.net:51233");
await xrpl.connect();

// Sponsee wallet - the customer's user whose account is being deleted.
const wallet = Wallet.fromSeed(sponseeSeed);
const signer = xrplWalletSigner({ wallet, decode });

const accountDelete = await xrpl.autofill({
  TransactionType: "AccountDelete",
  Account: wallet.classicAddress,
  Destination: "rfmDRhoEcT5FiT6KiGHPjyGUFhkmZXPMK2", // sponsor address
});

const res = await signAndReleaseAccount({
  client: dropless,
  network: "devnet",
  signer,
  accountDelete,
});

console.log("refunded", res.credits_refunded, "credits");
curl -X POST https://your-dropless-host/v1/sponsor/release-account \
  -H "Authorization: Bearer $DLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "devnet",
    "signed_tx": {
      "TransactionType": "AccountDelete",
      "Account":       "rSPONSEE...",
      "Destination":   "rSPONSOR...",
      "Fee":           "2000000",
      "Sequence":      42,
      "SigningPubKey": "ED...",
      "TxnSignature":  "..."
    }
  }'
XRPL constraints on AccountDelete:
  • The account must own zero non-default ledger objects. Release TrustLines / offers / escrows first via release-trustline.
  • At least 256 ledger indexes must have passed since the account was last modified. Otherwise rippled returns tecTOO_SOON.
  • The AccountDelete fee is a minimum of 2 XRP on mainnet, paid by the sponsee. dropless only recovers the base reserve on the sponsor side.

POSTRelease a TrustLine

POST /v1/sponsor/release-trustline

Submits any signed owner-object dissolution - decrementing the sponsor's SponsoredOwnerCount and returning the 0.2 XRP owner reserve. On tesSUCCESS, dropless credits your other_reserve bucket with credit_costs.reserve_object × funding.refund_ratio_bps / 10_000 (default 100,000 credits per released owner-object).

Accepted transaction types

TransactionTypeExtra validation
TrustSet LimitAmount.value must be "0". Other flags on the tx are passed through to rippled untouched.
OfferCancel None - every OfferCancel is a dissolution.
CheckCancel None.
EscrowCancel None.

Request

Field Type Required Description
network string yes Target network.
signed_tx object yes Fully-signed dissolution transaction JSON (see table above for accepted types). Must include TxnSignature + SigningPubKey.

Response

Same shape as release-account, plus a tx_type string field echoing the dissolution transaction type (helpful when your integration handles multiple release paths through one code path).

Example (TrustSet)

import { signAndReleaseDissolution } from "@dropless/sdk";
import { xrplWalletSigner } from "@dropless/sdk/signers/xrpl";
import { decode } from "ripple-binary-codec";

const signer = xrplWalletSigner({ wallet, decode });

// Any owner-object dissolution works: TrustSet (LimitAmount=0),
// OfferCancel, CheckCancel, EscrowCancel. Here: dissolve a TrustLine.
const dissolveLine = await xrpl.autofill({
  TransactionType: "TrustSet",
  Account: wallet.classicAddress,
  LimitAmount: { currency: "USD", issuer: "rISSUER...", value: "0" },
});

const res = await signAndReleaseDissolution({
  client: dropless,
  network: "devnet",
  signer,
  dissolutionTx: dissolveLine,
});

console.log(res.tx_type, "→ refunded", res.credits_refunded);
curl -X POST https://your-dropless-host/v1/sponsor/release-trustline \
  -H "Authorization: Bearer $DLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "network": "devnet",
    "signed_tx": {
      "TransactionType": "TrustSet",
      "Account":       "rSPONSEE...",
      "LimitAmount":   { "currency": "USD", "issuer": "rISSUER...", "value": "0" },
      "Fee":           "12",
      "Sequence":      43,
      "SigningPubKey": "ED...",
      "TxnSignature":  "..."
    }
  }'
Refund invariant: credit refunds are strictly less than the original cost (default 50 %). The remainder covers dropless's on-chain fee outlay + operational overhead. See Credit system for the 1-credit-1-drop peg that keeps credit balances and sponsor spendable in lockstep.

Address whitelist

Optional per-project allow-list of destination r-addresses. When enabled (Settings tab toggle), sponsor-api requests targeting an address not on the list are rejected with policy_denied. Useful for high-value flows where the set of legitimate destinations is known ahead of time.

POST Add addresses

POST /v1/whitelist/addresses

await dropless.whitelistAdd({
  add: ["rN7n7...", "rAlice..."],
});
curl -X POST https://your-dropless-host/v1/whitelist/addresses \
  -H "Authorization: Bearer $DLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "add": ["rN7n7...", "rAlice..."]
  }'

Response: { "inserted": N, "removed": 0, "cleared": false, "total_after": M }. Duplicates are ignored (idempotent).

DELETE Remove addresses

DELETE /v1/whitelist/addresses

await dropless.whitelistRemove({
  remove: ["rN7n7..."],
});
curl -X DELETE https://your-dropless-host/v1/whitelist/addresses \
  -H "Authorization: Bearer $DLS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "remove": ["rN7n7..."]
  }'

GET List addresses

GET /v1/whitelist/addresses?cursor=<opaque>

Paginated: response contains addresses (array of r-addresses) and next_cursor (opaque string or null). Follow the cursor until it's null.

let cursor: string | undefined;
do {
  const page = await dropless.whitelistList({ cursor, limit: 1000 });
  console.log(page.addresses);
  cursor = page.next_cursor ?? undefined;
} while (cursor);
curl -G https://your-dropless-host/v1/whitelist/addresses \
  -H "Authorization: Bearer $DLS_API_KEY" \
  --data-urlencode "limit=1000"

Network status

A public read on which XRPL networks are ready for sponsor operations. The BFF calls rippled's feature RPC at boot and every 30 minutes; a network shows up as xls68_active: false until the amendment activates. Frontends use this to hide mainnet CTAs before activation.

GET Network status

GET /api/network-status         # no auth

Response

{
  "mainnet": { "xls68_active": false },
  "testnet": { "xls68_active": false },
  "devnet":  { "xls68_active": true  }
}

Fail-closed: on RPC error or timeout the network is reported as inactive. Buy buttons and project-creation toggles for a network are gated on this flag.

Buy credits

Paid packs are sold via Stripe Checkout Sessions. All packs grant mainnet credits (with a 10× bonus on testnet); the endpoint refuses to create a session while mainnet.xls68_active = false.

POST Create checkout session

POST /api/billing/checkout
Cookie: dropless_session=…             # dashboard session, not an API key

Body

{
  "billing_entity_id": "01a094ec-…",
  "plan_id":           "01H9G2X…"
}

Response

{
  "checkout_url": "https://checkout.stripe.com/pay/cs_test_…",
  "session_id":   "cs_test_…",
  "topup_id":     "01…-…"
}

Redirect the browser to checkout_url. Stripe returns the user to [stripe].success_url on success (with ?session_id={CHECKOUT_SESSION_ID} appended) or cancel_url on abort.

Errors: 400 checkout_locked - mainnet XLS-68 not active; 400 plan purchase cap reached - PoC-style plans have a 3/year cap; 400 plan has no Stripe price configured - operator hasn't wired [stripe.prices].

Credits are granted on the checkout.session.completed webhook (one-time packs) or invoice.paid webhook (recurring). Idempotent via UNIQUE indexes on topups.stripe_session_id and topups.stripe_invoice_id.

Subscriptions

GET List active subscriptions

GET /api/billing/subscriptions?billing_entity_id=…
Cookie: dropless_session=…

Response

[
  {
    "id":                     "01…",
    "plan_id":                "01H9G2X…",
    "stripe_subscription_id": "sub_…",
    "status":                 "active",
    "current_period_end":     "2026-10-13T09:06:19Z",
    "cancel_at":              null
  }
]

POST Cancel at period end

POST /api/billing/subscriptions/{id}/cancel
Cookie: dropless_session=…

Instructs Stripe to end the subscription at the current period end. Response is a 204 No Content. Credits already granted don't expire; the customer just stops receiving new monthly grants. Cancellation is reflected in the local mirror when the customer.subscription.updated webhook arrives; the UI eagerly shows status: "canceling" to bridge that gap.

dropless docs · reload the container after editing docker/docs/html/