1. TLY Pay API
English
  • English
  • 简体中文
  • TLY Pay API
    • Getting started
    • HTTP conventions and payment status
    • Webhook verification and recovery
    • Payment integration
      • Create a Payment
      • Get Payment status
      • Cancel a Payment
      • Disable Checkout access
      • Check pricing configuration
      • Configure a Webhook endpoint
      • Verify a Webhook signing Secret
  • Schemas
    • CreatePayment
    • CreatedPayment
    • ErrorResponse
    • BootstrapWebhook
    • MerchantPaymentView
    • MerchantStoreSourceView
    • MerchantStoreView
    • OneTimeSecretResponse
    • SourceAmount
    • MerchantSourceAmountView
    • VerifyWebhookBinding
    • WebhookBindingView
  1. TLY Pay API

HTTP conventions and payment status

Authentication and permissions#

Send the API Key in the Authorization header from your server. Each operation lists its required scope.
HTTP 401 means the supplied credential or Webhook signing Secret was rejected. HTTP 403 means the Key lacks the required scope. Unknown or inaccessible Payment resources return 404. Do not use the browser login session or payment_id in place of an API Key.

Requests, retries and idempotency#

Use JSON request bodies and the documented HTTP method. Only send query parameters listed for the operation.
Creating a Payment or configuring a Webhook endpoint requires Idempotency-Key. It must be nonblank and at most 255 bytes. Keep it stable for a single intent, including network retries. Reusing a Key with different input returns 409. order_ref does not replace idempotency and may be absent or repeated.
For a timeout, retry the same idempotent request or read authoritative state. Honor a positive Retry-After when returned for throttling or temporary unavailability. Do not repeat permanently rejected requests without correcting their input or credentials.
Error responses contain err, msg and retryable fields, with optional operation-specific details. Use err for classification. msg is explanatory text, not a stable programmatic discriminator. An API failure may return 503 merchant_api_temporarily_unavailable without proving whether a prior write succeeded.

Amounts and time#

In a Payment creation request, amount_raw must be a canonical positive integer string containing 1 to 78 ASCII digits, with no leading zero. Zero, signs, decimal points and exponent notation are rejected. Decimals come from the configured currency or crypto pricing source. Requests do not supply decimals. Fiat is a pricing unit, not a promise of card or fiat payment support.
Service-generated responses use X-Server-Time as the authoritative response time, in UTC RFC 3339 with exactly three millisecond digits. Standard Date is a transport diagnostic. Do not infer a body server_time field. Other timestamps describe when the Payment was created, activated or updated.

Payment status#

Status in API and appIntegration handling
openWait for payment facts. A created Payment can still be awaiting first activation.
paidProcess the authoritative result according to your fulfillment policy.
partially_paidApply your underpayment policy; do not equate it with paid.
overpaidApply your overpayment policy; the API does not automatically refund.
expiredThe activation deadline or payment window ended. Continue to use authoritative facts for exceptions.
cancelledA permitted merchant cancellation was recorded.
review_requiredRequire review; do not infer success without authoritative status.
The API and app display the same status values in every language.
Before first activation, activated_at is null and payment_expires_at is the deadline for first opening Checkout. When your customer first opens Checkout successfully, the API sets activated_at and resets payment_expires_at to the payment deadline. Creation, creation retries and queries from your server do not activate the Payment. Reopening an activated Checkout does not extend its payment window.
Activation does not change status_version or emit payment.updated. Read GET /v1/payments/{payment_id} when you need the current activation time or payment deadline.
status_version orders facts within one Payment, not across different Payments. A late or duplicate event must not overwrite a newer version. Payment states derive from authoritative facts and must not be treated as immutable browser success flags.
Cancelling a Payment and disabling Checkout access have different effects. Cancellation requires an open, unexpired Payment with no accepted or confirming funds; it changes payment state and produces a state event. Repeating a successful cancellation reads the current state. Disabling Checkout access prevents customers from accessing the Payment through Checkout. It does not change payment status or emit a state event.
Previous
Getting started
Next
Webhook verification and recovery
Built with