public interface SubscriptionsApi
| Modifier and Type | Method and Description |
|---|---|
CancelSubscriptionResponse |
cancelSubscription(String subscriptionId)
Schedules a `CANCEL` action to cancel an active subscription by setting the `canceled_date`
field to the end of the active billing period and changing the subscription status from
ACTIVE to CANCELED after this date.
|
CompletableFuture<CancelSubscriptionResponse> |
cancelSubscriptionAsync(String subscriptionId)
Schedules a `CANCEL` action to cancel an active subscription by setting the `canceled_date`
field to the end of the active billing period and changing the subscription status from
ACTIVE to CANCELED after this date.
|
CreateSubscriptionResponse |
createSubscription(CreateSubscriptionRequest body)
Creates a subscription to a subscription plan by a customer.
|
CompletableFuture<CreateSubscriptionResponse> |
createSubscriptionAsync(CreateSubscriptionRequest body)
Creates a subscription to a subscription plan by a customer.
|
DeleteSubscriptionActionResponse |
deleteSubscriptionAction(String subscriptionId,
String actionId)
Deletes a scheduled action for a subscription.
|
CompletableFuture<DeleteSubscriptionActionResponse> |
deleteSubscriptionActionAsync(String subscriptionId,
String actionId)
Deletes a scheduled action for a subscription.
|
ListSubscriptionEventsResponse |
listSubscriptionEvents(String subscriptionId,
String cursor,
Integer limit)
Lists all events for a specific subscription.
|
CompletableFuture<ListSubscriptionEventsResponse> |
listSubscriptionEventsAsync(String subscriptionId,
String cursor,
Integer limit)
Lists all events for a specific subscription.
|
PauseSubscriptionResponse |
pauseSubscription(String subscriptionId,
PauseSubscriptionRequest body)
Schedules a `PAUSE` action to pause an active subscription.
|
CompletableFuture<PauseSubscriptionResponse> |
pauseSubscriptionAsync(String subscriptionId,
PauseSubscriptionRequest body)
Schedules a `PAUSE` action to pause an active subscription.
|
ResumeSubscriptionResponse |
resumeSubscription(String subscriptionId,
ResumeSubscriptionRequest body)
Schedules a `RESUME` action to resume a paused or a deactivated subscription.
|
CompletableFuture<ResumeSubscriptionResponse> |
resumeSubscriptionAsync(String subscriptionId,
ResumeSubscriptionRequest body)
Schedules a `RESUME` action to resume a paused or a deactivated subscription.
|
RetrieveSubscriptionResponse |
retrieveSubscription(String subscriptionId,
String include)
Retrieves a subscription.
|
CompletableFuture<RetrieveSubscriptionResponse> |
retrieveSubscriptionAsync(String subscriptionId,
String include)
Retrieves a subscription.
|
SearchSubscriptionsResponse |
searchSubscriptions(SearchSubscriptionsRequest body)
Searches for subscriptions.
|
CompletableFuture<SearchSubscriptionsResponse> |
searchSubscriptionsAsync(SearchSubscriptionsRequest body)
Searches for subscriptions.
|
SwapPlanResponse |
swapPlan(String subscriptionId,
SwapPlanRequest body)
Schedules a `SWAP_PLAN` action to swap a subscription plan in an existing subscription.
|
CompletableFuture<SwapPlanResponse> |
swapPlanAsync(String subscriptionId,
SwapPlanRequest body)
Schedules a `SWAP_PLAN` action to swap a subscription plan in an existing subscription.
|
UpdateSubscriptionResponse |
updateSubscription(String subscriptionId,
UpdateSubscriptionRequest body)
Updates a subscription.
|
CompletableFuture<UpdateSubscriptionResponse> |
updateSubscriptionAsync(String subscriptionId,
UpdateSubscriptionRequest body)
Updates a subscription.
|
CreateSubscriptionResponse createSubscription(CreateSubscriptionRequest body) throws ApiException, IOException
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<CreateSubscriptionResponse> createSubscriptionAsync(CreateSubscriptionRequest body)
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.SearchSubscriptionsResponse searchSubscriptions(SearchSubscriptionsRequest body) throws ApiException, IOException
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<SearchSubscriptionsResponse> searchSubscriptionsAsync(SearchSubscriptionsRequest body)
body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.RetrieveSubscriptionResponse retrieveSubscription(String subscriptionId, String include) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription to retrieve.include - Optional parameter: A query parameter to specify related information to be
included in the response. The supported query parameter values are: - `actions`: to
include scheduled actions on the targeted subscription.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<RetrieveSubscriptionResponse> retrieveSubscriptionAsync(String subscriptionId, String include)
subscriptionId - Required parameter: The ID of the subscription to retrieve.include - Optional parameter: A query parameter to specify related information to be
included in the response. The supported query parameter values are: - `actions`: to
include scheduled actions on the targeted subscription.UpdateSubscriptionResponse updateSubscription(String subscriptionId, UpdateSubscriptionRequest body) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<UpdateSubscriptionResponse> updateSubscriptionAsync(String subscriptionId, UpdateSubscriptionRequest body)
subscriptionId - Required parameter: The ID of the subscription to update.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.DeleteSubscriptionActionResponse deleteSubscriptionAction(String subscriptionId, String actionId) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription the targeted action is
to act upon.actionId - Required parameter: The ID of the targeted action to be deleted.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<DeleteSubscriptionActionResponse> deleteSubscriptionActionAsync(String subscriptionId, String actionId)
subscriptionId - Required parameter: The ID of the subscription the targeted action is
to act upon.actionId - Required parameter: The ID of the targeted action to be deleted.CancelSubscriptionResponse cancelSubscription(String subscriptionId) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription to cancel.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<CancelSubscriptionResponse> cancelSubscriptionAsync(String subscriptionId)
subscriptionId - Required parameter: The ID of the subscription to cancel.ListSubscriptionEventsResponse listSubscriptionEvents(String subscriptionId, String cursor, Integer limit) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription to retrieve the events
for.cursor - Optional parameter: When the total number of resulting subscription events
exceeds the limit of a paged response, specify the cursor returned from a preceding
response here to fetch the next set of results. If the cursor is unset, the response
contains the last page of the results. For more information, see
[Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).limit - Optional parameter: The upper limit on the number of subscription events to
return in a paged response.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<ListSubscriptionEventsResponse> listSubscriptionEventsAsync(String subscriptionId, String cursor, Integer limit)
subscriptionId - Required parameter: The ID of the subscription to retrieve the events
for.cursor - Optional parameter: When the total number of resulting subscription events
exceeds the limit of a paged response, specify the cursor returned from a preceding
response here to fetch the next set of results. If the cursor is unset, the response
contains the last page of the results. For more information, see
[Pagination](https://developer.squareup.com/docs/working-with-apis/pagination).limit - Optional parameter: The upper limit on the number of subscription events to
return in a paged response.PauseSubscriptionResponse pauseSubscription(String subscriptionId, PauseSubscriptionRequest body) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription to pause.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<PauseSubscriptionResponse> pauseSubscriptionAsync(String subscriptionId, PauseSubscriptionRequest body)
subscriptionId - Required parameter: The ID of the subscription to pause.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ResumeSubscriptionResponse resumeSubscription(String subscriptionId, ResumeSubscriptionRequest body) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription to resume.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<ResumeSubscriptionResponse> resumeSubscriptionAsync(String subscriptionId, ResumeSubscriptionRequest body)
subscriptionId - Required parameter: The ID of the subscription to resume.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.SwapPlanResponse swapPlan(String subscriptionId, SwapPlanRequest body) throws ApiException, IOException
subscriptionId - Required parameter: The ID of the subscription to swap the
subscription plan for.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.CompletableFuture<SwapPlanResponse> swapPlanAsync(String subscriptionId, SwapPlanRequest body)
subscriptionId - Required parameter: The ID of the subscription to swap the
subscription plan for.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.Copyright © 2022. All rights reserved.