public final class DefaultLoyaltyApi extends BaseApi implements LoyaltyApi
AUTHENTICATION_KEY, GLOBAL_ERROR_CASES| Constructor and Description |
|---|
DefaultLoyaltyApi(io.apimatic.core.GlobalConfiguration globalConfig)
Initializes the controller.
|
getClientInstance, getGlobalConfiguration, getHttpCallbackpublic DefaultLoyaltyApi(io.apimatic.core.GlobalConfiguration globalConfig)
globalConfig - Configurations added in client.public CreateLoyaltyAccountResponse createLoyaltyAccount(CreateLoyaltyAccountRequest body) throws ApiException, IOException
createLoyaltyAccount in interface LoyaltyApibody - 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.public CompletableFuture<CreateLoyaltyAccountResponse> createLoyaltyAccountAsync(CreateLoyaltyAccountRequest body)
createLoyaltyAccountAsync in interface LoyaltyApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SearchLoyaltyAccountsResponse searchLoyaltyAccounts(SearchLoyaltyAccountsRequest body) throws ApiException, IOException
searchLoyaltyAccounts in interface LoyaltyApibody - 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.public CompletableFuture<SearchLoyaltyAccountsResponse> searchLoyaltyAccountsAsync(SearchLoyaltyAccountsRequest body)
searchLoyaltyAccountsAsync in interface LoyaltyApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public RetrieveLoyaltyAccountResponse retrieveLoyaltyAccount(String accountId) throws ApiException, IOException
retrieveLoyaltyAccount in interface LoyaltyApiaccountId - Required parameter: The ID of the [loyalty account](entity:LoyaltyAccount)
to retrieve.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveLoyaltyAccountResponse> retrieveLoyaltyAccountAsync(String accountId)
retrieveLoyaltyAccountAsync in interface LoyaltyApiaccountId - Required parameter: The ID of the [loyalty account](entity:LoyaltyAccount)
to retrieve.public AccumulateLoyaltyPointsResponse accumulateLoyaltyPoints(String accountId, AccumulateLoyaltyPointsRequest body) throws ApiException, IOException
accumulateLoyaltyPoints in interface LoyaltyApiaccountId - Required parameter: The ID of the target [loyalty
account](entity:LoyaltyAccount).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.public CompletableFuture<AccumulateLoyaltyPointsResponse> accumulateLoyaltyPointsAsync(String accountId, AccumulateLoyaltyPointsRequest body)
accumulateLoyaltyPointsAsync in interface LoyaltyApiaccountId - Required parameter: The ID of the target [loyalty
account](entity:LoyaltyAccount).body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public AdjustLoyaltyPointsResponse adjustLoyaltyPoints(String accountId, AdjustLoyaltyPointsRequest body) throws ApiException, IOException
adjustLoyaltyPoints in interface LoyaltyApiaccountId - Required parameter: The ID of the target [loyalty
account](entity:LoyaltyAccount).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.public CompletableFuture<AdjustLoyaltyPointsResponse> adjustLoyaltyPointsAsync(String accountId, AdjustLoyaltyPointsRequest body)
adjustLoyaltyPointsAsync in interface LoyaltyApiaccountId - Required parameter: The ID of the target [loyalty
account](entity:LoyaltyAccount).body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SearchLoyaltyEventsResponse searchLoyaltyEvents(SearchLoyaltyEventsRequest body) throws ApiException, IOException
searchLoyaltyEvents in interface LoyaltyApibody - 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.public CompletableFuture<SearchLoyaltyEventsResponse> searchLoyaltyEventsAsync(SearchLoyaltyEventsRequest body)
searchLoyaltyEventsAsync in interface LoyaltyApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.@Deprecated public ListLoyaltyProgramsResponse listLoyaltyPrograms() throws ApiException, IOException
listLoyaltyPrograms in interface LoyaltyApiApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.@Deprecated public CompletableFuture<ListLoyaltyProgramsResponse> listLoyaltyProgramsAsync()
listLoyaltyProgramsAsync in interface LoyaltyApipublic RetrieveLoyaltyProgramResponse retrieveLoyaltyProgram(String programId) throws ApiException, IOException
retrieveLoyaltyProgram in interface LoyaltyApiprogramId - Required parameter: The ID of the loyalty program or the keyword `main`.
Either value can be used to retrieve the single loyalty program that belongs to the
seller.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveLoyaltyProgramResponse> retrieveLoyaltyProgramAsync(String programId)
retrieveLoyaltyProgramAsync in interface LoyaltyApiprogramId - Required parameter: The ID of the loyalty program or the keyword `main`.
Either value can be used to retrieve the single loyalty program that belongs to the
seller.public CalculateLoyaltyPointsResponse calculateLoyaltyPoints(String programId, CalculateLoyaltyPointsRequest body) throws ApiException, IOException
calculateLoyaltyPoints in interface LoyaltyApiprogramId - Required parameter: The ID of the [loyalty
program](entity:LoyaltyProgram), which defines the rules for accruing points.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.public CompletableFuture<CalculateLoyaltyPointsResponse> calculateLoyaltyPointsAsync(String programId, CalculateLoyaltyPointsRequest body)
calculateLoyaltyPointsAsync in interface LoyaltyApiprogramId - Required parameter: The ID of the [loyalty
program](entity:LoyaltyProgram), which defines the rules for accruing points.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public ListLoyaltyPromotionsResponse listLoyaltyPromotions(String programId, String status, String cursor, Integer limit) throws ApiException, IOException
listLoyaltyPromotions in interface LoyaltyApiprogramId - Required parameter: The ID of the base [loyalty
program](entity:LoyaltyProgram). To get the program ID, call
[RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the
`main` keyword.status - Optional parameter: The status to filter the results by. If a status is
provided, only loyalty promotions with the specified status are returned. Otherwise,
all loyalty promotions associated with the loyalty program are returned.cursor - Optional parameter: The cursor returned in the paged response from the
previous call to this endpoint. Provide this cursor to retrieve the next page of
results for your original request. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit - Optional parameter: The maximum number of results to return in a single paged
response. The minimum value is 1 and the maximum value is 30. The default value is
30. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<ListLoyaltyPromotionsResponse> listLoyaltyPromotionsAsync(String programId, String status, String cursor, Integer limit)
listLoyaltyPromotionsAsync in interface LoyaltyApiprogramId - Required parameter: The ID of the base [loyalty
program](entity:LoyaltyProgram). To get the program ID, call
[RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the
`main` keyword.status - Optional parameter: The status to filter the results by. If a status is
provided, only loyalty promotions with the specified status are returned. Otherwise,
all loyalty promotions associated with the loyalty program are returned.cursor - Optional parameter: The cursor returned in the paged response from the
previous call to this endpoint. Provide this cursor to retrieve the next page of
results for your original request. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).limit - Optional parameter: The maximum number of results to return in a single paged
response. The minimum value is 1 and the maximum value is 30. The default value is
30. For more information, see
[Pagination](https://developer.squareup.com/docs/build-basics/common-api-patterns/pagination).public CreateLoyaltyPromotionResponse createLoyaltyPromotion(String programId, CreateLoyaltyPromotionRequest body) throws ApiException, IOException
createLoyaltyPromotion in interface LoyaltyApiprogramId - Required parameter: The ID of the [loyalty program](entity:LoyaltyProgram)
to associate with the promotion. To get the program ID, call
[RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the
`main` keyword.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.public CompletableFuture<CreateLoyaltyPromotionResponse> createLoyaltyPromotionAsync(String programId, CreateLoyaltyPromotionRequest body)
createLoyaltyPromotionAsync in interface LoyaltyApiprogramId - Required parameter: The ID of the [loyalty program](entity:LoyaltyProgram)
to associate with the promotion. To get the program ID, call
[RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the
`main` keyword.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public RetrieveLoyaltyPromotionResponse retrieveLoyaltyPromotion(String promotionId, String programId) throws ApiException, IOException
retrieveLoyaltyPromotion in interface LoyaltyApipromotionId - Required parameter: The ID of the [loyalty
promotion](entity:LoyaltyPromotion) to retrieve.programId - Required parameter: The ID of the base [loyalty
program](entity:LoyaltyProgram). To get the program ID, call
[RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the
`main` keyword.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveLoyaltyPromotionResponse> retrieveLoyaltyPromotionAsync(String promotionId, String programId)
retrieveLoyaltyPromotionAsync in interface LoyaltyApipromotionId - Required parameter: The ID of the [loyalty
promotion](entity:LoyaltyPromotion) to retrieve.programId - Required parameter: The ID of the base [loyalty
program](entity:LoyaltyProgram). To get the program ID, call
[RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the
`main` keyword.public CancelLoyaltyPromotionResponse cancelLoyaltyPromotion(String promotionId, String programId) throws ApiException, IOException
cancelLoyaltyPromotion in interface LoyaltyApipromotionId - Required parameter: The ID of the [loyalty
promotion](entity:LoyaltyPromotion) to cancel. You can cancel a promotion that has an
`ACTIVE` or `SCHEDULED` status.programId - Required parameter: The ID of the base [loyalty
program](entity:LoyaltyProgram).ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<CancelLoyaltyPromotionResponse> cancelLoyaltyPromotionAsync(String promotionId, String programId)
cancelLoyaltyPromotionAsync in interface LoyaltyApipromotionId - Required parameter: The ID of the [loyalty
promotion](entity:LoyaltyPromotion) to cancel. You can cancel a promotion that has an
`ACTIVE` or `SCHEDULED` status.programId - Required parameter: The ID of the base [loyalty
program](entity:LoyaltyProgram).public CreateLoyaltyRewardResponse createLoyaltyReward(CreateLoyaltyRewardRequest body) throws ApiException, IOException
createLoyaltyReward in interface LoyaltyApibody - 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.public CompletableFuture<CreateLoyaltyRewardResponse> createLoyaltyRewardAsync(CreateLoyaltyRewardRequest body)
createLoyaltyRewardAsync in interface LoyaltyApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public SearchLoyaltyRewardsResponse searchLoyaltyRewards(SearchLoyaltyRewardsRequest body) throws ApiException, IOException
searchLoyaltyRewards in interface LoyaltyApibody - 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.public CompletableFuture<SearchLoyaltyRewardsResponse> searchLoyaltyRewardsAsync(SearchLoyaltyRewardsRequest body)
searchLoyaltyRewardsAsync in interface LoyaltyApibody - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.public DeleteLoyaltyRewardResponse deleteLoyaltyReward(String rewardId) throws ApiException, IOException
deleteLoyaltyReward in interface LoyaltyApirewardId - Required parameter: The ID of the [loyalty reward](entity:LoyaltyReward) to
delete.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<DeleteLoyaltyRewardResponse> deleteLoyaltyRewardAsync(String rewardId)
deleteLoyaltyRewardAsync in interface LoyaltyApirewardId - Required parameter: The ID of the [loyalty reward](entity:LoyaltyReward) to
delete.public RetrieveLoyaltyRewardResponse retrieveLoyaltyReward(String rewardId) throws ApiException, IOException
retrieveLoyaltyReward in interface LoyaltyApirewardId - Required parameter: The ID of the [loyalty reward](entity:LoyaltyReward) to
retrieve.ApiException - Represents error response from the server.IOException - Signals that an I/O exception of some sort has occurred.public CompletableFuture<RetrieveLoyaltyRewardResponse> retrieveLoyaltyRewardAsync(String rewardId)
retrieveLoyaltyRewardAsync in interface LoyaltyApirewardId - Required parameter: The ID of the [loyalty reward](entity:LoyaltyReward) to
retrieve.public RedeemLoyaltyRewardResponse redeemLoyaltyReward(String rewardId, RedeemLoyaltyRewardRequest body) throws ApiException, IOException
redeemLoyaltyReward in interface LoyaltyApirewardId - Required parameter: The ID of the [loyalty reward](entity:LoyaltyReward) to
redeem.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.public CompletableFuture<RedeemLoyaltyRewardResponse> redeemLoyaltyRewardAsync(String rewardId, RedeemLoyaltyRewardRequest body)
redeemLoyaltyRewardAsync in interface LoyaltyApirewardId - Required parameter: The ID of the [loyalty reward](entity:LoyaltyReward) to
redeem.body - Required parameter: An object containing the fields to POST for the request.
See the corresponding object definition for field details.Copyright © 2024. All rights reserved.