Embed, API & SDKs
One-line payment buttons, a drop-in Add Funds module, a REST API for everything, and official SDKs. Pick the lightest tool that does the job.
What the buyer sees
The hosted checkout is a single focused flow: the amount (or pay-what-you-want input), tax line, any custom fields, and the method grid - coin tiles grouped by network, plus card, PayPal, Lightning, and one tile per bank rail. On paying, a QR code and the exact address/amount appear (with copy buttons and wallet-extension buttons like MetaMask, TronLink, Phantom, and TonKeeper where enabled); detection and confirmations tick live, then the receipt screen shows the transaction hash with an explorer link.
Buyers can retry a failed payment on the same link, and machine clients (AI agents) get an HTTP 402 payment manifest from the same URLs instead of HTML - see Agents & x402.
The Cloud Token
The Cloud Token identifies your store on public, buyer-facing surfaces. It is publishable: it goes in embed snippets and checkout links. Your API key is different - it is a server-side secret that can read transactions and change settings. Never put the API key in a snippet.
- Find the Cloud Token in the console under Account → Stores (per-store).
- Fetch it programmatically with
function=get-cloud-tokenusing your API key.
Add Funds module
If your product runs on U.CASH accounts (white-label partners, apps), one script gives every page a balance top-up widget:
<script src="https://pay.u.cash/topup.js" async></script>
It mounts a + action on the account balance widget and opens a themed modal with Credit (USD) and UCASH tabs - presets and minimums included, live UNITS conversion for UCASH, and theme-following via Shadow DOM (no style or CSP conflicts). On completion it fires a uxc:topup-complete event on document so your page can refresh balance displays.
Return URLs are allowlisted to *.u.cash hosts over HTTPS; the module never bounces users to third-party sites.
REST API
Everything the console does is available over HTTPS POST to https://pay.u.cash/api.php (form-encoded, function= dispatch). Authenticate with the X-Api-Key header - the header is preferred over a POST field because it stays out of access logs.
Common functions
| Function | Key parameters | Purpose |
|---|---|---|
create-transaction | amount, cryptocurrency_code | Create a checkout/invoice |
invoice / payment-link | transaction_id | Get a shareable payment URL |
get-transaction / get-transactions | transaction_id | Status and history |
check-transactions | transaction_id | Force a re-scan of pending payments |
get-fiat-value | amount, cryptocurrency_code, currency_code | Price a coin amount in fiat |
get-exchange-rates | currency_code, cryptocurrency_code | Rate lookup |
vat / vat-validation | amount / vat_number | Tax math and VAT number checks |
save-checkout / get-checkouts | checkout / checkout_id | Manage saved payment links |
get-cloud-token | - | Retrieve the publishable store token |
test-connection | - | Authenticates with the Cloud Token and sends a signed test webhook to your webhook URL, reporting the HTTP status and whether the signature verified |
Example
curl https://pay.u.cash/api.php \
-H "X-Api-Key: YOUR_API_KEY" \
-d function=create-transaction \
-d amount=25.00 \
-d cryptocurrency_code=
Successful responses are {"success":true,"response":...}; errors are structured {"success":false,"error_code":...,"message":...} - parse error_code, not prose. Get your API key from Settings → API key.
Buyer-side creation (no API key)
Creating a buyer checkout with only a Cloud Token is public by design - that is what embeds use - via POST https://pay.u.cash/payment/ajax.php with function=create-transaction. The token is the credential; keep the API key server-side.
SDKs and plugins
The full catalog - 125+ open-source plugins, SDKs, and bots - lives at pay.u.cash/plugins and on GitHub under UdotCASH. Highlights:
- E-commerce gateways: WooCommerce (
wc-ucashpay), Magento 2, BigCommerce, PrestaShop, OpenCart, Shopify (see Shopify) - Frameworks: React, Vue, Svelte, Next.js, Flask, FastAPI, Django, Laravel, Rails, Go, .NET, Rust, and more
- Agents:
npm install @ucash/agentsandpip install agents-u-cashfor the x402 protocol (see Agents & x402) - Mobile & game: Flutter, React Native, Android, Unity, Godot