Skip to content

Creating Payments ​

POST /v1/payments ​

Create a new payment request. Requires Basic KYC and an API key.

Request ​

POST https://api.tokencashflow.com/v1/payments
X-API-Key: tcf_live_...
Content-Type: application/json

Request body ​

FieldTypeRequiredDescription
amount_usddecimalYesPayment amount in USD. Must be greater than 0. The platform may enforce configurable global / per-token min/max limits.
descriptionstringNoShown to the payer on the payment page. Max 150 characters.
redirect_urlstringNoHTTPS URL to redirect the payer to after the payment completes. Max 2048 characters.
allowed_token_idsarray of UUIDsNoRestrict the payer to a subset of your enabled tokens. Defaults to your full enabled set. Token UUIDs are available from GET /v1/payments/tokens.

Example request:

bash
curl -X POST https://api.tokencashflow.com/v1/payments \
  -H "X-API-Key: tcf_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "amount_usd": 150.00,
    "description": "Invoice #INV-2026-042",
    "redirect_url": "https://yourstore.com/order/complete?ref=INV-2026-042"
  }'

Response (201 Created) ​

FieldTypeDescription
idUUIDUnique payment identifier
pay_urlstringThe payment page URL to share with your customer
statusstringAlways awaiting_selection on creation
amount_usddecimal (string)Payment amount
fee_payerstringWho absorbs fees — user (you) or payer (customer); snapshotted from your payment settings
selection_expires_atISO 8601 or nullNull on creation; set when payer confirms a token
created_atISO 8601Creation timestamp (UTC)

Payment status reference ​

StatusDescription
awaiting_selectionPayer has not selected a crypto yet — no countdown
awaiting_paymentPayer confirmed crypto and rate; selection_expires_at countdown running
partially_paidSome funds received; payer can top up before selection window expires
confirmingRequired amount received; waiting for required block confirmations
confirmedConfirmations reached; sweep in progress
completedSweep done and merchant account credited
expired_selectionChain selection window expired; payer can return and reselect at current market rate
blacklistedSender wallet address is on the platform blacklist
sweep_failedAutomated sweep from payment wallet failed; admin intervention required
failedSystem error; requires investigation

Status values are always lowercase snake_case.

Only the chain selection window expires. Once the payer confirms a token, selection_expires_at starts a countdown (typically 30–60 minutes). expired_selection is fully recoverable — the payer can always return to the payment link and reselect.

Customising the allowed crypto list ​

By default, every payment offers all cryptos you have enabled in Dashboard → Payment Settings (an empty enabled list means all active tokens).

To restrict a specific payment to certain tokens, pass allowed_token_ids:

json
{
  "amount_usd": 100.00,
  "allowed_token_ids": [
    "a1b2c3d4-...",  // ETH on Ethereum
    "e5f6a7b8-..."   // USDT on Ethereum
  ]
}

Retrieve available token UUIDs from:

GET /v1/payments/tokens
X-API-Key: tcf_live_...

You can also manage your default enabled-token set and the fee payer option via the API:

GET /v1/payments/settings
PUT /v1/payments/settings     {"fee_payer": "user" | "payer", "enabled_token_ids": [...]}

Listing and filtering payments ​

GET /v1/payments
X-API-Key: tcf_live_...

Query parameters:

ParameterTypeDescription
statusstringFilter by status (lowercase, e.g. completed, awaiting_payment)
date_fromISO 8601 dateOnly payments created on or after this date (UTC)
date_toISO 8601 dateOnly payments created on or before this date (UTC)
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 20, max: 100)

Response:

json
{
  "success": true,
  "data": {
    "total": 453,
    "page": 1,
    "page_size": 20,
    "total_pages": 23,
    "payments": [ ... ]
  }
}

Fetching a single payment ​

GET /v1/payments/{payment_id}
X-API-Key: tcf_live_...

Returns full payment detail including:

  • All state transition timestamps (awaiting_payment_at, partially_paid_at, confirming_at, confirmed_at, completed_at)
  • Locked rate and required crypto amount (after payer confirms)
  • Received amounts and fee breakdown
  • The on-chain transactions received for this payment

Unauthenticated status polling ​

The payer's payment page polls this endpoint every 5 seconds. No authentication required:

GET /v1/pay/{payment_id}/status

Returns only safe public fields: status, total_received_crypto, required_crypto_amount, selection_expires_at, confirmations_received, confirmations_required, redirect_url.

selection_expires_at is null until the payer confirms a token selection; once set, this controls the countdown timer on the payment page.

TokenCashFlow Documentation