Assinaturas
subscriptionsnamespacePlanos, assinaturas e renovações.
8métodos
subscriptionsnamespaceEsta página é gerada automaticamente pelo
@luckymaker/sdk-generator. Não edite manualmente.
cancelSubscription
Seção intitulada “cancelSubscription”POST
/user/subscriptions/:id/cancelAssinatura:
cancelSubscription(id: string, body?: CancelSubscriptionBody, settings?: SdkSettings): Promise<CancelSubscriptionResponse>Parâmetros de rota
Seção intitulada “Parâmetros de rota”| 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;Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.cancelSubscription("string", { "feedback": "FINANCIAL", "comment": "string" });Testar esta função no playground
getPayments
Seção intitulada “getPayments”GET
/user/subscriptions/:id/paymentsAssinatura:
getPayments(id: string, query?: GetPaymentsQuery, settings?: SdkSettings): Promise<GetPaymentsResponse>Parâmetros de rota
Seção intitulada “Parâmetros de rota”| Nome | Tipo |
|---|---|
id |
string |
| Nome | Tipo | Obrigatório |
|---|---|---|
page |
number |
não |
type GetPaymentsParams = { "id": string; };type GetPaymentsQuery = { "page"?: number; };type GetPaymentsResponse = unknown;Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.getPayments("string");Testar esta função no playground
getPlan
Seção intitulada “getPlan”GET
/subscriptions/:idAssinatura:
getPlan(id: string, settings?: SdkSettings): Promise<GetPlanResponse>Parâmetros de rota
Seção intitulada “Parâmetros de rota”| 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; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.getPlan("string");Testar esta função no playground
getSubscription
Seção intitulada “getSubscription”GET
/user/subscriptions/:idAssinatura:
getSubscription(id: string, settings?: SdkSettings): Promise<GetSubscriptionResponse>Parâmetros de rota
Seção intitulada “Parâmetros de rota”| Nome | Tipo |
|---|---|
id |
string |
type GetSubscriptionParams = { "id": string; };type GetSubscriptionResponse = unknown;Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.getSubscription("string");Testar esta função no playground
getSummary
Seção intitulada “getSummary”GET
/user/subscriptions/summaryAssinatura:
getSummary(settings?: SdkSettings): Promise<GetSummaryResponse>type GetSummaryResponse = { "everSubscribedPlanIds": Array<string>; "activePlanIds": Array<string>; };Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.getSummary();Testar esta função no playground
listPlans
Seção intitulada “listPlans”GET
/subscriptions/plansAssinatura:
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; }>;Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.listPlans();Testar esta função no playground
listSubscriptions
Seção intitulada “listSubscriptions”GET
/user/subscriptionsAssinatura:
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; }; }>;Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.listSubscriptions();Testar esta função no playground
renewSubscription
Seção intitulada “renewSubscription”POST
/user/subscriptions/:id/renewAssinatura:
renewSubscription(id: string, settings?: SdkSettings): Promise<RenewSubscriptionResponse>Parâmetros de rota
Seção intitulada “Parâmetros de rota”| Nome | Tipo |
|---|---|
id |
string |
type RenewSubscriptionParams = { "id": string; };type RenewSubscriptionResponse = unknown;Exemplo
Seção intitulada “Exemplo”const response = await sdk.subscriptions.renewSubscription("string");