Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.privataswap.com/llms.txt

Use this file to discover all available pages before exploring further.

1. Get an API key

Sign up at dashboard.privataswap.com. You get two keys immediately:
  • pk_test_... — sandbox. Orders are flagged sandbox=1 and excluded from payouts.
  • pk_live_... — production. Orders count toward your revenue share.
Never ship pk_live_ keys in mobile or web bundles. The SDK enforces a runtime check and warns when a live key is used from a browser bundle.

2. Install the SDK

npm install @privata/wallet-api

3. Quote and create an order

import { Privata } from "@privata/wallet-api";

const privata = new Privata({ apiKey: process.env.PRIVATA_API_KEY! });

// 1. Get the best quote across 50+ providers.
const quote = await privata.estimate({
  from: "BTC",
  to: "XMR",
  amount: "0.05",
  side: "send",
});

// 2. Create the order.
const order = await privata.createOrder({
  quoteId: quote.quoteId,
  address: "4ABCxyz...",            // payout address (user's wallet receive addr)
  refundAddress: "bc1q...",         // recommended: where to send funds on refund
  refundPreference: {
    default: "return_to_refund_address",
    fallbackIfRefundAddressMissing: "manual_review",
  },
});

console.log(order.depositAddress);   // show this in your UI
console.log(order.refundCapability); // "programmatic" | "ticket"

4. Track status

Pick one transport. Don’t combine both — events will duplicate.

5. Move to production

  1. Swap the pk_test_ key for pk_live_ in your environment.
  2. Confirm your webhook URL is reachable from *.privataswap.com ranges (see IP allowlist).
  3. Subscribe to the status page RSS for incident notifications.
  4. Add a Pingdom probe against GET /partner/v1/health if you want SLA credits.
You’re live.