Prepare customer wallet transaction
Prepare customer wallet transaction
POST /api/subscriptions/{subscriptionId}/transactions/init-authority
x-gateway-key: sk_live_...

{
  "account": "customer Solana wallet"
}

Returns an unsigned base64 transaction that prepares the customer's wallet for recurring Solana payments.
Create customer subscribe transaction
Create customer subscribe transaction
POST /api/subscriptions/{subscriptionId}/transactions/subscribe
x-gateway-key: sk_live_...

{
  "account": "customer Solana wallet",
  "expectedSubscriptionAuthorityInitId": "1"
}

Returns an unsigned base64 transaction for the customer wallet to subscribe to the plan.
expectedSubscriptionAuthorityInitId is optional. Leave it out to let Gateway read the customer's SubscriptionAuthority from Solana.
Cancel customer subscription transaction
Cancel customer subscription transaction
POST /api/subscriptions/{subscriptionId}/transactions/cancel
x-gateway-key: sk_live_...

{
  "account": "customer Solana wallet"
}

Returns an unsigned base64 transaction that lets the customer cancel the subscription on Solana.
Customers can still cancel subscriptions on paused or archived plans, so businesses can retire offers without trapping existing customers.
Resume customer subscription transaction
Resume customer subscription transaction
POST /api/subscriptions/{subscriptionId}/transactions/resume
x-gateway-key: sk_live_...

{
  "account": "customer Solana wallet"
}

Returns an unsigned base64 transaction that lets the customer resume a canceled subscription on Solana before the current period ends. Gateway keeps the existing billing window instead of restarting billing.
Confirm subscription action
Confirm subscription action
POST /api/subscriptions/{subscriptionId}/confirm
x-gateway-key: sk_live_...

{
  "action": "subscribe | collect | cancel | resume",
  "signature": "solana transaction signature"
}

Verifies the matching subscription transaction, updates the customer subscription status or next billing date, sends a signed subscription callback, and notifies the customer chat in Telegram. Gateway reads the transaction at finalized commitment, about 13 seconds after it is sent; before that the request fails with a not-found error and should be retried.
Expire canceled subscription
Expire canceled subscription
POST /api/subscriptions/{subscriptionId}/expire
x-gateway-key: sk_live_...

Expires a canceled customer subscription after the current period ends. This sends a subscription.expired callback and Telegram notification, but does not build a Solana transaction or charge a gateway fee. Retries for an already EXPIRED subscription return the stored subscription without sending another subscription.expired callback or Telegram message.