api

Transactions API

The Transactions API covers the complete payment lifecycle: creating checkout sessions, querying transaction status, and verifying blockchain confirmations.

Updated: 3/9/2026

The Transactions API covers the complete payment lifecycle: creating checkout sessions, querying transaction status, and verifying blockchain confirmations.

Payment Flow Overview

┌─────────────┐    ┌──────────────┐    ┌──────────────┐    ┌───────────────┐
│ Your Server │───>│ Create       │───>│ Customer     │───>│ Blockchain    │
│             │    │ Checkout     │    │ Pays on      │    │ Confirms      │
│ POST api.php│    │ Session      │    │ Payment Page │    │ Transaction   │
└─────────────┘    └──────────────┘    └──────────────┘    └───────────────┘
                         │                                        │
                         │ payment_url                             │
                         ▼                                        ▼
                   ┌──────────────┐                         ┌───────────────┐
                   │ Redirect     │                         │ Webhook POST  │
                   │ Customer     │                         │ to Your Server│
                   │ to pay.php   │                         │               │
                   └──────────────┘                         └───────────────┘
  1. Your server calls create-checkout-session with the payment amount and currency.
  2. You receive a payment_url and redirect the customer to it.
  3. The customer selects a cryptocurrency, scans the QR code, and sends payment.
  4. QuantaPay monitors the blockchain and waits for confirmations.
  5. Once confirmed, QuantaPay sends a webhook to your server and/or redirects the customer.

create-checkout-session

Create a new payment session. Returns a payment URL to redirect your customer to.

Request

curl -X POST https://cloud.quantapay.app/api.php \
  -d "function=create-checkout-session" \
  -d "api-key=YOUR_API_KEY" \
  -d "price=49.99" \
  -d "currency=USD"

Parameters

ParameterTypeRequiredDescription
pricenumberYesPayment amount in the specified currency.
currencystringYesISO 4217 currency code (e.g., USD, EUR, GBP).
order_idstringNoYour internal order ID for reference.
redirectstringNoURL to redirect the customer after successful payment.
cancel_urlstringNoURL to redirect the customer if they cancel.
notestringNoInternal note attached to the transaction.
itemsJSON stringNoArray of line items (see below).
customerJSON stringNoCustomer information object.
signaturestringNoHMAC-SHA256 signature for tamper protection.
timestampintegerNoUnix timestamp (required if signature is provided).
external_referencestringNoEncrypted reference from WordPress plugin.
pluginstringNoSource plugin identifier (e.g., woo, edd).

Items Format

[
  {
    "name": "Product Name",
    "qty": 2,
    "price": 24.99,
    "image": "https://example.com/product.jpg"
  }
]
  • Maximum 50 items per session.
  • name: Max 200 characters.
  • image: Must be HTTP or HTTPS URL, max 500 characters.

Response

{
  "success": true,
  "response": {
    "session_id": "cs_a1b2c3d4e5f6a1b2c3d4",
    "payment_url": "https://cloud.quantapay.app/pay.php?session=cs_a1b2c3d4e5f6a1b2c3d4",
    "expires_at": "2026-03-08T11:00:00+00:00"
  }
}
  • session_id: Unique session identifier (format: cs_ + 24 hex characters).
  • payment_url: URL to redirect the customer to complete payment.
  • expires_at: ISO 8601 timestamp. Sessions expire after 60 minutes.

Error Responses

MessageCause
Missing required fields: price, currencyprice is 0/missing or currency is empty.
Invalid signatureHMAC signature verification failed.
Request expiredTimestamp is more than 5 minutes from server time.
Failed to create checkout sessionDatabase error.

get-checkout-session

Query the current status of a checkout session.

Request

curl -X POST https://cloud.quantapay.app/api.php \
  -d "function=get-checkout-session" \
  -d "api-key=YOUR_API_KEY" \
  -d "session_id=cs_a1b2c3d4e5f6a1b2c3d4"

Parameters

ParameterTypeRequiredDescription
session_idstringYesThe checkout session ID (starts with cs_).

Response

{
  "success": true,
  "response": {
    "session_id": "cs_a1b2c3d4e5f6a1b2c3d4",
    "status": "paid",
    "price": 49.99,
    "currency": "usd",
    "order_id": "ORD-12345",
    "created_at": "2026-03-08T10:00:00+00:00",
    "expires_at": "2026-03-08T11:00:00+00:00",
    "paid_at": "2026-03-08T10:15:23+00:00"
  }
}

Session Statuses

StatusDescription
activeSession is open and waiting for payment.
paidPayment has been received and confirmed on the blockchain.
expiredSession expired without receiving payment (after 60 minutes).
cancelledSession was cancelled before payment was received.

get-transactions

Query a paginated list of transactions. Useful for reconciliation and reporting.

Request

curl -X POST https://cloud.quantapay.app/api.php \
  -d "function=get-transactions" \
  -d "api-key=YOUR_API_KEY" \
  -d "pagination=0"

Parameters

All parameters are optional:

ParameterTypeDescription
paginationintegerPage number (0-indexed). Each page returns up to 100 transactions.
searchstringSearch by transaction ID, hash, amount, or description.
statusstringFilter by status: C (completed), P (pending), X (underpaid), E (expired).
cryptocurrencystringFilter by cryptocurrency code (e.g., btc, eth).
date_rangearrayDate range filter as a two-element array: date_range[0]=2026-01-01&date_range[1]=2026-03-01.
checkout_idstringFilter by checkout/payment button ID.

Response

Returns an array of transaction objects:

{
  "success": true,
  "response": [
    {
      "id": "123",
      "title": "Payment #ORD-12345",
      "description": "",
      "from": "0xCustomerAddress...",
      "to": "0xYourAddress...",
      "hash": "0xTransactionHash...",
      "amount": "0.025",
      "amount_fiat": "49.99",
      "cryptocurrency": "eth",
      "currency": "usd",
      "external_reference": "",
      "creation_time": "2026-03-08 10:00:00",
      "status": "C",
      "webhook": "1",
      "vat": ""
    }
  ]
}

Transaction Statuses

CodeStatusDescription
CCompletedPayment confirmed on the blockchain.
PPendingWaiting for payment or blockchain confirmation.
XUnderpaidPayment received but amount was less than required.
EExpiredPayment window expired without sufficient payment.
RRefundedPayment has been refunded.

get-transaction

Get details of a single transaction by ID.

Request

curl -X POST https://cloud.quantapay.app/api.php \
  -d "function=get-transaction" \
  -d "api-key=YOUR_API_KEY" \
  -d "transaction_id=123"

Parameters

ParameterTypeRequiredDescription
transaction_idintegerYesThe transaction ID.

Response

Returns a single transaction object (same format as get-transactions).


check-transaction

Manually trigger a blockchain confirmation check for a specific transaction.

Request

curl -X POST https://cloud.quantapay.app/api.php \
  -d "function=check-transaction" \
  -d "api-key=YOUR_API_KEY" \
  -d "transaction=TRANSACTION_JSON"

Parameters

ParameterTypeRequiredDescription
transactionJSON stringYesThe transaction object to check (as returned by get-transaction).

Response

Returns the updated transaction object with current confirmation status. If the required number of confirmations is reached, the transaction status changes to C (completed).

Note: This function is typically not needed in normal operation. QuantaPay automatically checks confirmations via its cron system. Use this only if you need to force an immediate check.