Cryptopay API

·

Cryptopay offers a powerful and developer-friendly API designed to help businesses seamlessly integrate cryptocurrency payments, automate payouts, manage transactions, and track financial data. Whether you're building a payment gateway, subscription service, or crypto wallet infrastructure, the Cryptopay API supports essential operations across multiple digital assets and currencies.

This comprehensive guide walks you through core functionalities, use cases, and integration best practices—equipping developers and fintech teams with everything needed to leverage cryptocurrency at scale.


Supported Coins and Networks

The Cryptopay API supports major cryptocurrencies such as Bitcoin (BTC), Ethereum (ETH), Litecoin (LTC), Ripple (XRP), and Stellar Lumens (XLM). Each coin operates on specific blockchain networks with defined precision levels and additional requirements like destination tags for XRP or memo IDs for XLM.

For example, when retrieving supported coins:

result = client.coins.list
p result

You’ll receive structured data including network details, fee configurations, and whether features like invoicing or withdrawals are enabled per asset.

👉 Discover how to accept crypto payments instantly with seamless API integration


Real-Time Exchange Rates

Accurate pricing is crucial in volatile crypto markets. The Cryptopay API provides real-time buy and sell rates between fiat and cryptocurrencies.

Retrieve All Currency Pair Rates

To fetch all current exchange rates:

result = client.rates.all
p result

Sample response:

{
  "data": {
    "BTC/EUR": {
      "buy_rate": "39000.1",
      "sell_rate": "38000.1"
    }
  }
}

Get Rate for a Specific Pair

You can also query individual pairs using path parameters:

base_currency = 'BTC'
quote_currency = 'EUR'
result = client.rates.retrieve(base_currency, quote_currency)
p result

These endpoints ensure your platform displays accurate pricing and minimizes slippage during transactions.


Invoicing System for Crypto Payments

Invoices simplify the process of requesting cryptocurrency payments by generating unique addresses tied to a specific amount and time window.

Create an Invoice

To create a new invoice:

{
  "price_amount": "100.0",
  "price_currency": "EUR",
  "pay_currency": "BTC",
  "network": "bitcoin",
  "custom_id": "PAYMENT-123",
  "success_redirect_url": "https://example.com/success"
}

The system returns a payment URI like bitcoin:2Mw43...?amount=0.002519, which customers can use to complete the transaction.

Manage Invoice Lifecycle

Key invoice operations include:

Two-step recalculation allows rate updates within a 30-second window before finalizing changes.


Payouts via Coin Withdrawals

Beyond accepting payments, businesses often need to send crypto to users—such as refunds, rewards, or disbursements.

Initiate a Withdrawal

Use one of three amount parameters depending on your accounting model:

Example request:

{
  "address": "2Mz3bcjSVHG8uQJpNjmCxp24VdTjwaqmFcJ",
  "charged_currency": "EUR",
  "received_currency": "BTC",
  "charged_amount": "100.0",
  "network_fee_level": "average"
}

Withdrawals support travel rule compliance and beneficiary validation for regulated environments.

Monitor and Confirm Transactions

After creating a withdrawal, confirm it using the commit endpoint. This two-step process enhances security and reduces errors.

You can also:


Static Payment Channels for Recurring Transactions

Channels provide fixed cryptocurrency addresses that can be assigned to individual customers for recurring deposits.

Create and Manage Channels

When setting up a channel:

{
  "name": "User Deposit Channel",
  "pay_currency": "BTC",
  "receiver_currency": "EUR",
  "customer_id": "CUSTOMER-123"
}

Once created, every incoming transaction to that address is automatically converted and credited in the desired fiat or stablecoin.

Track Channel Payments

Each channel generates a history of payments, showing:

This enables robust reconciliation and reporting for high-volume platforms.

👉 Start building your crypto payment flow with developer-first tools


Account and Transaction Management

Transparency into financial activity is vital. The API exposes full account balances and detailed transaction histories.

List Accounts and Balances

Retrieve all accounts:

result = client.accounts.list
p result

Response includes balance per currency (e.g., EUR, USD) and associated project IDs.

View Transaction History

Filter transactions by:

This helps audit trails, detect anomalies, and generate financial reports.


Cross-Currency Exchange Transfers

Automate conversions between fiat and crypto within your account ecosystem.

Execute Instant Swaps

Create an exchange transfer:

{
  "charged_currency": "EUR",
  "charged_amount": "100.0",
  "received_currency": "BTC"
}

Optionally enable two-step confirmation for added control.

Retrieve Conversion Details

Each transfer includes:

Ideal for platforms managing multi-currency wallets or dynamic pricing models.


Customer Risk Management

Assign customer profiles to enforce security policies and automate risk handling.

Create Customer Profiles

Include preferred currency and refund addresses:

{
  "id": "CUSTOMER-123",
  "currency": "EUR",
  "addresses": [
    {
      "address": "2N9wPGx67zdSeAbXi15qHgoZ9Hb9Uxhd2uQ",
      "currency": "BTC"
    }
  ]
}

High-risk transactions are either rejected or redirected to predefined addresses.

Update and Retrieve Customer Data

Maintain accurate records and respond dynamically to changing risk assessments.


Subscription Billing with Crypto Support

Enable recurring billing powered by cryptocurrency.

Set Up Subscriptions

Define:

All subscriptions generate automated invoices payable in crypto.

Manage Subscription Lifecycle

Actions include:

Callback events notify your backend upon payment confirmations or failures.


Frequently Asked Questions (FAQ)

Q: Can I accept multiple cryptocurrencies with one integration?
A: Yes. The Cryptopay API supports BTC, ETH, LTC, XRP, XLM, and more—all accessible through a unified interface with automatic conversion options.

Q: How are exchange rates determined?
A: Rates are pulled from trusted market sources in real time. Buy/sell spreads reflect current liquidity conditions to ensure fair pricing.

Q: Is two-step verification required for withdrawals?
A: Not mandatory, but recommended. You can disable it using force_commit=true if instant execution is preferred.

Q: Can I assign permanent crypto addresses to users?
A: Absolutely. Use the Channels feature to create static deposit addresses linked to specific customers or accounts.

Q: How do I handle failed or unconfirmed transactions?
A: Webhooks deliver real-time updates via callback URLs. Monitor statuses like new, paid, completed, or expired to trigger appropriate actions.

Q: Does Cryptopay support partial payments or overpayments?
A: Partial payments are not supported—invoices require full settlement. Overpayments beyond tolerance thresholds may be flagged for review.


👉 Integrate secure, scalable crypto payments into your app today