| Hosted Checkout | Embedded Checkout | |
|---|---|---|
| Customer experience | Open the supplied Checkout page | Open a payment overlay on your website |
| Website setting | Optional, used for the merchant website link | Optional, used for the merchant website link |
| Create request | Omit checkout_origin | Set checkout_origin to the HTTPS origin of the page that opens the Widget |
| Browser integration | Open /#payment_id=<payment_id> on the Checkout origin | Load the Widget once and call CryptoPay.open |
payment:write: create or cancel Payments and disable Checkout access.payment:read: query payment status and verify pricing configuration.webhook:bootstrap: configure a Webhook endpoint and verify its signing Secret.Authorization: Bearer <API_KEY>; never put an API Key in browser code, a URL, screenshots or logs. Your plan sets how many active API Keys you can have: Free includes 1 and Business 5. Each connected website, plugin or app uses one. To replace a Key, issue a new one, deploy and verify it, and revoke the old one in your TLY Pay dashboard; on Free, revoke the old Key first, which stops API calls until the new Key is deployed.TLY_API_ORIGIN and TLY_API_KEY configuration. Set TLY_API_ORIGIN to https://api.tlypay.com.| Purpose | Address |
|---|---|
| Server-side API | https://api.tlypay.com |
| Hosted Checkout | https://pay.tlypay.com |
| Embedded Checkout script | https://pay.tlypay.com/widget/crypto-pay.js |
crypto-pay.js. Your own application only implements order creation and the call that opens Checkout.GET /v1/store with your API Key to verify the configured pricing source and website domain before building the request. Use the returned primary_source kind, ref and decimals to construct source_amount. Do not infer Payment pricing from Display currency or from the asset your customer will pay with. payments_ready is true once the Store has a verified wallet with at least one enabled network; hide the payment method while it is false and re-check periodically, because creating a Payment fails until the Store is ready. payment_assets lists the assets your customers can pay with right now (symbol, name and enabled network names); cache it with the readiness check and show the symbols next to the payment method.curl --request POST "${TLY_API_ORIGIN}/v1/payments" \
--header "Authorization: Bearer ${TLY_API_KEY}" \
--header "Content-Type: application/json" \
--header "Idempotency-Key: order-example-1048" \
--data '{"order_ref":"ORDER-EXAMPLE-1048","source_amount":{"kind":"fiat","currency":"USD","amount_raw":"12800"}}'source_amount must match your configured primary pricing source. USD 12800 means USD 128.00. Use positive integer strings without leading zeros, not floating-point numbers. The service determines decimals. For crypto pricing, provide kind: "crypto", your configured pricing_ref, and amount_raw; do not substitute a token contract address or a network ID for a pricing ref.order_ref is optional and is not a unique key. Keep one Idempotency-Key for each creation intent and reuse both that Key and the same request body after a timeout. A successful create or identical replay returns HTTP 200, not 201. Creating a Payment does not mark the order paid.client_ref unless you are a TLY Pay platform plugin; plugins send their installation reference so they can recognize their own Payments in Webhooks, as described in the Webhook guide.payment_id with your order. Use it to open Checkout, query payment status and identify the Payment when contacting support. You and your customers use the same ID, which can be displayed and copied. Checkout remains subject to website authorization, risk checks, expiry and access restrictions. Queries and changes from your server require your API Key.checkout_origin. Open https://pay.tlypay.com/#payment_id=<payment_id>, replacing <payment_id> with the returned ID. The app's Create Payment Link action also creates Hosted Payments. Customers do not need to remain on your website to pay. Set the optional return_url to a page of your website, such as the order confirmation, and Checkout shows a button that returns your customer there once the Payment is paid; it never redirects automatically.checkout_origin when creating the Payment. TLY Pay records it on the Payment, and the Widget can only be opened from that origin: https://shop.example.com does not permit https://www.example.com, https://shop.example.com:8443 or a plain http:// page. The hosted Checkout origin is not accepted. Use your server's trusted configuration, not an unchecked value supplied by the browser.checkout_origin still creates a Hosted Payment. The origin is fixed when the Payment is created and returned as checkout_origin by GET /v1/payments/{payment_id} (null for Hosted Payments). An Embedded Payment can also be completed on the Hosted Checkout page (a plugin uses it as its fallback when the Widget is unavailable); a Hosted Payment cannot be opened in the Embedded Widget.checkout_origin to the same creation request used above. This illustrative request assumes USD is your configured pricing source; replace the website, order and amount with your own validated values.{
"order_ref": "ORDER-EXAMPLE-1048",
"source_amount": { "kind": "fiat", "currency": "USD", "amount_raw": "12800" },
"checkout_origin": "https://shop.example.com"
}POST /v1/payments with your server-side API Key and an Idempotency-Key. Save the returned payment_id against the order and pass only that ID to your browser application. Retrying this creation intent must reuse the same body and idempotency key./your-checkout-integration.js represents your own application code, containing the openPayment function below and your Pay button handler; replace that example path with your application's script path.open accepts only { paymentId }. Do not pass API Keys, amount overrides, a runtime API URL or a payment-success callback. A resolved open() means the overlay has mounted, not that the payment session is ready or the order has been paid.window.CryptoPay.close() when your integration needs to dismiss the overlay. Closing does not cancel the Payment. A document supports one active Widget: opening another Payment closes the previous overlay. Coordinate calls across page components; do not load the script again during client-side navigation. If you use a dynamic loader instead, share one pending load, impose a load timeout and allow explicit retry after failure. Do not use an iframe.https://pay.tlypay.com in script-src and connect-src, and https://cdn.tlypay.com in img-src. Wallet-specific connections may require additional provider origins; allow only the providers used by your integration. Do not disable your site's CSP to make the Widget load.| Symptom | What to check |
|---|---|
Creation rejects checkout_origin | The value is an HTTPS origin without a path, query, fragment or login details, and it is not the hosted Checkout origin |
| Script fails to load or the Widget global is unavailable | Use https://pay.tlypay.com/widget/crypto-pay.js, allow the platform origin in CSP, load the script once, then reload and retry |
| Overlay cannot access the Payment | Confirm the page origin equals the Payment's checkout_origin, and check expiry and access through your server; do not infer the cause from a generic browser authentication error |
| Browser closes or loses connection | Query the existing Payment from your server; do not create another Payment solely because the overlay closed |
payment.updated Webhook, or query GET /v1/payments/{payment_id} from your server with payment:read. Query responses describe authoritative payment facts. A browser redirect or Webhook delivery result is not a payment receipt.status_version as described in the Webhook guide.POST /v1/payments/{payment_id}/cancel. Repeating a successful cancellation reads the current state.DELETE /v1/payments/{payment_id}/consumer-access. Customers will no longer be able to access this Payment through Checkout. Its payment status is unchanged; you can still query the Payment from your server.GET /v1/store to verify the API Key's configured pricing source and website domain.