Documentation Index
Fetch the complete documentation index at: https://docs.gate.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Subscription payment fits memberships, SaaS, recurring services, and any scenario that needs ongoing authorization and debits. Products are split into two capability classes, distinguished bypriceType on the product price:
priceType | Capability | How debits work |
|---|---|---|
FIX_AMOUNT | Fixed amount debited on the plan’s billing cycle | After the user authorizes, the platform runs recurring debits according to the merchant’s subscription plan |
ACCOUNT_AUTH | Account authorization; the merchant decides when to debit | After the user authorizes, the merchant initiates debits when the business requires |
Standard integration flow
Both product types share the same main path: create product → create plan → create subscription order → guide the user to authorize. They diverge after authorization succeeds:Debit phase branches
- FIX_AMOUNT: After authorization → recurring debits (automatic per plan) → query and notification tracking
- ACCOUNT_AUTH: After authorization → merchant-initiated debits on demand → query and notification tracking
Minimum runnable path
For a first integration, run the smallest path end to end, then add trials, first-period discounts, and completion rules.- FIX_AMOUNT: After this path works, focus on automatic cycle debits and failure retries.
- ACCOUNT_AUTH: After authorization, trigger debits from your backend and still confirm via notifications + queries.
Step 1: Create products
Create subscription products and pricing first to define what is sold, billing currency, and presentation. When creating a price, setpriceType so you know whether debits are cyclic or merchant-initiated after auth.
Core APIs:
POST /merchant/open/v1/pay/merchant/product/createGET /merchant/open/v1/pay/merchant/product/pageQueryGET /merchant/open/v1/pay/merchant/product/queryOne
Step 2: Create subscription plans
Plans define rules such as billing cycle, trial, end conditions, and promotions. Associate each plan with the product or price created earlier. Core APIs:POST /open/v1/plan/saveGET /open/v1/plan/listGET /open/v1/plan/detail
Step 3: Create subscription orders
When the user confirms purchase, your backend creates a subscription order. The response includessubscriptionLink for the authorization page.
Core APIs:
POST /open/v1/order/createGET /open/v1/order/listGET /open/v1/order/detail
Step 4: Guide the user through authorization
Redirect the user tosubscriptionLink to complete authorization.
- FIX_AMOUNT: After authorization, the subscription enters the planned recurring debit phase.
- ACCOUNT_AUTH: After authorization, you hold account debit authorization; call
POST /open/v1/order/deductfrom your server when you need to debit.
Step 5: Track order and debit status
Prefer notifications for subscription order status and each debit outcome; use query APIs as a fallback. Core APIs:GET /open/v1/deduction/order/listGET /open/v1/deduction/order/detailPOST /open/v1/order/deduct(merchant-initiated debit forACCOUNT_AUTH)
subscriptionOrderNotifyWebhook: subscription order status updatessubscriptionOrderPaymentNotifyWebhook: payment / deduction notifications
Integration notes
- Store separate business IDs for products, plans, and orders to simplify reconciliation and support.
- After order creation, send users to authorization quickly to reduce drop-off.
- Treat “subscription order status” and “debit status” as two related but separate tracks; for
ACCOUNT_AUTH, also distinguish authorized amount vs total debited. - FIX_AMOUNT: recurring debits are ongoing—do not infer long-term health from a single API response.
- ACCOUNT_AUTH: implement authorization validity, idempotent debits, and retry policy on the server to avoid duplicate or missing debits.
- If you have a membership or entitlement system, map subscription states explicitly to internal entitlements instead of equating a single payment result with access.
FAQ
Which currencies and payment methods are supported?
Major Web3 wallets are supported, or users can authorize USDT/USDC in the Gate App for subscription. If you have enabled Stripe, linked accounts can be used for fiat subscription payments.How long is a subscription order valid?
There is no single fixed “validity” window. The order ends based on configured termination such astotalPayCount or endTime. If neither is set, it is usually treated as an ongoing subscription.
How do I configure a trial period?
SettrialDays on the subscription plan. No formal debit runs during the trial; after the trial, debits follow product and plan rules.
How do I configure a first-period discount?
When creating product pricing for subscription, setpromoConfigType:
FIX_AMOUNT: setpromoAmountas the discounted amount for the first periodRATE: setpromoRateas the discount ratio, e.g.0.1for a 10% price
How can a merchant manually end a subscription?
CallPOST /open/v1/order/complete with operationType=FINISH. No further debits are executed after completion.
Who initiates debits in ACCOUNT_AUTH mode?
The merchant triggers debits from the backend when needed by callingPOST /open/v1/order/deduct with amount and currency, then reconcile with notifications and deduction query APIs.
Order status
| Status | Description |
|---|---|
CREATED | Order created; waiting for user authorization |
AUTHORIZED | Authorized; waiting for the first debit or for the merchant to initiate a debit |
CONFIRMING | Confirming; awaiting the first subscription confirmation deduction result |
TRIAL | In trial; formal debit has not started |
RUNNING | Running normally; waiting for the platform or the merchant to initiate the next debit |
UNPAID | Current debit failed but close conditions are not met yet |
COMPLETED | End condition reached or merchant completed manually |
CANCELLED | Cancelled by the merchant |
CLOSED | Closed due to an exception, e.g. too many failed debits |
BLOCKED | A debit was made but funds are under risk control |

