# `PolarExpress.Services.SubscriptionsService`
[🔗](https://github.com/jeffhuen/polar_express/blob/main/lib/polar_express/services/subscriptions_service.ex#L2)

Subscriptions

Subscriptions API operations.

# `create_subscription`

```elixir
@spec create_subscription(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.Subscription.t()}
  | {:error, PolarExpress.Error.t()}
```

Create Subscription

Create a subscription programmatically.

This endpoint only allows to create subscription on free products.
For paid products, use the checkout flow.

No initial order will be created and no confirmation email will be sent.

**Scopes**: `subscriptions:write`

See `PolarExpress.Params.SubscriptionsCreateSubscriptionParams` for parameter details.

# `export_subscriptions`

```elixir
@spec export_subscriptions(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, term()} | {:error, PolarExpress.Error.t()}
```

Export Subscriptions

Export subscriptions as a CSV file.

**Scopes**: `subscriptions:read` `subscriptions:write`

See `PolarExpress.Params.SubscriptionsExportSubscriptionsParams` for parameter details.

# `get_subscription`

```elixir
@spec get_subscription(PolarExpress.Client.t(), String.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.Subscription.t()}
  | {:error, PolarExpress.Error.t()}
```

Get Subscription

Get a subscription by ID.

**Scopes**: `subscriptions:read` `subscriptions:write`

See `PolarExpress.Params.SubscriptionsGetSubscriptionParams` for parameter details.

# `list_subscriptions`

```elixir
@spec list_subscriptions(PolarExpress.Client.t(), map(), keyword()) ::
  {:ok, PolarExpress.ListObject.t()} | {:error, PolarExpress.Error.t()}
```

List Subscriptions

List subscriptions.

**Scopes**: `subscriptions:read` `subscriptions:write`

See `PolarExpress.Params.SubscriptionsListSubscriptionsParams` for parameter details.

# `revoke_subscription`

```elixir
@spec revoke_subscription(PolarExpress.Client.t(), String.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.Subscription.t()}
  | {:error, PolarExpress.Error.t()}
```

Revoke Subscription

Revoke a subscription, i.e cancel immediately.

**Scopes**: `subscriptions:write`

See `PolarExpress.Params.SubscriptionsRevokeSubscriptionParams` for parameter details.

# `update_subscription`

```elixir
@spec update_subscription(PolarExpress.Client.t(), String.t(), map(), keyword()) ::
  {:ok, PolarExpress.Schemas.Subscription.t()}
  | {:error, PolarExpress.Error.t()}
```

Update Subscription

Update a subscription.

**Scopes**: `subscriptions:write`

See `PolarExpress.Params.SubscriptionsUpdateSubscriptionParams` for parameter details.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
