API Reference

Β·

Overview

Crypto Pay is a powerful solution designed for Payment Aggregators and Corporate Clients (Merchants) to seamlessly integrate cryptocurrency payments into their operations. This platform enables merchants to accept crypto payments for goods and services or deposit funds using digital assets.

Key features include:

Whether you're building a full payment gateway or integrating direct merchant capabilities, Crypto Pay provides the tools needed for efficient, secure, and scalable crypto transactions.

πŸ‘‰ Discover how to integrate advanced crypto payment flows with powerful tools and real-time processing.


Base URL and API Methods

The base URL for all production API requests is:
https://api.cryptopayx.tech

For sandbox testing, use:
https://api.sandbox.cryptopayx.tech

Crypto Pay follows RESTful design principles and supports standard HTTP methods:

Request Parameters

You can pass parameters in two ways:

Parameters may be mixed between query strings and request bodies. If a parameter appears in both, the query string value takes precedence.

All timestamps are in milliseconds since Unix Epoch.

Responses return data in chronological order, with the newest entries first.


Authentication

To access protected endpoints, you must generate an API Key and Secret. Starting December 9, 2024, users can manage these credentials directly from the Client Area under Security Settings.

Available actions:

Ensure you replace placeholder values in code examples with your actual credentials.

Required Headers

All authenticated requests must include:

HeaderDescription
CRYPTO-PAY-API-KEYYour API key
CRYPTO-PAY-API-SIGNHMAC-SHA256 signature
CRYPTO-PAY-API-TIMESTAMPRequest timestamp in milliseconds

Signing Requests

The signature ensures request integrity and authenticity. It's generated as follows:

HMAC_SHA256(apiSecret, timestamp + method + path + contentHash)

Where:

The timestamp must be within 60 seconds of server time.


Return Codes

CodeMeaning
200Success
201Resource created
400Bad request – check formatting
401Unauthorized – invalid or missing credentials
404Resource not found
500Server error – contact support

Payment Intents

A payment intent represents a request to deposit a specific amount of cryptocurrency into a merchant’s wallet. It supports cross-currency deposits with automatic conversion.

Creation Methods

  1. Via API – Fully programmatic integration.
  2. Via iframe – Embedded UI for simplified checkout.
  3. Payment Request Link – Shareable link without integration.

πŸ‘‰ Learn how to implement secure, scalable payment intent systems with minimal friction.


Payment Intent Statuses

Payment intents progress through various states based on user action and system logic:

StatusCondition
PendingAwaiting deposit
ProcessingTransaction being verified
CompletedDeposit matches requested amount
PartiallyCompletedAmount within threshold; auto-retried successfully
ManualActionRequiredOutside threshold; requires merchant decision
FailedNo deposit within 30 seconds

See full status grid below for flow-specific conditions.


Handling Failed or Mismatched Payments

When a payment fails due to incorrect amounts or timeouts, several recovery options exist:

Automatic Retry

If the received amount falls within the configured threshold (e.g., Β±2%), the system automatically retries the transaction with updated pricing.

Manual Retry

For failed intents where conversion is enabled, merchants can manually retry using the current market rate.

Refund

Funds can be refunded via API or UI. Optionally, generate a refund link for customers to submit their wallet details.

Accept Received Amount

Merchants may manually accept under/over payments and complete the intent accordingly.

Top-Up (Underpaid Intent)

Multiple deposits are allowed until the total meets the required amount or threshold.


Sandbox Testing

Use the sandbox environment to simulate all payment flows without real transactions.

Sandbox Base URL:
https://api.sandbox.cryptopayx.tech

Sandbox accounts are separate from live accounts and require unique API keys.

Test Flows Overview

FlowConditionOutcome
1Exact amount depositedCompleted
2Amount within thresholdPartiallyCompleted
3–6Outside thresholdManualActionRequired
7No deposit within 30sFailed
8–10Manual actionsResolved via Refund/Retry/Accept

Each flow includes detailed webhook notifications for status tracking.


Core Endpoints

List Supported Currencies & Networks

GET /v1/currencies

Returns all available coins, networks, and virtual fiat currencies (e.g., SAR, AED).

Request Quote

POST /v2/payment-intents/estimated-quote

Get estimated conversion rates before creating a payment intent.

Create Payment Intent

POST /v2/payment-intents/

Initiate a new payment with specified currency, amount, network, and callback URL.

Check Status

GET /v1/payment-intents/{paymentIntentId}

Retrieve real-time status and transaction details.

Search by Filters

POST /v1/payment-intents/search

Filter by customOrderId, accountId, or date range.


Payouts

Convert fiat balances to cryptocurrency and withdraw to external wallets.

Supported methods:

Status progression:
Pending β†’ Processing β†’ Completed (or Failed)

Notifications are sent on every status change.


Single Payment Address Mode

For integration simplicity, enable a single permanent crypto address for multiple payment intents under one account.

To activate:

Crypto Pay identifies deposits by matching incoming transactions to active intents using account metadata.


Conversion Rules

Customize how incoming crypto is handled:

Exceptions can be set for specific coins that should never convert.


Virtual Fiat Currencies

Support for virtual fiat includes:

These allow merchants to quote prices in local currencies while receiving crypto settlements.


Frequently Asked Questions

What is a payment intent?

A payment intent is a secure request to receive cryptocurrency from a customer. It includes amount, currency, network, and destination details.

How do I test integrations safely?

Use the sandbox environment at https://api.sandbox.cryptopayx.tech with test credentials to simulate all transaction scenarios without real funds.

Can I accept partial payments?

Yes. If enabled, multiple deposits can fulfill a single intent. The system tracks totals and allows top-ups until requirements are met.

How does automatic retry work?

If a deposit deviates slightly from the requested amount but stays within the configured threshold (e.g., Β±2%), the system automatically retries processing with adjusted pricing.

What happens if no payment is made?

After 30 seconds with no deposit, the intent fails. However, if a valid deposit arrives later and meets threshold rules, the status updates to "Completed".

Can I refund a failed payment?

Yes. Refunds can be issued via API or through a customer-facing refund link that allows users to enter their wallet information securely.


πŸ‘‰ Explore next-generation crypto payment infrastructure with seamless integration and enterprise-grade security.