Skip to content

Quickstart

Create your first payment request and redirect a customer to the pay page.


Before you start

  1. Create a DropPay account and start a Pro trial (required for API access)
  2. Add your XRP wallet address - Dashboard > Account > Wallet
  3. Copy your API key - Dashboard > API

14-day Pro trial

No payment needed to start. Upgrade to Pro from the dashboard.


Step 1 - Create a payment request

POST /payments/requests returns a pay_url to redirect your customer to.

create_payment.py
import requests

BASE = "https://droppayxrp.com"
API_KEY = "dp_live_your_api_key_here"

response = requests.post(
    f"{BASE}/payments/requests",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={
        "amount": 10.0,
        "currency": "XRP",
        "description": "Order #1234",
        "order_id": "order_1234",
        "redirect_url": "https://yoursite.com/payment-complete"
    }
)

payment = response.json()
print(payment["pay_url"])  # /pay/dp_xxxxxxxxxx
create_payment.js
const BASE = "https://droppayxrp.com";
const API_KEY = "dp_live_your_api_key_here";

const response = await fetch(`${BASE}/payments/requests`, {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${API_KEY}`,
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    amount: 10.0,
    currency: "XRP",
    description: "Order #1234",
    order_id: "order_1234",
    redirect_url: "https://yoursite.com/payment-complete"
  })
});

const payment = await response.json();
console.log(payment.pay_url);  // /pay/dp_xxxxxxxxxx

Response

{
  "request_id": "dp_xxxxxxxxxx",
  "amount": 10.0,
  "currency": "XRP",
  "status": "pending",
  "pay_url": "/pay/dp_xxxxxxxxxx",
  "verify_url": "/payments/dp_xxxxxxxxxx/verify",
  "destination_tag": 1827364550,
  "merchant_wallet": "rYourXRPLWalletAddress",
  "order_id": "order_1234",
  "expires_at": null,
  "created_at": "2026-07-14T12:00:00.000Z"
}

Step 2 - Redirect the customer

Redirect to https://droppayxrp.com + pay_url.

from flask import redirect

@app.route("/checkout")
def checkout():
    payment = create_payment(order_id="order_1234", amount=10.0)
    return redirect("https://droppayxrp.com" + payment["pay_url"])
app.get("/checkout", async (req, res) => {
  const payment = await createPayment({ orderId: "order_1234", amount: 10.0 });
  res.redirect("https://droppayxrp.com" + payment.pay_url);
});

The customer lands on the DropPay pay page and scans a QR code with Xaman or any XRPL wallet. Payment confirms within a few seconds.


Step 3 - Handle the return

After payment, the customer is redirected back to your redirect_url with these parameters:

Parameter Description
request_id DropPay payment ID (dp_xxxxxxxxxx)
tx_hash XRPL transaction hash
order_id The order_id you passed at creation

Warning

Do not fulfill the order based on the redirect. Always confirm via webhook before shipping or granting access.


Step 4 - Receive the webhook

Set up a webhook endpoint in Dashboard > API > Webhooks. DropPay sends a signed payment.confirmed event to your server when payment is detected on-chain.

webhook_handler.py
import hmac, hashlib, time
from flask import request, abort

WEBHOOK_SECRET = "your_webhook_secret"

@app.route("/webhook/droppay", methods=["POST"])
def droppay_webhook():
    timestamp = request.headers.get("X-DropPay-Timestamp", "")
    signature = request.headers.get("X-DropPay-Signature", "")
    body = request.get_data()

    if abs(int(time.time()) - int(timestamp)) > 300:
        abort(400)

    expected = "sha256=" + hmac.new(
        WEBHOOK_SECRET.encode(),
        timestamp.encode() + b"." + body,
        hashlib.sha256
    ).hexdigest()

    if not hmac.compare_digest(expected, signature):
        abort(400)

    event = request.json
    if event["event"] == "payment.confirmed":
        fulfill_order(event["data"]["order_id"])

    return "", 200
webhook.js
import crypto from "crypto";

const WEBHOOK_SECRET = "your_webhook_secret";

app.post("/webhook/droppay", express.raw({ type: "application/json" }), (req, res) => {
  const timestamp = req.headers["x-droppay-timestamp"];
  const signature = req.headers["x-droppay-signature"];

  if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) {
    return res.status(400).end();
  }

  const expected = "sha256=" + crypto
    .createHmac("sha256", WEBHOOK_SECRET)
    .update(timestamp + "." + req.body)
    .digest("hex");

  if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature))) {
    return res.status(400).end();
  }

  const event = JSON.parse(req.body);
  if (event.event === "payment.confirmed") {
    fulfillOrder(event.data.order_id);
  }

  res.status(200).end();
});

Full webhook reference: Webhooks →


Next steps