Pular para o conteúdo

Assinaturas

subscriptionsnamespace

Planos, assinaturas e renovações.

8métodos
subscriptionsnamespace

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

POST/user/subscriptions/:id/cancel

Assinatura:

cancelSubscription(id: string, body?: CancelSubscriptionBody, settings?: SdkSettings): Promise<CancelSubscriptionResponse>
Nome Tipo
id string
Nome Tipo Obrigatório
feedback "FINANCIAL" | "NOT_USING" | "BETTER_ALTERNATIVE" | "TOO_EXPENSIVE" | "RESUBSCRIBE_INTENT" | "OTHER" não
comment string não
type CancelSubscriptionParams = { "id": string; };
type CancelSubscriptionBody = { "feedback"?: "FINANCIAL" | "NOT_USING" | "BETTER_ALTERNATIVE" | "TOO_EXPENSIVE" | "RESUBSCRIBE_INTENT" | "OTHER"; "comment"?: string; };
type CancelSubscriptionResponse = unknown;
const response = await sdk.subscriptions.cancelSubscription("string", { "feedback": "FINANCIAL", "comment": "string" });

Testar esta função no playground

GET/user/subscriptions/:id/payments

Assinatura:

getPayments(id: string, query?: GetPaymentsQuery, settings?: SdkSettings): Promise<GetPaymentsResponse>
Nome Tipo
id string
Nome Tipo Obrigatório
page number não
type GetPaymentsParams = { "id": string; };
type GetPaymentsQuery = { "page"?: number; };
type GetPaymentsResponse = unknown;
const response = await sdk.subscriptions.getPayments("string");

Testar esta função no playground

GET/subscriptions/:id

Assinatura:

getPlan(id: string, settings?: SdkSettings): Promise<GetPlanResponse>
Nome Tipo
id string
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; };
const response = await sdk.subscriptions.getPlan("string");

Testar esta função no playground

GET/user/subscriptions/:id

Assinatura:

getSubscription(id: string, settings?: SdkSettings): Promise<GetSubscriptionResponse>
Nome Tipo
id string
type GetSubscriptionParams = { "id": string; };
type GetSubscriptionResponse = unknown;
const response = await sdk.subscriptions.getSubscription("string");

Testar esta função no playground

GET/user/subscriptions/summary

Assinatura:

getSummary(settings?: SdkSettings): Promise<GetSummaryResponse>
type GetSummaryResponse = { "everSubscribedPlanIds": Array<string>; "activePlanIds": Array<string>; };
const response = await sdk.subscriptions.getSummary();

Testar esta função no playground

GET/subscriptions/plans

Assinatura:

listPlans(settings?: SdkSettings): Promise<ListPlansResponse>
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; }>;
const response = await sdk.subscriptions.listPlans();

Testar esta função no playground

GET/user/subscriptions

Assinatura:

listSubscriptions(settings?: SdkSettings): Promise<ListSubscriptionsResponse>
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; }; }>;
const response = await sdk.subscriptions.listSubscriptions();

Testar esta função no playground

POST/user/subscriptions/:id/renew

Assinatura:

renewSubscription(id: string, settings?: SdkSettings): Promise<RenewSubscriptionResponse>
Nome Tipo
id string
type RenewSubscriptionParams = { "id": string; };
type RenewSubscriptionResponse = unknown;
const response = await sdk.subscriptions.renewSubscription("string");

Testar esta função no playground