---
title: "Assinaturas"
description: "Planos, assinaturas e renovações."
---
<div class="lm-ref-kicker"><code>subscriptions</code><span>namespace</span></div>

Planos, assinaturas e renovações.

<div class="lm-ref-stats lm-ref-stats--compact">
  <div class="lm-ref-stat"><strong>8</strong><span>métodos</span></div>
  <div class="lm-ref-stat"><code>subscriptions</code><span>namespace</span></div>
</div>

> Esta página é gerada automaticamente pelo `@luckymaker/sdk-generator`. Não edite manualmente.

## `cancelSubscription`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/subscriptions/:id/cancel</code></div>

Assinatura:

```ts
cancelSubscription(id: string, body?: CancelSubscriptionBody, settings?: SdkSettings): Promise<CancelSubscriptionResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Body

| Nome | Tipo | Obrigatório |
|---|---|---|
| `feedback` | `"FINANCIAL" \| "NOT_USING" \| "BETTER_ALTERNATIVE" \| "TOO_EXPENSIVE" \| "RESUBSCRIBE_INTENT" \| "OTHER"` | não |
| `comment` | `string` | não |

### Tipos

```ts
type CancelSubscriptionParams = { "id": string; };
type CancelSubscriptionBody = { "feedback"?: "FINANCIAL" | "NOT_USING" | "BETTER_ALTERNATIVE" | "TOO_EXPENSIVE" | "RESUBSCRIBE_INTENT" | "OTHER"; "comment"?: string; };
type CancelSubscriptionResponse = unknown;
```

### Exemplo

```ts
const response = await sdk.subscriptions.cancelSubscription("string", { "feedback": "FINANCIAL", "comment": "string" });
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=cancelSubscription">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getPayments`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/subscriptions/:id/payments</code></div>

Assinatura:

```ts
getPayments(id: string, query?: GetPaymentsQuery, settings?: SdkSettings): Promise<GetPaymentsResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Query

| Nome | Tipo | Obrigatório |
|---|---|---|
| `page` | `number` | não |

### Tipos

```ts
type GetPaymentsParams = { "id": string; };
type GetPaymentsQuery = { "page"?: number; };
type GetPaymentsResponse = unknown;
```

### Exemplo

```ts
const response = await sdk.subscriptions.getPayments("string");
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=getPayments">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getPlan`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/subscriptions/:id</code></div>

Assinatura:

```ts
getPlan(id: string, settings?: SdkSettings): Promise<GetPlanResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Tipos

```ts
type GetPlanParams = { "id": string; };
type GetPlanResponse = { "id": string; "name": string; "description"?: null | string; "benefitsDescription": string; "benefits": Array<{ "title": string; "description": string; "icon": string; }>; "price": number; "isSelling": boolean; "timeUnit": "WEEK" | "MONTH"; "timeUnitAmount": number; "billingLabel": string; "ecommerceItemId"?: null | string; "ecommerceItem"?: null | { "id": string; "title": string; }; "thumbnail": { "url"?: null | string; }; "badges": Array<{ "type": string; "label": string; "bgColor": string; "txtColor": string; "tooltip"?: string; }>; "backgroundColor"?: null | string; "textColor"?: null | string; "rewardItems"?: Array<{ "type": "RAFFLE_NUMBERS" | "CREDITS" | "ECOMMERCE_ITEM" | "BENEFITS_CLUB_POINTS" | "SUBSCRIPTION" | "SHIPPING"; "label": string; "excerpt"?: null | string; "totalAmount": number; }>; "showcaseDiscount"?: { "offerId": string; "discountType": "FIXED" | "PERCENTAGE"; "discountValue": number; "durationCycles": number; "requiresNeverPurchasedPlan": boolean; } | null; };
```

### Exemplo

```ts
const response = await sdk.subscriptions.getPlan("string");
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=getPlan">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getSubscription`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/subscriptions/:id</code></div>

Assinatura:

```ts
getSubscription(id: string, settings?: SdkSettings): Promise<GetSubscriptionResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Tipos

```ts
type GetSubscriptionParams = { "id": string; };
type GetSubscriptionResponse = unknown;
```

### Exemplo

```ts
const response = await sdk.subscriptions.getSubscription("string");
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=getSubscription">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `getSummary`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/subscriptions/summary</code></div>

Assinatura:

```ts
getSummary(settings?: SdkSettings): Promise<GetSummaryResponse>
```

### Tipos

```ts
type GetSummaryResponse = { "everSubscribedPlanIds": Array<string>; "activePlanIds": Array<string>; };
```

### Exemplo

```ts
const response = await sdk.subscriptions.getSummary();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=getSummary">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `listPlans`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/subscriptions/plans</code></div>

Assinatura:

```ts
listPlans(settings?: SdkSettings): Promise<ListPlansResponse>
```

### Tipos

```ts
type ListPlansResponse = Array<{ "id": string; "name": string; "description"?: null | string; "benefitsDescription": string; "benefits": Array<{ "title": string; "description": string; "icon": string; }>; "price": number; "isSelling": boolean; "timeUnit": "WEEK" | "MONTH"; "timeUnitAmount": number; "billingLabel": string; "ecommerceItemId"?: null | string; "ecommerceItem"?: null | { "id": string; "title": string; }; "thumbnail": { "url"?: null | string; }; "badges": Array<{ "type": string; "label": string; "bgColor": string; "txtColor": string; "tooltip"?: string; }>; "backgroundColor"?: null | string; "textColor"?: null | string; "rewardItems"?: Array<{ "type": "RAFFLE_NUMBERS" | "CREDITS" | "ECOMMERCE_ITEM" | "BENEFITS_CLUB_POINTS" | "SUBSCRIPTION" | "SHIPPING"; "label": string; "excerpt"?: null | string; "totalAmount": number; }>; "showcaseDiscount"?: { "offerId": string; "discountType": "FIXED" | "PERCENTAGE"; "discountValue": number; "durationCycles": number; "requiresNeverPurchasedPlan": boolean; } | null; }>;
```

### Exemplo

```ts
const response = await sdk.subscriptions.listPlans();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=listPlans">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `listSubscriptions`

<div class="lm-endpoint"><span class="lm-http lm-http--get">GET</span><code>/user/subscriptions</code></div>

Assinatura:

```ts
listSubscriptions(settings?: SdkSettings): Promise<ListSubscriptionsResponse>
```

### Tipos

```ts
type ListSubscriptionsResponse = Array<{ "id": string; "userId": number; "planId": string; "paymentId": number; "status": "PENDING_FIRST_PAYMENT" | "PENDING_RENEWAL" | "ACTIVE" | "CANCELLED" | "EXPIRED"; "optOutReason": "USER_REQUESTED" | "ADMIN_REQUESTED" | "PAYMENT_FAILED" | "AUTHORIZATION_REVOKED" | "LOST_GATEWAY_TRACKING" | null; "cancellationFeedback": "FINANCIAL" | "NOT_USING" | "BETTER_ALTERNATIVE" | "TOO_EXPENSIVE" | "RESUBSCRIBE_INTENT" | "OTHER" | null; "cancellationComment": string | null; "optedOutAt": string | null; "canReactivate": boolean; "gateway": string; "price": number; "timeUnit": "WEEK" | "MONTH"; "timeUnitAmount": number; "billingLabel": string; "nextBillingAt": string | null; "lastBillingAt"?: string | null; "createdAt": string; "updatedAt": string; "discountedPrice"?: number | null; "activeDiscounts"?: Array<{ "id": string; "sourceType": string; "discountType": "FIXED" | "PERCENTAGE"; "discountValue": number; "totalCycles": number; "remainingCycles": number; }>; "plan"?: { "id": string; "name": string; "description"?: null | string; "benefitsDescription": string; "benefits": Array<{ "title": string; "description": string; "icon": string; }>; "price": number; "isSelling": boolean; "timeUnit": "WEEK" | "MONTH"; "timeUnitAmount": number; "billingLabel": string; "ecommerceItemId"?: null | string; "ecommerceItem"?: null | { "id": string; "title": string; }; "thumbnail": { "url"?: null | string; }; "badges": Array<{ "type": string; "label": string; "bgColor": string; "txtColor": string; "tooltip"?: string; }>; "backgroundColor"?: null | string; "textColor"?: null | string; "rewardItems"?: Array<{ "type": "RAFFLE_NUMBERS" | "CREDITS" | "ECOMMERCE_ITEM" | "BENEFITS_CLUB_POINTS" | "SUBSCRIPTION" | "SHIPPING"; "label": string; "excerpt"?: null | string; "totalAmount": number; }>; "showcaseDiscount"?: { "offerId": string; "discountType": "FIXED" | "PERCENTAGE"; "discountValue": number; "durationCycles": number; "requiresNeverPurchasedPlan": boolean; } | null; }; }>;
```

### Exemplo

```ts
const response = await sdk.subscriptions.listSubscriptions();
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=listSubscriptions">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>

## `renewSubscription`

<div class="lm-endpoint"><span class="lm-http lm-http--post">POST</span><code>/user/subscriptions/:id/renew</code></div>

Assinatura:

```ts
renewSubscription(id: string, settings?: SdkSettings): Promise<RenewSubscriptionResponse>
```

### Parâmetros de rota

| Nome | Tipo |
|---|---|
| `id` | `string` |

### Tipos

```ts
type RenewSubscriptionParams = { "id": string; };
type RenewSubscriptionResponse = unknown;
```

### Exemplo

```ts
const response = await sdk.subscriptions.renewSubscription("string");
```

<a class="lm-playground-link" href="/docs/guias/playground/?namespace=subscriptions&method=renewSubscription">Testar esta função no playground <svg class="lm-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg></a>