> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Subscriptions Overview

> Accept recurring USDC payments using spend permissions on Base

Defined in the [Coinbase Wallet SDK](https://github.com/base/account-sdk)

<Info>
  Base Subscriptions enable recurring USDC payments. Users grant your application permission to charge their account periodically, eliminating the need for manual approvals on each payment. **No fees for merchants or users.**
</Info>

## How Subscriptions Work

<Steps>
  <Step title="User Creates Subscription">
    User approves a spend permission for your application to charge a specific amount periodically.
  </Step>

  <Step title="Application Charges Periodically">
    Your backend charges the subscription when payment is due, up to the permitted amount per period.
  </Step>

  <Step title="Automatic Period Reset">
    The spending limit resets automatically at the start of each new period.
  </Step>

  <Step title="User Can Cancel Anytime">
    Users maintain full control and can revoke the permission at any time.
  </Step>
</Steps>

## Core Functions

<CardGroup cols={3}>
  <Card title="Subscribe" icon="credit-card" href="/coinbase-wallet/reference/base-pay/subscribe">
    Create a new subscription with spend permissions
  </Card>

  <Card title="getStatus" icon="chart-line" href="/coinbase-wallet/reference/base-pay/getStatus">
    Check subscription status and remaining charges
  </Card>

  <Card title="Charge" icon="bolt" href="/coinbase-wallet/reference/base-pay/charge">
    Charge a subscription from your backend (Node.js only)
  </Card>

  <Card title="Revoke" icon="ban" href="/coinbase-wallet/reference/base-pay/revoke">
    Cancel a subscription from your backend (Node.js only)
  </Card>

  <Card title="getOrCreateSubscriptionOwnerWallet" icon="wallet" href="/coinbase-wallet/reference/base-pay/getOrCreateSubscriptionOwnerWallet">
    Setup CDP smart wallet for subscription management (Node.js only)
  </Card>

  <Card title="prepareCharge" icon="receipt" href="/coinbase-wallet/reference/base-pay/prepareCharge">
    Advanced: Prepare transaction calls to charge a subscription
  </Card>

  <Card title="prepareRevoke" icon="code" href="/coinbase-wallet/reference/base-pay/prepareRevoke">
    Advanced: Prepare transaction calls to revoke a subscription
  </Card>
</CardGroup>

## Type Definitions

```typescript Type Definitions lines wrap expandable theme={null}
// Subscription creation options
interface SubscriptionOptions {
  recurringCharge: string;
  subscriptionOwner: string;
  periodInDays?: number;
  testnet?: boolean;
  telemetry?: boolean;
}

// Subscription result
interface SubscriptionResult {
  id: string;
  subscriptionOwner: Address;
  subscriptionPayer: Address;
  recurringCharge: string;
  periodInDays: number;
}

// Subscription status
interface SubscriptionStatus {
  isSubscribed: boolean;
  recurringCharge: string;
  remainingChargeInPeriod?: string;
  currentPeriodStart?: Date;
  nextPeriodStart?: Date;
  periodInDays?: number;
}

// Charge options (Node.js backend only)
interface ChargeOptions {
  id: string;
  amount: string | 'max-remaining-charge';
  paymasterUrl?: string;
  recipient?: Address;
  testnet?: boolean;
}

// Charge result
interface ChargeResult {
  id: string;
  amount: string;
  recipient?: Address;
}

// Revoke options (Node.js backend only)
interface RevokeOptions {
  id: string;
  paymasterUrl?: string;
  testnet?: boolean;
}

// Revoke result
interface RevokeResult {
  id: string;
}

// Subscription owner wallet setup (Node.js backend only)
interface GetOrCreateSubscriptionOwnerWalletOptions {
  walletName?: string;
}

interface SubscriptionOwnerWallet {
  address: Address;
  walletName: string;
}

// Charge preparation (advanced)
interface PrepareChargeOptions {
  id: string;
  amount: string | 'max-remaining-charge';
  recipient?: Address;
  testnet?: boolean;
}

type PrepareChargeResult = Array<{
  to: Address;
  data: Hex;
  value: '0x0';
}>;

// Revoke preparation (advanced)
interface PrepareRevokeOptions {
  id: string;
  testnet?: boolean;
}

type PrepareRevokeResult = {
  to: Address;
  data: Hex;
  value: '0x0';
};
```

## Next Steps

<CardGroup cols={3}>
  <Card title="Subscribe() Reference" icon="book" href="/coinbase-wallet/reference/base-pay/subscribe">
    Learn how to implement recurring payments with Base Pay
  </Card>

  <Card title="One-Time Payments Guide" icon="book" href="/coinbase-wallet/guides/accept-payments">
    Learn how to implement one-time payments with Base Pay
  </Card>

  <Card title="Spend Permissions" icon="shield" href="/coinbase-wallet/improve-ux/spend-permissions">
    Deep dive into Spend Permissions
  </Card>
</CardGroup>
