Test Ad

CashLink Developers

CashLink BCH Short URL Payment API

Integrate BCH-paid short URLs with anonymous order tokens, SSE, and webhooks.

API base URL
https://linkincash.cc/api/v2
On this page

CashLink BCH Short URL Payment API

API v2 exposes custom-code and random-batch short URL products through one order contract. Image quota remains an owner-bound internal checkout and is not a public product.

Download OpenAPI v2

Choose a product

  • custom_code reserves one named short URL and activates it automatically after payment.
  • random_batch creates system codes in units of 100 URLs.

Custom names are matched as complete, case-insensitive words. The default tiers are the top 2,000 words at 30,000 sat, words 2,001–10,000 at 20,000 sat, and all other names at 10,000 sat. Administrators may change these prices, so the quote response is authoritative.

curl -sS 'https://linkincash.cc/api/v2/short-url-payment-products/custom_code/quote?custom_code=example'
curl -sS 'https://linkincash.cc/api/v2/short-url-payment-products/random_batch/quote?quantity=100'

Create an order

Every mutation requires a stable Idempotency-Key. A custom-code order must include custom_code and original_url; the server reclassifies the exact name and snapshots its tier price. The order_token and optional webhook_secret are returned only by the first 201 response.

curl -sS -X POST 'https://linkincash.cc/api/v2/short-url-payment-orders' \
  -H 'Content-Type: application/json' \
  -H 'Idempotency-Key: YOUR-STABLE-KEY' \
  -d '{"product_type":"custom_code","custom_code":"example","original_url":"https://example.com/page","generate_qr":true,"refund_address":"bitcoincash:...","refund_address_confirmation":"bitcoincash:...","terms_version":"2026-08-04","terms_accepted":true}'

Orders, payment, and events

Use Authorization: Bearer clapi_.... The /api/v2/short-url-payment-orders/ORDER_UUID/events SSE endpoint returns a versioned envelope with version, event, revision, and data; resume with Last-Event-ID.

Activation, legacy redemption, and batches

New custom-code orders reserve the name at order creation and activate that short URL automatically when sufficient payment is detected. POST .../redemptions remains available only for older unbound credits. Random products use POST .../batches; product-specific operations cannot be mixed.

Webhook v2

Deduplicate the UUIDv7 Event ID and reject timestamps outside five minutes:

v2=HMAC_SHA256(webhook_secret, timestamp + "." + event_id + "." + raw_body)

Retries reuse the same Event ID. Verify the raw body before JSON decoding.

Errors

Errors use application/problem+json. Success responses always contain data, links, and meta.