Skip to main content
Display a partner’s referral link and earnings in their account. If the account supports withdrawals, preview the payout, show the amount and destination, and get the partner’s approval before submitting the request. Private operations require a Bearer token and HMAC v2 signature and act on behalf of the key owner. Grant only the read scopes your integration needs. public-api:partner:payouts:create must be granted separately from the default scopes. The commands use request.mjs from the quickstart. Run the write examples on a test installation. Manage API access
For an unfiltered report, use result.statistics.exchanges.by_currency and result.statistics.payouts.by_currency from the profile or statistics response. The aggregate paid_amount and pending_amount can be "0" with a null currency when payouts in that status span multiple or unknown currencies. Read the current available balance from result.balance.available. For a filtered report, use the list endpoints. Each meta.summary covers the entire filtered result set before pagination.
  • Earnings. meta.summary.total counts every nonzero ledger entry. The monetary summary in meta.summary.by_currency includes confirmed positive earnings that have not been reversed. History also includes pending entries and reversals with is_reversal: true. reversal_of_id points to the original entry when the link is available. An earnings entry for a hidden order can have order: null.
  • Payouts. meta.summary contains total, pending, paid, and rejected counts. To calculate monetary totals with the same filters, sum result[].amount.requested across all pages by status and currency.code. Use exact decimal arithmetic and keep a separate bucket for unknown currency.
To filter earnings by order, use the internal numeric filter[order_id], the numeric string filter[order_public_id], or the tracking string filter[order_tracking_id]. In the payout list, filter[public_id] matches the legacy numeric reference as a string. Save result[].id to look up individual payouts. filter[created_from] and filter[created_to] include the specified creation dates, so a payout date range selects when requests were created. Start with pagination=cursor. Cursor sorting supports sort=id and sort=-id and defaults to -id. Pass meta.pagination.next_cursor as cursor with the same filters and sorting until the list ends. Response format and pagination

Preview a payout

  1. Call GET /private/partner/payout-methods with public-api:partner:payouts:read. Take currency_id from result.methods. Pass the destination in wallet as a string of 2 to 191 characters. Use wallet.mask, wallet.min_length, and wallet.max_length as form hints. Preview checks the destination against the exchanger’s configured validators.
  2. Check result.balance.can_request. This flag indicates a positive available balance that meets the minimum payout. Pass amount as a decimal string in result.balance.currency between minimum_payout and available, inclusive. The amount must be positive and fit result.balance.precision without discarding nonzero digits. The format allows up to 30 digits before the decimal point and up to 18 after it. To request the full available balance, omit amount or pass null.
  3. Call POST /private/partner/payouts/preview with the same scope. Preview validates the method, amount, and destination while leaving the balance available. The exchanger recalculates the terms when you submit the payout.
Get the available payout methods, then save the parameters as payout.json. Replace currency_id and wallet with values from your test installation.
payout.json
Excerpt from a 200 response for a test conversion from XTS to XPT, with a 10% fee and a fixed fee of 0.75 XPT.
Display amount.base as the debit in the base currency and amount.requested as the payout in currency.code. The exchanger deducts the percentage fee in the base currency, converts the remainder, deducts the fixed fee in the payout currency, and rounds the result HALF_UP to the method’s precision. Display the amounts returned by the exchanger.

Submit the payout request and save its ID

After the partner approves the amount and destination, send POST /private/partner/payouts with public-api:partner:payouts:create. Before the first attempt, save the body and a unique Idempotency-Key of 8 to 191 ASCII letters, digits, or ., _, :, and -. Include the key in the signing string.
A 201 response includes result.payout.id, result.payout.status: "pending", and result.replayed: false. The exchange deducts the base amount from the available balance when the request is created. pending means it has been accepted for processing. If you lose the response, submit the same body and key with a fresh HMAC signature from the same integration. Rotating an API key preserves that integration. Issuing a separate key creates a different integration, even for the same account. A replay can return the stored 201 with Idempotency-Replayed: true, or 200 with result.replayed: true if the response was reconstructed from the saved payout request. Use the returned ID to read the current status. For 409 idempotency_conflict, check the original request body. Retry a request

Read payout status

Call GET /private/partner/payouts/ with public-api:partner:payouts:read. Use the numeric result.payout.id from the creation response. A missing payout or a payout belonging to another account returns 404.
Check status before reading confirmation_required. Email confirmation sets result.payout.verified_at. The payout stays pending until it is processed. Older records can have an empty amount.base_currency and a null currency or currency.code. Treat these as unknown currencies. For 422 validation_failed, check the available methods and balance again, then verify the amount, precision, and destination format. For 422 invalid_idempotency_key, check the Idempotency-Key header on creation. For 403 scope_denied, check the scope of the specific operation. Error responses · API reference

Prompt for your coding agent