/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { ApiResponse, RequestOptions } from '../core.js'; import { ActivateSubscriptionRequest } from '../models/activateSubscriptionRequest.js'; import { BillingPlan } from '../models/billingPlan.js'; import { CancelSubscriptionRequest } from '../models/cancelSubscriptionRequest.js'; import { CaptureSubscriptionRequest } from '../models/captureSubscriptionRequest.js'; import { CreateSubscriptionRequest } from '../models/createSubscriptionRequest.js'; import { ModifySubscriptionRequest } from '../models/modifySubscriptionRequest.js'; import { ModifySubscriptionResponse } from '../models/modifySubscriptionResponse.js'; import { Patch } from '../models/patch.js'; import { PlanCollection } from '../models/planCollection.js'; import { PlanRequest } from '../models/planRequest.js'; import { Subscription } from '../models/subscription.js'; import { SubscriptionCollection } from '../models/subscriptionCollection.js'; import { SubscriptionTransactionDetails } from '../models/subscriptionTransactionDetails.js'; import { SuspendSubscription } from '../models/suspendSubscription.js'; import { TransactionsList } from '../models/transactionsList.js'; import { UpdatePricingSchemesRequest } from '../models/updatePricingSchemesRequest.js'; import { BaseController } from './baseController.js'; export declare class SubscriptionsController extends BaseController { /** * Creates a plan that defines pricing and billing cycle details for subscriptions. * * @param prefer The preferred server response upon successful completion of the * request. Value is: return=minimal. The server returns a minimal * response to optimize communication between the API caller and the * server. A minimal response includes the id, status and HATEOAS * links. return=representation. The server returns a complete * resource representation, including the current state of the * resource. * @param paypalRequestId The server stores keys for 72 hours. * @param body * @return Response from the API call */ createBillingPlan({ prefer, paypalRequestId, body, }: { prefer?: string; paypalRequestId?: string; body?: PlanRequest; }, requestOptions?: RequestOptions): Promise>; /** * Lists billing plans. * * @param prefer The preferred server response upon successful completion of the request. Value * is: return=minimal. The server returns a minimal response to optimize * communication between the API caller and the server. A minimal response includes * the id, name, description and HATEOAS links. return=representation. The server * returns a complete resource representation, including the current state of the * resource. * @param productId Filters the response by a Product ID. * @param pageSize The number of items to return in the response. * @param page A non-zero integer which is the start index of the entire list of items to * return in the response. The combination of `page=1` and `page_size=20` returns * the first 20 items. The combination of `page=2` and `page_size=20` returns the * next 20 items. * @param totalRequired Indicates whether to show the total count in the response. * @return Response from the API call */ listBillingPlans({ prefer, productId, pageSize, page, totalRequired, }: { prefer?: string; productId?: string; pageSize?: number; page?: number; totalRequired?: boolean; }, requestOptions?: RequestOptions): Promise>; /** * Shows details for a plan, by ID. * * @param id The ID of the plan. * @return Response from the API call */ getBillingPlan(id: string, requestOptions?: RequestOptions): Promise>; /** * Updates a plan with the `CREATED` or `ACTIVE` status. For an `INACTIVE` plan, you can make only * status updates. You can patch these attributes and objects: Attribute or object Operations * description replace payment_preferences.auto_bill_outstanding replace taxes.percentage replace * payment_preferences.payment_failure_threshold replace payment_preferences.setup_fee replace * payment_preferences.setup_fee_failure_action replace name replace * * @param id The ID of the plan. * @param body * @return Response from the API call */ patchBillingPlan({ id, body, }: { id: string; body?: Patch[]; }, requestOptions?: RequestOptions): Promise>; /** * Activates a plan, by ID. * * @param id The ID of the plan. * @return Response from the API call */ activateBillingPlan(id: string, requestOptions?: RequestOptions): Promise>; /** * Deactivates a plan, by ID. * * @param id The ID of the plan. * @return Response from the API call */ deactivateBillingPlan(id: string, requestOptions?: RequestOptions): Promise>; /** * Updates pricing for a plan. For example, you can update a regular billing cycle from $5 per month to * $7 per month. * * @param id The ID for the plan. * @param body * @return Response from the API call */ updateBillingPlanPricingSchemes({ id, body, }: { id: string; body?: UpdatePricingSchemesRequest; }, requestOptions?: RequestOptions): Promise>; /** * Creates a subscription. * * @param prefer The preferred server response upon * successful completion of the request. Value * is: return=minimal. The server returns a * minimal response to optimize communication * between the API caller and the server. A * minimal response includes the id, status and * HATEOAS links. return=representation. The * server returns a complete resource * representation, including the current state * of the resource. * @param paypalRequestId The server stores keys for 72 hours. * @param paypalClientMetadataId The PayPal Client Metadata Id(CMID) is used * to provide device-specific information to * PayPal's risk engine. This is crucial for * transactions that require device-specific * risk assessments. Merchants typically use the * Paypal SDK that automatically submits the * CMID or they use tools like Fraudnet JS for * web or Magnes JS for mobile to generate the * CMID on the frontend and then pass it to the * API as part of the request headers. * @param body * @return Response from the API call */ createSubscription({ prefer, paypalRequestId, paypalClientMetadataId, body, }: { prefer?: string; paypalRequestId?: string; paypalClientMetadataId?: string; body?: CreateSubscriptionRequest; }, requestOptions?: RequestOptions): Promise>; /** * List all subscriptions for merchant account. * * @param planIds Filters the response by list of plan IDs. Filter supports upto 70 plan * IDs. URLs should not exceed a length of 2000 characters. * @param statuses Filters the response by list of subscription statuses. * @param createdAfter Filters the response by subscription creation start time for a range of * subscriptions. * @param createdBefore Filters the response by subscription creation end time for a range of * subscriptions. * @param statusUpdatedBefore Filters the response by status update start time for a range of * subscriptions. * @param statusUpdatedAfter Filters the response by status update end time for a range of * subscriptions. * @param filter Filter the response using complex expressions that could use comparison * operators like ge, gt, le, lt and logical operators such as 'and' and * 'or'. * @param pageSize The number of items to return in the response. * @param page A non-zero integer which is the start index of the entire list of items * to return in the response. The combination of `page=1` and `page_size=20` * returns the first 20 items. The combination of `page=2` and * `page_size=20` returns the next 20 items. * @param customerIds Filters the response by comma separated vault customer IDs (FSS * subscriptions only). * @return Response from the API call */ listSubscriptions({ planIds, statuses, createdAfter, createdBefore, statusUpdatedBefore, statusUpdatedAfter, filter, pageSize, page, customerIds, }: { planIds?: string; statuses?: string; createdAfter?: string; createdBefore?: string; statusUpdatedBefore?: string; statusUpdatedAfter?: string; filter?: string; pageSize?: number; page?: number; customerIds?: string[]; }, requestOptions?: RequestOptions): Promise>; /** * Shows details for a subscription, by ID. * * @param id The ID of the subscription. * @param fields List of fields that are to be returned in the response. Possible value for fields are * last_failed_payment and plan. * @return Response from the API call */ getSubscription({ id, fields, }: { id: string; fields?: string; }, requestOptions?: RequestOptions): Promise>; /** * Updates a subscription which could be in ACTIVE or SUSPENDED status. You can override plan level * default attributes by providing customised values for plan path in the patch request. You cannot * update attributes that have already completed (Example - trial cycles can’t be updated if completed). * Once overridden, changes to plan resource will not impact subscription. Any price update will not * impact billing cycles within next 10 days (Applicable only for subscriptions funded by PayPal * account). Following are the fields eligible for patch. Attribute or object Operations billing_info. * outstanding_balance replace custom_id add,replace plan.billing_cycles[@sequence==n]. pricing_scheme. * fixed_price add,replace plan.billing_cycles[@sequence==n]. pricing_scheme.tiers replace plan. * billing_cycles[@sequence==n]. total_cycles replace plan.payment_preferences. auto_bill_outstanding * replace plan.payment_preferences. payment_failure_threshold replace plan.taxes.inclusive add,replace * plan.taxes.percentage add,replace shipping_amount add,replace start_time replace subscriber. * shipping_address add,replace subscriber.payment_source (for subscriptions funded by card payments) * replace * * @param id The ID for the subscription. * @param body * @return Response from the API call */ patchSubscription({ id, body, }: { id: string; body?: Patch[]; }, requestOptions?: RequestOptions): Promise>; /** * Updates the quantity of the product or service in a subscription. You can also use this method to * switch the plan and update the `shipping_amount`, `shipping_address` values for the subscription. * This type of update requires the buyer's consent. * * @param id The ID of the subscription. * @param body * @return Response from the API call */ reviseSubscription({ id, body, }: { id: string; body?: ModifySubscriptionRequest; }, requestOptions?: RequestOptions): Promise>; /** * Suspends the subscription. * * @param id The ID of the subscription. * @param body * @return Response from the API call */ suspendSubscription({ id, body, }: { id: string; body?: SuspendSubscription; }, requestOptions?: RequestOptions): Promise>; /** * Cancels the subscription. * * @param id The ID of the subscription. * @param body * @return Response from the API call */ cancelSubscription({ id, body, }: { id: string; body?: CancelSubscriptionRequest; }, requestOptions?: RequestOptions): Promise>; /** * Activates the subscription. * * @param id The ID of the subscription. * @param body * @return Response from the API call */ activateSubscription({ id, body, }: { id: string; body?: ActivateSubscriptionRequest; }, requestOptions?: RequestOptions): Promise>; /** * Captures an authorized payment from the subscriber on the subscription. * * @param id The ID of the subscription. * @param paypalRequestId The server stores keys for 72 hours. * @param body * @return Response from the API call */ captureSubscription({ id, paypalRequestId, body, }: { id: string; paypalRequestId?: string; body?: CaptureSubscriptionRequest; }, requestOptions?: RequestOptions): Promise>; /** * Lists transactions for a subscription. * * @param id The ID of the subscription. * @param startTime The start time of the range of transactions to list. * @param endTime The end time of the range of transactions to list. * @return Response from the API call */ listSubscriptionTransactions({ id, startTime, endTime, }: { id: string; startTime: string; endTime: string; }, requestOptions?: RequestOptions): Promise>; } //# sourceMappingURL=subscriptionsController.d.ts.map