diff --git a/.github/workflows/autorelease.yml b/.github/workflows/autorelease.yml index 86502a2..b5ad972 100644 --- a/.github/workflows/autorelease.yml +++ b/.github/workflows/autorelease.yml @@ -121,3 +121,4 @@ jobs: --title "$ver" \ --notes-file "$notes_file" \ --target "$GITHUB_SHA" + diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 7a51c76..ac80a37 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -91,7 +91,7 @@ docs/BaseSamlConnection.md docs/BestPriorPrice.md docs/BestPriorPriceMetadata.md docs/BestPriorPriceRequest.md -docs/BestPriorPriceRequestTarget.md +docs/BestPriorTarget.md docs/Binding.md docs/BulkApplicationNotification.md docs/BulkOperationOnCampaigns.md @@ -150,9 +150,11 @@ docs/CardLedgerPointsEntryIntegrationAPI.md docs/CardLedgerTransactionLogEntry.md docs/CardLedgerTransactionLogEntryIntegrationAPI.md docs/CartItem.md +docs/CartItemFilterTemplate.md docs/Catalog.md docs/CatalogActionFilter.md docs/CatalogItem.md +docs/CatalogRule.md docs/CatalogSyncRequest.md docs/CatalogsStrikethroughNotificationPolicy.md docs/Change.md @@ -162,6 +164,7 @@ docs/CodeGeneratorSettings.md docs/Collection.md docs/CollectionItem.md docs/CollectionWithoutPayload.md +docs/CollectionsCatalog.md docs/Coupon.md docs/CouponConstraints.md docs/CouponCreatedEffectProps.md @@ -172,7 +175,6 @@ docs/CouponEntity.md docs/CouponFailureSummary.md docs/CouponLimitConfigs.md docs/CouponRejectionReason.md -docs/CouponRejections.md docs/CouponReservations.md docs/CouponSearch.md docs/CouponValue.md @@ -205,6 +207,7 @@ docs/DeactivateUserRequest.md docs/DeductLoyaltyPoints.md docs/DeductLoyaltyPointsEffectProps.md docs/DeleteCouponsData.md +docs/DeleteLoyaltyTransactionsRequest.md docs/DeleteUserRequest.md docs/Effect.md docs/EffectEntity.md @@ -245,6 +248,7 @@ docs/GenerateCampaignSummary.md docs/GenerateCampaignTags.md docs/GenerateCouponFailureDetailedSummary.md docs/GenerateCouponFailureSummary.md +docs/GenerateCouponRejections200Response.md docs/GenerateItemFilterDescription.md docs/GenerateLoyaltyCard.md docs/GenerateRuleTitle.md @@ -404,6 +408,7 @@ docs/NewCampaignStoreBudgetStoreLimit.md docs/NewCampaignTemplate.md docs/NewCatalog.md docs/NewCollection.md +docs/NewCollectionsCatalog.md docs/NewCouponCreationJob.md docs/NewCouponDeletionJob.md docs/NewCoupons.md @@ -553,7 +558,6 @@ docs/ScimUser.md docs/ScimUsersListResponse.md docs/SecondaryDeployment.md docs/Session.md -docs/SessionCoupons.md docs/SetDiscountEffectProps.md docs/SetDiscountPerAdditionalCostEffectProps.md docs/SetDiscountPerAdditionalCostPerItemEffectProps.md @@ -610,6 +614,7 @@ docs/UpdateCampaignGroup.md docs/UpdateCampaignTemplate.md docs/UpdateCatalog.md docs/UpdateCollection.md +docs/UpdateCollectionsCatalog.md docs/UpdateCoupon.md docs/UpdateCouponBatch.md docs/UpdateCouponsData.md @@ -631,7 +636,6 @@ docs/UserEntity.md docs/ValueMap.md docs/Webhook.md docs/WebhookAuthentication.md -docs/WebhookAuthenticationBase.md docs/WebhookAuthenticationDataBasic.md docs/WebhookAuthenticationDataCustom.md docs/WebhookAuthenticationWebhookRef.md @@ -736,7 +740,7 @@ talon_one/models/base_saml_connection.py talon_one/models/best_prior_price.py talon_one/models/best_prior_price_metadata.py talon_one/models/best_prior_price_request.py -talon_one/models/best_prior_price_request_target.py +talon_one/models/best_prior_target.py talon_one/models/binding.py talon_one/models/bulk_application_notification.py talon_one/models/bulk_operation_on_campaigns.py @@ -795,9 +799,11 @@ talon_one/models/card_ledger_points_entry_integration_api.py talon_one/models/card_ledger_transaction_log_entry.py talon_one/models/card_ledger_transaction_log_entry_integration_api.py talon_one/models/cart_item.py +talon_one/models/cart_item_filter_template.py talon_one/models/catalog.py talon_one/models/catalog_action_filter.py talon_one/models/catalog_item.py +talon_one/models/catalog_rule.py talon_one/models/catalog_sync_request.py talon_one/models/catalogs_strikethrough_notification_policy.py talon_one/models/change.py @@ -807,6 +813,7 @@ talon_one/models/code_generator_settings.py talon_one/models/collection.py talon_one/models/collection_item.py talon_one/models/collection_without_payload.py +talon_one/models/collections_catalog.py talon_one/models/coupon.py talon_one/models/coupon_constraints.py talon_one/models/coupon_created_effect_props.py @@ -817,7 +824,6 @@ talon_one/models/coupon_entity.py talon_one/models/coupon_failure_summary.py talon_one/models/coupon_limit_configs.py talon_one/models/coupon_rejection_reason.py -talon_one/models/coupon_rejections.py talon_one/models/coupon_reservations.py talon_one/models/coupon_search.py talon_one/models/coupon_value.py @@ -850,6 +856,7 @@ talon_one/models/deactivate_user_request.py talon_one/models/deduct_loyalty_points.py talon_one/models/deduct_loyalty_points_effect_props.py talon_one/models/delete_coupons_data.py +talon_one/models/delete_loyalty_transactions_request.py talon_one/models/delete_user_request.py talon_one/models/effect.py talon_one/models/effect_entity.py @@ -890,6 +897,7 @@ talon_one/models/generate_campaign_summary.py talon_one/models/generate_campaign_tags.py talon_one/models/generate_coupon_failure_detailed_summary.py talon_one/models/generate_coupon_failure_summary.py +talon_one/models/generate_coupon_rejections200_response.py talon_one/models/generate_item_filter_description.py talon_one/models/generate_loyalty_card.py talon_one/models/generate_rule_title.py @@ -1047,6 +1055,7 @@ talon_one/models/new_campaign_store_budget_store_limit.py talon_one/models/new_campaign_template.py talon_one/models/new_catalog.py talon_one/models/new_collection.py +talon_one/models/new_collections_catalog.py talon_one/models/new_coupon_creation_job.py talon_one/models/new_coupon_deletion_job.py talon_one/models/new_coupons.py @@ -1195,7 +1204,6 @@ talon_one/models/scim_user.py talon_one/models/scim_users_list_response.py talon_one/models/secondary_deployment.py talon_one/models/session.py -talon_one/models/session_coupons.py talon_one/models/set_discount_effect_props.py talon_one/models/set_discount_per_additional_cost_effect_props.py talon_one/models/set_discount_per_additional_cost_per_item_effect_props.py @@ -1253,6 +1261,7 @@ talon_one/models/update_campaign_group.py talon_one/models/update_campaign_template.py talon_one/models/update_catalog.py talon_one/models/update_collection.py +talon_one/models/update_collections_catalog.py talon_one/models/update_coupon.py talon_one/models/update_coupon_batch.py talon_one/models/update_coupons_data.py @@ -1274,7 +1283,6 @@ talon_one/models/user_entity.py talon_one/models/value_map.py talon_one/models/webhook.py talon_one/models/webhook_authentication.py -talon_one/models/webhook_authentication_base.py talon_one/models/webhook_authentication_data_basic.py talon_one/models/webhook_authentication_data_custom.py talon_one/models/webhook_authentication_webhook_ref.py @@ -1368,7 +1376,7 @@ test/test_base_saml_connection.py test/test_best_prior_price.py test/test_best_prior_price_metadata.py test/test_best_prior_price_request.py -test/test_best_prior_price_request_target.py +test/test_best_prior_target.py test/test_binding.py test/test_bulk_application_notification.py test/test_bulk_operation_on_campaigns.py @@ -1427,9 +1435,11 @@ test/test_card_ledger_points_entry_integration_api.py test/test_card_ledger_transaction_log_entry.py test/test_card_ledger_transaction_log_entry_integration_api.py test/test_cart_item.py +test/test_cart_item_filter_template.py test/test_catalog.py test/test_catalog_action_filter.py test/test_catalog_item.py +test/test_catalog_rule.py test/test_catalog_sync_request.py test/test_catalogs_strikethrough_notification_policy.py test/test_change.py @@ -1439,6 +1449,7 @@ test/test_code_generator_settings.py test/test_collection.py test/test_collection_item.py test/test_collection_without_payload.py +test/test_collections_catalog.py test/test_coupon.py test/test_coupon_constraints.py test/test_coupon_created_effect_props.py @@ -1449,7 +1460,6 @@ test/test_coupon_entity.py test/test_coupon_failure_summary.py test/test_coupon_limit_configs.py test/test_coupon_rejection_reason.py -test/test_coupon_rejections.py test/test_coupon_reservations.py test/test_coupon_search.py test/test_coupon_value.py @@ -1482,6 +1492,7 @@ test/test_deactivate_user_request.py test/test_deduct_loyalty_points.py test/test_deduct_loyalty_points_effect_props.py test/test_delete_coupons_data.py +test/test_delete_loyalty_transactions_request.py test/test_delete_user_request.py test/test_effect.py test/test_effect_entity.py @@ -1522,6 +1533,7 @@ test/test_generate_campaign_summary.py test/test_generate_campaign_tags.py test/test_generate_coupon_failure_detailed_summary.py test/test_generate_coupon_failure_summary.py +test/test_generate_coupon_rejections200_response.py test/test_generate_item_filter_description.py test/test_generate_loyalty_card.py test/test_generate_rule_title.py @@ -1681,6 +1693,7 @@ test/test_new_campaign_store_budget_store_limit.py test/test_new_campaign_template.py test/test_new_catalog.py test/test_new_collection.py +test/test_new_collections_catalog.py test/test_new_coupon_creation_job.py test/test_new_coupon_deletion_job.py test/test_new_coupons.py @@ -1829,7 +1842,6 @@ test/test_scim_user.py test/test_scim_users_list_response.py test/test_secondary_deployment.py test/test_session.py -test/test_session_coupons.py test/test_set_discount_effect_props.py test/test_set_discount_per_additional_cost_effect_props.py test/test_set_discount_per_additional_cost_per_item_effect_props.py @@ -1887,6 +1899,7 @@ test/test_update_campaign_group.py test/test_update_campaign_template.py test/test_update_catalog.py test/test_update_collection.py +test/test_update_collections_catalog.py test/test_update_coupon.py test/test_update_coupon_batch.py test/test_update_coupons_data.py @@ -1908,7 +1921,6 @@ test/test_user_entity.py test/test_value_map.py test/test_webhook.py test/test_webhook_authentication.py -test/test_webhook_authentication_base.py test/test_webhook_authentication_data_basic.py test/test_webhook_authentication_data_custom.py test/test_webhook_authentication_webhook_ref.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 1b2d969..3821090 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.18.0 +7.19.0 diff --git a/README.md b/README.md index c205f09..ce639b6 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,7 @@ All URLs are relative to `https://yourbaseurl.talon.one`. Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*IntegrationApi* | [**activate_loyalty_points**](docs/IntegrationApi.md#activate_loyalty_points) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/activate_points | Activate loyalty points *IntegrationApi* | [**best_prior_price**](docs/IntegrationApi.md#best_prior_price) | **POST** /v1/best_prior_price | Fetch best prior price *IntegrationApi* | [**create_audience_v2**](docs/IntegrationApi.md#create_audience_v2) | **POST** /v2/audiences | Create audience *IntegrationApi* | [**create_coupon_reservation**](docs/IntegrationApi.md#create_coupon_reservation) | **POST** /v1/coupon_reservations/{couponValue} | Create coupon reservation @@ -162,6 +163,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**delete_audience_v2**](docs/IntegrationApi.md#delete_audience_v2) | **DELETE** /v2/audiences/{audienceId} | Delete audience *IntegrationApi* | [**delete_coupon_reservation**](docs/IntegrationApi.md#delete_coupon_reservation) | **DELETE** /v1/coupon_reservations/{couponValue} | Delete coupon reservations *IntegrationApi* | [**delete_customer_data**](docs/IntegrationApi.md#delete_customer_data) | **DELETE** /v1/customer_data/{integrationId} | Delete customer's personal data +*IntegrationApi* | [**delete_loyalty_transactions_from_ledgers**](docs/IntegrationApi.md#delete_loyalty_transactions_from_ledgers) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/delete_transactions | Delete customer's transactions from loyalty ledgers *IntegrationApi* | [**generate_loyalty_card**](docs/IntegrationApi.md#generate_loyalty_card) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards | Generate loyalty card *IntegrationApi* | [**get_customer_achievement_history**](docs/IntegrationApi.md#get_customer_achievement_history) | **GET** /v1/customer_profiles/{integrationId}/achievements/{achievementId} | List customer's achievement history *IntegrationApi* | [**get_customer_achievements**](docs/IntegrationApi.md#get_customer_achievements) | **GET** /v1/customer_profiles/{integrationId}/achievements | List customer's available achievements @@ -179,6 +181,7 @@ Class | Method | HTTP request | Description *IntegrationApi* | [**return_cart_items**](docs/IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items *IntegrationApi* | [**sync_catalog**](docs/IntegrationApi.md#sync_catalog) | **PUT** /v1/catalogs/{catalogId}/sync | Sync cart item catalog *IntegrationApi* | [**track_event_v2**](docs/IntegrationApi.md#track_event_v2) | **POST** /v2/events | Track event +*IntegrationApi* | [**unlink_loyalty_card_from_profile**](docs/IntegrationApi.md#unlink_loyalty_card_from_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/unlink_profile | Unlink customer profile from a loyalty card *IntegrationApi* | [**update_audience_customers_attributes**](docs/IntegrationApi.md#update_audience_customers_attributes) | **PUT** /v2/audience_customers/{audienceId}/attributes | Update profile attributes for all customers in audience *IntegrationApi* | [**update_audience_v2**](docs/IntegrationApi.md#update_audience_v2) | **PUT** /v2/audiences/{audienceId} | Update audience name *IntegrationApi* | [**update_customer_profile_audiences**](docs/IntegrationApi.md#update_customer_profile_audiences) | **POST** /v2/customer_audiences | Update multiple customer profiles' audiences @@ -240,6 +243,7 @@ Class | Method | HTTP request | Description *ManagementApi* | [**export_loyalty_ledger**](docs/ManagementApi.md#export_loyalty_ledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log | Export customer's transaction logs *ManagementApi* | [**export_pool_giveaways**](docs/ManagementApi.md#export_pool_giveaways) | **GET** /v1/giveaways/pools/{poolId}/export | Export giveaway codes of a giveaway pool *ManagementApi* | [**export_referrals**](docs/ManagementApi.md#export_referrals) | **GET** /v1/applications/{applicationId}/export_referrals | Export referrals +*ManagementApi* | [**generate_coupon_rejections**](docs/ManagementApi.md#generate_coupon_rejections) | **GET** /v1/coupon_rejections | Summarize coupon redemption failures in session *ManagementApi* | [**get_access_logs_without_total_count**](docs/ManagementApi.md#get_access_logs_without_total_count) | **GET** /v1/applications/{applicationId}/access_logs/no_total | Get access logs for Application *ManagementApi* | [**get_account**](docs/ManagementApi.md#get_account) | **GET** /v1/accounts/{accountId} | Get account details *ManagementApi* | [**get_account_analytics**](docs/ManagementApi.md#get_account_analytics) | **GET** /v1/accounts/{accountId}/analytics | Get account analytics @@ -287,8 +291,10 @@ Class | Method | HTTP request | Description *ManagementApi* | [**get_loyalty_card**](docs/ManagementApi.md#get_loyalty_card) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Get loyalty card *ManagementApi* | [**get_loyalty_card_transaction_logs**](docs/ManagementApi.md#get_loyalty_card_transaction_logs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions *ManagementApi* | [**get_loyalty_cards**](docs/ManagementApi.md#get_loyalty_cards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards | List loyalty cards +*ManagementApi* | [**get_loyalty_ledger_balances**](docs/ManagementApi.md#get_loyalty_ledger_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances | Get customer's loyalty balances *ManagementApi* | [**get_loyalty_points**](docs/ManagementApi.md#get_loyalty_points) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} | Get customer's full loyalty ledger *ManagementApi* | [**get_loyalty_program**](docs/ManagementApi.md#get_loyalty_program) | **GET** /v1/loyalty_programs/{loyaltyProgramId} | Get loyalty program +*ManagementApi* | [**get_loyalty_program_profile_ledger_transactions**](docs/ManagementApi.md#get_loyalty_program_profile_ledger_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions | List customer's loyalty transactions *ManagementApi* | [**get_loyalty_program_transactions**](docs/ManagementApi.md#get_loyalty_program_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/transactions | List loyalty program transactions *ManagementApi* | [**get_loyalty_programs**](docs/ManagementApi.md#get_loyalty_programs) | **GET** /v1/loyalty_programs | List loyalty programs *ManagementApi* | [**get_loyalty_statistics**](docs/ManagementApi.md#get_loyalty_statistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/statistics | Get loyalty program statistics @@ -445,7 +451,7 @@ Class | Method | HTTP request | Description - [BestPriorPrice](docs/BestPriorPrice.md) - [BestPriorPriceMetadata](docs/BestPriorPriceMetadata.md) - [BestPriorPriceRequest](docs/BestPriorPriceRequest.md) -- [BestPriorPriceRequestTarget](docs/BestPriorPriceRequestTarget.md) +- [BestPriorTarget](docs/BestPriorTarget.md) - [Binding](docs/Binding.md) - [BulkApplicationNotification](docs/BulkApplicationNotification.md) - [BulkOperationOnCampaigns](docs/BulkOperationOnCampaigns.md) @@ -504,9 +510,11 @@ Class | Method | HTTP request | Description - [CardLedgerTransactionLogEntry](docs/CardLedgerTransactionLogEntry.md) - [CardLedgerTransactionLogEntryIntegrationAPI](docs/CardLedgerTransactionLogEntryIntegrationAPI.md) - [CartItem](docs/CartItem.md) +- [CartItemFilterTemplate](docs/CartItemFilterTemplate.md) - [Catalog](docs/Catalog.md) - [CatalogActionFilter](docs/CatalogActionFilter.md) - [CatalogItem](docs/CatalogItem.md) +- [CatalogRule](docs/CatalogRule.md) - [CatalogSyncRequest](docs/CatalogSyncRequest.md) - [CatalogsStrikethroughNotificationPolicy](docs/CatalogsStrikethroughNotificationPolicy.md) - [Change](docs/Change.md) @@ -516,6 +524,7 @@ Class | Method | HTTP request | Description - [Collection](docs/Collection.md) - [CollectionItem](docs/CollectionItem.md) - [CollectionWithoutPayload](docs/CollectionWithoutPayload.md) +- [CollectionsCatalog](docs/CollectionsCatalog.md) - [Coupon](docs/Coupon.md) - [CouponConstraints](docs/CouponConstraints.md) - [CouponCreatedEffectProps](docs/CouponCreatedEffectProps.md) @@ -526,7 +535,6 @@ Class | Method | HTTP request | Description - [CouponFailureSummary](docs/CouponFailureSummary.md) - [CouponLimitConfigs](docs/CouponLimitConfigs.md) - [CouponRejectionReason](docs/CouponRejectionReason.md) -- [CouponRejections](docs/CouponRejections.md) - [CouponReservations](docs/CouponReservations.md) - [CouponSearch](docs/CouponSearch.md) - [CouponValue](docs/CouponValue.md) @@ -559,6 +567,7 @@ Class | Method | HTTP request | Description - [DeductLoyaltyPoints](docs/DeductLoyaltyPoints.md) - [DeductLoyaltyPointsEffectProps](docs/DeductLoyaltyPointsEffectProps.md) - [DeleteCouponsData](docs/DeleteCouponsData.md) +- [DeleteLoyaltyTransactionsRequest](docs/DeleteLoyaltyTransactionsRequest.md) - [DeleteUserRequest](docs/DeleteUserRequest.md) - [Effect](docs/Effect.md) - [EffectEntity](docs/EffectEntity.md) @@ -599,6 +608,7 @@ Class | Method | HTTP request | Description - [GenerateCampaignTags](docs/GenerateCampaignTags.md) - [GenerateCouponFailureDetailedSummary](docs/GenerateCouponFailureDetailedSummary.md) - [GenerateCouponFailureSummary](docs/GenerateCouponFailureSummary.md) +- [GenerateCouponRejections200Response](docs/GenerateCouponRejections200Response.md) - [GenerateItemFilterDescription](docs/GenerateItemFilterDescription.md) - [GenerateLoyaltyCard](docs/GenerateLoyaltyCard.md) - [GenerateRuleTitle](docs/GenerateRuleTitle.md) @@ -756,6 +766,7 @@ Class | Method | HTTP request | Description - [NewCampaignTemplate](docs/NewCampaignTemplate.md) - [NewCatalog](docs/NewCatalog.md) - [NewCollection](docs/NewCollection.md) +- [NewCollectionsCatalog](docs/NewCollectionsCatalog.md) - [NewCouponCreationJob](docs/NewCouponCreationJob.md) - [NewCouponDeletionJob](docs/NewCouponDeletionJob.md) - [NewCoupons](docs/NewCoupons.md) @@ -905,7 +916,6 @@ Class | Method | HTTP request | Description - [ScimUsersListResponse](docs/ScimUsersListResponse.md) - [SecondaryDeployment](docs/SecondaryDeployment.md) - [Session](docs/Session.md) -- [SessionCoupons](docs/SessionCoupons.md) - [SetDiscountEffectProps](docs/SetDiscountEffectProps.md) - [SetDiscountPerAdditionalCostEffectProps](docs/SetDiscountPerAdditionalCostEffectProps.md) - [SetDiscountPerAdditionalCostPerItemEffectProps](docs/SetDiscountPerAdditionalCostPerItemEffectProps.md) @@ -962,6 +972,7 @@ Class | Method | HTTP request | Description - [UpdateCampaignTemplate](docs/UpdateCampaignTemplate.md) - [UpdateCatalog](docs/UpdateCatalog.md) - [UpdateCollection](docs/UpdateCollection.md) +- [UpdateCollectionsCatalog](docs/UpdateCollectionsCatalog.md) - [UpdateCoupon](docs/UpdateCoupon.md) - [UpdateCouponBatch](docs/UpdateCouponBatch.md) - [UpdateCouponsData](docs/UpdateCouponsData.md) @@ -983,7 +994,6 @@ Class | Method | HTTP request | Description - [ValueMap](docs/ValueMap.md) - [Webhook](docs/Webhook.md) - [WebhookAuthentication](docs/WebhookAuthentication.md) -- [WebhookAuthenticationBase](docs/WebhookAuthenticationBase.md) - [WebhookAuthenticationDataBasic](docs/WebhookAuthenticationDataBasic.md) - [WebhookAuthenticationDataCustom](docs/WebhookAuthenticationDataCustom.md) - [WebhookAuthenticationWebhookRef](docs/WebhookAuthenticationWebhookRef.md) diff --git a/docs/BestPriorPriceRequest.md b/docs/BestPriorPriceRequest.md index 8af7b4f..8a252dc 100644 --- a/docs/BestPriorPriceRequest.md +++ b/docs/BestPriorPriceRequest.md @@ -7,9 +7,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **skus** | **List[str]** | List of product SKUs to check when determining the best prior price. | **timeframe_end_date** | **datetime** | The end date and time that defines the latest time for retrieving historical SKU prices. | -**timeframe** | **int** | The number of days prior to the timeframeEndDate. Only prices within this look back period are considered for the best prior price evaluation. | +**timeframe** | **str** | The number of days prior to the timeframeEndDate. Only prices within this look back period are considered for the best prior price evaluation. | **strict_end_date** | **bool** | Indicates whether the timeframe includes the start of the current sale. - When `false`, the timeframe includes the start date of the current sale. - When `true`, the timeframe striclty uses the number of days specified in `timeframe`. | -**target** | [**BestPriorPriceRequestTarget**](BestPriorPriceRequestTarget.md) | | [optional] +**target** | [**BestPriorTarget**](BestPriorTarget.md) | | [optional] ## Example diff --git a/docs/BestPriorPriceRequestTarget.md b/docs/BestPriorTarget.md similarity index 54% rename from docs/BestPriorPriceRequestTarget.md rename to docs/BestPriorTarget.md index 1681a2d..9a77f3f 100644 --- a/docs/BestPriorPriceRequestTarget.md +++ b/docs/BestPriorTarget.md @@ -1,4 +1,4 @@ -# BestPriorPriceRequestTarget +# BestPriorTarget Specifies the target for which the best prior price calculation is taken into consideration. @@ -12,19 +12,19 @@ Name | Type | Description | Notes ## Example ```python -from talon_one.models.best_prior_price_request_target import BestPriorPriceRequestTarget +from talon_one.models.best_prior_target import BestPriorTarget # TODO update the JSON string below json = "{}" -# create an instance of BestPriorPriceRequestTarget from a JSON string -best_prior_price_request_target_instance = BestPriorPriceRequestTarget.from_json(json) +# create an instance of BestPriorTarget from a JSON string +best_prior_target_instance = BestPriorTarget.from_json(json) # print the JSON string representation of the object -print(BestPriorPriceRequestTarget.to_json()) +print(BestPriorTarget.to_json()) # convert the object into a dict -best_prior_price_request_target_dict = best_prior_price_request_target_instance.to_dict() -# create an instance of BestPriorPriceRequestTarget from a dict -best_prior_price_request_target_from_dict = BestPriorPriceRequestTarget.from_dict(best_prior_price_request_target_dict) +best_prior_target_dict = best_prior_target_instance.to_dict() +# create an instance of BestPriorTarget from a dict +best_prior_target_from_dict = BestPriorTarget.from_dict(best_prior_target_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CardLedgerPointsEntryIntegrationAPI.md b/docs/CardLedgerPointsEntryIntegrationAPI.md index ce330ef..b3ec87e 100644 --- a/docs/CardLedgerPointsEntryIntegrationAPI.md +++ b/docs/CardLedgerPointsEntryIntegrationAPI.md @@ -17,6 +17,7 @@ Name | Type | Description | Notes **expiry_date** | **str** | Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. | **subledger_id** | **str** | ID of the subledger. | **amount** | **float** | Amount of loyalty points added in the transaction. | +**validity_duration** | **str** | The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. | [optional] ## Example diff --git a/docs/CardLedgerTransactionLogEntryIntegrationAPI.md b/docs/CardLedgerTransactionLogEntryIntegrationAPI.md index 8a8cfe8..a18e611 100644 --- a/docs/CardLedgerTransactionLogEntryIntegrationAPI.md +++ b/docs/CardLedgerTransactionLogEntryIntegrationAPI.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **id** | **int** | ID of the loyalty ledger transaction. | **ruleset_id** | **int** | The ID of the ruleset containing the rule that triggered this effect. | [optional] **rule_name** | **str** | The name of the rule that triggered this effect. | [optional] +**validity_duration** | **str** | The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. | [optional] ## Example diff --git a/docs/CartItemFilterTemplate.md b/docs/CartItemFilterTemplate.md new file mode 100644 index 0000000..18b5d5e --- /dev/null +++ b/docs/CartItemFilterTemplate.md @@ -0,0 +1,31 @@ +# CartItemFilterTemplate + +A cart item filter template stored in a library entry. Cart item filters in library entries only contain name (no description, as description is at the library entry level). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the Application cart item filter. | +**expression** | **List[object]** | The Talang expression for the cart item filter. | + +## Example + +```python +from talon_one.models.cart_item_filter_template import CartItemFilterTemplate + +# TODO update the JSON string below +json = "{}" +# create an instance of CartItemFilterTemplate from a JSON string +cart_item_filter_template_instance = CartItemFilterTemplate.from_json(json) +# print the JSON string representation of the object +print(CartItemFilterTemplate.to_json()) + +# convert the object into a dict +cart_item_filter_template_dict = cart_item_filter_template_instance.to_dict() +# create an instance of CartItemFilterTemplate from a dict +cart_item_filter_template_from_dict = CartItemFilterTemplate.from_dict(cart_item_filter_template_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CatalogRule.md b/docs/CatalogRule.md new file mode 100644 index 0000000..bada07e --- /dev/null +++ b/docs/CatalogRule.md @@ -0,0 +1,33 @@ +# CatalogRule + +A rule template stored in a catalog entry. Rules in catalog entries only contain title (no description, as description is at the catalog entry level). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | A short description of the rule. | +**bindings** | [**List[Binding]**](Binding.md) | An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array. | [optional] +**condition** | **List[object]** | A Talang expression that will be evaluated in the context of the given event. | +**effects** | **List[object]** | An array of effectful Talang expressions in arrays that will be evaluated when a rule matches. | + +## Example + +```python +from talon_one.models.catalog_rule import CatalogRule + +# TODO update the JSON string below +json = "{}" +# create an instance of CatalogRule from a JSON string +catalog_rule_instance = CatalogRule.from_json(json) +# print the JSON string representation of the object +print(CatalogRule.to_json()) + +# convert the object into a dict +catalog_rule_dict = catalog_rule_instance.to_dict() +# create an instance of CatalogRule from a dict +catalog_rule_from_dict = CatalogRule.from_dict(catalog_rule_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CollectionsCatalog.md b/docs/CollectionsCatalog.md new file mode 100644 index 0000000..f693213 --- /dev/null +++ b/docs/CollectionsCatalog.md @@ -0,0 +1,41 @@ +# CollectionsCatalog + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | The internal ID of this collection. | +**account_id** | **int** | The ID of the account that owns this collection. | +**application_id** | **int** | The ID of the Application that owns this collection. | +**title** | **str** | A short description of the collection catalog. | +**description** | **str** | A longer, more detailed description of the collection catalog. | [optional] +**category** | **str** | Category used to group collection catalogs. | +**source** | **str** | Indicates whether the collection is custom or shipped by Talon.One. | +**rules** | [**List[CatalogRule]**](CatalogRule.md) | Array of rule templates in this collection catalog. Rules only contain title (no description, as description is at the collection catalog level). | +**cart_item_filters** | [**List[CartItemFilterTemplate]**](CartItemFilterTemplate.md) | Array of cart item filter templates in this collection catalog. Cart item filters only contain name (no description, as description is at the collection catalog level). | +**created** | **datetime** | Timestamp when the collection was created. | +**created_by** | **int** | ID of the user who created the collection. | +**modified** | **datetime** | Timestamp when the collection was last updated. | [optional] +**modified_by** | **int** | ID of the user who last updated the collection. | [optional] + +## Example + +```python +from talon_one.models.collections_catalog import CollectionsCatalog + +# TODO update the JSON string below +json = "{}" +# create an instance of CollectionsCatalog from a JSON string +collections_catalog_instance = CollectionsCatalog.from_json(json) +# print the JSON string representation of the object +print(CollectionsCatalog.to_json()) + +# convert the object into a dict +collections_catalog_dict = collections_catalog_instance.to_dict() +# create an instance of CollectionsCatalog from a dict +collections_catalog_from_dict = CollectionsCatalog.from_dict(collections_catalog_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/CouponFailureSummary.md b/docs/CouponFailureSummary.md index cd92d22..097dfda 100644 --- a/docs/CouponFailureSummary.md +++ b/docs/CouponFailureSummary.md @@ -13,8 +13,7 @@ Name | Type | Description | Notes **status** | **str** | Status defines if the coupon code was applied or rejected. | **coupon_code** | **str** | Coupon code passed for evaluation. | **language** | **str** | Language of the summary. | -**short_summary** | **str** | A summary of the reasons for coupon redemption failure. | -**long_summary** | **str** | A detailed summary of the reasons for coupon redemption failure based on events of the entire session. | +**summary** | **str** | A summary of the reasons for coupon redemption failure. | **created_at** | **datetime** | Timestamp when the request was made. | **updated_at** | **datetime** | Timestamp when the request was last updated. | diff --git a/docs/CouponRejections.md b/docs/CouponRejections.md deleted file mode 100644 index 87a0996..0000000 --- a/docs/CouponRejections.md +++ /dev/null @@ -1,31 +0,0 @@ -# CouponRejections - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**session_details** | [**List[SessionCoupons]**](SessionCoupons.md) | Array containing details from session like session id and optional coupon code used in the session. Only the first 15 entries will be processed. | -**application_id** | **int** | The application ID for which the coupon was used. | -**language** | **str** | The language the summary will be generated in. | [optional] - -## Example - -```python -from talon_one.models.coupon_rejections import CouponRejections - -# TODO update the JSON string below -json = "{}" -# create an instance of CouponRejections from a JSON string -coupon_rejections_instance = CouponRejections.from_json(json) -# print the JSON string representation of the object -print(CouponRejections.to_json()) - -# convert the object into a dict -coupon_rejections_dict = coupon_rejections_instance.to_dict() -# create an instance of CouponRejections from a dict -coupon_rejections_from_dict = CouponRejections.from_dict(coupon_rejections_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DeleteLoyaltyTransactionsRequest.md b/docs/DeleteLoyaltyTransactionsRequest.md new file mode 100644 index 0000000..7da1a88 --- /dev/null +++ b/docs/DeleteLoyaltyTransactionsRequest.md @@ -0,0 +1,31 @@ +# DeleteLoyaltyTransactionsRequest + +Request to delete transactions based on the specified scope. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scope** | **str** | `AllSubledgers` deletes all transactions for the specified customer profile from all ledgers in the loyalty program. `SelectedSubledgers` deletes all transactions for the specified customer profile only from the given ledgers in the loyalty program. | +**subledger_ids** | **List[str]** | The IDs of the ledgers from which to delete the customer's transactions. This parameter is required if the `scope` is set to `SelectedSubledgers`. To specify the main ledger, provide an empty string (\"\"). | [optional] + +## Example + +```python +from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of DeleteLoyaltyTransactionsRequest from a JSON string +delete_loyalty_transactions_request_instance = DeleteLoyaltyTransactionsRequest.from_json(json) +# print the JSON string representation of the object +print(DeleteLoyaltyTransactionsRequest.to_json()) + +# convert the object into a dict +delete_loyalty_transactions_request_dict = delete_loyalty_transactions_request_instance.to_dict() +# create an instance of DeleteLoyaltyTransactionsRequest from a dict +delete_loyalty_transactions_request_from_dict = DeleteLoyaltyTransactionsRequest.from_dict(delete_loyalty_transactions_request_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GenerateCouponRejections200Response.md b/docs/GenerateCouponRejections200Response.md new file mode 100644 index 0000000..ff77ee4 --- /dev/null +++ b/docs/GenerateCouponRejections200Response.md @@ -0,0 +1,29 @@ +# GenerateCouponRejections200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[CouponFailureSummary]**](CouponFailureSummary.md) | | + +## Example + +```python +from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GenerateCouponRejections200Response from a JSON string +generate_coupon_rejections200_response_instance = GenerateCouponRejections200Response.from_json(json) +# print the JSON string representation of the object +print(GenerateCouponRejections200Response.to_json()) + +# convert the object into a dict +generate_coupon_rejections200_response_dict = generate_coupon_rejections200_response_instance.to_dict() +# create an instance of GenerateCouponRejections200Response from a dict +generate_coupon_rejections200_response_from_dict = GenerateCouponRejections200Response.from_dict(generate_coupon_rejections200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/IntegrationApi.md b/docs/IntegrationApi.md index 1a120c3..2b5190e 100644 --- a/docs/IntegrationApi.md +++ b/docs/IntegrationApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://yourbaseurl.talon.one* Method | HTTP request | Description ------------- | ------------- | ------------- +[**activate_loyalty_points**](IntegrationApi.md#activate_loyalty_points) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/activate_points | Activate loyalty points [**best_prior_price**](IntegrationApi.md#best_prior_price) | **POST** /v1/best_prior_price | Fetch best prior price [**create_audience_v2**](IntegrationApi.md#create_audience_v2) | **POST** /v2/audiences | Create audience [**create_coupon_reservation**](IntegrationApi.md#create_coupon_reservation) | **POST** /v1/coupon_reservations/{couponValue} | Create coupon reservation @@ -13,6 +14,7 @@ Method | HTTP request | Description [**delete_audience_v2**](IntegrationApi.md#delete_audience_v2) | **DELETE** /v2/audiences/{audienceId} | Delete audience [**delete_coupon_reservation**](IntegrationApi.md#delete_coupon_reservation) | **DELETE** /v1/coupon_reservations/{couponValue} | Delete coupon reservations [**delete_customer_data**](IntegrationApi.md#delete_customer_data) | **DELETE** /v1/customer_data/{integrationId} | Delete customer's personal data +[**delete_loyalty_transactions_from_ledgers**](IntegrationApi.md#delete_loyalty_transactions_from_ledgers) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/delete_transactions | Delete customer's transactions from loyalty ledgers [**generate_loyalty_card**](IntegrationApi.md#generate_loyalty_card) | **POST** /v1/loyalty_programs/{loyaltyProgramId}/cards | Generate loyalty card [**get_customer_achievement_history**](IntegrationApi.md#get_customer_achievement_history) | **GET** /v1/customer_profiles/{integrationId}/achievements/{achievementId} | List customer's achievement history [**get_customer_achievements**](IntegrationApi.md#get_customer_achievements) | **GET** /v1/customer_profiles/{integrationId}/achievements | List customer's available achievements @@ -30,6 +32,7 @@ Method | HTTP request | Description [**return_cart_items**](IntegrationApi.md#return_cart_items) | **POST** /v2/customer_sessions/{customerSessionId}/returns | Return cart items [**sync_catalog**](IntegrationApi.md#sync_catalog) | **PUT** /v1/catalogs/{catalogId}/sync | Sync cart item catalog [**track_event_v2**](IntegrationApi.md#track_event_v2) | **POST** /v2/events | Track event +[**unlink_loyalty_card_from_profile**](IntegrationApi.md#unlink_loyalty_card_from_profile) | **POST** /v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/unlink_profile | Unlink customer profile from a loyalty card [**update_audience_customers_attributes**](IntegrationApi.md#update_audience_customers_attributes) | **PUT** /v2/audience_customers/{audienceId}/attributes | Update profile attributes for all customers in audience [**update_audience_v2**](IntegrationApi.md#update_audience_v2) | **PUT** /v2/audiences/{audienceId} | Update audience name [**update_customer_profile_audiences**](IntegrationApi.md#update_customer_profile_audiences) | **POST** /v2/customer_audiences | Update multiple customer profiles' audiences @@ -38,6 +41,97 @@ Method | HTTP request | Description [**update_customer_session_v2**](IntegrationApi.md#update_customer_session_v2) | **PUT** /v2/customer_sessions/{customerSessionId} | Update customer session +# **activate_loyalty_points** +> ActivateLoyaltyPointsResponse activate_loyalty_points(loyalty_program_id, activate_loyalty_points) + +Activate loyalty points + +Activate points when a defined action occurs. + +You can activate pending points using one of the following parameters: +- `sessionId`: Activates all points earned in the specified session. +- `transactionUUIDs`: Activates points earned in the transactions specified by the +given UUIDs. + + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.activate_loyalty_points import ActivateLoyaltyPoints +from talon_one.models.activate_loyalty_points_response import ActivateLoyaltyPointsResponse +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.IntegrationApi(api_client) + loyalty_program_id = 56 # int | The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. + activate_loyalty_points = {transactionUUIDs=[8f1a8d7c-9c3e-4a5e-9f0d-2c5f7a3b1cde, 12b3c456-78d9-4e0f-a1b2-3456789abcde]} # ActivateLoyaltyPoints | body + + try: + # Activate loyalty points + api_response = api_instance.activate_loyalty_points(loyalty_program_id, activate_loyalty_points) + print("The response of IntegrationApi->activate_loyalty_points:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationApi->activate_loyalty_points: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyalty_program_id** | **int**| The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **activate_loyalty_points** | [**ActivateLoyaltyPoints**](ActivateLoyaltyPoints.md)| body | + +### Return type + +[**ActivateLoyaltyPointsResponse**](ActivateLoyaltyPointsResponse.md) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **best_prior_price** > List[BestPriorPrice] best_prior_price(best_prior_price_request) @@ -859,6 +953,95 @@ void (empty response body) [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **delete_loyalty_transactions_from_ledgers** +> delete_loyalty_transactions_from_ledgers(loyalty_program_id, integration_id, delete_loyalty_transactions_request) + +Delete customer's transactions from loyalty ledgers + +Delete a customer's transactions in all loyalty ledgers or a specified ledger. + +**Note:** To retrieve loyalty transaction logs for a specific customer in a given +loyalty program, use the [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions) +endpoint. + + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.IntegrationApi(api_client) + loyalty_program_id = 56 # int | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. + integration_id = 'integration_id_example' # str | The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. + delete_loyalty_transactions_request = talon_one.DeleteLoyaltyTransactionsRequest() # DeleteLoyaltyTransactionsRequest | + + try: + # Delete customer's transactions from loyalty ledgers + api_instance.delete_loyalty_transactions_from_ledgers(loyalty_program_id, integration_id, delete_loyalty_transactions_request) + except Exception as e: + print("Exception when calling IntegrationApi->delete_loyalty_transactions_from_ledgers: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **integration_id** | **str**| The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. | + **delete_loyalty_transactions_request** | [**DeleteLoyaltyTransactionsRequest**](DeleteLoyaltyTransactionsRequest.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | No Content | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **generate_loyalty_card** > LoyaltyCard generate_loyalty_card(loyalty_program_id, generate_loyalty_card) @@ -1621,7 +1804,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_loyalty_card_transactions** -> GetLoyaltyCardTransactions200Response get_loyalty_card_transactions(loyalty_program_id, loyalty_card_id, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip) +> GetLoyaltyCardTransactions200Response get_loyalty_card_transactions(loyalty_program_id, loyalty_card_id, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, awaits_activation=awaits_activation) List card's transactions @@ -1670,10 +1853,11 @@ with talon_one.ApiClient(configuration) as api_client: transaction_uuids = ['transaction_uuids_example'] # List[str] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. (optional) page_size = 50 # int | The number of items in the response. (optional) (default to 50) skip = 56 # int | The number of items to skip when paging through large result sets. (optional) + awaits_activation = True # bool | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. (optional) try: # List card's transactions - api_response = api_instance.get_loyalty_card_transactions(loyalty_program_id, loyalty_card_id, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip) + api_response = api_instance.get_loyalty_card_transactions(loyalty_program_id, loyalty_card_id, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, awaits_activation=awaits_activation) print("The response of IntegrationApi->get_loyalty_card_transactions:\n") pprint(api_response) except Exception as e: @@ -1697,6 +1881,7 @@ Name | Type | Description | Notes **transaction_uuids** | [**List[str]**](str.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] **page_size** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] + **awaits_activation** | **bool**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] ### Return type @@ -1827,7 +2012,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **get_loyalty_program_profile_transactions** -> GetLoyaltyProgramProfileTransactions200Response get_loyalty_program_profile_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip) +> GetLoyaltyProgramProfileTransactions200Response get_loyalty_program_profile_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) List customer's loyalty transactions @@ -1880,10 +2065,11 @@ with talon_one.ApiClient(configuration) as api_client: end_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) page_size = 50 # int | The number of items in the response. (optional) (default to 50) skip = 56 # int | The number of items to skip when paging through large result sets. (optional) + awaits_activation = True # bool | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. (optional) try: # List customer's loyalty transactions - api_response = api_instance.get_loyalty_program_profile_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip) + api_response = api_instance.get_loyalty_program_profile_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) print("The response of IntegrationApi->get_loyalty_program_profile_transactions:\n") pprint(api_response) except Exception as e: @@ -1907,6 +2093,7 @@ Name | Type | Description | Notes **end_date** | **datetime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **page_size** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] + **awaits_activation** | **bool**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] ### Return type @@ -2148,11 +2335,9 @@ When reopening a session: -

To see an example of a rollback, see the Cancelling a session with campaign budgetstutorial.

+

To see an example of a rollback, see the Cancelling a session with campaign budgets tutorial.

-**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the -[Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel -a closed session and create a new one. +**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel a closed session and create a new one. ### Example @@ -2765,6 +2950,98 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **unlink_loyalty_card_from_profile** +> LoyaltyCard unlink_loyalty_card_from_profile(loyalty_program_id, loyalty_card_id, loyalty_card_registration) + +Unlink customer profile from a loyalty card + +Unlink a customer profile from a [registered](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card) loyalty card. + +To get the `integrationId` of a customer profile, you can use the +[Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) +endpoint. + + +### Example + +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.loyalty_card import LoyaltyCard +from talon_one.models.loyalty_card_registration import LoyaltyCardRegistration +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.IntegrationApi(api_client) + loyalty_program_id = 56 # int | The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. + loyalty_card_id = 'loyalty_card_id_example' # str | The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. + loyalty_card_registration = talon_one.LoyaltyCardRegistration() # LoyaltyCardRegistration | body + + try: + # Unlink customer profile from a loyalty card + api_response = api_instance.unlink_loyalty_card_from_profile(loyalty_program_id, loyalty_card_id, loyalty_card_registration) + print("The response of IntegrationApi->unlink_loyalty_card_from_profile:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling IntegrationApi->unlink_loyalty_card_from_profile: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyalty_program_id** | **int**| The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **loyalty_card_id** | **str**| The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. | + **loyalty_card_registration** | [**LoyaltyCardRegistration**](LoyaltyCardRegistration.md)| body | + +### Return type + +[**LoyaltyCard**](LoyaltyCard.md) + +### Authorization + +[api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **update_audience_customers_attributes** > update_audience_customers_attributes(audience_id, body) diff --git a/docs/LedgerPointsEntryIntegrationAPI.md b/docs/LedgerPointsEntryIntegrationAPI.md index d978b75..217d59b 100644 --- a/docs/LedgerPointsEntryIntegrationAPI.md +++ b/docs/LedgerPointsEntryIntegrationAPI.md @@ -16,6 +16,7 @@ Name | Type | Description | Notes **expiry_date** | **str** | Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. | **subledger_id** | **str** | ID of the subledger. | **amount** | **float** | Amount of loyalty points added in the transaction. | +**validity_duration** | **str** | The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. | [optional] ## Example diff --git a/docs/LedgerTransactionLogEntryIntegrationAPI.md b/docs/LedgerTransactionLogEntryIntegrationAPI.md index 6bf97f1..ac308b7 100644 --- a/docs/LedgerTransactionLogEntryIntegrationAPI.md +++ b/docs/LedgerTransactionLogEntryIntegrationAPI.md @@ -20,6 +20,7 @@ Name | Type | Description | Notes **ruleset_id** | **int** | The ID of the ruleset containing the rule that triggered this effect. | [optional] **rule_name** | **str** | The name of the rule that triggered this effect. | [optional] **flags** | [**LoyaltyLedgerEntryFlags**](LoyaltyLedgerEntryFlags.md) | The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance. | [optional] +**validity_duration** | **str** | The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. | [optional] ## Example diff --git a/docs/LoyaltyLedgerEntry.md b/docs/LoyaltyLedgerEntry.md index fb9711c..9fcdefc 100644 --- a/docs/LoyaltyLedgerEntry.md +++ b/docs/LoyaltyLedgerEntry.md @@ -21,6 +21,7 @@ Name | Type | Description | Notes **user_id** | **int** | This is the ID of the user who created this entry, if the addition or subtraction was done manually. | [optional] **archived** | **bool** | Indicates if the entry belongs to the archived session. | [optional] **flags** | [**LoyaltyLedgerEntryFlags**](LoyaltyLedgerEntryFlags.md) | A map of flags providing additional details about the entry. | [optional] +**validity_duration** | **str** | The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. | [optional] ## Example diff --git a/docs/LoyaltyProgramTransaction.md b/docs/LoyaltyProgramTransaction.md index 11702cb..da1b8ef 100644 --- a/docs/LoyaltyProgramTransaction.md +++ b/docs/LoyaltyProgramTransaction.md @@ -25,6 +25,7 @@ Name | Type | Description | Notes **ruleset_id** | **int** | ID of the ruleset containing the rule that triggered the effect. Applies only for transactions that resulted from a customer session. | [optional] **rule_name** | **str** | Name of the rule that triggered the effect. Applies only for transactions that resulted from a customer session. | [optional] **flags** | [**LoyaltyLedgerEntryFlags**](LoyaltyLedgerEntryFlags.md) | The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance. | [optional] +**validity_duration** | **str** | The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. | [optional] ## Example diff --git a/docs/ManagementApi.md b/docs/ManagementApi.md index efe5616..a567057 100644 --- a/docs/ManagementApi.md +++ b/docs/ManagementApi.md @@ -59,6 +59,7 @@ Method | HTTP request | Description [**export_loyalty_ledger**](ManagementApi.md#export_loyalty_ledger) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/export_log | Export customer's transaction logs [**export_pool_giveaways**](ManagementApi.md#export_pool_giveaways) | **GET** /v1/giveaways/pools/{poolId}/export | Export giveaway codes of a giveaway pool [**export_referrals**](ManagementApi.md#export_referrals) | **GET** /v1/applications/{applicationId}/export_referrals | Export referrals +[**generate_coupon_rejections**](ManagementApi.md#generate_coupon_rejections) | **GET** /v1/coupon_rejections | Summarize coupon redemption failures in session [**get_access_logs_without_total_count**](ManagementApi.md#get_access_logs_without_total_count) | **GET** /v1/applications/{applicationId}/access_logs/no_total | Get access logs for Application [**get_account**](ManagementApi.md#get_account) | **GET** /v1/accounts/{accountId} | Get account details [**get_account_analytics**](ManagementApi.md#get_account_analytics) | **GET** /v1/accounts/{accountId}/analytics | Get account analytics @@ -106,8 +107,10 @@ Method | HTTP request | Description [**get_loyalty_card**](ManagementApi.md#get_loyalty_card) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId} | Get loyalty card [**get_loyalty_card_transaction_logs**](ManagementApi.md#get_loyalty_card_transaction_logs) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/logs | List card's transactions [**get_loyalty_cards**](ManagementApi.md#get_loyalty_cards) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/cards | List loyalty cards +[**get_loyalty_ledger_balances**](ManagementApi.md#get_loyalty_ledger_balances) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances | Get customer's loyalty balances [**get_loyalty_points**](ManagementApi.md#get_loyalty_points) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} | Get customer's full loyalty ledger [**get_loyalty_program**](ManagementApi.md#get_loyalty_program) | **GET** /v1/loyalty_programs/{loyaltyProgramId} | Get loyalty program +[**get_loyalty_program_profile_ledger_transactions**](ManagementApi.md#get_loyalty_program_profile_ledger_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions | List customer's loyalty transactions [**get_loyalty_program_transactions**](ManagementApi.md#get_loyalty_program_transactions) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/transactions | List loyalty program transactions [**get_loyalty_programs**](ManagementApi.md#get_loyalty_programs) | **GET** /v1/loyalty_programs | List loyalty programs [**get_loyalty_statistics**](ManagementApi.md#get_loyalty_statistics) | **GET** /v1/loyalty_programs/{loyaltyProgramId}/statistics | Get loyalty program statistics @@ -5818,6 +5821,106 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **generate_coupon_rejections** +> GenerateCouponRejections200Response generate_coupon_rejections(session_integration_id, application_id=application_id, language=language, coupon_code=coupon_code) + +Summarize coupon redemption failures in session + +Create a summary of the reasons for coupon redemption failures in a given customer session. + + +### Example + +* Api Key Authentication (management_key): +* Api Key Authentication (manager_auth): +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: management_key +configuration.api_key['management_key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['management_key'] = 'Bearer' + +# Configure API key authorization: manager_auth +configuration.api_key['manager_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['manager_auth'] = 'Bearer' + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.ManagementApi(api_client) + session_integration_id = 'session_integration_id_example' # str | The integration ID of the session to summarize. + application_id = 3.4 # float | Filter results by Application ID. (optional) + language = 'language_example' # str | The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. (optional) + coupon_code = 'coupon_code_example' # str | The coupon code for which to get the rejection reason. (optional) + + try: + # Summarize coupon redemption failures in session + api_response = api_instance.generate_coupon_rejections(session_integration_id, application_id=application_id, language=language, coupon_code=coupon_code) + print("The response of ManagementApi->generate_coupon_rejections:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->generate_coupon_rejections: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **session_integration_id** | **str**| The integration ID of the session to summarize. | + **application_id** | **float**| Filter results by Application ID. | [optional] + **language** | **str**| The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. | [optional] + **coupon_code** | **str**| The coupon code for which to get the rejection reason. | [optional] + +### Return type + +[**GenerateCouponRejections200Response**](GenerateCouponRejections200Response.md) + +### Authorization + +[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_access_logs_without_total_count** > GetAccessLogsWithoutTotalCount200Response get_access_logs_without_total_count(application_id, range_start, range_end, path=path, method=method, status=status, page_size=page_size, skip=skip, sort=sort) @@ -10658,6 +10761,122 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_loyalty_ledger_balances** +> LoyaltyBalancesWithTiers get_loyalty_ledger_balances(loyalty_program_id, integration_id, end_date=end_date, subledger_id=subledger_id, include_tiers=include_tiers, include_projected_tier=include_projected_tier) + +Get customer's loyalty balances + +Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. +You can filter balances by date and subledger ID, and include tier-related information in the response. + +**Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. + +Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. + +For more information, see: +- [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) +- [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + + +### Example + +* Api Key Authentication (management_key): +* Api Key Authentication (manager_auth): +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.loyalty_balances_with_tiers import LoyaltyBalancesWithTiers +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: management_key +configuration.api_key['management_key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['management_key'] = 'Bearer' + +# Configure API key authorization: manager_auth +configuration.api_key['manager_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['manager_auth'] = 'Bearer' + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.ManagementApi(api_client) + loyalty_program_id = 56 # int | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. + integration_id = 'integration_id_example' # str | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. + end_date = '2013-10-20T19:20:30+01:00' # datetime | Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + subledger_id = 'subledger_id_example' # str | The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. (optional) + include_tiers = False # bool | Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. (optional) (default to False) + include_projected_tier = False # bool | Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. (optional) (default to False) + + try: + # Get customer's loyalty balances + api_response = api_instance.get_loyalty_ledger_balances(loyalty_program_id, integration_id, end_date=end_date, subledger_id=subledger_id, include_tiers=include_tiers, include_projected_tier=include_projected_tier) + print("The response of ManagementApi->get_loyalty_ledger_balances:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_loyalty_ledger_balances: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **integration_id** | **str**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | + **end_date** | **datetime**| Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] + **subledger_id** | **str**| The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. | [optional] + **include_tiers** | **bool**| Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. | [optional] [default to False] + **include_projected_tier** | **bool**| Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. | [optional] [default to False] + +### Return type + +[**LoyaltyBalancesWithTiers**](LoyaltyBalancesWithTiers.md) + +### Authorization + +[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_loyalty_points** > LoyaltyLedger get_loyalty_points(loyalty_program_id, integration_id) @@ -10858,8 +11077,130 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_loyalty_program_profile_ledger_transactions** +> GetLoyaltyProgramProfileTransactions200Response get_loyalty_program_profile_ledger_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) + +List customer's loyalty transactions + +Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. + +You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. + +**Note:** To retrieve all loyalty program transaction logs in a given loyalty program, +use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. + + +### Example + +* Api Key Authentication (management_key): +* Api Key Authentication (manager_auth): +* Api Key Authentication (api_key_v1): + +```python +import talon_one +from talon_one.models.get_loyalty_program_profile_transactions200_response import GetLoyaltyProgramProfileTransactions200Response +from talon_one.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://yourbaseurl.talon.one +# See configuration.py for a list of all supported configuration parameters. +configuration = talon_one.Configuration( + host = "https://yourbaseurl.talon.one" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure API key authorization: management_key +configuration.api_key['management_key'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['management_key'] = 'Bearer' + +# Configure API key authorization: manager_auth +configuration.api_key['manager_auth'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['manager_auth'] = 'Bearer' + +# Configure API key authorization: api_key_v1 +configuration.api_key['api_key_v1'] = os.environ["API_KEY"] + +# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed +# configuration.api_key_prefix['api_key_v1'] = 'Bearer' + +# Enter a context with an instance of the API client +with talon_one.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = talon_one.ManagementApi(api_client) + loyalty_program_id = 56 # int | Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. + integration_id = 'integration_id_example' # str | The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. + customer_session_ids = ['customer_session_ids_example'] # List[str] | Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. (optional) + transaction_uuids = ['transaction_uuids_example'] # List[str] | Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. (optional) + subledger_id = 'subledger_id_example' # str | The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. (optional) + loyalty_transaction_type = 'loyalty_transaction_type_example' # str | Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. (optional) + start_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + end_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) + page_size = 50 # int | The number of items in the response. (optional) (default to 50) + skip = 56 # int | The number of items to skip when paging through large result sets. (optional) + awaits_activation = True # bool | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. (optional) + + try: + # List customer's loyalty transactions + api_response = api_instance.get_loyalty_program_profile_ledger_transactions(loyalty_program_id, integration_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, subledger_id=subledger_id, loyalty_transaction_type=loyalty_transaction_type, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) + print("The response of ManagementApi->get_loyalty_program_profile_ledger_transactions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ManagementApi->get_loyalty_program_profile_ledger_transactions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **loyalty_program_id** | **int**| Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. | + **integration_id** | **str**| The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. | + **customer_session_ids** | [**List[str]**](str.md)| Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. | [optional] + **transaction_uuids** | [**List[str]**](str.md)| Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. | [optional] + **subledger_id** | **str**| The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. | [optional] + **loyalty_transaction_type** | **str**| Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. | [optional] + **start_date** | **datetime**| Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] + **end_date** | **datetime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] + **page_size** | **int**| The number of items in the response. | [optional] [default to 50] + **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] + **awaits_activation** | **bool**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] + +### Return type + +[**GetLoyaltyProgramProfileTransactions200Response**](GetLoyaltyProgramProfileTransactions200Response.md) + +### Authorization + +[management_key](../README.md#management_key), [manager_auth](../README.md#manager_auth), [api_key_v1](../README.md#api_key_v1) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad request | - | +**401** | Unauthorized | - | +**404** | Not found | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **get_loyalty_program_transactions** -> GetLoyaltyProgramTransactions200Response get_loyalty_program_transactions(loyalty_program_id, loyalty_transaction_type=loyalty_transaction_type, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip) +> GetLoyaltyProgramTransactions200Response get_loyalty_program_transactions(loyalty_program_id, loyalty_transaction_type=loyalty_transaction_type, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) List loyalty program transactions @@ -10924,10 +11265,11 @@ with talon_one.ApiClient(configuration) as api_client: end_date = '2013-10-20T19:20:30+01:00' # datetime | Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. (optional) page_size = 50 # int | The number of items in the response. (optional) (default to 50) skip = 56 # int | The number of items to skip when paging through large result sets. (optional) + awaits_activation = True # bool | If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. (optional) try: # List loyalty program transactions - api_response = api_instance.get_loyalty_program_transactions(loyalty_program_id, loyalty_transaction_type=loyalty_transaction_type, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip) + api_response = api_instance.get_loyalty_program_transactions(loyalty_program_id, loyalty_transaction_type=loyalty_transaction_type, subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, start_date=start_date, end_date=end_date, page_size=page_size, skip=skip, awaits_activation=awaits_activation) print("The response of ManagementApi->get_loyalty_program_transactions:\n") pprint(api_response) except Exception as e: @@ -10950,6 +11292,7 @@ Name | Type | Description | Notes **end_date** | **datetime**| Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. | [optional] **page_size** | **int**| The number of items in the response. | [optional] [default to 50] **skip** | **int**| The number of items to skip when paging through large result sets. | [optional] + **awaits_activation** | **bool**| If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. | [optional] ### Return type diff --git a/docs/NewCollectionsCatalog.md b/docs/NewCollectionsCatalog.md new file mode 100644 index 0000000..e941d8d --- /dev/null +++ b/docs/NewCollectionsCatalog.md @@ -0,0 +1,33 @@ +# NewCollectionsCatalog + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | The display name for the collection catalog. | +**description** | **str** | A longer, more detailed description of the collection catalog. | [optional] +**category** | **str** | Category used to group collection catalogs. | [optional] [default to 'custom'] +**rules** | [**List[CatalogRule]**](CatalogRule.md) | Array of rules to store in this collection catalog. Rules should only contain title (no description, as description is at the collection catalog level). At least one rule or cart item filter is required. | [optional] +**cart_item_filters** | [**List[CartItemFilterTemplate]**](CartItemFilterTemplate.md) | Array of cart item filters to store in this collection catalog. If not provided, will be extracted from the rules. Cart item filters should only contain name (no description, as description is at the collection catalog level). | [optional] + +## Example + +```python +from talon_one.models.new_collections_catalog import NewCollectionsCatalog + +# TODO update the JSON string below +json = "{}" +# create an instance of NewCollectionsCatalog from a JSON string +new_collections_catalog_instance = NewCollectionsCatalog.from_json(json) +# print the JSON string representation of the object +print(NewCollectionsCatalog.to_json()) + +# convert the object into a dict +new_collections_catalog_dict = new_collections_catalog_instance.to_dict() +# create an instance of NewCollectionsCatalog from a dict +new_collections_catalog_from_dict = NewCollectionsCatalog.from_dict(new_collections_catalog_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/PrismaticEventPayloadCouponBasedNotifications.md b/docs/PrismaticEventPayloadCouponBasedNotifications.md index c5da04c..bfe0232 100644 --- a/docs/PrismaticEventPayloadCouponBasedNotifications.md +++ b/docs/PrismaticEventPayloadCouponBasedNotifications.md @@ -23,6 +23,8 @@ Name | Type | Description | Notes **batch_id** | **str** | | [optional] **attributes** | **object** | | [optional] **limits** | [**List[PrismaticEventPayloadCouponBasedNotificationsLimits]**](PrismaticEventPayloadCouponBasedNotificationsLimits.md) | | [optional] +**source_of_event** | **str** | | +**employee_name** | **str** | | ## Example diff --git a/docs/SessionCoupons.md b/docs/SessionCoupons.md deleted file mode 100644 index 4397455..0000000 --- a/docs/SessionCoupons.md +++ /dev/null @@ -1,30 +0,0 @@ -# SessionCoupons - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**session_integration_id** | **str** | The integration ID of the session in which the coupons were applied. | -**coupon_code** | **str** | The coupon codes for which rejection reason is needed. | [optional] - -## Example - -```python -from talon_one.models.session_coupons import SessionCoupons - -# TODO update the JSON string below -json = "{}" -# create an instance of SessionCoupons from a JSON string -session_coupons_instance = SessionCoupons.from_json(json) -# print the JSON string representation of the object -print(SessionCoupons.to_json()) - -# convert the object into a dict -session_coupons_dict = session_coupons_instance.to_dict() -# create an instance of SessionCoupons from a dict -session_coupons_from_dict = SessionCoupons.from_dict(session_coupons_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/UpdateCollectionsCatalog.md b/docs/UpdateCollectionsCatalog.md new file mode 100644 index 0000000..7d40088 --- /dev/null +++ b/docs/UpdateCollectionsCatalog.md @@ -0,0 +1,33 @@ +# UpdateCollectionsCatalog + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | The display name for the collection catalog. | [optional] +**description** | **str** | A longer, more detailed description of the collection catalog. | [optional] +**category** | **str** | Category used to group collection catalogs. | [optional] +**rules** | [**List[CatalogRule]**](CatalogRule.md) | Replaces the stored rules. Rules should only contain title (no description, as description is at the collection catalog level). | [optional] +**cart_item_filters** | [**List[CartItemFilterTemplate]**](CartItemFilterTemplate.md) | Replaces the stored cart item filters. Cart item filters should only contain name (no description, as description is at the collection catalog level). | [optional] + +## Example + +```python +from talon_one.models.update_collections_catalog import UpdateCollectionsCatalog + +# TODO update the JSON string below +json = "{}" +# create an instance of UpdateCollectionsCatalog from a JSON string +update_collections_catalog_instance = UpdateCollectionsCatalog.from_json(json) +# print the JSON string representation of the object +print(UpdateCollectionsCatalog.to_json()) + +# convert the object into a dict +update_collections_catalog_dict = update_collections_catalog_instance.to_dict() +# create an instance of UpdateCollectionsCatalog from a dict +update_collections_catalog_from_dict = UpdateCollectionsCatalog.from_dict(update_collections_catalog_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WebhookAuthentication.md b/docs/WebhookAuthentication.md index f60572e..fe1097e 100644 --- a/docs/WebhookAuthentication.md +++ b/docs/WebhookAuthentication.md @@ -5,15 +5,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | The name of the webhook authentication. | -**type** | **str** | | -**data** | **object** | | **id** | **int** | The internal ID of this entity. | **created** | **datetime** | The time this entity was created. | **modified** | **datetime** | The time this entity was last modified. | **created_by** | **str** | The name of the user who created the webhook authentication. | **modified_by** | **str** | The name of the user who last modified the webhook authentication. | **webhooks** | [**List[WebhookAuthenticationWebhookRef]**](WebhookAuthenticationWebhookRef.md) | | +**name** | **str** | The name of the webhook authentication. | +**type** | **str** | | +**data** | **object** | | ## Example diff --git a/docs/WebhookAuthenticationBase.md b/docs/WebhookAuthenticationBase.md deleted file mode 100644 index e79e417..0000000 --- a/docs/WebhookAuthenticationBase.md +++ /dev/null @@ -1,31 +0,0 @@ -# WebhookAuthenticationBase - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | The name of the webhook authentication. | -**type** | **str** | | -**data** | **object** | | - -## Example - -```python -from talon_one.models.webhook_authentication_base import WebhookAuthenticationBase - -# TODO update the JSON string below -json = "{}" -# create an instance of WebhookAuthenticationBase from a JSON string -webhook_authentication_base_instance = WebhookAuthenticationBase.from_json(json) -# print the JSON string representation of the object -print(WebhookAuthenticationBase.to_json()) - -# convert the object into a dict -webhook_authentication_base_dict = webhook_authentication_base_instance.to_dict() -# create an instance of WebhookAuthenticationBase from a dict -webhook_authentication_base_from_dict = WebhookAuthenticationBase.from_dict(webhook_authentication_base_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/pyproject.toml b/pyproject.toml index 3b18897..a112e07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "talon-one-sdk" -version = "26.01" +version = "26.02" description = "Talon.One API" authors = [ {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, diff --git a/setup.py b/setup.py index 2093b0b..827c88a 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ # http://pypi.python.org/pypi/setuptools NAME = "talon-one-sdk" -VERSION = "26.01" +VERSION = "26.02" # Get the long description from the README.md file here = pathlib.Path(__file__).parent.resolve() diff --git a/talon_one/__init__.py b/talon_one/__init__.py index c1041f0..a407673 100644 --- a/talon_one/__init__.py +++ b/talon_one/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "26.01" +__version__ = "26.02" # Define package exports __all__ = [ @@ -113,7 +113,7 @@ "BestPriorPrice", "BestPriorPriceMetadata", "BestPriorPriceRequest", - "BestPriorPriceRequestTarget", + "BestPriorTarget", "Binding", "BulkApplicationNotification", "BulkOperationOnCampaigns", @@ -172,9 +172,11 @@ "CardLedgerTransactionLogEntry", "CardLedgerTransactionLogEntryIntegrationAPI", "CartItem", + "CartItemFilterTemplate", "Catalog", "CatalogActionFilter", "CatalogItem", + "CatalogRule", "CatalogSyncRequest", "CatalogsStrikethroughNotificationPolicy", "Change", @@ -184,6 +186,7 @@ "Collection", "CollectionItem", "CollectionWithoutPayload", + "CollectionsCatalog", "Coupon", "CouponConstraints", "CouponCreatedEffectProps", @@ -194,7 +197,6 @@ "CouponFailureSummary", "CouponLimitConfigs", "CouponRejectionReason", - "CouponRejections", "CouponReservations", "CouponSearch", "CouponValue", @@ -227,6 +229,7 @@ "DeductLoyaltyPoints", "DeductLoyaltyPointsEffectProps", "DeleteCouponsData", + "DeleteLoyaltyTransactionsRequest", "DeleteUserRequest", "Effect", "EffectEntity", @@ -267,6 +270,7 @@ "GenerateCampaignTags", "GenerateCouponFailureDetailedSummary", "GenerateCouponFailureSummary", + "GenerateCouponRejections200Response", "GenerateItemFilterDescription", "GenerateLoyaltyCard", "GenerateRuleTitle", @@ -424,6 +428,7 @@ "NewCampaignTemplate", "NewCatalog", "NewCollection", + "NewCollectionsCatalog", "NewCouponCreationJob", "NewCouponDeletionJob", "NewCoupons", @@ -573,7 +578,6 @@ "ScimUsersListResponse", "SecondaryDeployment", "Session", - "SessionCoupons", "SetDiscountEffectProps", "SetDiscountPerAdditionalCostEffectProps", "SetDiscountPerAdditionalCostPerItemEffectProps", @@ -630,6 +634,7 @@ "UpdateCampaignTemplate", "UpdateCatalog", "UpdateCollection", + "UpdateCollectionsCatalog", "UpdateCoupon", "UpdateCouponBatch", "UpdateCouponsData", @@ -651,7 +656,6 @@ "ValueMap", "Webhook", "WebhookAuthentication", - "WebhookAuthenticationBase", "WebhookAuthenticationDataBasic", "WebhookAuthenticationDataCustom", "WebhookAuthenticationWebhookRef", @@ -759,7 +763,7 @@ from talon_one.models.best_prior_price import BestPriorPrice as BestPriorPrice from talon_one.models.best_prior_price_metadata import BestPriorPriceMetadata as BestPriorPriceMetadata from talon_one.models.best_prior_price_request import BestPriorPriceRequest as BestPriorPriceRequest -from talon_one.models.best_prior_price_request_target import BestPriorPriceRequestTarget as BestPriorPriceRequestTarget +from talon_one.models.best_prior_target import BestPriorTarget as BestPriorTarget from talon_one.models.binding import Binding as Binding from talon_one.models.bulk_application_notification import BulkApplicationNotification as BulkApplicationNotification from talon_one.models.bulk_operation_on_campaigns import BulkOperationOnCampaigns as BulkOperationOnCampaigns @@ -818,9 +822,11 @@ from talon_one.models.card_ledger_transaction_log_entry import CardLedgerTransactionLogEntry as CardLedgerTransactionLogEntry from talon_one.models.card_ledger_transaction_log_entry_integration_api import CardLedgerTransactionLogEntryIntegrationAPI as CardLedgerTransactionLogEntryIntegrationAPI from talon_one.models.cart_item import CartItem as CartItem +from talon_one.models.cart_item_filter_template import CartItemFilterTemplate as CartItemFilterTemplate from talon_one.models.catalog import Catalog as Catalog from talon_one.models.catalog_action_filter import CatalogActionFilter as CatalogActionFilter from talon_one.models.catalog_item import CatalogItem as CatalogItem +from talon_one.models.catalog_rule import CatalogRule as CatalogRule from talon_one.models.catalog_sync_request import CatalogSyncRequest as CatalogSyncRequest from talon_one.models.catalogs_strikethrough_notification_policy import CatalogsStrikethroughNotificationPolicy as CatalogsStrikethroughNotificationPolicy from talon_one.models.change import Change as Change @@ -830,6 +836,7 @@ from talon_one.models.collection import Collection as Collection from talon_one.models.collection_item import CollectionItem as CollectionItem from talon_one.models.collection_without_payload import CollectionWithoutPayload as CollectionWithoutPayload +from talon_one.models.collections_catalog import CollectionsCatalog as CollectionsCatalog from talon_one.models.coupon import Coupon as Coupon from talon_one.models.coupon_constraints import CouponConstraints as CouponConstraints from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps as CouponCreatedEffectProps @@ -840,7 +847,6 @@ from talon_one.models.coupon_failure_summary import CouponFailureSummary as CouponFailureSummary from talon_one.models.coupon_limit_configs import CouponLimitConfigs as CouponLimitConfigs from talon_one.models.coupon_rejection_reason import CouponRejectionReason as CouponRejectionReason -from talon_one.models.coupon_rejections import CouponRejections as CouponRejections from talon_one.models.coupon_reservations import CouponReservations as CouponReservations from talon_one.models.coupon_search import CouponSearch as CouponSearch from talon_one.models.coupon_value import CouponValue as CouponValue @@ -873,6 +879,7 @@ from talon_one.models.deduct_loyalty_points import DeductLoyaltyPoints as DeductLoyaltyPoints from talon_one.models.deduct_loyalty_points_effect_props import DeductLoyaltyPointsEffectProps as DeductLoyaltyPointsEffectProps from talon_one.models.delete_coupons_data import DeleteCouponsData as DeleteCouponsData +from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest as DeleteLoyaltyTransactionsRequest from talon_one.models.delete_user_request import DeleteUserRequest as DeleteUserRequest from talon_one.models.effect import Effect as Effect from talon_one.models.effect_entity import EffectEntity as EffectEntity @@ -913,6 +920,7 @@ from talon_one.models.generate_campaign_tags import GenerateCampaignTags as GenerateCampaignTags from talon_one.models.generate_coupon_failure_detailed_summary import GenerateCouponFailureDetailedSummary as GenerateCouponFailureDetailedSummary from talon_one.models.generate_coupon_failure_summary import GenerateCouponFailureSummary as GenerateCouponFailureSummary +from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response as GenerateCouponRejections200Response from talon_one.models.generate_item_filter_description import GenerateItemFilterDescription as GenerateItemFilterDescription from talon_one.models.generate_loyalty_card import GenerateLoyaltyCard as GenerateLoyaltyCard from talon_one.models.generate_rule_title import GenerateRuleTitle as GenerateRuleTitle @@ -1070,6 +1078,7 @@ from talon_one.models.new_campaign_template import NewCampaignTemplate as NewCampaignTemplate from talon_one.models.new_catalog import NewCatalog as NewCatalog from talon_one.models.new_collection import NewCollection as NewCollection +from talon_one.models.new_collections_catalog import NewCollectionsCatalog as NewCollectionsCatalog from talon_one.models.new_coupon_creation_job import NewCouponCreationJob as NewCouponCreationJob from talon_one.models.new_coupon_deletion_job import NewCouponDeletionJob as NewCouponDeletionJob from talon_one.models.new_coupons import NewCoupons as NewCoupons @@ -1219,7 +1228,6 @@ from talon_one.models.scim_users_list_response import ScimUsersListResponse as ScimUsersListResponse from talon_one.models.secondary_deployment import SecondaryDeployment as SecondaryDeployment from talon_one.models.session import Session as Session -from talon_one.models.session_coupons import SessionCoupons as SessionCoupons from talon_one.models.set_discount_effect_props import SetDiscountEffectProps as SetDiscountEffectProps from talon_one.models.set_discount_per_additional_cost_effect_props import SetDiscountPerAdditionalCostEffectProps as SetDiscountPerAdditionalCostEffectProps from talon_one.models.set_discount_per_additional_cost_per_item_effect_props import SetDiscountPerAdditionalCostPerItemEffectProps as SetDiscountPerAdditionalCostPerItemEffectProps @@ -1276,6 +1284,7 @@ from talon_one.models.update_campaign_template import UpdateCampaignTemplate as UpdateCampaignTemplate from talon_one.models.update_catalog import UpdateCatalog as UpdateCatalog from talon_one.models.update_collection import UpdateCollection as UpdateCollection +from talon_one.models.update_collections_catalog import UpdateCollectionsCatalog as UpdateCollectionsCatalog from talon_one.models.update_coupon import UpdateCoupon as UpdateCoupon from talon_one.models.update_coupon_batch import UpdateCouponBatch as UpdateCouponBatch from talon_one.models.update_coupons_data import UpdateCouponsData as UpdateCouponsData @@ -1297,7 +1306,6 @@ from talon_one.models.value_map import ValueMap as ValueMap from talon_one.models.webhook import Webhook as Webhook from talon_one.models.webhook_authentication import WebhookAuthentication as WebhookAuthentication -from talon_one.models.webhook_authentication_base import WebhookAuthenticationBase as WebhookAuthenticationBase from talon_one.models.webhook_authentication_data_basic import WebhookAuthenticationDataBasic as WebhookAuthenticationDataBasic from talon_one.models.webhook_authentication_data_custom import WebhookAuthenticationDataCustom as WebhookAuthenticationDataCustom from talon_one.models.webhook_authentication_webhook_ref import WebhookAuthenticationWebhookRef as WebhookAuthenticationWebhookRef diff --git a/talon_one/api/integration_api.py b/talon_one/api/integration_api.py index cd7c938..37c7364 100644 --- a/talon_one/api/integration_api.py +++ b/talon_one/api/integration_api.py @@ -20,6 +20,8 @@ from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, Dict, List, Optional from typing_extensions import Annotated +from talon_one.models.activate_loyalty_points import ActivateLoyaltyPoints +from talon_one.models.activate_loyalty_points_response import ActivateLoyaltyPointsResponse from talon_one.models.audience import Audience from talon_one.models.best_prior_price import BestPriorPrice from talon_one.models.best_prior_price_request import BestPriorPriceRequest @@ -32,6 +34,7 @@ from talon_one.models.customer_profile_audience_request import CustomerProfileAudienceRequest from talon_one.models.customer_profile_integration_request_v2 import CustomerProfileIntegrationRequestV2 from talon_one.models.customer_profile_integration_response_v2 import CustomerProfileIntegrationResponseV2 +from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest from talon_one.models.generate_loyalty_card import GenerateLoyaltyCard from talon_one.models.get_customer_achievement_history200_response import GetCustomerAchievementHistory200Response from talon_one.models.get_customer_achievements200_response import GetCustomerAchievements200Response @@ -78,9 +81,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def best_prior_price( + def activate_loyalty_points( self, - best_prior_price_request: Annotated[BestPriorPriceRequest, Field(description="body")], + loyalty_program_id: Annotated[StrictInt, Field(description="The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + activate_loyalty_points: Annotated[ActivateLoyaltyPoints, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -93,13 +97,15 @@ def best_prior_price( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[BestPriorPrice]: - """Fetch best prior price + ) -> ActivateLoyaltyPointsResponse: + """Activate loyalty points - Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe. + Activate points when a defined action occurs. You can activate pending points using one of the following parameters: - `sessionId`: Activates all points earned in the specified session. - `transactionUUIDs`: Activates points earned in the transactions specified by the given UUIDs. - :param best_prior_price_request: body (required) - :type best_prior_price_request: BestPriorPriceRequest + :param loyalty_program_id: The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param activate_loyalty_points: body (required) + :type activate_loyalty_points: ActivateLoyaltyPoints :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -122,8 +128,9 @@ def best_prior_price( :return: Returns the result object. """ # noqa: E501 - _param = self._best_prior_price_serialize( - best_prior_price_request=best_prior_price_request, + _param = self._activate_loyalty_points_serialize( + loyalty_program_id=loyalty_program_id, + activate_loyalty_points=activate_loyalty_points, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -131,7 +138,10 @@ def best_prior_price( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[BestPriorPrice]", + '200': "ActivateLoyaltyPointsResponse", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -145,9 +155,10 @@ def best_prior_price( @validate_call - def best_prior_price_with_http_info( + def activate_loyalty_points_with_http_info( self, - best_prior_price_request: Annotated[BestPriorPriceRequest, Field(description="body")], + loyalty_program_id: Annotated[StrictInt, Field(description="The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + activate_loyalty_points: Annotated[ActivateLoyaltyPoints, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -160,13 +171,15 @@ def best_prior_price_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[BestPriorPrice]]: - """Fetch best prior price + ) -> ApiResponse[ActivateLoyaltyPointsResponse]: + """Activate loyalty points - Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe. + Activate points when a defined action occurs. You can activate pending points using one of the following parameters: - `sessionId`: Activates all points earned in the specified session. - `transactionUUIDs`: Activates points earned in the transactions specified by the given UUIDs. - :param best_prior_price_request: body (required) - :type best_prior_price_request: BestPriorPriceRequest + :param loyalty_program_id: The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param activate_loyalty_points: body (required) + :type activate_loyalty_points: ActivateLoyaltyPoints :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -189,8 +202,9 @@ def best_prior_price_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._best_prior_price_serialize( - best_prior_price_request=best_prior_price_request, + _param = self._activate_loyalty_points_serialize( + loyalty_program_id=loyalty_program_id, + activate_loyalty_points=activate_loyalty_points, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -198,7 +212,10 @@ def best_prior_price_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[BestPriorPrice]", + '200': "ActivateLoyaltyPointsResponse", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -212,9 +229,10 @@ def best_prior_price_with_http_info( @validate_call - def best_prior_price_without_preload_content( + def activate_loyalty_points_without_preload_content( self, - best_prior_price_request: Annotated[BestPriorPriceRequest, Field(description="body")], + loyalty_program_id: Annotated[StrictInt, Field(description="The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + activate_loyalty_points: Annotated[ActivateLoyaltyPoints, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -228,12 +246,14 @@ def best_prior_price_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Fetch best prior price + """Activate loyalty points - Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe. + Activate points when a defined action occurs. You can activate pending points using one of the following parameters: - `sessionId`: Activates all points earned in the specified session. - `transactionUUIDs`: Activates points earned in the transactions specified by the given UUIDs. - :param best_prior_price_request: body (required) - :type best_prior_price_request: BestPriorPriceRequest + :param loyalty_program_id: The identifier for the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param activate_loyalty_points: body (required) + :type activate_loyalty_points: ActivateLoyaltyPoints :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -256,8 +276,9 @@ def best_prior_price_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._best_prior_price_serialize( - best_prior_price_request=best_prior_price_request, + _param = self._activate_loyalty_points_serialize( + loyalty_program_id=loyalty_program_id, + activate_loyalty_points=activate_loyalty_points, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -265,7 +286,10 @@ def best_prior_price_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[BestPriorPrice]", + '200': "ActivateLoyaltyPointsResponse", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -274,9 +298,10 @@ def best_prior_price_without_preload_content( return response_data.response - def _best_prior_price_serialize( + def _activate_loyalty_points_serialize( self, - best_prior_price_request, + loyalty_program_id, + activate_loyalty_points, _request_auth, _content_type, _headers, @@ -298,12 +323,14 @@ def _best_prior_price_serialize( _body_params: Optional[bytes] = None # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if best_prior_price_request is not None: - _body_params = best_prior_price_request + if activate_loyalty_points is not None: + _body_params = activate_loyalty_points # set the HTTP header `Accept` @@ -330,14 +357,12 @@ def _best_prior_price_serialize( # authentication setting _auth_settings: List[str] = [ - 'management_key', - 'manager_auth', 'api_key_v1' ] return self.api_client.param_serialize( method='POST', - resource_path='/v1/best_prior_price', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/activate_points', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -354,9 +379,9 @@ def _best_prior_price_serialize( @validate_call - def create_audience_v2( + def best_prior_price( self, - new_audience: Annotated[NewAudience, Field(description="body")], + best_prior_price_request: Annotated[BestPriorPriceRequest, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -369,13 +394,13 @@ def create_audience_v2( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Audience: - """Create audience + ) -> List[BestPriorPrice]: + """Fetch best prior price - Create an audience. The audience can be created directly from scratch or can come from third party platforms. **Note:** Audiences can also be created from scratch via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](https://docs.talon.one/docs/dev/technology-partners/overview): 1. Set the `integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch: 1. Only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder. + Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe. - :param new_audience: body (required) - :type new_audience: NewAudience + :param best_prior_price_request: body (required) + :type best_prior_price_request: BestPriorPriceRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -398,8 +423,8 @@ def create_audience_v2( :return: Returns the result object. """ # noqa: E501 - _param = self._create_audience_v2_serialize( - new_audience=new_audience, + _param = self._best_prior_price_serialize( + best_prior_price_request=best_prior_price_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -407,10 +432,7 @@ def create_audience_v2( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Audience", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "ErrorResponseWithStatus", + '200': "List[BestPriorPrice]", } response_data = self.api_client.call_api( *_param, @@ -424,9 +446,9 @@ def create_audience_v2( @validate_call - def create_audience_v2_with_http_info( + def best_prior_price_with_http_info( self, - new_audience: Annotated[NewAudience, Field(description="body")], + best_prior_price_request: Annotated[BestPriorPriceRequest, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -439,13 +461,13 @@ def create_audience_v2_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Audience]: - """Create audience + ) -> ApiResponse[List[BestPriorPrice]]: + """Fetch best prior price - Create an audience. The audience can be created directly from scratch or can come from third party platforms. **Note:** Audiences can also be created from scratch via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](https://docs.talon.one/docs/dev/technology-partners/overview): 1. Set the `integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch: 1. Only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder. + Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe. - :param new_audience: body (required) - :type new_audience: NewAudience + :param best_prior_price_request: body (required) + :type best_prior_price_request: BestPriorPriceRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -468,8 +490,8 @@ def create_audience_v2_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_audience_v2_serialize( - new_audience=new_audience, + _param = self._best_prior_price_serialize( + best_prior_price_request=best_prior_price_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -477,10 +499,7 @@ def create_audience_v2_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Audience", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "ErrorResponseWithStatus", + '200': "List[BestPriorPrice]", } response_data = self.api_client.call_api( *_param, @@ -494,9 +513,9 @@ def create_audience_v2_with_http_info( @validate_call - def create_audience_v2_without_preload_content( + def best_prior_price_without_preload_content( self, - new_audience: Annotated[NewAudience, Field(description="body")], + best_prior_price_request: Annotated[BestPriorPriceRequest, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -510,12 +529,12 @@ def create_audience_v2_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create audience + """Fetch best prior price - Create an audience. The audience can be created directly from scratch or can come from third party platforms. **Note:** Audiences can also be created from scratch via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](https://docs.talon.one/docs/dev/technology-partners/overview): 1. Set the `integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch: 1. Only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder. + Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe. - :param new_audience: body (required) - :type new_audience: NewAudience + :param best_prior_price_request: body (required) + :type best_prior_price_request: BestPriorPriceRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -538,8 +557,8 @@ def create_audience_v2_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_audience_v2_serialize( - new_audience=new_audience, + _param = self._best_prior_price_serialize( + best_prior_price_request=best_prior_price_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -547,10 +566,7 @@ def create_audience_v2_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Audience", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '409': "ErrorResponseWithStatus", + '200': "List[BestPriorPrice]", } response_data = self.api_client.call_api( *_param, @@ -559,9 +575,9 @@ def create_audience_v2_without_preload_content( return response_data.response - def _create_audience_v2_serialize( + def _best_prior_price_serialize( self, - new_audience, + best_prior_price_request, _request_auth, _content_type, _headers, @@ -587,8 +603,8 @@ def _create_audience_v2_serialize( # process the header parameters # process the form parameters # process the body parameter - if new_audience is not None: - _body_params = new_audience + if best_prior_price_request is not None: + _body_params = best_prior_price_request # set the HTTP header `Accept` @@ -615,12 +631,14 @@ def _create_audience_v2_serialize( # authentication setting _auth_settings: List[str] = [ + 'management_key', + 'manager_auth', 'api_key_v1' ] return self.api_client.param_serialize( method='POST', - resource_path='/v2/audiences', + resource_path='/v1/best_prior_price', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -637,10 +655,9 @@ def _create_audience_v2_serialize( @validate_call - def create_coupon_reservation( + def create_audience_v2( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], - coupon_reservations: Annotated[CouponReservations, Field(description="body")], + new_audience: Annotated[NewAudience, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -653,15 +670,13 @@ def create_coupon_reservation( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Coupon: - """Create coupon reservation + ) -> Audience: + """Create audience - Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. **Note:** - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon is associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. - This endpoint overrides the coupon reservation limit set when [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. + Create an audience. The audience can be created directly from scratch or can come from third party platforms. **Note:** Audiences can also be created from scratch via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](https://docs.talon.one/docs/dev/technology-partners/overview): 1. Set the `integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch: 1. Only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder. - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str - :param coupon_reservations: body (required) - :type coupon_reservations: CouponReservations + :param new_audience: body (required) + :type new_audience: NewAudience :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -684,9 +699,8 @@ def create_coupon_reservation( :return: Returns the result object. """ # noqa: E501 - _param = self._create_coupon_reservation_serialize( - coupon_value=coupon_value, - coupon_reservations=coupon_reservations, + _param = self._create_audience_v2_serialize( + new_audience=new_audience, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -694,10 +708,10 @@ def create_coupon_reservation( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Coupon", + '201': "Audience", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '409': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -711,10 +725,9 @@ def create_coupon_reservation( @validate_call - def create_coupon_reservation_with_http_info( + def create_audience_v2_with_http_info( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], - coupon_reservations: Annotated[CouponReservations, Field(description="body")], + new_audience: Annotated[NewAudience, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -727,15 +740,13 @@ def create_coupon_reservation_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Coupon]: - """Create coupon reservation + ) -> ApiResponse[Audience]: + """Create audience - Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. **Note:** - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon is associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. - This endpoint overrides the coupon reservation limit set when [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. + Create an audience. The audience can be created directly from scratch or can come from third party platforms. **Note:** Audiences can also be created from scratch via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](https://docs.talon.one/docs/dev/technology-partners/overview): 1. Set the `integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch: 1. Only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder. - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str - :param coupon_reservations: body (required) - :type coupon_reservations: CouponReservations + :param new_audience: body (required) + :type new_audience: NewAudience :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -758,9 +769,8 @@ def create_coupon_reservation_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_coupon_reservation_serialize( - coupon_value=coupon_value, - coupon_reservations=coupon_reservations, + _param = self._create_audience_v2_serialize( + new_audience=new_audience, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -768,10 +778,10 @@ def create_coupon_reservation_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Coupon", + '201': "Audience", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '409': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -785,10 +795,9 @@ def create_coupon_reservation_with_http_info( @validate_call - def create_coupon_reservation_without_preload_content( + def create_audience_v2_without_preload_content( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], - coupon_reservations: Annotated[CouponReservations, Field(description="body")], + new_audience: Annotated[NewAudience, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -802,14 +811,12 @@ def create_coupon_reservation_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create coupon reservation + """Create audience - Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. **Note:** - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon is associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. - This endpoint overrides the coupon reservation limit set when [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. + Create an audience. The audience can be created directly from scratch or can come from third party platforms. **Note:** Audiences can also be created from scratch via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](https://docs.talon.one/docs/dev/technology-partners/overview): 1. Set the `integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch: 1. Only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder. - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str - :param coupon_reservations: body (required) - :type coupon_reservations: CouponReservations + :param new_audience: body (required) + :type new_audience: NewAudience :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -832,9 +839,8 @@ def create_coupon_reservation_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_coupon_reservation_serialize( - coupon_value=coupon_value, - coupon_reservations=coupon_reservations, + _param = self._create_audience_v2_serialize( + new_audience=new_audience, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -842,10 +848,10 @@ def create_coupon_reservation_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Coupon", + '201': "Audience", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '409': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -854,10 +860,9 @@ def create_coupon_reservation_without_preload_content( return response_data.response - def _create_coupon_reservation_serialize( + def _create_audience_v2_serialize( self, - coupon_value, - coupon_reservations, + new_audience, _request_auth, _content_type, _headers, @@ -879,14 +884,12 @@ def _create_coupon_reservation_serialize( _body_params: Optional[bytes] = None # process the path parameters - if coupon_value is not None: - _path_params['couponValue'] = coupon_value # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if coupon_reservations is not None: - _body_params = coupon_reservations + if new_audience is not None: + _body_params = new_audience # set the HTTP header `Accept` @@ -918,7 +921,7 @@ def _create_coupon_reservation_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/coupon_reservations/{couponValue}', + resource_path='/v2/audiences', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -935,9 +938,10 @@ def _create_coupon_reservation_serialize( @validate_call - def create_referral( + def create_coupon_reservation( self, - new_referral: Annotated[NewReferral, Field(description="body")], + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + coupon_reservations: Annotated[CouponReservations, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -950,13 +954,15 @@ def create_referral( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Referral: - """Create referral code for an advocate + ) -> Coupon: + """Create coupon reservation - Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the `campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. + Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. **Note:** - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon is associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. - This endpoint overrides the coupon reservation limit set when [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. - :param new_referral: body (required) - :type new_referral: NewReferral + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str + :param coupon_reservations: body (required) + :type coupon_reservations: CouponReservations :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -979,8 +985,9 @@ def create_referral( :return: Returns the result object. """ # noqa: E501 - _param = self._create_referral_serialize( - new_referral=new_referral, + _param = self._create_coupon_reservation_serialize( + coupon_value=coupon_value, + coupon_reservations=coupon_reservations, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -988,9 +995,10 @@ def create_referral( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Referral", - '400': "ErrorResponse", + '201': "Coupon", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1004,9 +1012,10 @@ def create_referral( @validate_call - def create_referral_with_http_info( + def create_coupon_reservation_with_http_info( self, - new_referral: Annotated[NewReferral, Field(description="body")], + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + coupon_reservations: Annotated[CouponReservations, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1019,13 +1028,15 @@ def create_referral_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Referral]: - """Create referral code for an advocate + ) -> ApiResponse[Coupon]: + """Create coupon reservation - Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the `campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. + Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. **Note:** - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon is associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. - This endpoint overrides the coupon reservation limit set when [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. - :param new_referral: body (required) - :type new_referral: NewReferral + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str + :param coupon_reservations: body (required) + :type coupon_reservations: CouponReservations :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1048,8 +1059,9 @@ def create_referral_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_referral_serialize( - new_referral=new_referral, + _param = self._create_coupon_reservation_serialize( + coupon_value=coupon_value, + coupon_reservations=coupon_reservations, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1057,9 +1069,10 @@ def create_referral_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Referral", - '400': "ErrorResponse", + '201': "Coupon", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1073,9 +1086,10 @@ def create_referral_with_http_info( @validate_call - def create_referral_without_preload_content( + def create_coupon_reservation_without_preload_content( self, - new_referral: Annotated[NewReferral, Field(description="body")], + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + coupon_reservations: Annotated[CouponReservations, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1089,12 +1103,14 @@ def create_referral_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create referral code for an advocate + """Create coupon reservation - Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the `campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. + Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. **Note:** - If the **Reservation mandatory** option was selected when creating the specified coupon, the endpoint creates a **hard** reservation, meaning only users who have this coupon code reserved can redeem it. Otherwise, the endpoint creates a **soft** reservation, meaning the coupon is associated with the specified customer profiles (they show up when using the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint), but any user can redeem it. This can be useful, for example, to display a _coupon wallet_ for customers when they visit your store. - If the **Coupon visibility** option was selected when creating the specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code will be returned for all customer profiles in the [List customer data](https://docs.talon.one/integration-api#operation/getCustomerInventory) endpoint. - This endpoint overrides the coupon reservation limit set when [the coupon is created](https://docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](https://docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](https://docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint. - :param new_referral: body (required) - :type new_referral: NewReferral + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str + :param coupon_reservations: body (required) + :type coupon_reservations: CouponReservations :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1117,8 +1133,9 @@ def create_referral_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_referral_serialize( - new_referral=new_referral, + _param = self._create_coupon_reservation_serialize( + coupon_value=coupon_value, + coupon_reservations=coupon_reservations, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1126,9 +1143,10 @@ def create_referral_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "Referral", - '400': "ErrorResponse", + '201': "Coupon", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1137,9 +1155,10 @@ def create_referral_without_preload_content( return response_data.response - def _create_referral_serialize( + def _create_coupon_reservation_serialize( self, - new_referral, + coupon_value, + coupon_reservations, _request_auth, _content_type, _headers, @@ -1161,12 +1180,14 @@ def _create_referral_serialize( _body_params: Optional[bytes] = None # process the path parameters + if coupon_value is not None: + _path_params['couponValue'] = coupon_value # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if new_referral is not None: - _body_params = new_referral + if coupon_reservations is not None: + _body_params = coupon_reservations # set the HTTP header `Accept` @@ -1198,7 +1219,7 @@ def _create_referral_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/referrals', + resource_path='/v1/coupon_reservations/{couponValue}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1215,10 +1236,9 @@ def _create_referral_serialize( @validate_call - def create_referrals_for_multiple_advocates( + def create_referral( self, - new_referrals_for_multiple_advocates: Annotated[NewReferralsForMultipleAdvocates, Field(description="body")], - silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + new_referral: Annotated[NewReferral, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1231,15 +1251,13 @@ def create_referrals_for_multiple_advocates( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CreateReferralsForMultipleAdvocates201Response: - """Create referral codes for multiple advocates + ) -> Referral: + """Create referral code for an advocate - Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the `campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. + Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the `campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. - :param new_referrals_for_multiple_advocates: body (required) - :type new_referrals_for_multiple_advocates: NewReferralsForMultipleAdvocates - :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. - :type silent: str + :param new_referral: body (required) + :type new_referral: NewReferral :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1262,9 +1280,8 @@ def create_referrals_for_multiple_advocates( :return: Returns the result object. """ # noqa: E501 - _param = self._create_referrals_for_multiple_advocates_serialize( - new_referrals_for_multiple_advocates=new_referrals_for_multiple_advocates, - silent=silent, + _param = self._create_referral_serialize( + new_referral=new_referral, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1272,9 +1289,8 @@ def create_referrals_for_multiple_advocates( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateReferralsForMultipleAdvocates201Response", - '204': None, - '400': "ErrorResponseWithStatus", + '201': "Referral", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( @@ -1289,10 +1305,9 @@ def create_referrals_for_multiple_advocates( @validate_call - def create_referrals_for_multiple_advocates_with_http_info( + def create_referral_with_http_info( self, - new_referrals_for_multiple_advocates: Annotated[NewReferralsForMultipleAdvocates, Field(description="body")], - silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + new_referral: Annotated[NewReferral, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1305,15 +1320,13 @@ def create_referrals_for_multiple_advocates_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CreateReferralsForMultipleAdvocates201Response]: - """Create referral codes for multiple advocates + ) -> ApiResponse[Referral]: + """Create referral code for an advocate - Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the `campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. + Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the `campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. - :param new_referrals_for_multiple_advocates: body (required) - :type new_referrals_for_multiple_advocates: NewReferralsForMultipleAdvocates - :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. - :type silent: str + :param new_referral: body (required) + :type new_referral: NewReferral :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1336,9 +1349,8 @@ def create_referrals_for_multiple_advocates_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._create_referrals_for_multiple_advocates_serialize( - new_referrals_for_multiple_advocates=new_referrals_for_multiple_advocates, - silent=silent, + _param = self._create_referral_serialize( + new_referral=new_referral, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1346,9 +1358,8 @@ def create_referrals_for_multiple_advocates_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateReferralsForMultipleAdvocates201Response", - '204': None, - '400': "ErrorResponseWithStatus", + '201': "Referral", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( @@ -1363,10 +1374,9 @@ def create_referrals_for_multiple_advocates_with_http_info( @validate_call - def create_referrals_for_multiple_advocates_without_preload_content( + def create_referral_without_preload_content( self, - new_referrals_for_multiple_advocates: Annotated[NewReferralsForMultipleAdvocates, Field(description="body")], - silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + new_referral: Annotated[NewReferral, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1380,14 +1390,12 @@ def create_referrals_for_multiple_advocates_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create referral codes for multiple advocates + """Create referral code for an advocate - Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the `campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. + Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the `campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. - :param new_referrals_for_multiple_advocates: body (required) - :type new_referrals_for_multiple_advocates: NewReferralsForMultipleAdvocates - :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. - :type silent: str + :param new_referral: body (required) + :type new_referral: NewReferral :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1410,9 +1418,8 @@ def create_referrals_for_multiple_advocates_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._create_referrals_for_multiple_advocates_serialize( - new_referrals_for_multiple_advocates=new_referrals_for_multiple_advocates, - silent=silent, + _param = self._create_referral_serialize( + new_referral=new_referral, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1420,9 +1427,8 @@ def create_referrals_for_multiple_advocates_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '201': "CreateReferralsForMultipleAdvocates201Response", - '204': None, - '400': "ErrorResponseWithStatus", + '201': "Referral", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( @@ -1432,10 +1438,9 @@ def create_referrals_for_multiple_advocates_without_preload_content( return response_data.response - def _create_referrals_for_multiple_advocates_serialize( + def _create_referral_serialize( self, - new_referrals_for_multiple_advocates, - silent, + new_referral, _request_auth, _content_type, _headers, @@ -1458,15 +1463,11 @@ def _create_referrals_for_multiple_advocates_serialize( # process the path parameters # process the query parameters - if silent is not None: - - _query_params.append(('silent', silent)) - # process the header parameters # process the form parameters # process the body parameter - if new_referrals_for_multiple_advocates is not None: - _body_params = new_referrals_for_multiple_advocates + if new_referral is not None: + _body_params = new_referral # set the HTTP header `Accept` @@ -1498,7 +1499,7 @@ def _create_referrals_for_multiple_advocates_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v1/referrals_for_multiple_advocates', + resource_path='/v1/referrals', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1515,9 +1516,10 @@ def _create_referrals_for_multiple_advocates_serialize( @validate_call - def delete_audience_memberships_v2( + def create_referrals_for_multiple_advocates( self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], + new_referrals_for_multiple_advocates: Annotated[NewReferralsForMultipleAdvocates, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1530,13 +1532,15 @@ def delete_audience_memberships_v2( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete audience memberships + ) -> CreateReferralsForMultipleAdvocates201Response: + """Create referral codes for multiple advocates - Remove all members from this audience. + Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the `campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. - :param audience_id: The ID of the audience. (required) - :type audience_id: int + :param new_referrals_for_multiple_advocates: body (required) + :type new_referrals_for_multiple_advocates: NewReferralsForMultipleAdvocates + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1559,8 +1563,9 @@ def delete_audience_memberships_v2( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_audience_memberships_v2_serialize( - audience_id=audience_id, + _param = self._create_referrals_for_multiple_advocates_serialize( + new_referrals_for_multiple_advocates=new_referrals_for_multiple_advocates, + silent=silent, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1568,9 +1573,10 @@ def delete_audience_memberships_v2( ) _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateReferralsForMultipleAdvocates201Response", '204': None, + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1584,9 +1590,10 @@ def delete_audience_memberships_v2( @validate_call - def delete_audience_memberships_v2_with_http_info( + def create_referrals_for_multiple_advocates_with_http_info( self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], + new_referrals_for_multiple_advocates: Annotated[NewReferralsForMultipleAdvocates, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1599,13 +1606,15 @@ def delete_audience_memberships_v2_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete audience memberships + ) -> ApiResponse[CreateReferralsForMultipleAdvocates201Response]: + """Create referral codes for multiple advocates - Remove all members from this audience. + Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the `campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. - :param audience_id: The ID of the audience. (required) - :type audience_id: int + :param new_referrals_for_multiple_advocates: body (required) + :type new_referrals_for_multiple_advocates: NewReferralsForMultipleAdvocates + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1628,8 +1637,9 @@ def delete_audience_memberships_v2_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_audience_memberships_v2_serialize( - audience_id=audience_id, + _param = self._create_referrals_for_multiple_advocates_serialize( + new_referrals_for_multiple_advocates=new_referrals_for_multiple_advocates, + silent=silent, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1637,9 +1647,10 @@ def delete_audience_memberships_v2_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateReferralsForMultipleAdvocates201Response", '204': None, + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1653,9 +1664,10 @@ def delete_audience_memberships_v2_with_http_info( @validate_call - def delete_audience_memberships_v2_without_preload_content( + def create_referrals_for_multiple_advocates_without_preload_content( self, - audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], + new_referrals_for_multiple_advocates: Annotated[NewReferralsForMultipleAdvocates, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1669,12 +1681,14 @@ def delete_audience_memberships_v2_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete audience memberships + """Create referral codes for multiple advocates - Remove all members from this audience. + Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the `campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate's profile. **Note:** Any [referral limits](https://docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) set are ignored when you use this endpoint. - :param audience_id: The ID of the audience. (required) - :type audience_id: int + :param new_referrals_for_multiple_advocates: body (required) + :type new_referrals_for_multiple_advocates: NewReferralsForMultipleAdvocates + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -1697,8 +1711,9 @@ def delete_audience_memberships_v2_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_audience_memberships_v2_serialize( - audience_id=audience_id, + _param = self._create_referrals_for_multiple_advocates_serialize( + new_referrals_for_multiple_advocates=new_referrals_for_multiple_advocates, + silent=silent, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1706,9 +1721,10 @@ def delete_audience_memberships_v2_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { + '201': "CreateReferralsForMultipleAdvocates201Response", '204': None, + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -1717,9 +1733,10 @@ def delete_audience_memberships_v2_without_preload_content( return response_data.response - def _delete_audience_memberships_v2_serialize( + def _create_referrals_for_multiple_advocates_serialize( self, - audience_id, + new_referrals_for_multiple_advocates, + silent, _request_auth, _content_type, _headers, @@ -1741,12 +1758,16 @@ def _delete_audience_memberships_v2_serialize( _body_params: Optional[bytes] = None # process the path parameters - if audience_id is not None: - _path_params['audienceId'] = audience_id # process the query parameters + if silent is not None: + + _query_params.append(('silent', silent)) + # process the header parameters # process the form parameters # process the body parameter + if new_referrals_for_multiple_advocates is not None: + _body_params = new_referrals_for_multiple_advocates # set the HTTP header `Accept` @@ -1757,6 +1778,19 @@ def _delete_audience_memberships_v2_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -1764,8 +1798,8 @@ def _delete_audience_memberships_v2_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/v2/audiences/{audienceId}/memberships', + method='POST', + resource_path='/v1/referrals_for_multiple_advocates', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -1782,7 +1816,7 @@ def _delete_audience_memberships_v2_serialize( @validate_call - def delete_audience_v2( + def delete_audience_memberships_v2( self, audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], _request_timeout: Union[ @@ -1798,9 +1832,9 @@ def delete_audience_v2( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete audience + """Delete audience memberships - Delete an audience created by a third-party integration. **Warning:** This endpoint also removes any associations recorded between a customer profile and this audience. **Note:** Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). + Remove all members from this audience. :param audience_id: The ID of the audience. (required) :type audience_id: int @@ -1826,7 +1860,7 @@ def delete_audience_v2( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_audience_v2_serialize( + _param = self._delete_audience_memberships_v2_serialize( audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1836,7 +1870,6 @@ def delete_audience_v2( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -1852,7 +1885,7 @@ def delete_audience_v2( @validate_call - def delete_audience_v2_with_http_info( + def delete_audience_memberships_v2_with_http_info( self, audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], _request_timeout: Union[ @@ -1868,9 +1901,9 @@ def delete_audience_v2_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete audience + """Delete audience memberships - Delete an audience created by a third-party integration. **Warning:** This endpoint also removes any associations recorded between a customer profile and this audience. **Note:** Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). + Remove all members from this audience. :param audience_id: The ID of the audience. (required) :type audience_id: int @@ -1896,7 +1929,7 @@ def delete_audience_v2_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_audience_v2_serialize( + _param = self._delete_audience_memberships_v2_serialize( audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1906,7 +1939,6 @@ def delete_audience_v2_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -1922,7 +1954,7 @@ def delete_audience_v2_with_http_info( @validate_call - def delete_audience_v2_without_preload_content( + def delete_audience_memberships_v2_without_preload_content( self, audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], _request_timeout: Union[ @@ -1938,9 +1970,9 @@ def delete_audience_v2_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete audience + """Delete audience memberships - Delete an audience created by a third-party integration. **Warning:** This endpoint also removes any associations recorded between a customer profile and this audience. **Note:** Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). + Remove all members from this audience. :param audience_id: The ID of the audience. (required) :type audience_id: int @@ -1966,7 +1998,7 @@ def delete_audience_v2_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_audience_v2_serialize( + _param = self._delete_audience_memberships_v2_serialize( audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, @@ -1976,7 +2008,6 @@ def delete_audience_v2_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, - '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -1987,7 +2018,7 @@ def delete_audience_v2_without_preload_content( return response_data.response - def _delete_audience_v2_serialize( + def _delete_audience_memberships_v2_serialize( self, audience_id, _request_auth, @@ -2035,7 +2066,7 @@ def _delete_audience_v2_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/v2/audiences/{audienceId}', + resource_path='/v2/audiences/{audienceId}/memberships', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2052,10 +2083,9 @@ def _delete_audience_v2_serialize( @validate_call - def delete_coupon_reservation( + def delete_audience_v2( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], - coupon_reservations: Annotated[CouponReservations, Field(description="body")], + audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2069,14 +2099,12 @@ def delete_coupon_reservation( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete coupon reservations + """Delete audience - Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code. + Delete an audience created by a third-party integration. **Warning:** This endpoint also removes any associations recorded between a customer profile and this audience. **Note:** Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str - :param coupon_reservations: body (required) - :type coupon_reservations: CouponReservations + :param audience_id: The ID of the audience. (required) + :type audience_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2099,9 +2127,8 @@ def delete_coupon_reservation( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_coupon_reservation_serialize( - coupon_value=coupon_value, - coupon_reservations=coupon_reservations, + _param = self._delete_audience_v2_serialize( + audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2126,10 +2153,9 @@ def delete_coupon_reservation( @validate_call - def delete_coupon_reservation_with_http_info( + def delete_audience_v2_with_http_info( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], - coupon_reservations: Annotated[CouponReservations, Field(description="body")], + audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2143,14 +2169,12 @@ def delete_coupon_reservation_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete coupon reservations + """Delete audience - Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code. + Delete an audience created by a third-party integration. **Warning:** This endpoint also removes any associations recorded between a customer profile and this audience. **Note:** Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str - :param coupon_reservations: body (required) - :type coupon_reservations: CouponReservations + :param audience_id: The ID of the audience. (required) + :type audience_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2173,9 +2197,8 @@ def delete_coupon_reservation_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_coupon_reservation_serialize( - coupon_value=coupon_value, - coupon_reservations=coupon_reservations, + _param = self._delete_audience_v2_serialize( + audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2200,10 +2223,9 @@ def delete_coupon_reservation_with_http_info( @validate_call - def delete_coupon_reservation_without_preload_content( + def delete_audience_v2_without_preload_content( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], - coupon_reservations: Annotated[CouponReservations, Field(description="body")], + audience_id: Annotated[StrictInt, Field(description="The ID of the audience.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2217,14 +2239,12 @@ def delete_coupon_reservation_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete coupon reservations + """Delete audience - Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code. + Delete an audience created by a third-party integration. **Warning:** This endpoint also removes any associations recorded between a customer profile and this audience. **Note:** Audiences can also be deleted via the Campaign Manager. See the [docs](https://docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience). - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str - :param coupon_reservations: body (required) - :type coupon_reservations: CouponReservations + :param audience_id: The ID of the audience. (required) + :type audience_id: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2247,9 +2267,8 @@ def delete_coupon_reservation_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_coupon_reservation_serialize( - coupon_value=coupon_value, - coupon_reservations=coupon_reservations, + _param = self._delete_audience_v2_serialize( + audience_id=audience_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2269,10 +2288,9 @@ def delete_coupon_reservation_without_preload_content( return response_data.response - def _delete_coupon_reservation_serialize( + def _delete_audience_v2_serialize( self, - coupon_value, - coupon_reservations, + audience_id, _request_auth, _content_type, _headers, @@ -2294,14 +2312,12 @@ def _delete_coupon_reservation_serialize( _body_params: Optional[bytes] = None # process the path parameters - if coupon_value is not None: - _path_params['couponValue'] = coupon_value + if audience_id is not None: + _path_params['audienceId'] = audience_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if coupon_reservations is not None: - _body_params = coupon_reservations # set the HTTP header `Accept` @@ -2312,19 +2328,6 @@ def _delete_coupon_reservation_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2333,7 +2336,7 @@ def _delete_coupon_reservation_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/v1/coupon_reservations/{couponValue}', + resource_path='/v2/audiences/{audienceId}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2350,9 +2353,10 @@ def _delete_coupon_reservation_serialize( @validate_call - def delete_customer_data( + def delete_coupon_reservation( self, - integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + coupon_reservations: Annotated[CouponReservations, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2366,12 +2370,14 @@ def delete_customer_data( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Delete customer's personal data + """Delete coupon reservations - Delete all attributes on the customer profile and on entities that reference this customer profile. **Important:** - Customer data is deleted from all Applications in the [environment](https://docs.talon.one/docs/product/applications/overview#application-environments) that the API key belongs to. For example, if you use this endpoint with an API key that belongs to a sandbox Application, customer data will be deleted from all sandbox Applications. This is because customer data is shared between Applications from the same environment. - To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours. + Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code. - :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type integration_id: str + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str + :param coupon_reservations: body (required) + :type coupon_reservations: CouponReservations :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2394,8 +2400,9 @@ def delete_customer_data( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_customer_data_serialize( - integration_id=integration_id, + _param = self._delete_coupon_reservation_serialize( + coupon_value=coupon_value, + coupon_reservations=coupon_reservations, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2404,6 +2411,7 @@ def delete_customer_data( _response_types_map: Dict[str, Optional[str]] = { '204': None, + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -2419,9 +2427,10 @@ def delete_customer_data( @validate_call - def delete_customer_data_with_http_info( + def delete_coupon_reservation_with_http_info( self, - integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + coupon_reservations: Annotated[CouponReservations, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2435,12 +2444,14 @@ def delete_customer_data_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Delete customer's personal data + """Delete coupon reservations - Delete all attributes on the customer profile and on entities that reference this customer profile. **Important:** - Customer data is deleted from all Applications in the [environment](https://docs.talon.one/docs/product/applications/overview#application-environments) that the API key belongs to. For example, if you use this endpoint with an API key that belongs to a sandbox Application, customer data will be deleted from all sandbox Applications. This is because customer data is shared between Applications from the same environment. - To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours. + Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code. - :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type integration_id: str + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str + :param coupon_reservations: body (required) + :type coupon_reservations: CouponReservations :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2463,8 +2474,9 @@ def delete_customer_data_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_customer_data_serialize( - integration_id=integration_id, + _param = self._delete_coupon_reservation_serialize( + coupon_value=coupon_value, + coupon_reservations=coupon_reservations, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2473,6 +2485,7 @@ def delete_customer_data_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -2488,9 +2501,10 @@ def delete_customer_data_with_http_info( @validate_call - def delete_customer_data_without_preload_content( + def delete_coupon_reservation_without_preload_content( self, - integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + coupon_reservations: Annotated[CouponReservations, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2504,12 +2518,14 @@ def delete_customer_data_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete customer's personal data + """Delete coupon reservations - Delete all attributes on the customer profile and on entities that reference this customer profile. **Important:** - Customer data is deleted from all Applications in the [environment](https://docs.talon.one/docs/product/applications/overview#application-environments) that the API key belongs to. For example, if you use this endpoint with an API key that belongs to a sandbox Application, customer data will be deleted from all sandbox Applications. This is because customer data is shared between Applications from the same environment. - To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours. + Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code. - :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type integration_id: str + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str + :param coupon_reservations: body (required) + :type coupon_reservations: CouponReservations :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2532,8 +2548,9 @@ def delete_customer_data_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_customer_data_serialize( - integration_id=integration_id, + _param = self._delete_coupon_reservation_serialize( + coupon_value=coupon_value, + coupon_reservations=coupon_reservations, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2542,6 +2559,7 @@ def delete_customer_data_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -2552,9 +2570,10 @@ def delete_customer_data_without_preload_content( return response_data.response - def _delete_customer_data_serialize( + def _delete_coupon_reservation_serialize( self, - integration_id, + coupon_value, + coupon_reservations, _request_auth, _content_type, _headers, @@ -2576,12 +2595,14 @@ def _delete_customer_data_serialize( _body_params: Optional[bytes] = None # process the path parameters - if integration_id is not None: - _path_params['integrationId'] = integration_id + if coupon_value is not None: + _path_params['couponValue'] = coupon_value # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if coupon_reservations is not None: + _body_params = coupon_reservations # set the HTTP header `Accept` @@ -2592,6 +2613,19 @@ def _delete_customer_data_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2600,7 +2634,7 @@ def _delete_customer_data_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/v1/customer_data/{integrationId}', + resource_path='/v1/coupon_reservations/{couponValue}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2617,10 +2651,9 @@ def _delete_customer_data_serialize( @validate_call - def generate_loyalty_card( + def delete_customer_data( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - generate_loyalty_card: Annotated[GenerateLoyaltyCard, Field(description="body")], + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2633,15 +2666,13 @@ def generate_loyalty_card( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LoyaltyCard: - """Generate loyalty card + ) -> None: + """Delete customer's personal data - Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. **Note:** - The number of customer profiles linked to the loyalty card cannot exceed the loyalty program's `usersPerCardLimit`. To find the program's limit, use the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) endpoint. - If the loyalty program has a defined code format, it will be used for the loyalty card identifier. + Delete all attributes on the customer profile and on entities that reference this customer profile. **Important:** - Customer data is deleted from all Applications in the [environment](https://docs.talon.one/docs/product/applications/overview#application-environments) that the API key belongs to. For example, if you use this endpoint with an API key that belongs to a sandbox Application, customer data will be deleted from all sandbox Applications. This is because customer data is shared between Applications from the same environment. - To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param generate_loyalty_card: body (required) - :type generate_loyalty_card: GenerateLoyaltyCard + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + :type integration_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2664,9 +2695,8 @@ def generate_loyalty_card( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - generate_loyalty_card=generate_loyalty_card, + _param = self._delete_customer_data_serialize( + integration_id=integration_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2674,9 +2704,9 @@ def generate_loyalty_card( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", + '204': None, '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -2690,10 +2720,9 @@ def generate_loyalty_card( @validate_call - def generate_loyalty_card_with_http_info( + def delete_customer_data_with_http_info( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - generate_loyalty_card: Annotated[GenerateLoyaltyCard, Field(description="body")], + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2706,15 +2735,13 @@ def generate_loyalty_card_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LoyaltyCard]: - """Generate loyalty card + ) -> ApiResponse[None]: + """Delete customer's personal data - Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. **Note:** - The number of customer profiles linked to the loyalty card cannot exceed the loyalty program's `usersPerCardLimit`. To find the program's limit, use the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) endpoint. - If the loyalty program has a defined code format, it will be used for the loyalty card identifier. + Delete all attributes on the customer profile and on entities that reference this customer profile. **Important:** - Customer data is deleted from all Applications in the [environment](https://docs.talon.one/docs/product/applications/overview#application-environments) that the API key belongs to. For example, if you use this endpoint with an API key that belongs to a sandbox Application, customer data will be deleted from all sandbox Applications. This is because customer data is shared between Applications from the same environment. - To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param generate_loyalty_card: body (required) - :type generate_loyalty_card: GenerateLoyaltyCard + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + :type integration_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2737,9 +2764,8 @@ def generate_loyalty_card_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - generate_loyalty_card=generate_loyalty_card, + _param = self._delete_customer_data_serialize( + integration_id=integration_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2747,9 +2773,9 @@ def generate_loyalty_card_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", + '204': None, '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -2763,10 +2789,9 @@ def generate_loyalty_card_with_http_info( @validate_call - def generate_loyalty_card_without_preload_content( + def delete_customer_data_without_preload_content( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - generate_loyalty_card: Annotated[GenerateLoyaltyCard, Field(description="body")], + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2780,14 +2805,12 @@ def generate_loyalty_card_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Generate loyalty card + """Delete customer's personal data - Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. **Note:** - The number of customer profiles linked to the loyalty card cannot exceed the loyalty program's `usersPerCardLimit`. To find the program's limit, use the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) endpoint. - If the loyalty program has a defined code format, it will be used for the loyalty card identifier. + Delete all attributes on the customer profile and on entities that reference this customer profile. **Important:** - Customer data is deleted from all Applications in the [environment](https://docs.talon.one/docs/product/applications/overview#application-environments) that the API key belongs to. For example, if you use this endpoint with an API key that belongs to a sandbox Application, customer data will be deleted from all sandbox Applications. This is because customer data is shared between Applications from the same environment. - To preserve performance, we recommend avoiding deleting customer data during peak-traffic hours. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param generate_loyalty_card: body (required) - :type generate_loyalty_card: GenerateLoyaltyCard + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + :type integration_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2810,9 +2833,8 @@ def generate_loyalty_card_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._generate_loyalty_card_serialize( - loyalty_program_id=loyalty_program_id, - generate_loyalty_card=generate_loyalty_card, + _param = self._delete_customer_data_serialize( + integration_id=integration_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2820,9 +2842,9 @@ def generate_loyalty_card_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", + '204': None, '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -2831,10 +2853,9 @@ def generate_loyalty_card_without_preload_content( return response_data.response - def _generate_loyalty_card_serialize( + def _delete_customer_data_serialize( self, - loyalty_program_id, - generate_loyalty_card, + integration_id, _request_auth, _content_type, _headers, @@ -2856,14 +2877,12 @@ def _generate_loyalty_card_serialize( _body_params: Optional[bytes] = None # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id + if integration_id is not None: + _path_params['integrationId'] = integration_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if generate_loyalty_card is not None: - _body_params = generate_loyalty_card # set the HTTP header `Accept` @@ -2874,19 +2893,6 @@ def _generate_loyalty_card_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2894,8 +2900,8 @@ def _generate_loyalty_card_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards', + method='DELETE', + resource_path='/v1/customer_data/{integrationId}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2912,15 +2918,11 @@ def _generate_loyalty_card_serialize( @validate_call - def get_customer_achievement_history( + def delete_loyalty_transactions_from_ledgers( self, - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - achievement_id: Annotated[StrictInt, Field(description="The achievement identifier. ")], - progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created on or after the start date.")] = None, - end_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created before or on the end date.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + delete_loyalty_transactions_request: DeleteLoyaltyTransactionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2933,25 +2935,17 @@ def get_customer_achievement_history( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetCustomerAchievementHistory200Response: - """List customer's achievement history + ) -> None: + """Delete customer's transactions from loyalty ledgers - Retrieve all progress history of a given customer in the given achievement. + Delete a customer's transactions in all loyalty ledgers or a specified ledger. **Note:** To retrieve loyalty transaction logs for a specific customer in a given loyalty program, use the [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions) endpoint. - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) :type integration_id: str - :param achievement_id: The achievement identifier. (required) - :type achievement_id: int - :param progress_status: Filter by customer progress status in the achievement. - :type progress_status: List[str] - :param start_date: Timestamp that filters the results to only contain achievements created on or after the start date. - :type start_date: datetime - :param end_date: Timestamp that filters the results to only contain achievements created before or on the end date. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param delete_loyalty_transactions_request: (required) + :type delete_loyalty_transactions_request: DeleteLoyaltyTransactionsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -2974,14 +2968,10 @@ def get_customer_achievement_history( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_achievement_history_serialize( + _param = self._delete_loyalty_transactions_from_ledgers_serialize( + loyalty_program_id=loyalty_program_id, integration_id=integration_id, - achievement_id=achievement_id, - progress_status=progress_status, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, + delete_loyalty_transactions_request=delete_loyalty_transactions_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2989,7 +2979,7 @@ def get_customer_achievement_history( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerAchievementHistory200Response", + '204': None, '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -3006,15 +2996,11 @@ def get_customer_achievement_history( @validate_call - def get_customer_achievement_history_with_http_info( + def delete_loyalty_transactions_from_ledgers_with_http_info( self, - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - achievement_id: Annotated[StrictInt, Field(description="The achievement identifier. ")], - progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created on or after the start date.")] = None, - end_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created before or on the end date.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + delete_loyalty_transactions_request: DeleteLoyaltyTransactionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3027,25 +3013,17 @@ def get_customer_achievement_history_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetCustomerAchievementHistory200Response]: - """List customer's achievement history + ) -> ApiResponse[None]: + """Delete customer's transactions from loyalty ledgers - Retrieve all progress history of a given customer in the given achievement. + Delete a customer's transactions in all loyalty ledgers or a specified ledger. **Note:** To retrieve loyalty transaction logs for a specific customer in a given loyalty program, use the [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions) endpoint. - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) :type integration_id: str - :param achievement_id: The achievement identifier. (required) - :type achievement_id: int - :param progress_status: Filter by customer progress status in the achievement. - :type progress_status: List[str] - :param start_date: Timestamp that filters the results to only contain achievements created on or after the start date. - :type start_date: datetime - :param end_date: Timestamp that filters the results to only contain achievements created before or on the end date. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param delete_loyalty_transactions_request: (required) + :type delete_loyalty_transactions_request: DeleteLoyaltyTransactionsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3068,14 +3046,10 @@ def get_customer_achievement_history_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_achievement_history_serialize( + _param = self._delete_loyalty_transactions_from_ledgers_serialize( + loyalty_program_id=loyalty_program_id, integration_id=integration_id, - achievement_id=achievement_id, - progress_status=progress_status, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, + delete_loyalty_transactions_request=delete_loyalty_transactions_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3083,7 +3057,7 @@ def get_customer_achievement_history_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerAchievementHistory200Response", + '204': None, '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -3100,15 +3074,11 @@ def get_customer_achievement_history_with_http_info( @validate_call - def get_customer_achievement_history_without_preload_content( + def delete_loyalty_transactions_from_ledgers_without_preload_content( self, - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - achievement_id: Annotated[StrictInt, Field(description="The achievement identifier. ")], - progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created on or after the start date.")] = None, - end_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created before or on the end date.")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + delete_loyalty_transactions_request: DeleteLoyaltyTransactionsRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3122,24 +3092,16 @@ def get_customer_achievement_history_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List customer's achievement history + """Delete customer's transactions from loyalty ledgers - Retrieve all progress history of a given customer in the given achievement. + Delete a customer's transactions in all loyalty ledgers or a specified ledger. **Note:** To retrieve loyalty transaction logs for a specific customer in a given loyalty program, use the [List customer's loyalty transactions](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions) endpoint. - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) :type integration_id: str - :param achievement_id: The achievement identifier. (required) - :type achievement_id: int - :param progress_status: Filter by customer progress status in the achievement. - :type progress_status: List[str] - :param start_date: Timestamp that filters the results to only contain achievements created on or after the start date. - :type start_date: datetime - :param end_date: Timestamp that filters the results to only contain achievements created before or on the end date. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param delete_loyalty_transactions_request: (required) + :type delete_loyalty_transactions_request: DeleteLoyaltyTransactionsRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3162,14 +3124,10 @@ def get_customer_achievement_history_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_achievement_history_serialize( + _param = self._delete_loyalty_transactions_from_ledgers_serialize( + loyalty_program_id=loyalty_program_id, integration_id=integration_id, - achievement_id=achievement_id, - progress_status=progress_status, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, + delete_loyalty_transactions_request=delete_loyalty_transactions_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3177,7 +3135,7 @@ def get_customer_achievement_history_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerAchievementHistory200Response", + '204': None, '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -3189,15 +3147,11 @@ def get_customer_achievement_history_without_preload_content( return response_data.response - def _get_customer_achievement_history_serialize( + def _delete_loyalty_transactions_from_ledgers_serialize( self, + loyalty_program_id, integration_id, - achievement_id, - progress_status, - start_date, - end_date, - page_size, - skip, + delete_loyalty_transactions_request, _request_auth, _content_type, _headers, @@ -3207,7 +3161,6 @@ def _get_customer_achievement_history_serialize( _host = None _collection_formats: Dict[str, str] = { - 'progressStatus': 'csv', } _path_params: Dict[str, str] = {} @@ -3220,52 +3173,16 @@ def _get_customer_achievement_history_serialize( _body_params: Optional[bytes] = None # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id if integration_id is not None: _path_params['integrationId'] = integration_id - if achievement_id is not None: - _path_params['achievementId'] = achievement_id # process the query parameters - if progress_status is not None: - - _query_params.append(('progressStatus', progress_status)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - # process the header parameters # process the form parameters # process the body parameter + if delete_loyalty_transactions_request is not None: + _body_params = delete_loyalty_transactions_request # set the HTTP header `Accept` @@ -3276,6 +3193,19 @@ def _get_customer_achievement_history_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -3283,8 +3213,8 @@ def _get_customer_achievement_history_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v1/customer_profiles/{integrationId}/achievements/{achievementId}', + method='POST', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/delete_transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3301,15 +3231,10 @@ def _get_customer_achievement_history_serialize( @validate_call - def get_customer_achievements( + def generate_loyalty_card( self, - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - campaign_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. ")] = None, - achievement_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. ")] = None, - achievement_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. ")] = None, - current_progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + generate_loyalty_card: Annotated[GenerateLoyaltyCard, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3322,12 +3247,889 @@ def get_customer_achievements( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetCustomerAchievements200Response: - """List customer's available achievements + ) -> LoyaltyCard: + """Generate loyalty card - Retrieve all the achievements available to a given customer and their progress in them. + Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. **Note:** - The number of customer profiles linked to the loyalty card cannot exceed the loyalty program's `usersPerCardLimit`. To find the program's limit, use the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) endpoint. - If the loyalty program has a defined code format, it will be used for the loyalty card identifier. - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param generate_loyalty_card: body (required) + :type generate_loyalty_card: GenerateLoyaltyCard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_loyalty_card_serialize( + loyalty_program_id=loyalty_program_id, + generate_loyalty_card=generate_loyalty_card, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoyaltyCard", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def generate_loyalty_card_with_http_info( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + generate_loyalty_card: Annotated[GenerateLoyaltyCard, Field(description="body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LoyaltyCard]: + """Generate loyalty card + + Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. **Note:** - The number of customer profiles linked to the loyalty card cannot exceed the loyalty program's `usersPerCardLimit`. To find the program's limit, use the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) endpoint. - If the loyalty program has a defined code format, it will be used for the loyalty card identifier. + + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param generate_loyalty_card: body (required) + :type generate_loyalty_card: GenerateLoyaltyCard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_loyalty_card_serialize( + loyalty_program_id=loyalty_program_id, + generate_loyalty_card=generate_loyalty_card, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoyaltyCard", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def generate_loyalty_card_without_preload_content( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + generate_loyalty_card: Annotated[GenerateLoyaltyCard, Field(description="body")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generate loyalty card + + Generate a loyalty card in a specified [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the `customerProfileIds` parameter in the request body. **Note:** - The number of customer profiles linked to the loyalty card cannot exceed the loyalty program's `usersPerCardLimit`. To find the program's limit, use the [Get loyalty program](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) endpoint. - If the loyalty program has a defined code format, it will be used for the loyalty card identifier. + + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param generate_loyalty_card: body (required) + :type generate_loyalty_card: GenerateLoyaltyCard + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_loyalty_card_serialize( + loyalty_program_id=loyalty_program_id, + generate_loyalty_card=generate_loyalty_card, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoyaltyCard", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _generate_loyalty_card_serialize( + self, + loyalty_program_id, + generate_loyalty_card, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if generate_loyalty_card is not None: + _body_params = generate_loyalty_card + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_customer_achievement_history( + self, + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + achievement_id: Annotated[StrictInt, Field(description="The achievement identifier. ")], + progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created on or after the start date.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created before or on the end date.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetCustomerAchievementHistory200Response: + """List customer's achievement history + + Retrieve all progress history of a given customer in the given achievement. + + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param achievement_id: The achievement identifier. (required) + :type achievement_id: int + :param progress_status: Filter by customer progress status in the achievement. + :type progress_status: List[str] + :param start_date: Timestamp that filters the results to only contain achievements created on or after the start date. + :type start_date: datetime + :param end_date: Timestamp that filters the results to only contain achievements created before or on the end date. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_customer_achievement_history_serialize( + integration_id=integration_id, + achievement_id=achievement_id, + progress_status=progress_status, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCustomerAchievementHistory200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_customer_achievement_history_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + achievement_id: Annotated[StrictInt, Field(description="The achievement identifier. ")], + progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created on or after the start date.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created before or on the end date.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetCustomerAchievementHistory200Response]: + """List customer's achievement history + + Retrieve all progress history of a given customer in the given achievement. + + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param achievement_id: The achievement identifier. (required) + :type achievement_id: int + :param progress_status: Filter by customer progress status in the achievement. + :type progress_status: List[str] + :param start_date: Timestamp that filters the results to only contain achievements created on or after the start date. + :type start_date: datetime + :param end_date: Timestamp that filters the results to only contain achievements created before or on the end date. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_customer_achievement_history_serialize( + integration_id=integration_id, + achievement_id=achievement_id, + progress_status=progress_status, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCustomerAchievementHistory200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_customer_achievement_history_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + achievement_id: Annotated[StrictInt, Field(description="The achievement identifier. ")], + progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created on or after the start date.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Timestamp that filters the results to only contain achievements created before or on the end date.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List customer's achievement history + + Retrieve all progress history of a given customer in the given achievement. + + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param achievement_id: The achievement identifier. (required) + :type achievement_id: int + :param progress_status: Filter by customer progress status in the achievement. + :type progress_status: List[str] + :param start_date: Timestamp that filters the results to only contain achievements created on or after the start date. + :type start_date: datetime + :param end_date: Timestamp that filters the results to only contain achievements created before or on the end date. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_customer_achievement_history_serialize( + integration_id=integration_id, + achievement_id=achievement_id, + progress_status=progress_status, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCustomerAchievementHistory200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_customer_achievement_history_serialize( + self, + integration_id, + achievement_id, + progress_status, + start_date, + end_date, + page_size, + skip, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'progressStatus': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_id + if achievement_id is not None: + _path_params['achievementId'] = achievement_id + # process the query parameters + if progress_status is not None: + + _query_params.append(('progressStatus', progress_status)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if page_size is not None: + + _query_params.append(('pageSize', page_size)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/customer_profiles/{integrationId}/achievements/{achievementId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_customer_achievements( + self, + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + campaign_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. ")] = None, + achievement_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. ")] = None, + achievement_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. ")] = None, + current_progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetCustomerAchievements200Response: + """List customer's available achievements + + Retrieve all the achievements available to a given customer and their progress in them. + + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param campaign_ids: Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. + :type campaign_ids: List[str] + :param achievement_ids: Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. + :type achievement_ids: List[str] + :param achievement_status: Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. + :type achievement_status: List[str] + :param current_progress_status: Filter by customer progress status in the achievement. + :type current_progress_status: List[str] + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_customer_achievements_serialize( + integration_id=integration_id, + campaign_ids=campaign_ids, + achievement_ids=achievement_ids, + achievement_status=achievement_status, + current_progress_status=current_progress_status, + page_size=page_size, + skip=skip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCustomerAchievements200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_customer_achievements_with_http_info( + self, + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + campaign_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. ")] = None, + achievement_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. ")] = None, + achievement_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. ")] = None, + current_progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetCustomerAchievements200Response]: + """List customer's available achievements + + Retrieve all the achievements available to a given customer and their progress in them. + + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param campaign_ids: Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. + :type campaign_ids: List[str] + :param achievement_ids: Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. + :type achievement_ids: List[str] + :param achievement_status: Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. + :type achievement_status: List[str] + :param current_progress_status: Filter by customer progress status in the achievement. + :type current_progress_status: List[str] + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_customer_achievements_serialize( + integration_id=integration_id, + campaign_ids=campaign_ids, + achievement_ids=achievement_ids, + achievement_status=achievement_status, + current_progress_status=current_progress_status, + page_size=page_size, + skip=skip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCustomerAchievements200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_customer_achievements_without_preload_content( + self, + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + campaign_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. ")] = None, + achievement_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. ")] = None, + achievement_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. ")] = None, + current_progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List customer's available achievements + + Retrieve all the achievements available to a given customer and their progress in them. + + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str :param campaign_ids: Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. :type campaign_ids: List[str] @@ -3363,14 +4165,202 @@ def get_customer_achievements( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_achievements_serialize( + _param = self._get_customer_achievements_serialize( + integration_id=integration_id, + campaign_ids=campaign_ids, + achievement_ids=achievement_ids, + achievement_status=achievement_status, + current_progress_status=current_progress_status, + page_size=page_size, + skip=skip, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetCustomerAchievements200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_customer_achievements_serialize( + self, + integration_id, + campaign_ids, + achievement_ids, + achievement_status, + current_progress_status, + page_size, + skip, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'campaignIds': 'csv', + 'achievementIds': 'csv', + 'achievementStatus': 'csv', + 'currentProgressStatus': 'csv', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if integration_id is not None: + _path_params['integrationId'] = integration_id + # process the query parameters + if campaign_ids is not None: + + _query_params.append(('campaignIds', campaign_ids)) + + if achievement_ids is not None: + + _query_params.append(('achievementIds', achievement_ids)) + + if achievement_status is not None: + + _query_params.append(('achievementStatus', achievement_status)) + + if current_progress_status is not None: + + _query_params.append(('currentProgressStatus', current_progress_status)) + + if page_size is not None: + + _query_params.append(('pageSize', page_size)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/customer_profiles/{integrationId}/achievements', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_customer_inventory( + self, + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + profile: Annotated[Optional[StrictBool], Field(description="Set to `true` to include customer profile information in the response.")] = None, + referrals: Annotated[Optional[StrictBool], Field(description="Set to `true` to include referral information in the response.")] = None, + coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, + loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, + giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, + achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CustomerInventory: + """List customer data + + Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. + + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) + :type integration_id: str + :param profile: Set to `true` to include customer profile information in the response. + :type profile: bool + :param referrals: Set to `true` to include referral information in the response. + :type referrals: bool + :param coupons: Set to `true` to include coupon information in the response. + :type coupons: bool + :param loyalty: Set to `true` to include loyalty information in the response. + :type loyalty: bool + :param giveaways: Set to `true` to include giveaways information in the response. + :type giveaways: bool + :param achievements: Set to `true` to include achievement information in the response. + :type achievements: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_customer_inventory_serialize( integration_id=integration_id, - campaign_ids=campaign_ids, - achievement_ids=achievement_ids, - achievement_status=achievement_status, - current_progress_status=current_progress_status, - page_size=page_size, - skip=skip, + profile=profile, + referrals=referrals, + coupons=coupons, + loyalty=loyalty, + giveaways=giveaways, + achievements=achievements, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3378,8 +4368,7 @@ def get_customer_achievements( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerAchievements200Response", - '400': "ErrorResponseWithStatus", + '200': "CustomerInventory", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -3395,15 +4384,15 @@ def get_customer_achievements( @validate_call - def get_customer_achievements_with_http_info( + def get_customer_inventory_with_http_info( self, - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - campaign_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. ")] = None, - achievement_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. ")] = None, - achievement_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. ")] = None, - current_progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + profile: Annotated[Optional[StrictBool], Field(description="Set to `true` to include customer profile information in the response.")] = None, + referrals: Annotated[Optional[StrictBool], Field(description="Set to `true` to include referral information in the response.")] = None, + coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, + loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, + giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, + achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3416,25 +4405,25 @@ def get_customer_achievements_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetCustomerAchievements200Response]: - """List customer's available achievements + ) -> ApiResponse[CustomerInventory]: + """List customer data - Retrieve all the achievements available to a given customer and their progress in them. + Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) :type integration_id: str - :param campaign_ids: Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. - :type campaign_ids: List[str] - :param achievement_ids: Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. - :type achievement_ids: List[str] - :param achievement_status: Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. - :type achievement_status: List[str] - :param current_progress_status: Filter by customer progress status in the achievement. - :type current_progress_status: List[str] - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param profile: Set to `true` to include customer profile information in the response. + :type profile: bool + :param referrals: Set to `true` to include referral information in the response. + :type referrals: bool + :param coupons: Set to `true` to include coupon information in the response. + :type coupons: bool + :param loyalty: Set to `true` to include loyalty information in the response. + :type loyalty: bool + :param giveaways: Set to `true` to include giveaways information in the response. + :type giveaways: bool + :param achievements: Set to `true` to include achievement information in the response. + :type achievements: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3457,14 +4446,14 @@ def get_customer_achievements_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_achievements_serialize( + _param = self._get_customer_inventory_serialize( integration_id=integration_id, - campaign_ids=campaign_ids, - achievement_ids=achievement_ids, - achievement_status=achievement_status, - current_progress_status=current_progress_status, - page_size=page_size, - skip=skip, + profile=profile, + referrals=referrals, + coupons=coupons, + loyalty=loyalty, + giveaways=giveaways, + achievements=achievements, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3472,8 +4461,7 @@ def get_customer_achievements_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerAchievements200Response", - '400': "ErrorResponseWithStatus", + '200': "CustomerInventory", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -3489,15 +4477,15 @@ def get_customer_achievements_with_http_info( @validate_call - def get_customer_achievements_without_preload_content( + def get_customer_inventory_without_preload_content( self, - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - campaign_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. ")] = None, - achievement_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. ")] = None, - achievement_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. ")] = None, - current_progress_status: Annotated[Optional[List[StrictStr]], Field(description="Filter by customer progress status in the achievement. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], + profile: Annotated[Optional[StrictBool], Field(description="Set to `true` to include customer profile information in the response.")] = None, + referrals: Annotated[Optional[StrictBool], Field(description="Set to `true` to include referral information in the response.")] = None, + coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, + loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, + giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, + achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3511,24 +4499,24 @@ def get_customer_achievements_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List customer's available achievements + """List customer data - Retrieve all the achievements available to a given customer and their progress in them. + Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) :type integration_id: str - :param campaign_ids: Filter by one or more Campaign IDs, separated by a comma. **Note:** If no campaigns are specified, data for all the campaigns in the Application is returned. - :type campaign_ids: List[str] - :param achievement_ids: Filter by one or more Achievement IDs, separated by a comma. **Note:** If no achievements are specified, data for all the achievements in the Application is returned. - :type achievement_ids: List[str] - :param achievement_status: Filter by status of the achievement. **Note:** If the achievement status is not specified, only data for all active achievements in the Application is returned. - :type achievement_status: List[str] - :param current_progress_status: Filter by customer progress status in the achievement. - :type current_progress_status: List[str] - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param profile: Set to `true` to include customer profile information in the response. + :type profile: bool + :param referrals: Set to `true` to include referral information in the response. + :type referrals: bool + :param coupons: Set to `true` to include coupon information in the response. + :type coupons: bool + :param loyalty: Set to `true` to include loyalty information in the response. + :type loyalty: bool + :param giveaways: Set to `true` to include giveaways information in the response. + :type giveaways: bool + :param achievements: Set to `true` to include achievement information in the response. + :type achievements: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3551,14 +4539,14 @@ def get_customer_achievements_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_achievements_serialize( + _param = self._get_customer_inventory_serialize( integration_id=integration_id, - campaign_ids=campaign_ids, - achievement_ids=achievement_ids, - achievement_status=achievement_status, - current_progress_status=current_progress_status, - page_size=page_size, - skip=skip, + profile=profile, + referrals=referrals, + coupons=coupons, + loyalty=loyalty, + giveaways=giveaways, + achievements=achievements, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3566,8 +4554,7 @@ def get_customer_achievements_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetCustomerAchievements200Response", - '400': "ErrorResponseWithStatus", + '200': "CustomerInventory", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", } @@ -3578,15 +4565,15 @@ def get_customer_achievements_without_preload_content( return response_data.response - def _get_customer_achievements_serialize( + def _get_customer_inventory_serialize( self, integration_id, - campaign_ids, - achievement_ids, - achievement_status, - current_progress_status, - page_size, - skip, + profile, + referrals, + coupons, + loyalty, + giveaways, + achievements, _request_auth, _content_type, _headers, @@ -3596,10 +4583,6 @@ def _get_customer_achievements_serialize( _host = None _collection_formats: Dict[str, str] = { - 'campaignIds': 'csv', - 'achievementIds': 'csv', - 'achievementStatus': 'csv', - 'currentProgressStatus': 'csv', } _path_params: Dict[str, str] = {} @@ -3615,29 +4598,29 @@ def _get_customer_achievements_serialize( if integration_id is not None: _path_params['integrationId'] = integration_id # process the query parameters - if campaign_ids is not None: + if profile is not None: - _query_params.append(('campaignIds', campaign_ids)) + _query_params.append(('profile', profile)) - if achievement_ids is not None: + if referrals is not None: - _query_params.append(('achievementIds', achievement_ids)) + _query_params.append(('referrals', referrals)) - if achievement_status is not None: + if coupons is not None: - _query_params.append(('achievementStatus', achievement_status)) + _query_params.append(('coupons', coupons)) - if current_progress_status is not None: + if loyalty is not None: - _query_params.append(('currentProgressStatus', current_progress_status)) + _query_params.append(('loyalty', loyalty)) - if page_size is not None: + if giveaways is not None: - _query_params.append(('pageSize', page_size)) + _query_params.append(('giveaways', giveaways)) - if skip is not None: + if achievements is not None: - _query_params.append(('skip', skip)) + _query_params.append(('achievements', achievements)) # process the header parameters # process the form parameters @@ -3660,7 +4643,7 @@ def _get_customer_achievements_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/customer_profiles/{integrationId}/achievements', + resource_path='/v1/customer_profiles/{integrationId}/inventory', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3677,15 +4660,9 @@ def _get_customer_achievements_serialize( @validate_call - def get_customer_inventory( + def get_customer_session( self, - integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - profile: Annotated[Optional[StrictBool], Field(description="Set to `true` to include customer profile information in the response.")] = None, - referrals: Annotated[Optional[StrictBool], Field(description="Set to `true` to include referral information in the response.")] = None, - coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, - loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, - giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, - achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3698,25 +4675,13 @@ def get_customer_inventory( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> CustomerInventory: - """List customer data + ) -> IntegrationCustomerSessionResponse: + """Get customer session - Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. + Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) - :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type integration_id: str - :param profile: Set to `true` to include customer profile information in the response. - :type profile: bool - :param referrals: Set to `true` to include referral information in the response. - :type referrals: bool - :param coupons: Set to `true` to include coupon information in the response. - :type coupons: bool - :param loyalty: Set to `true` to include loyalty information in the response. - :type loyalty: bool - :param giveaways: Set to `true` to include giveaways information in the response. - :type giveaways: bool - :param achievements: Set to `true` to include achievement information in the response. - :type achievements: bool + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) + :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3739,14 +4704,8 @@ def get_customer_inventory( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_inventory_serialize( - integration_id=integration_id, - profile=profile, - referrals=referrals, - coupons=coupons, - loyalty=loyalty, - giveaways=giveaways, - achievements=achievements, + _param = self._get_customer_session_serialize( + customer_session_id=customer_session_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3754,9 +4713,9 @@ def get_customer_inventory( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerInventory", + '200': "IntegrationCustomerSessionResponse", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -3770,15 +4729,9 @@ def get_customer_inventory( @validate_call - def get_customer_inventory_with_http_info( + def get_customer_session_with_http_info( self, - integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - profile: Annotated[Optional[StrictBool], Field(description="Set to `true` to include customer profile information in the response.")] = None, - referrals: Annotated[Optional[StrictBool], Field(description="Set to `true` to include referral information in the response.")] = None, - coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, - loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, - giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, - achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3791,25 +4744,13 @@ def get_customer_inventory_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[CustomerInventory]: - """List customer data + ) -> ApiResponse[IntegrationCustomerSessionResponse]: + """Get customer session - Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. + Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) - :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type integration_id: str - :param profile: Set to `true` to include customer profile information in the response. - :type profile: bool - :param referrals: Set to `true` to include referral information in the response. - :type referrals: bool - :param coupons: Set to `true` to include coupon information in the response. - :type coupons: bool - :param loyalty: Set to `true` to include loyalty information in the response. - :type loyalty: bool - :param giveaways: Set to `true` to include giveaways information in the response. - :type giveaways: bool - :param achievements: Set to `true` to include achievement information in the response. - :type achievements: bool + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) + :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3832,14 +4773,8 @@ def get_customer_inventory_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_inventory_serialize( - integration_id=integration_id, - profile=profile, - referrals=referrals, - coupons=coupons, - loyalty=loyalty, - giveaways=giveaways, - achievements=achievements, + _param = self._get_customer_session_serialize( + customer_session_id=customer_session_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3847,9 +4782,9 @@ def get_customer_inventory_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerInventory", + '200': "IntegrationCustomerSessionResponse", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -3863,15 +4798,9 @@ def get_customer_inventory_with_http_info( @validate_call - def get_customer_inventory_without_preload_content( + def get_customer_session_without_preload_content( self, - integration_id: Annotated[StrictStr, Field(description="The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. ")], - profile: Annotated[Optional[StrictBool], Field(description="Set to `true` to include customer profile information in the response.")] = None, - referrals: Annotated[Optional[StrictBool], Field(description="Set to `true` to include referral information in the response.")] = None, - coupons: Annotated[Optional[StrictBool], Field(description="Set to `true` to include coupon information in the response.")] = None, - loyalty: Annotated[Optional[StrictBool], Field(description="Set to `true` to include loyalty information in the response.")] = None, - giveaways: Annotated[Optional[StrictBool], Field(description="Set to `true` to include giveaways information in the response.")] = None, - achievements: Annotated[Optional[StrictBool], Field(description="Set to `true` to include achievement information in the response.")] = None, + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3885,24 +4814,12 @@ def get_customer_inventory_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List customer data + """Get customer session - Return the customer inventory regarding entities referencing this customer profile's `integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons. + Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) - :param integration_id: The integration ID of the customer profile. You can get the `integrationId` of a profile using: - A customer session integration ID with the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - The Management API with the [List application's customers](https://docs.talon.one/management-api#operation/getApplicationCustomers) endpoint. (required) - :type integration_id: str - :param profile: Set to `true` to include customer profile information in the response. - :type profile: bool - :param referrals: Set to `true` to include referral information in the response. - :type referrals: bool - :param coupons: Set to `true` to include coupon information in the response. - :type coupons: bool - :param loyalty: Set to `true` to include loyalty information in the response. - :type loyalty: bool - :param giveaways: Set to `true` to include giveaways information in the response. - :type giveaways: bool - :param achievements: Set to `true` to include achievement information in the response. - :type achievements: bool + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) + :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -3925,14 +4842,8 @@ def get_customer_inventory_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_inventory_serialize( - integration_id=integration_id, - profile=profile, - referrals=referrals, - coupons=coupons, - loyalty=loyalty, - giveaways=giveaways, - achievements=achievements, + _param = self._get_customer_session_serialize( + customer_session_id=customer_session_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3940,9 +4851,9 @@ def get_customer_inventory_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "CustomerInventory", + '200': "IntegrationCustomerSessionResponse", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -3951,15 +4862,9 @@ def get_customer_inventory_without_preload_content( return response_data.response - def _get_customer_inventory_serialize( + def _get_customer_session_serialize( self, - integration_id, - profile, - referrals, - coupons, - loyalty, - giveaways, - achievements, + customer_session_id, _request_auth, _content_type, _headers, @@ -3981,33 +4886,9 @@ def _get_customer_inventory_serialize( _body_params: Optional[bytes] = None # process the path parameters - if integration_id is not None: - _path_params['integrationId'] = integration_id + if customer_session_id is not None: + _path_params['customerSessionId'] = customer_session_id # process the query parameters - if profile is not None: - - _query_params.append(('profile', profile)) - - if referrals is not None: - - _query_params.append(('referrals', referrals)) - - if coupons is not None: - - _query_params.append(('coupons', coupons)) - - if loyalty is not None: - - _query_params.append(('loyalty', loyalty)) - - if giveaways is not None: - - _query_params.append(('giveaways', giveaways)) - - if achievements is not None: - - _query_params.append(('achievements', achievements)) - # process the header parameters # process the form parameters # process the body parameter @@ -4029,7 +4910,7 @@ def _get_customer_inventory_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/customer_profiles/{integrationId}/inventory', + resource_path='/v2/customer_sessions/{customerSessionId}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4046,9 +4927,14 @@ def _get_customer_inventory_serialize( @validate_call - def get_customer_session( + def get_loyalty_balances( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, + include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4061,13 +4947,23 @@ def get_customer_session( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> IntegrationCustomerSessionResponse: - """Get customer session + ) -> LoyaltyBalancesWithTiers: + """Get customer's loyalty balances - Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) + Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) - :type customer_session_id: str + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. + :type include_tiers: bool + :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. + :type include_projected_tier: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4090,8 +4986,13 @@ def get_customer_session( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_session_serialize( - customer_session_id=customer_session_id, + _param = self._get_loyalty_balances_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + end_date=end_date, + subledger_id=subledger_id, + include_tiers=include_tiers, + include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4099,9 +5000,10 @@ def get_customer_session( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "IntegrationCustomerSessionResponse", - '400': "ErrorResponse", + '200': "LoyaltyBalancesWithTiers", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -4115,9 +5017,14 @@ def get_customer_session( @validate_call - def get_customer_session_with_http_info( + def get_loyalty_balances_with_http_info( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, + include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4130,13 +5037,23 @@ def get_customer_session_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[IntegrationCustomerSessionResponse]: - """Get customer session + ) -> ApiResponse[LoyaltyBalancesWithTiers]: + """Get customer's loyalty balances - Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) + Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) - :type customer_session_id: str + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. + :type include_tiers: bool + :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. + :type include_projected_tier: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4159,8 +5076,13 @@ def get_customer_session_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_session_serialize( - customer_session_id=customer_session_id, + _param = self._get_loyalty_balances_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + end_date=end_date, + subledger_id=subledger_id, + include_tiers=include_tiers, + include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4168,9 +5090,10 @@ def get_customer_session_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "IntegrationCustomerSessionResponse", - '400': "ErrorResponse", + '200': "LoyaltyBalancesWithTiers", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -4184,9 +5107,14 @@ def get_customer_session_with_http_info( @validate_call - def get_customer_session_without_preload_content( + def get_loyalty_balances_without_preload_content( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, + include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4200,12 +5128,22 @@ def get_customer_session_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get customer session + """Get customer's loyalty balances - Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) + Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) - :type customer_session_id: str + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. + :type include_tiers: bool + :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. + :type include_projected_tier: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4228,8 +5166,13 @@ def get_customer_session_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_customer_session_serialize( - customer_session_id=customer_session_id, + _param = self._get_loyalty_balances_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + end_date=end_date, + subledger_id=subledger_id, + include_tiers=include_tiers, + include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4237,9 +5180,10 @@ def get_customer_session_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "IntegrationCustomerSessionResponse", - '400': "ErrorResponse", + '200': "LoyaltyBalancesWithTiers", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -4248,9 +5192,14 @@ def get_customer_session_without_preload_content( return response_data.response - def _get_customer_session_serialize( + def _get_loyalty_balances_serialize( self, - customer_session_id, + loyalty_program_id, + integration_id, + end_date, + subledger_id, + include_tiers, + include_projected_tier, _request_auth, _content_type, _headers, @@ -4272,9 +5221,36 @@ def _get_customer_session_serialize( _body_params: Optional[bytes] = None # process the path parameters - if customer_session_id is not None: - _path_params['customerSessionId'] = customer_session_id + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + if integration_id is not None: + _path_params['integrationId'] = integration_id # process the query parameters + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if subledger_id is not None: + + _query_params.append(('subledgerId', subledger_id)) + + if include_tiers is not None: + + _query_params.append(('includeTiers', include_tiers)) + + if include_projected_tier is not None: + + _query_params.append(('includeProjectedTier', include_projected_tier)) + # process the header parameters # process the form parameters # process the body parameter @@ -4296,7 +5272,7 @@ def _get_customer_session_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v2/customer_sessions/{customerSessionId}', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4313,14 +5289,12 @@ def _get_customer_session_serialize( @validate_call - def get_loyalty_balances( + def get_loyalty_card_balances( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, - include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, + subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4333,23 +5307,19 @@ def get_loyalty_balances( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LoyaltyBalancesWithTiers: - """Get customer's loyalty balances + ) -> LoyaltyCardBalances: + """Get card's point balances - Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned. - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str + :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. :type end_date: datetime - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. - :type include_tiers: bool - :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. - :type include_projected_tier: bool + :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. + :type subledger_id: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4372,13 +5342,11 @@ def get_loyalty_balances( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_balances_serialize( + _param = self._get_loyalty_card_balances_serialize( loyalty_program_id=loyalty_program_id, - integration_id=integration_id, + loyalty_card_id=loyalty_card_id, end_date=end_date, subledger_id=subledger_id, - include_tiers=include_tiers, - include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4386,7 +5354,7 @@ def get_loyalty_balances( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyBalancesWithTiers", + '200': "LoyaltyCardBalances", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -4403,14 +5371,12 @@ def get_loyalty_balances( @validate_call - def get_loyalty_balances_with_http_info( + def get_loyalty_card_balances_with_http_info( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, - include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, + subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4423,23 +5389,19 @@ def get_loyalty_balances_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LoyaltyBalancesWithTiers]: - """Get customer's loyalty balances + ) -> ApiResponse[LoyaltyCardBalances]: + """Get card's point balances - Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned. - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str + :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. :type end_date: datetime - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. - :type include_tiers: bool - :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. - :type include_projected_tier: bool + :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. + :type subledger_id: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4462,13 +5424,11 @@ def get_loyalty_balances_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_balances_serialize( + _param = self._get_loyalty_card_balances_serialize( loyalty_program_id=loyalty_program_id, - integration_id=integration_id, + loyalty_card_id=loyalty_card_id, end_date=end_date, subledger_id=subledger_id, - include_tiers=include_tiers, - include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4476,7 +5436,7 @@ def get_loyalty_balances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyBalancesWithTiers", + '200': "LoyaltyCardBalances", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -4493,14 +5453,12 @@ def get_loyalty_balances_with_http_info( @validate_call - def get_loyalty_balances_without_preload_content( + def get_loyalty_card_balances_without_preload_content( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, - include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, + subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4514,22 +5472,18 @@ def get_loyalty_balances_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get customer's loyalty balances + """Get card's point balances - Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) + Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned. - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str + :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. :type end_date: datetime - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. - :type include_tiers: bool - :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. - :type include_projected_tier: bool + :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. + :type subledger_id: List[str] :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4552,13 +5506,11 @@ def get_loyalty_balances_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_balances_serialize( + _param = self._get_loyalty_card_balances_serialize( loyalty_program_id=loyalty_program_id, - integration_id=integration_id, + loyalty_card_id=loyalty_card_id, end_date=end_date, subledger_id=subledger_id, - include_tiers=include_tiers, - include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4566,7 +5518,7 @@ def get_loyalty_balances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyBalancesWithTiers", + '200': "LoyaltyCardBalances", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -4578,14 +5530,12 @@ def get_loyalty_balances_without_preload_content( return response_data.response - def _get_loyalty_balances_serialize( + def _get_loyalty_card_balances_serialize( self, loyalty_program_id, - integration_id, + loyalty_card_id, end_date, subledger_id, - include_tiers, - include_projected_tier, _request_auth, _content_type, _headers, @@ -4595,6 +5545,7 @@ def _get_loyalty_balances_serialize( _host = None _collection_formats: Dict[str, str] = { + 'subledgerId': 'multi', } _path_params: Dict[str, str] = {} @@ -4609,8 +5560,8 @@ def _get_loyalty_balances_serialize( # process the path parameters if loyalty_program_id is not None: _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id + if loyalty_card_id is not None: + _path_params['loyaltyCardId'] = loyalty_card_id # process the query parameters if end_date is not None: if isinstance(end_date, datetime): @@ -4629,14 +5580,6 @@ def _get_loyalty_balances_serialize( _query_params.append(('subledgerId', subledger_id)) - if include_tiers is not None: - - _query_params.append(('includeTiers', include_tiers)) - - if include_projected_tier is not None: - - _query_params.append(('includeProjectedTier', include_projected_tier)) - # process the header parameters # process the form parameters # process the body parameter @@ -4658,7 +5601,7 @@ def _get_loyalty_balances_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4675,12 +5618,17 @@ def _get_loyalty_balances_serialize( @validate_call - def get_loyalty_card_balances( + def get_loyalty_card_points( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4693,19 +5641,29 @@ def get_loyalty_card_balances( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LoyaltyCardBalances: - """Get card's point balances + ) -> GetLoyaltyCardPoints200Response: + """List card's unused loyalty points - Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned. + Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) :type loyalty_card_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime + :param status: Filter points based on their status. + :type status: str :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. :type subledger_id: List[str] + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4728,11 +5686,16 @@ def get_loyalty_card_balances( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_balances_serialize( + _param = self._get_loyalty_card_points_serialize( loyalty_program_id=loyalty_program_id, loyalty_card_id=loyalty_card_id, - end_date=end_date, + status=status, subledger_id=subledger_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + page_size=page_size, + skip=skip, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4740,7 +5703,7 @@ def get_loyalty_card_balances( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCardBalances", + '200': "GetLoyaltyCardPoints200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -4757,12 +5720,17 @@ def get_loyalty_card_balances( @validate_call - def get_loyalty_card_balances_with_http_info( + def get_loyalty_card_points_with_http_info( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4775,19 +5743,29 @@ def get_loyalty_card_balances_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LoyaltyCardBalances]: - """Get card's point balances + ) -> ApiResponse[GetLoyaltyCardPoints200Response]: + """List card's unused loyalty points - Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned. + Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) :type loyalty_card_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime + :param status: Filter points based on their status. + :type status: str :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. :type subledger_id: List[str] + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4810,11 +5788,16 @@ def get_loyalty_card_balances_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_balances_serialize( + _param = self._get_loyalty_card_points_serialize( loyalty_program_id=loyalty_program_id, loyalty_card_id=loyalty_card_id, - end_date=end_date, + status=status, subledger_id=subledger_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + page_size=page_size, + skip=skip, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4822,7 +5805,7 @@ def get_loyalty_card_balances_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCardBalances", + '200': "GetLoyaltyCardPoints200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -4839,12 +5822,17 @@ def get_loyalty_card_balances_with_http_info( @validate_call - def get_loyalty_card_balances_without_preload_content( + def get_loyalty_card_points_without_preload_content( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4858,18 +5846,28 @@ def get_loyalty_card_balances_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get card's point balances + """List card's unused loyalty points - Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned. + Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) :type loyalty_card_id: str - :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime + :param status: Filter points based on their status. + :type status: str :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. :type subledger_id: List[str] + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -4892,11 +5890,16 @@ def get_loyalty_card_balances_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_balances_serialize( + _param = self._get_loyalty_card_points_serialize( loyalty_program_id=loyalty_program_id, loyalty_card_id=loyalty_card_id, - end_date=end_date, + status=status, subledger_id=subledger_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + page_size=page_size, + skip=skip, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4904,7 +5907,7 @@ def get_loyalty_card_balances_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCardBalances", + '200': "GetLoyaltyCardPoints200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -4916,12 +5919,17 @@ def get_loyalty_card_balances_without_preload_content( return response_data.response - def _get_loyalty_card_balances_serialize( + def _get_loyalty_card_points_serialize( self, loyalty_program_id, loyalty_card_id, - end_date, + status, subledger_id, + customer_session_ids, + transaction_uuids, + page_size, + skip, + sort, _request_auth, _content_type, _headers, @@ -4932,6 +5940,8 @@ def _get_loyalty_card_balances_serialize( _collection_formats: Dict[str, str] = { 'subledgerId': 'multi', + 'customerSessionIDs': 'multi', + 'transactionUUIDs': 'multi', } _path_params: Dict[str, str] = {} @@ -4949,23 +5959,34 @@ def _get_loyalty_card_balances_serialize( if loyalty_card_id is not None: _path_params['loyaltyCardId'] = loyalty_card_id # process the query parameters - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) + if status is not None: + + _query_params.append(('status', status)) if subledger_id is not None: _query_params.append(('subledgerId', subledger_id)) + if customer_session_ids is not None: + + _query_params.append(('customerSessionIDs', customer_session_ids)) + + if transaction_uuids is not None: + + _query_params.append(('transactionUUIDs', transaction_uuids)) + + if page_size is not None: + + _query_params.append(('pageSize', page_size)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + if sort is not None: + + _query_params.append(('sort', sort)) + # process the header parameters # process the form parameters # process the body parameter @@ -4987,7 +6008,7 @@ def _get_loyalty_card_balances_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/points', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5004,17 +6025,19 @@ def _get_loyalty_card_balances_serialize( @validate_call - def get_loyalty_card_points( + def get_loyalty_card_transactions( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5027,19 +6050,23 @@ def get_loyalty_card_points( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetLoyaltyCardPoints200Response: - """List card's unused loyalty points + ) -> GetLoyaltyCardTransactions200Response: + """List card's transactions - Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. + Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) :type loyalty_card_id: str - :param status: Filter points based on their status. - :type status: str :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. :type subledger_id: List[str] + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. @@ -5048,8 +6075,8 @@ def get_loyalty_card_points( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. - :type sort: str + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5072,16 +6099,18 @@ def get_loyalty_card_points( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_points_serialize( + _param = self._get_loyalty_card_transactions_serialize( loyalty_program_id=loyalty_program_id, loyalty_card_id=loyalty_card_id, - status=status, subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, - sort=sort, + awaits_activation=awaits_activation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5089,7 +6118,7 @@ def get_loyalty_card_points( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardPoints200Response", + '200': "GetLoyaltyCardTransactions200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -5106,17 +6135,19 @@ def get_loyalty_card_points( @validate_call - def get_loyalty_card_points_with_http_info( + def get_loyalty_card_transactions_with_http_info( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5129,19 +6160,23 @@ def get_loyalty_card_points_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetLoyaltyCardPoints200Response]: - """List card's unused loyalty points + ) -> ApiResponse[GetLoyaltyCardTransactions200Response]: + """List card's transactions - Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. + Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) :type loyalty_card_id: str - :param status: Filter points based on their status. - :type status: str :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. :type subledger_id: List[str] + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. @@ -5150,8 +6185,8 @@ def get_loyalty_card_points_with_http_info( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. - :type sort: str + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5174,16 +6209,18 @@ def get_loyalty_card_points_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_points_serialize( + _param = self._get_loyalty_card_transactions_serialize( loyalty_program_id=loyalty_program_id, loyalty_card_id=loyalty_card_id, - status=status, subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, - sort=sort, + awaits_activation=awaits_activation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5191,7 +6228,7 @@ def get_loyalty_card_points_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardPoints200Response", + '200': "GetLoyaltyCardTransactions200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -5208,17 +6245,19 @@ def get_loyalty_card_points_with_http_info( @validate_call - def get_loyalty_card_points_without_preload_content( + def get_loyalty_card_transactions_without_preload_content( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5232,18 +6271,22 @@ def get_loyalty_card_points_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List card's unused loyalty points + """List card's transactions - Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. + Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) :type loyalty_card_id: str - :param status: Filter points based on their status. - :type status: str :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. :type subledger_id: List[str] + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. @@ -5252,8 +6295,8 @@ def get_loyalty_card_points_without_preload_content( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. - :type sort: str + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5276,16 +6319,18 @@ def get_loyalty_card_points_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_points_serialize( + _param = self._get_loyalty_card_transactions_serialize( loyalty_program_id=loyalty_program_id, loyalty_card_id=loyalty_card_id, - status=status, subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, - sort=sort, + awaits_activation=awaits_activation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5293,7 +6338,7 @@ def get_loyalty_card_points_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardPoints200Response", + '200': "GetLoyaltyCardTransactions200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -5305,17 +6350,19 @@ def get_loyalty_card_points_without_preload_content( return response_data.response - def _get_loyalty_card_points_serialize( + def _get_loyalty_card_transactions_serialize( self, loyalty_program_id, loyalty_card_id, - status, subledger_id, + loyalty_transaction_type, + start_date, + end_date, customer_session_ids, transaction_uuids, page_size, skip, - sort, + awaits_activation, _request_auth, _content_type, _headers, @@ -5345,14 +6392,40 @@ def _get_loyalty_card_points_serialize( if loyalty_card_id is not None: _path_params['loyaltyCardId'] = loyalty_card_id # process the query parameters - if status is not None: - - _query_params.append(('status', status)) - if subledger_id is not None: _query_params.append(('subledgerId', subledger_id)) + if loyalty_transaction_type is not None: + + _query_params.append(('loyaltyTransactionType', loyalty_transaction_type)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + if customer_session_ids is not None: _query_params.append(('customerSessionIDs', customer_session_ids)) @@ -5369,9 +6442,9 @@ def _get_loyalty_card_points_serialize( _query_params.append(('skip', skip)) - if sort is not None: + if awaits_activation is not None: - _query_params.append(('sort', sort)) + _query_params.append(('awaitsActivation', awaits_activation)) # process the header parameters # process the form parameters @@ -5394,7 +6467,7 @@ def _get_loyalty_card_points_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/points', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5411,18 +6484,17 @@ def _get_loyalty_card_points_serialize( @validate_call - def get_loyalty_card_transactions( + def get_loyalty_program_profile_points( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5435,23 +6507,19 @@ def get_loyalty_card_transactions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetLoyaltyCardTransactions200Response: - """List card's transactions + ) -> GetLoyaltyProgramProfilePoints200Response: + """List customer's unused loyalty points - Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. - :type subledger_id: List[str] - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param status: Filter points based on their status. + :type status: str + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. @@ -5460,6 +6528,8 @@ def get_loyalty_card_transactions( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int + :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5482,17 +6552,16 @@ def get_loyalty_card_transactions( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_transactions_serialize( + _param = self._get_loyalty_program_profile_points_serialize( loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, + integration_id=integration_id, + status=status, subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5500,7 +6569,7 @@ def get_loyalty_card_transactions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardTransactions200Response", + '200': "GetLoyaltyProgramProfilePoints200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -5517,18 +6586,17 @@ def get_loyalty_card_transactions( @validate_call - def get_loyalty_card_transactions_with_http_info( + def get_loyalty_program_profile_points_with_http_info( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5541,23 +6609,19 @@ def get_loyalty_card_transactions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetLoyaltyCardTransactions200Response]: - """List card's transactions + ) -> ApiResponse[GetLoyaltyProgramProfilePoints200Response]: + """List customer's unused loyalty points - Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. - :type subledger_id: List[str] - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param status: Filter points based on their status. + :type status: str + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. @@ -5566,6 +6630,8 @@ def get_loyalty_card_transactions_with_http_info( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int + :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5588,17 +6654,16 @@ def get_loyalty_card_transactions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_transactions_serialize( + _param = self._get_loyalty_program_profile_points_serialize( loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, + integration_id=integration_id, + status=status, subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5606,7 +6671,7 @@ def get_loyalty_card_transactions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardTransactions200Response", + '200': "GetLoyaltyProgramProfilePoints200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -5623,18 +6688,17 @@ def get_loyalty_card_transactions_with_http_info( @validate_call - def get_loyalty_card_transactions_without_preload_content( + def get_loyalty_program_profile_points_without_preload_content( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - subledger_id: Annotated[Optional[List[StrictStr]], Field(description="Filter results by one or more subledger IDs. Must be exact match.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5648,22 +6712,18 @@ def get_loyalty_card_transactions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List card's transactions + """List customer's unused loyalty points - Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned. + Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param subledger_id: Filter results by one or more subledger IDs. Must be exact match. - :type subledger_id: List[str] - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param status: Filter points based on their status. + :type status: str + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. @@ -5672,6 +6732,8 @@ def get_loyalty_card_transactions_without_preload_content( :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int + :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. + :type sort: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5694,17 +6756,16 @@ def get_loyalty_card_transactions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_card_transactions_serialize( + _param = self._get_loyalty_program_profile_points_serialize( loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, + integration_id=integration_id, + status=status, subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, page_size=page_size, skip=skip, + sort=sort, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5712,7 +6773,7 @@ def get_loyalty_card_transactions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyCardTransactions200Response", + '200': "GetLoyaltyProgramProfilePoints200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -5724,18 +6785,17 @@ def get_loyalty_card_transactions_without_preload_content( return response_data.response - def _get_loyalty_card_transactions_serialize( + def _get_loyalty_program_profile_points_serialize( self, loyalty_program_id, - loyalty_card_id, + integration_id, + status, subledger_id, - loyalty_transaction_type, - start_date, - end_date, customer_session_ids, transaction_uuids, page_size, skip, + sort, _request_auth, _content_type, _headers, @@ -5745,7 +6805,6 @@ def _get_loyalty_card_transactions_serialize( _host = None _collection_formats: Dict[str, str] = { - 'subledgerId': 'multi', 'customerSessionIDs': 'multi', 'transactionUUIDs': 'multi', } @@ -5762,42 +6821,16 @@ def _get_loyalty_card_transactions_serialize( # process the path parameters if loyalty_program_id is not None: _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id + if integration_id is not None: + _path_params['integrationId'] = integration_id # process the query parameters - if subledger_id is not None: - - _query_params.append(('subledgerId', subledger_id)) - - if loyalty_transaction_type is not None: + if status is not None: - _query_params.append(('loyaltyTransactionType', loyalty_transaction_type)) + _query_params.append(('status', status)) - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) + if subledger_id is not None: - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) + _query_params.append(('subledgerId', subledger_id)) if customer_session_ids is not None: @@ -5815,6 +6848,10 @@ def _get_loyalty_card_transactions_serialize( _query_params.append(('skip', skip)) + if sort is not None: + + _query_params.append(('sort', sort)) + # process the header parameters # process the form parameters # process the body parameter @@ -5836,7 +6873,7 @@ def _get_loyalty_card_transactions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transactions', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/points', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5853,17 +6890,19 @@ def _get_loyalty_card_transactions_serialize( @validate_call - def get_loyalty_program_profile_points( + def get_loyalty_program_profile_transactions( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5876,29 +6915,33 @@ def get_loyalty_program_profile_points( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetLoyaltyProgramProfilePoints200Response: - """List customer's unused loyalty points + ) -> GetLoyaltyProgramProfileTransactions200Response: + """List customer's loyalty transactions - Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. + Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str - :param status: Filter points based on their status. - :type status: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. :type transaction_uuids: List[str] + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime :param page_size: The number of items in the response. :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. - :type sort: str + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -5921,16 +6964,18 @@ def get_loyalty_program_profile_points( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_profile_points_serialize( + _param = self._get_loyalty_program_profile_transactions_serialize( loyalty_program_id=loyalty_program_id, integration_id=integration_id, - status=status, - subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, + subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, page_size=page_size, skip=skip, - sort=sort, + awaits_activation=awaits_activation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5938,7 +6983,7 @@ def get_loyalty_program_profile_points( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfilePoints200Response", + '200': "GetLoyaltyProgramProfileTransactions200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -5955,17 +7000,19 @@ def get_loyalty_program_profile_points( @validate_call - def get_loyalty_program_profile_points_with_http_info( + def get_loyalty_program_profile_transactions_with_http_info( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5978,29 +7025,33 @@ def get_loyalty_program_profile_points_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetLoyaltyProgramProfilePoints200Response]: - """List customer's unused loyalty points + ) -> ApiResponse[GetLoyaltyProgramProfileTransactions200Response]: + """List customer's loyalty transactions - Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. + Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str - :param status: Filter points based on their status. - :type status: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. :type transaction_uuids: List[str] + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime :param page_size: The number of items in the response. :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. - :type sort: str + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6023,16 +7074,18 @@ def get_loyalty_program_profile_points_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_profile_points_serialize( + _param = self._get_loyalty_program_profile_transactions_serialize( loyalty_program_id=loyalty_program_id, integration_id=integration_id, - status=status, - subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, + subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, page_size=page_size, skip=skip, - sort=sort, + awaits_activation=awaits_activation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6040,7 +7093,7 @@ def get_loyalty_program_profile_points_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfilePoints200Response", + '200': "GetLoyaltyProgramProfileTransactions200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6057,17 +7110,19 @@ def get_loyalty_program_profile_points_with_http_info( @validate_call - def get_loyalty_program_profile_points_without_preload_content( + def get_loyalty_program_profile_transactions_without_preload_content( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - status: Annotated[Optional[StrictStr], Field(description="Filter points based on their status.")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, - sort: Annotated[Optional[StrictStr], Field(description="The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. ")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6081,28 +7136,32 @@ def get_loyalty_program_profile_points_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List customer's unused loyalty points + """List customer's loyalty transactions - Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - `active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past. + Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str - :param status: Filter points based on their status. - :type status: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. :type customer_session_ids: List[str] :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. :type transaction_uuids: List[str] + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime :param page_size: The number of items in the response. :type page_size: int :param skip: The number of items to skip when paging through large result sets. :type skip: int - :param sort: The field by which results should be sorted. You can enter one of the following values: - `startDate`: Sorts the results by the start date of the points. - `expiryDate`: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with `-`. **Note:** You can only sort by one field at a time. - :type sort: str + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6125,16 +7184,18 @@ def get_loyalty_program_profile_points_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_profile_points_serialize( + _param = self._get_loyalty_program_profile_transactions_serialize( loyalty_program_id=loyalty_program_id, integration_id=integration_id, - status=status, - subledger_id=subledger_id, customer_session_ids=customer_session_ids, transaction_uuids=transaction_uuids, + subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, page_size=page_size, skip=skip, - sort=sort, + awaits_activation=awaits_activation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6142,7 +7203,7 @@ def get_loyalty_program_profile_points_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfilePoints200Response", + '200': "GetLoyaltyProgramProfileTransactions200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6154,17 +7215,19 @@ def get_loyalty_program_profile_points_without_preload_content( return response_data.response - def _get_loyalty_program_profile_points_serialize( + def _get_loyalty_program_profile_transactions_serialize( self, loyalty_program_id, integration_id, - status, - subledger_id, customer_session_ids, transaction_uuids, + subledger_id, + loyalty_transaction_type, + start_date, + end_date, page_size, skip, - sort, + awaits_activation, _request_auth, _content_type, _headers, @@ -6193,21 +7256,47 @@ def _get_loyalty_program_profile_points_serialize( if integration_id is not None: _path_params['integrationId'] = integration_id # process the query parameters - if status is not None: + if customer_session_ids is not None: - _query_params.append(('status', status)) + _query_params.append(('customerSessionIDs', customer_session_ids)) + + if transaction_uuids is not None: + + _query_params.append(('transactionUUIDs', transaction_uuids)) if subledger_id is not None: _query_params.append(('subledgerId', subledger_id)) - if customer_session_ids is not None: + if loyalty_transaction_type is not None: - _query_params.append(('customerSessionIDs', customer_session_ids)) + _query_params.append(('loyaltyTransactionType', loyalty_transaction_type)) - if transaction_uuids is not None: + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) - _query_params.append(('transactionUUIDs', transaction_uuids)) + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) if page_size is not None: @@ -6217,9 +7306,9 @@ def _get_loyalty_program_profile_points_serialize( _query_params.append(('skip', skip)) - if sort is not None: + if awaits_activation is not None: - _query_params.append(('sort', sort)) + _query_params.append(('awaitsActivation', awaits_activation)) # process the header parameters # process the form parameters @@ -6242,7 +7331,7 @@ def _get_loyalty_program_profile_points_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/points', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6259,18 +7348,9 @@ def _get_loyalty_program_profile_points_serialize( @validate_call - def get_loyalty_program_profile_transactions( + def get_reserved_customers( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, - transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6283,31 +7363,13 @@ def get_loyalty_program_profile_transactions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetLoyaltyProgramProfileTransactions200Response: - """List customer's loyalty transactions + ) -> GetReservedCustomers200Response: + """List customers that have this coupon reserved - Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. + Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. - :type customer_session_ids: List[str] - :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. - :type transaction_uuids: List[str] - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6330,17 +7392,8 @@ def get_loyalty_program_profile_transactions( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_profile_transactions_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, + _param = self._get_reserved_customers_serialize( + coupon_value=coupon_value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6348,7 +7401,7 @@ def get_loyalty_program_profile_transactions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfileTransactions200Response", + '200': "GetReservedCustomers200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6365,18 +7418,9 @@ def get_loyalty_program_profile_transactions( @validate_call - def get_loyalty_program_profile_transactions_with_http_info( + def get_reserved_customers_with_http_info( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, - transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6389,31 +7433,13 @@ def get_loyalty_program_profile_transactions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetLoyaltyProgramProfileTransactions200Response]: - """List customer's loyalty transactions + ) -> ApiResponse[GetReservedCustomers200Response]: + """List customers that have this coupon reserved - Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. + Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. - :type customer_session_ids: List[str] - :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. - :type transaction_uuids: List[str] - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6436,17 +7462,8 @@ def get_loyalty_program_profile_transactions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_profile_transactions_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, + _param = self._get_reserved_customers_serialize( + coupon_value=coupon_value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6454,7 +7471,7 @@ def get_loyalty_program_profile_transactions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfileTransactions200Response", + '200': "GetReservedCustomers200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6471,18 +7488,9 @@ def get_loyalty_program_profile_transactions_with_http_info( @validate_call - def get_loyalty_program_profile_transactions_without_preload_content( + def get_reserved_customers_without_preload_content( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], - customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, - transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6496,30 +7504,12 @@ def get_loyalty_program_profile_transactions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List customer's loyalty transactions + """List customers that have this coupon reserved - Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. + Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. - :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) - :type integration_id: str - :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. - :type customer_session_ids: List[str] - :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. - :type transaction_uuids: List[str] - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) + :type coupon_value: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6542,17 +7532,8 @@ def get_loyalty_program_profile_transactions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_profile_transactions_serialize( - loyalty_program_id=loyalty_program_id, - integration_id=integration_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - subledger_id=subledger_id, - loyalty_transaction_type=loyalty_transaction_type, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, + _param = self._get_reserved_customers_serialize( + coupon_value=coupon_value, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6560,7 +7541,7 @@ def get_loyalty_program_profile_transactions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramProfileTransactions200Response", + '200': "GetReservedCustomers200Response", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6572,18 +7553,9 @@ def get_loyalty_program_profile_transactions_without_preload_content( return response_data.response - def _get_loyalty_program_profile_transactions_serialize( + def _get_reserved_customers_serialize( self, - loyalty_program_id, - integration_id, - customer_session_ids, - transaction_uuids, - subledger_id, - loyalty_transaction_type, - start_date, - end_date, - page_size, - skip, + coupon_value, _request_auth, _content_type, _headers, @@ -6593,8 +7565,6 @@ def _get_loyalty_program_profile_transactions_serialize( _host = None _collection_formats: Dict[str, str] = { - 'customerSessionIDs': 'multi', - 'transactionUUIDs': 'multi', } _path_params: Dict[str, str] = {} @@ -6604,64 +7574,12 @@ def _get_loyalty_program_profile_transactions_serialize( _files: Dict[ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] ] = {} - _body_params: Optional[bytes] = None - - # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if integration_id is not None: - _path_params['integrationId'] = integration_id + _body_params: Optional[bytes] = None + + # process the path parameters + if coupon_value is not None: + _path_params['couponValue'] = coupon_value # process the query parameters - if customer_session_ids is not None: - - _query_params.append(('customerSessionIDs', customer_session_ids)) - - if transaction_uuids is not None: - - _query_params.append(('transactionUUIDs', transaction_uuids)) - - if subledger_id is not None: - - _query_params.append(('subledgerId', subledger_id)) - - if loyalty_transaction_type is not None: - - _query_params.append(('loyaltyTransactionType', loyalty_transaction_type)) - - if start_date is not None: - if isinstance(start_date, datetime): - _query_params.append( - ( - 'startDate', - start_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('startDate', start_date)) - - if end_date is not None: - if isinstance(end_date, datetime): - _query_params.append( - ( - 'endDate', - end_date.strftime( - self.api_client.configuration.datetime_format - ) - ) - ) - else: - _query_params.append(('endDate', end_date)) - - if page_size is not None: - - _query_params.append(('pageSize', page_size)) - - if skip is not None: - - _query_params.append(('skip', skip)) - # process the header parameters # process the form parameters # process the body parameter @@ -6683,7 +7601,7 @@ def _get_loyalty_program_profile_transactions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions', + resource_path='/v1/coupon_reservations/customerprofiles/{couponValue}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6700,9 +7618,11 @@ def _get_loyalty_program_profile_transactions_serialize( @validate_call - def get_reserved_customers( + def link_loyalty_card_to_profile( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], + loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6715,13 +7635,17 @@ def get_reserved_customers( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetReservedCustomers200Response: - """List customers that have this coupon reserved + ) -> LoyaltyCard: + """Link customer profile to card - Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. + [Loyalty cards](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as **Registered**. This affects how it can be used. See the [docs](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). **Note:** You can link as many customer profiles to a given loyalty card as the [**card user limit**](https://docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) allows. - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str + :param loyalty_card_registration: body (required) + :type loyalty_card_registration: LoyaltyCardRegistration :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6744,8 +7668,10 @@ def get_reserved_customers( :return: Returns the result object. """ # noqa: E501 - _param = self._get_reserved_customers_serialize( - coupon_value=coupon_value, + _param = self._link_loyalty_card_to_profile_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_card_id=loyalty_card_id, + loyalty_card_registration=loyalty_card_registration, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6753,7 +7679,7 @@ def get_reserved_customers( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetReservedCustomers200Response", + '200': "LoyaltyCard", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6770,9 +7696,11 @@ def get_reserved_customers( @validate_call - def get_reserved_customers_with_http_info( + def link_loyalty_card_to_profile_with_http_info( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], + loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6785,13 +7713,17 @@ def get_reserved_customers_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetReservedCustomers200Response]: - """List customers that have this coupon reserved + ) -> ApiResponse[LoyaltyCard]: + """Link customer profile to card - Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. + [Loyalty cards](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as **Registered**. This affects how it can be used. See the [docs](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). **Note:** You can link as many customer profiles to a given loyalty card as the [**card user limit**](https://docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) allows. - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str + :param loyalty_card_registration: body (required) + :type loyalty_card_registration: LoyaltyCardRegistration :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6814,8 +7746,10 @@ def get_reserved_customers_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_reserved_customers_serialize( - coupon_value=coupon_value, + _param = self._link_loyalty_card_to_profile_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_card_id=loyalty_card_id, + loyalty_card_registration=loyalty_card_registration, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6823,7 +7757,7 @@ def get_reserved_customers_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetReservedCustomers200Response", + '200': "LoyaltyCard", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6840,9 +7774,11 @@ def get_reserved_customers_with_http_info( @validate_call - def get_reserved_customers_without_preload_content( + def link_loyalty_card_to_profile_without_preload_content( self, - coupon_value: Annotated[StrictStr, Field(description="The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. ")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], + loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6856,12 +7792,16 @@ def get_reserved_customers_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List customers that have this coupon reserved + """Link customer profile to card - Return all customers that have this coupon marked as reserved. This includes hard and soft reservations. + [Loyalty cards](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as **Registered**. This affects how it can be used. See the [docs](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). **Note:** You can link as many customer profiles to a given loyalty card as the [**card user limit**](https://docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) allows. - :param coupon_value: The code of the coupon. **Important:** The coupon code requires [URL encoding](https://www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode `SUMMER25%OFF` as `SUMMER25%25OFF`. (required) - :type coupon_value: str + :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str + :param loyalty_card_registration: body (required) + :type loyalty_card_registration: LoyaltyCardRegistration :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -6884,8 +7824,10 @@ def get_reserved_customers_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_reserved_customers_serialize( - coupon_value=coupon_value, + _param = self._link_loyalty_card_to_profile_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_card_id=loyalty_card_id, + loyalty_card_registration=loyalty_card_registration, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6893,7 +7835,7 @@ def get_reserved_customers_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetReservedCustomers200Response", + '200': "LoyaltyCard", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", '404': "ErrorResponseWithStatus", @@ -6905,9 +7847,11 @@ def get_reserved_customers_without_preload_content( return response_data.response - def _get_reserved_customers_serialize( + def _link_loyalty_card_to_profile_serialize( self, - coupon_value, + loyalty_program_id, + loyalty_card_id, + loyalty_card_registration, _request_auth, _content_type, _headers, @@ -6929,12 +7873,16 @@ def _get_reserved_customers_serialize( _body_params: Optional[bytes] = None # process the path parameters - if coupon_value is not None: - _path_params['couponValue'] = coupon_value + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + if loyalty_card_id is not None: + _path_params['loyaltyCardId'] = loyalty_card_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter + if loyalty_card_registration is not None: + _body_params = loyalty_card_registration # set the HTTP header `Accept` @@ -6945,6 +7893,19 @@ def _get_reserved_customers_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -6952,8 +7913,8 @@ def _get_reserved_customers_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/v1/coupon_reservations/customerprofiles/{couponValue}', + method='POST', + resource_path='/v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6970,11 +7931,9 @@ def _get_reserved_customers_serialize( @validate_call - def link_loyalty_card_to_profile( + def reopen_customer_session( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6987,17 +7946,13 @@ def link_loyalty_card_to_profile( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LoyaltyCard: - """Link customer profile to card + ) -> ReopenSessionResponse: + """Reopen customer session - [Loyalty cards](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as **Registered**. This affects how it can be used. See the [docs](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). **Note:** You can link as many customer profiles to a given loyalty card as the [**card user limit**](https://docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) allows. + Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

To see an example of a rollback, see the Cancelling a session with campaign budgets tutorial.

**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel a closed session and create a new one. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param loyalty_card_registration: body (required) - :type loyalty_card_registration: LoyaltyCardRegistration + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) + :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7020,10 +7975,8 @@ def link_loyalty_card_to_profile( :return: Returns the result object. """ # noqa: E501 - _param = self._link_loyalty_card_to_profile_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - loyalty_card_registration=loyalty_card_registration, + _param = self._reopen_customer_session_serialize( + customer_session_id=customer_session_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7031,10 +7984,9 @@ def link_loyalty_card_to_profile( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", + '200': "ReopenSessionResponse", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -7048,11 +8000,9 @@ def link_loyalty_card_to_profile( @validate_call - def link_loyalty_card_to_profile_with_http_info( + def reopen_customer_session_with_http_info( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7065,17 +8015,13 @@ def link_loyalty_card_to_profile_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LoyaltyCard]: - """Link customer profile to card + ) -> ApiResponse[ReopenSessionResponse]: + """Reopen customer session - [Loyalty cards](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as **Registered**. This affects how it can be used. See the [docs](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). **Note:** You can link as many customer profiles to a given loyalty card as the [**card user limit**](https://docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) allows. + Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

To see an example of a rollback, see the Cancelling a session with campaign budgets tutorial.

**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel a closed session and create a new one. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param loyalty_card_registration: body (required) - :type loyalty_card_registration: LoyaltyCardRegistration + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) + :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7098,10 +8044,8 @@ def link_loyalty_card_to_profile_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._link_loyalty_card_to_profile_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - loyalty_card_registration=loyalty_card_registration, + _param = self._reopen_customer_session_serialize( + customer_session_id=customer_session_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7109,10 +8053,9 @@ def link_loyalty_card_to_profile_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", + '200': "ReopenSessionResponse", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -7126,11 +8069,9 @@ def link_loyalty_card_to_profile_with_http_info( @validate_call - def link_loyalty_card_to_profile_without_preload_content( + def reopen_customer_session_without_preload_content( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], - loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], + customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7144,16 +8085,12 @@ def link_loyalty_card_to_profile_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Link customer profile to card + """Reopen customer session - [Loyalty cards](https://docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as **Registered**. This affects how it can be used. See the [docs](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). **Note:** You can link as many customer profiles to a given loyalty card as the [**card user limit**](https://docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) allows. + Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

To see an example of a rollback, see the Cancelling a session with campaign budgets tutorial.

**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel a closed session and create a new one. - :param loyalty_program_id: Identifier of the card-based loyalty program containing the loyalty card. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int - :param loyalty_card_id: Identifier of the loyalty card. You can get the identifier with the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) - :type loyalty_card_id: str - :param loyalty_card_registration: body (required) - :type loyalty_card_registration: LoyaltyCardRegistration + :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) + :type customer_session_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7176,10 +8113,8 @@ def link_loyalty_card_to_profile_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._link_loyalty_card_to_profile_serialize( - loyalty_program_id=loyalty_program_id, - loyalty_card_id=loyalty_card_id, - loyalty_card_registration=loyalty_card_registration, + _param = self._reopen_customer_session_serialize( + customer_session_id=customer_session_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7187,10 +8122,9 @@ def link_loyalty_card_to_profile_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyCard", - '400': "ErrorResponseWithStatus", + '200': "ReopenSessionResponse", + '400': "ErrorResponse", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -7199,11 +8133,9 @@ def link_loyalty_card_to_profile_without_preload_content( return response_data.response - def _link_loyalty_card_to_profile_serialize( + def _reopen_customer_session_serialize( self, - loyalty_program_id, - loyalty_card_id, - loyalty_card_registration, + customer_session_id, _request_auth, _content_type, _headers, @@ -7225,16 +8157,12 @@ def _link_loyalty_card_to_profile_serialize( _body_params: Optional[bytes] = None # process the path parameters - if loyalty_program_id is not None: - _path_params['loyaltyProgramId'] = loyalty_program_id - if loyalty_card_id is not None: - _path_params['loyaltyCardId'] = loyalty_card_id + if customer_session_id is not None: + _path_params['customerSessionId'] = customer_session_id # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if loyalty_card_registration is not None: - _body_params = loyalty_card_registration # set the HTTP header `Accept` @@ -7245,19 +8173,6 @@ def _link_loyalty_card_to_profile_serialize( ] ) - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) - ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -7265,8 +8180,8 @@ def _link_loyalty_card_to_profile_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile', + method='PUT', + resource_path='/v2/customer_sessions/{customerSessionId}/reopen', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7283,9 +8198,11 @@ def _link_loyalty_card_to_profile_serialize( @validate_call - def reopen_customer_session( + def return_cart_items( self, customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], + return_integration_request: Annotated[ReturnIntegrationRequest, Field(description="body")], + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7298,13 +8215,17 @@ def reopen_customer_session( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ReopenSessionResponse: - """Reopen customer session + ) -> IntegrationStateV2: + """Return cart items - Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

To see an example of a rollback, see the Cancelling a session with campaign budgetstutorial.

**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel a closed session and create a new one. + Create a new return request for the specified cart items. This endpoint automatically changes the session state from `closed` to `partially_returned`. **Note:** This will roll back any effects associated with these cart items. For more information, see [our documentation on session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) and [this tutorial](https://docs.talon.one/docs/dev/tutorials/partially-returning-a-session). :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) :type customer_session_id: str + :param return_integration_request: body (required) + :type return_integration_request: ReturnIntegrationRequest + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7327,8 +8248,10 @@ def reopen_customer_session( :return: Returns the result object. """ # noqa: E501 - _param = self._reopen_customer_session_serialize( + _param = self._return_cart_items_serialize( customer_session_id=customer_session_id, + return_integration_request=return_integration_request, + dry=dry, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7336,7 +8259,7 @@ def reopen_customer_session( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReopenSessionResponse", + '200': "IntegrationStateV2", '400': "ErrorResponse", '401': "ErrorResponseWithStatus", } @@ -7352,9 +8275,11 @@ def reopen_customer_session( @validate_call - def reopen_customer_session_with_http_info( + def return_cart_items_with_http_info( self, customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], + return_integration_request: Annotated[ReturnIntegrationRequest, Field(description="body")], + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7367,13 +8292,17 @@ def reopen_customer_session_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ReopenSessionResponse]: - """Reopen customer session + ) -> ApiResponse[IntegrationStateV2]: + """Return cart items - Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

To see an example of a rollback, see the Cancelling a session with campaign budgetstutorial.

**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel a closed session and create a new one. + Create a new return request for the specified cart items. This endpoint automatically changes the session state from `closed` to `partially_returned`. **Note:** This will roll back any effects associated with these cart items. For more information, see [our documentation on session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) and [this tutorial](https://docs.talon.one/docs/dev/tutorials/partially-returning-a-session). :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) :type customer_session_id: str + :param return_integration_request: body (required) + :type return_integration_request: ReturnIntegrationRequest + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7396,8 +8325,10 @@ def reopen_customer_session_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._reopen_customer_session_serialize( + _param = self._return_cart_items_serialize( customer_session_id=customer_session_id, + return_integration_request=return_integration_request, + dry=dry, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7405,7 +8336,7 @@ def reopen_customer_session_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReopenSessionResponse", + '200': "IntegrationStateV2", '400': "ErrorResponse", '401': "ErrorResponseWithStatus", } @@ -7421,9 +8352,11 @@ def reopen_customer_session_with_http_info( @validate_call - def reopen_customer_session_without_preload_content( + def return_cart_items_without_preload_content( self, customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], + return_integration_request: Annotated[ReturnIntegrationRequest, Field(description="body")], + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7437,12 +8370,16 @@ def reopen_customer_session_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Reopen customer session + """Return cart items - Reopen a closed [customer session](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The `talon_session_reopened` event is triggered. You can see it in the **Events** view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](https://docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance.
Effects and budgets unimpacted by a session reopening

The following effects and budgets remain in the state they were in when the session closed:

To see an example of a rollback, see the Cancelling a session with campaign budgetstutorial.

**Note:** If your order workflow requires you to create a new session instead of reopening a session, use the [Update customer session](https://docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint to cancel a closed session and create a new one. + Create a new return request for the specified cart items. This endpoint automatically changes the session state from `closed` to `partially_returned`. **Note:** This will roll back any effects associated with these cart items. For more information, see [our documentation on session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) and [this tutorial](https://docs.talon.one/docs/dev/tutorials/partially-returning-a-session). :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) :type customer_session_id: str + :param return_integration_request: body (required) + :type return_integration_request: ReturnIntegrationRequest + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7465,8 +8402,10 @@ def reopen_customer_session_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._reopen_customer_session_serialize( + _param = self._return_cart_items_serialize( customer_session_id=customer_session_id, + return_integration_request=return_integration_request, + dry=dry, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7474,7 +8413,7 @@ def reopen_customer_session_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ReopenSessionResponse", + '200': "IntegrationStateV2", '400': "ErrorResponse", '401': "ErrorResponseWithStatus", } @@ -7485,9 +8424,11 @@ def reopen_customer_session_without_preload_content( return response_data.response - def _reopen_customer_session_serialize( + def _return_cart_items_serialize( self, customer_session_id, + return_integration_request, + dry, _request_auth, _content_type, _headers, @@ -7512,9 +8453,15 @@ def _reopen_customer_session_serialize( if customer_session_id is not None: _path_params['customerSessionId'] = customer_session_id # process the query parameters + if dry is not None: + + _query_params.append(('dry', dry)) + # process the header parameters # process the form parameters # process the body parameter + if return_integration_request is not None: + _body_params = return_integration_request # set the HTTP header `Accept` @@ -7525,6 +8472,19 @@ def _reopen_customer_session_serialize( ] ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -7532,8 +8492,8 @@ def _reopen_customer_session_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/v2/customer_sessions/{customerSessionId}/reopen', + method='POST', + resource_path='/v2/customer_sessions/{customerSessionId}/returns', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7550,11 +8510,10 @@ def _reopen_customer_session_serialize( @validate_call - def return_cart_items( + def sync_catalog( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], - return_integration_request: Annotated[ReturnIntegrationRequest, Field(description="body")], - dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], + catalog_sync_request: Annotated[CatalogSyncRequest, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7567,17 +8526,15 @@ def return_cart_items( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> IntegrationStateV2: - """Return cart items + ) -> Catalog: + """Sync cart item catalog - Create a new return request for the specified cart items. This endpoint automatically changes the session state from `closed` to `partially_returned`. **Note:** This will roll back any effects associated with these cart items. For more information, see [our documentation on session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) and [this tutorial](https://docs.talon.one/docs/dev/tutorials/partially-returning-a-session). + Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding multiple items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Updating the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Updating the attributes of multiple items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing multiple items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
- :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) - :type customer_session_id: str - :param return_integration_request: body (required) - :type return_integration_request: ReturnIntegrationRequest - :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. - :type dry: bool + :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + :type catalog_id: int + :param catalog_sync_request: body (required) + :type catalog_sync_request: CatalogSyncRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7600,10 +8557,9 @@ def return_cart_items( :return: Returns the result object. """ # noqa: E501 - _param = self._return_cart_items_serialize( - customer_session_id=customer_session_id, - return_integration_request=return_integration_request, - dry=dry, + _param = self._sync_catalog_serialize( + catalog_id=catalog_id, + catalog_sync_request=catalog_sync_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7611,9 +8567,10 @@ def return_cart_items( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "IntegrationStateV2", + '200': "Catalog", '400': "ErrorResponse", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -7627,11 +8584,10 @@ def return_cart_items( @validate_call - def return_cart_items_with_http_info( + def sync_catalog_with_http_info( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], - return_integration_request: Annotated[ReturnIntegrationRequest, Field(description="body")], - dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], + catalog_sync_request: Annotated[CatalogSyncRequest, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7644,17 +8600,15 @@ def return_cart_items_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[IntegrationStateV2]: - """Return cart items + ) -> ApiResponse[Catalog]: + """Sync cart item catalog - Create a new return request for the specified cart items. This endpoint automatically changes the session state from `closed` to `partially_returned`. **Note:** This will roll back any effects associated with these cart items. For more information, see [our documentation on session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) and [this tutorial](https://docs.talon.one/docs/dev/tutorials/partially-returning-a-session). + Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding multiple items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Updating the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Updating the attributes of multiple items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing multiple items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
- :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) - :type customer_session_id: str - :param return_integration_request: body (required) - :type return_integration_request: ReturnIntegrationRequest - :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. - :type dry: bool + :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + :type catalog_id: int + :param catalog_sync_request: body (required) + :type catalog_sync_request: CatalogSyncRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7677,10 +8631,9 @@ def return_cart_items_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._return_cart_items_serialize( - customer_session_id=customer_session_id, - return_integration_request=return_integration_request, - dry=dry, + _param = self._sync_catalog_serialize( + catalog_id=catalog_id, + catalog_sync_request=catalog_sync_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7688,9 +8641,10 @@ def return_cart_items_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "IntegrationStateV2", + '200': "Catalog", '400': "ErrorResponse", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -7704,11 +8658,10 @@ def return_cart_items_with_http_info( @validate_call - def return_cart_items_without_preload_content( + def sync_catalog_without_preload_content( self, - customer_session_id: Annotated[StrictStr, Field(description="The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. ")], - return_integration_request: Annotated[ReturnIntegrationRequest, Field(description="body")], - dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], + catalog_sync_request: Annotated[CatalogSyncRequest, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7722,16 +8675,14 @@ def return_cart_items_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Return cart items + """Sync cart item catalog - Create a new return request for the specified cart items. This endpoint automatically changes the session state from `closed` to `partially_returned`. **Note:** This will roll back any effects associated with these cart items. For more information, see [our documentation on session states](https://docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) and [this tutorial](https://docs.talon.one/docs/dev/tutorials/partially-returning-a-session). + Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding multiple items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Updating the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Updating the attributes of multiple items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing multiple items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
- :param customer_session_id: The `integration ID` of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager's **Sessions** menu, or via the [List Application session](https://docs.talon.one/management-api#operation/getApplicationSessions) endpoint. (required) - :type customer_session_id: str - :param return_integration_request: body (required) - :type return_integration_request: ReturnIntegrationRequest - :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. - :type dry: bool + :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) + :type catalog_id: int + :param catalog_sync_request: body (required) + :type catalog_sync_request: CatalogSyncRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7754,10 +8705,9 @@ def return_cart_items_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._return_cart_items_serialize( - customer_session_id=customer_session_id, - return_integration_request=return_integration_request, - dry=dry, + _param = self._sync_catalog_serialize( + catalog_id=catalog_id, + catalog_sync_request=catalog_sync_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7765,9 +8715,10 @@ def return_cart_items_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "IntegrationStateV2", + '200': "Catalog", '400': "ErrorResponse", '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -7776,11 +8727,10 @@ def return_cart_items_without_preload_content( return response_data.response - def _return_cart_items_serialize( + def _sync_catalog_serialize( self, - customer_session_id, - return_integration_request, - dry, + catalog_id, + catalog_sync_request, _request_auth, _content_type, _headers, @@ -7802,18 +8752,14 @@ def _return_cart_items_serialize( _body_params: Optional[bytes] = None # process the path parameters - if customer_session_id is not None: - _path_params['customerSessionId'] = customer_session_id + if catalog_id is not None: + _path_params['catalogId'] = catalog_id # process the query parameters - if dry is not None: - - _query_params.append(('dry', dry)) - # process the header parameters # process the form parameters # process the body parameter - if return_integration_request is not None: - _body_params = return_integration_request + if catalog_sync_request is not None: + _body_params = catalog_sync_request # set the HTTP header `Accept` @@ -7844,8 +8790,8 @@ def _return_cart_items_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/v2/customer_sessions/{customerSessionId}/returns', + method='PUT', + resource_path='/v1/catalogs/{catalogId}/sync', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7862,10 +8808,12 @@ def _return_cart_items_serialize( @validate_call - def sync_catalog( + def track_event_v2( self, - catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], - catalog_sync_request: Annotated[CatalogSyncRequest, Field(description="body")], + integration_event_v2_request: Annotated[IntegrationEventV2Request, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7878,15 +8826,19 @@ def sync_catalog( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Catalog: - """Sync cart item catalog + ) -> TrackEventV2Response: + """Track event - Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding multiple items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Updating the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Updating the attributes of multiple items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing multiple items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
+ Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing).

Important

1. `profileId` is required even though the schema does not specify it. 1. If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. 1. We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). 1. [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.
- :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - :type catalog_id: int - :param catalog_sync_request: body (required) - :type catalog_sync_request: CatalogSyncRequest + :param integration_event_v2_request: body (required) + :type integration_event_v2_request: IntegrationEventV2Request + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool + :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. + :type force_complete_evaluation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7909,9 +8861,11 @@ def sync_catalog( :return: Returns the result object. """ # noqa: E501 - _param = self._sync_catalog_serialize( - catalog_id=catalog_id, - catalog_sync_request=catalog_sync_request, + _param = self._track_event_v2_serialize( + integration_event_v2_request=integration_event_v2_request, + silent=silent, + dry=dry, + force_complete_evaluation=force_complete_evaluation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7919,10 +8873,10 @@ def sync_catalog( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Catalog", - '400': "ErrorResponse", + '200': "TrackEventV2Response", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -7936,10 +8890,12 @@ def sync_catalog( @validate_call - def sync_catalog_with_http_info( + def track_event_v2_with_http_info( self, - catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], - catalog_sync_request: Annotated[CatalogSyncRequest, Field(description="body")], + integration_event_v2_request: Annotated[IntegrationEventV2Request, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7952,15 +8908,19 @@ def sync_catalog_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Catalog]: - """Sync cart item catalog + ) -> ApiResponse[TrackEventV2Response]: + """Track event - Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding multiple items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Updating the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Updating the attributes of multiple items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing multiple items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
+ Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing).

Important

1. `profileId` is required even though the schema does not specify it. 1. If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. 1. We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). 1. [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.
- :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - :type catalog_id: int - :param catalog_sync_request: body (required) - :type catalog_sync_request: CatalogSyncRequest + :param integration_event_v2_request: body (required) + :type integration_event_v2_request: IntegrationEventV2Request + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool + :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. + :type force_complete_evaluation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -7983,9 +8943,11 @@ def sync_catalog_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._sync_catalog_serialize( - catalog_id=catalog_id, - catalog_sync_request=catalog_sync_request, + _param = self._track_event_v2_serialize( + integration_event_v2_request=integration_event_v2_request, + silent=silent, + dry=dry, + force_complete_evaluation=force_complete_evaluation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7993,10 +8955,10 @@ def sync_catalog_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Catalog", - '400': "ErrorResponse", + '200': "TrackEventV2Response", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -8010,10 +8972,12 @@ def sync_catalog_with_http_info( @validate_call - def sync_catalog_without_preload_content( + def track_event_v2_without_preload_content( self, - catalog_id: Annotated[StrictInt, Field(description="The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**.")], - catalog_sync_request: Annotated[CatalogSyncRequest, Field(description="body")], + integration_event_v2_request: Annotated[IntegrationEventV2Request, Field(description="body")], + silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, + dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, + force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8027,14 +8991,18 @@ def sync_catalog_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Sync cart item catalog + """Track event - Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique `SKU`. **Important**: You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](https://docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](https://docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. **Note:** `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action:
Adding an item to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Adding multiple items to the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241027\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" }, { \"payload\": { \"attributes\": { \"color\": \"Navy blue\", \"type\": \"shoes\" }, \"replaceIfExists\": true, \"sku\": \"SKU1241028\", \"price\": 100, \"product\": { \"name\": \"sneakers\" } }, \"type\": \"ADD\" } ] } ```
Updating the attributes of an item in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"age\": 11, \"origin\": \"germany\" }, \"createIfNotExists\": false, \"sku\": \"SKU1241028\", \"product\": { \"name\": \"sneakers\" } }, \"type\": \"PATCH\" } ] } ```
Updating the attributes of multiple items in the catalog
```json { \"actions\": [ { \"payload\": { \"attributes\": { \"color\": \"red\" }, \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"PATCH_MANY\" } ] } ```
Removing an item from the catalog
```json { \"actions\": [ { \"payload\": { \"sku\": \"SKU1241028\" }, \"type\": \"REMOVE\" } ] } ```
Removing multiple items from the catalog
```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"color\", \"op\": \"EQ\", \"value\": \"blue\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
Removing shoes of sizes above 45 from the catalog

Let's imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:

```json { \"actions\": [ { \"payload\": { \"filters\": [ { \"attr\": \"size\", \"op\": \"GT\", \"value\": \"45\" } ] }, \"type\": \"REMOVE_MANY\" } ] } ```
+ Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing).

Important

1. `profileId` is required even though the schema does not specify it. 1. If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. 1. We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). 1. [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.
- :param catalog_id: The ID of the catalog. You can find the ID in the Campaign Manager in **Account** > **Tools** > **Cart item catalogs**. (required) - :type catalog_id: int - :param catalog_sync_request: body (required) - :type catalog_sync_request: CatalogSyncRequest + :param integration_event_v2_request: body (required) + :type integration_event_v2_request: IntegrationEventV2Request + :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. + :type silent: str + :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. + :type dry: bool + :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. + :type force_complete_evaluation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8057,9 +9025,11 @@ def sync_catalog_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._sync_catalog_serialize( - catalog_id=catalog_id, - catalog_sync_request=catalog_sync_request, + _param = self._track_event_v2_serialize( + integration_event_v2_request=integration_event_v2_request, + silent=silent, + dry=dry, + force_complete_evaluation=force_complete_evaluation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8067,10 +9037,10 @@ def sync_catalog_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Catalog", - '400': "ErrorResponse", + '200': "TrackEventV2Response", + '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '409': "UpdateCustomerProfileV2409Response", } response_data = self.api_client.call_api( *_param, @@ -8079,10 +9049,12 @@ def sync_catalog_without_preload_content( return response_data.response - def _sync_catalog_serialize( + def _track_event_v2_serialize( self, - catalog_id, - catalog_sync_request, + integration_event_v2_request, + silent, + dry, + force_complete_evaluation, _request_auth, _content_type, _headers, @@ -8104,14 +9076,24 @@ def _sync_catalog_serialize( _body_params: Optional[bytes] = None # process the path parameters - if catalog_id is not None: - _path_params['catalogId'] = catalog_id # process the query parameters + if silent is not None: + + _query_params.append(('silent', silent)) + + if dry is not None: + + _query_params.append(('dry', dry)) + + if force_complete_evaluation is not None: + + _query_params.append(('forceCompleteEvaluation', force_complete_evaluation)) + # process the header parameters # process the form parameters # process the body parameter - if catalog_sync_request is not None: - _body_params = catalog_sync_request + if integration_event_v2_request is not None: + _body_params = integration_event_v2_request # set the HTTP header `Accept` @@ -8142,8 +9124,8 @@ def _sync_catalog_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/v1/catalogs/{catalogId}/sync', + method='POST', + resource_path='/v2/events', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8160,12 +9142,11 @@ def _sync_catalog_serialize( @validate_call - def track_event_v2( + def unlink_loyalty_card_from_profile( self, - integration_event_v2_request: Annotated[IntegrationEventV2Request, Field(description="body")], - silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, - dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, - force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], + loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8178,19 +9159,17 @@ def track_event_v2( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> TrackEventV2Response: - """Track event + ) -> LoyaltyCard: + """Unlink customer profile from a loyalty card - Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing).

Important

1. `profileId` is required even though the schema does not specify it. 1. If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. 1. We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). 1. [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.
+ Unlink a customer profile from a [registered](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card) loyalty card. To get the `integrationId` of a customer profile, you can use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - :param integration_event_v2_request: body (required) - :type integration_event_v2_request: IntegrationEventV2Request - :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. - :type silent: str - :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. - :type dry: bool - :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. - :type force_complete_evaluation: bool + :param loyalty_program_id: The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_card_id: The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str + :param loyalty_card_registration: body (required) + :type loyalty_card_registration: LoyaltyCardRegistration :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8213,11 +9192,10 @@ def track_event_v2( :return: Returns the result object. """ # noqa: E501 - _param = self._track_event_v2_serialize( - integration_event_v2_request=integration_event_v2_request, - silent=silent, - dry=dry, - force_complete_evaluation=force_complete_evaluation, + _param = self._unlink_loyalty_card_from_profile_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_card_id=loyalty_card_id, + loyalty_card_registration=loyalty_card_registration, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8225,10 +9203,10 @@ def track_event_v2( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TrackEventV2Response", + '200': "LoyaltyCard", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -8242,12 +9220,11 @@ def track_event_v2( @validate_call - def track_event_v2_with_http_info( + def unlink_loyalty_card_from_profile_with_http_info( self, - integration_event_v2_request: Annotated[IntegrationEventV2Request, Field(description="body")], - silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, - dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, - force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], + loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8260,19 +9237,17 @@ def track_event_v2_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[TrackEventV2Response]: - """Track event + ) -> ApiResponse[LoyaltyCard]: + """Unlink customer profile from a loyalty card - Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing).

Important

1. `profileId` is required even though the schema does not specify it. 1. If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. 1. We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). 1. [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.
+ Unlink a customer profile from a [registered](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card) loyalty card. To get the `integrationId` of a customer profile, you can use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - :param integration_event_v2_request: body (required) - :type integration_event_v2_request: IntegrationEventV2Request - :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. - :type silent: str - :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. - :type dry: bool - :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. - :type force_complete_evaluation: bool + :param loyalty_program_id: The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_card_id: The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str + :param loyalty_card_registration: body (required) + :type loyalty_card_registration: LoyaltyCardRegistration :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8295,11 +9270,10 @@ def track_event_v2_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._track_event_v2_serialize( - integration_event_v2_request=integration_event_v2_request, - silent=silent, - dry=dry, - force_complete_evaluation=force_complete_evaluation, + _param = self._unlink_loyalty_card_from_profile_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_card_id=loyalty_card_id, + loyalty_card_registration=loyalty_card_registration, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8307,10 +9281,10 @@ def track_event_v2_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TrackEventV2Response", + '200': "LoyaltyCard", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -8324,12 +9298,11 @@ def track_event_v2_with_http_info( @validate_call - def track_event_v2_without_preload_content( + def unlink_loyalty_card_from_profile_without_preload_content( self, - integration_event_v2_request: Annotated[IntegrationEventV2Request, Field(description="body")], - silent: Annotated[Optional[StrictStr], Field(description="Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. ")] = None, - dry: Annotated[Optional[StrictBool], Field(description="Indicates whether to persist the changes. Changes are ignored when `dry=true`. ")] = None, - force_complete_evaluation: Annotated[Optional[StrictBool], Field(description="Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. ")] = None, + loyalty_program_id: Annotated[StrictInt, Field(description="The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_card_id: Annotated[str, Field(min_length=4, strict=True, max_length=108, description="The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. ")], + loyalty_card_registration: Annotated[LoyaltyCardRegistration, Field(description="body")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -8343,18 +9316,16 @@ def track_event_v2_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Track event + """Unlink customer profile from a loyalty card - Triggers a custom event. To use this endpoint: 1. Define a [custom event](https://docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the **Events** view in the Campaign Manager. Talon.One also offers a set of [built-in events](https://docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](https://docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing).

Important

1. `profileId` is required even though the schema does not specify it. 1. If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](https://docs.talon.one/docs/dev/concepts/entities/events) is **not** triggered. 1. We recommend sending requests sequentially. See [Managing parallel requests](https://docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). 1. [Archived campaigns](https://docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.
+ Unlink a customer profile from a [registered](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card) loyalty card. To get the `integrationId` of a customer profile, you can use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. - :param integration_event_v2_request: body (required) - :type integration_event_v2_request: IntegrationEventV2Request - :param silent: Possible values: `yes` or `no`. - `yes`: Increases the performance of the API call by returning a 204 response. - `no`: Returns a 200 response that contains the updated customer profiles. - :type silent: str - :param dry: Indicates whether to persist the changes. Changes are ignored when `dry=true`. - :type dry: bool - :param force_complete_evaluation: Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](https://docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires `dry=true`. - :type force_complete_evaluation: bool + :param loyalty_program_id: The identifier of the card-based loyalty program containing the loyalty card. You can get this ID using the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_card_id: The identifier of the loyalty card. You can get this ID using the [List loyalty cards](https://docs.talon.one/management-api#tag/Loyalty-cards/operation/getLoyaltyCards) endpoint. (required) + :type loyalty_card_id: str + :param loyalty_card_registration: body (required) + :type loyalty_card_registration: LoyaltyCardRegistration :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -8377,11 +9348,10 @@ def track_event_v2_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._track_event_v2_serialize( - integration_event_v2_request=integration_event_v2_request, - silent=silent, - dry=dry, - force_complete_evaluation=force_complete_evaluation, + _param = self._unlink_loyalty_card_from_profile_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_card_id=loyalty_card_id, + loyalty_card_registration=loyalty_card_registration, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8389,10 +9359,10 @@ def track_event_v2_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "TrackEventV2Response", + '200': "LoyaltyCard", '400': "ErrorResponseWithStatus", '401': "ErrorResponseWithStatus", - '409': "UpdateCustomerProfileV2409Response", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -8401,12 +9371,11 @@ def track_event_v2_without_preload_content( return response_data.response - def _track_event_v2_serialize( + def _unlink_loyalty_card_from_profile_serialize( self, - integration_event_v2_request, - silent, - dry, - force_complete_evaluation, + loyalty_program_id, + loyalty_card_id, + loyalty_card_registration, _request_auth, _content_type, _headers, @@ -8428,24 +9397,16 @@ def _track_event_v2_serialize( _body_params: Optional[bytes] = None # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + if loyalty_card_id is not None: + _path_params['loyaltyCardId'] = loyalty_card_id # process the query parameters - if silent is not None: - - _query_params.append(('silent', silent)) - - if dry is not None: - - _query_params.append(('dry', dry)) - - if force_complete_evaluation is not None: - - _query_params.append(('forceCompleteEvaluation', force_complete_evaluation)) - # process the header parameters # process the form parameters # process the body parameter - if integration_event_v2_request is not None: - _body_params = integration_event_v2_request + if loyalty_card_registration is not None: + _body_params = loyalty_card_registration # set the HTTP header `Accept` @@ -8477,7 +9438,7 @@ def _track_event_v2_serialize( return self.api_client.param_serialize( method='POST', - resource_path='/v2/events', + resource_path='/v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/unlink_profile', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/talon_one/api/management_api.py b/talon_one/api/management_api.py index bfda948..51f725c 100644 --- a/talon_one/api/management_api.py +++ b/talon_one/api/management_api.py @@ -50,6 +50,7 @@ from talon_one.models.deactivate_user_request import DeactivateUserRequest from talon_one.models.deduct_loyalty_points import DeductLoyaltyPoints from talon_one.models.delete_user_request import DeleteUserRequest +from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response from talon_one.models.get_access_logs_without_total_count200_response import GetAccessLogsWithoutTotalCount200Response from talon_one.models.get_additional_costs200_response import GetAdditionalCosts200Response from talon_one.models.get_application_customer_friends200_response import GetApplicationCustomerFriends200Response @@ -79,6 +80,7 @@ from talon_one.models.get_exports200_response import GetExports200Response from talon_one.models.get_loyalty_card_transaction_logs200_response import GetLoyaltyCardTransactionLogs200Response from talon_one.models.get_loyalty_cards200_response import GetLoyaltyCards200Response +from talon_one.models.get_loyalty_program_profile_transactions200_response import GetLoyaltyProgramProfileTransactions200Response from talon_one.models.get_loyalty_program_transactions200_response import GetLoyaltyProgramTransactions200Response from talon_one.models.get_loyalty_programs200_response import GetLoyaltyPrograms200Response from talon_one.models.get_referrals_without_total_count200_response import GetReferralsWithoutTotalCount200Response @@ -92,6 +94,7 @@ from talon_one.models.list_catalog_items200_response import ListCatalogItems200Response from talon_one.models.list_stores200_response import ListStores200Response from talon_one.models.login_params import LoginParams +from talon_one.models.loyalty_balances_with_tiers import LoyaltyBalancesWithTiers from talon_one.models.loyalty_card import LoyaltyCard from talon_one.models.loyalty_card_batch import LoyaltyCardBatch from talon_one.models.loyalty_card_batch_response import LoyaltyCardBatchResponse @@ -17105,6 +17108,322 @@ def _export_referrals_serialize( + @validate_call + def generate_coupon_rejections( + self, + session_integration_id: Annotated[StrictStr, Field(description="The integration ID of the session to summarize.")], + application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, + language: Annotated[Optional[StrictStr], Field(description="The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. ")] = None, + coupon_code: Annotated[Optional[StrictStr], Field(description="The coupon code for which to get the rejection reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GenerateCouponRejections200Response: + """Summarize coupon redemption failures in session + + Create a summary of the reasons for coupon redemption failures in a given customer session. + + :param session_integration_id: The integration ID of the session to summarize. (required) + :type session_integration_id: str + :param application_id: Filter results by Application ID. + :type application_id: float + :param language: The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. + :type language: str + :param coupon_code: The coupon code for which to get the rejection reason. + :type coupon_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_coupon_rejections_serialize( + session_integration_id=session_integration_id, + application_id=application_id, + language=language, + coupon_code=coupon_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GenerateCouponRejections200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def generate_coupon_rejections_with_http_info( + self, + session_integration_id: Annotated[StrictStr, Field(description="The integration ID of the session to summarize.")], + application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, + language: Annotated[Optional[StrictStr], Field(description="The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. ")] = None, + coupon_code: Annotated[Optional[StrictStr], Field(description="The coupon code for which to get the rejection reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GenerateCouponRejections200Response]: + """Summarize coupon redemption failures in session + + Create a summary of the reasons for coupon redemption failures in a given customer session. + + :param session_integration_id: The integration ID of the session to summarize. (required) + :type session_integration_id: str + :param application_id: Filter results by Application ID. + :type application_id: float + :param language: The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. + :type language: str + :param coupon_code: The coupon code for which to get the rejection reason. + :type coupon_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_coupon_rejections_serialize( + session_integration_id=session_integration_id, + application_id=application_id, + language=language, + coupon_code=coupon_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GenerateCouponRejections200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def generate_coupon_rejections_without_preload_content( + self, + session_integration_id: Annotated[StrictStr, Field(description="The integration ID of the session to summarize.")], + application_id: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter results by Application ID.")] = None, + language: Annotated[Optional[StrictStr], Field(description="The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. ")] = None, + coupon_code: Annotated[Optional[StrictStr], Field(description="The coupon code for which to get the rejection reason.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Summarize coupon redemption failures in session + + Create a summary of the reasons for coupon redemption failures in a given customer session. + + :param session_integration_id: The integration ID of the session to summarize. (required) + :type session_integration_id: str + :param application_id: Filter results by Application ID. + :type application_id: float + :param language: The [ISO-639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) code of the language in which the summary will be generated. + :type language: str + :param coupon_code: The coupon code for which to get the rejection reason. + :type coupon_code: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._generate_coupon_rejections_serialize( + session_integration_id=session_integration_id, + application_id=application_id, + language=language, + coupon_code=coupon_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GenerateCouponRejections200Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _generate_coupon_rejections_serialize( + self, + session_integration_id, + application_id, + language, + coupon_code, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if session_integration_id is not None: + + _query_params.append(('sessionIntegrationId', session_integration_id)) + + if application_id is not None: + + _query_params.append(('applicationId', application_id)) + + if language is not None: + + _query_params.append(('language', language)) + + if coupon_code is not None: + + _query_params.append(('couponCode', coupon_code)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'management_key', + 'manager_auth', + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/coupon_rejections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def get_access_logs_without_total_count( self, @@ -33095,10 +33414,14 @@ def _get_loyalty_cards_serialize( @validate_call - def get_loyalty_points( + def get_loyalty_ledger_balances( self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, + include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, + include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33111,15 +33434,23 @@ def get_loyalty_points( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LoyaltyLedger: - """Get customer's full loyalty ledger + ) -> LoyaltyBalancesWithTiers: + """Get customer's loyalty balances - Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str + :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. + :type subledger_id: str + :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. + :type include_tiers: bool + :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. + :type include_projected_tier: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33142,9 +33473,13 @@ def get_loyalty_points( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_points_serialize( + _param = self._get_loyalty_ledger_balances_serialize( loyalty_program_id=loyalty_program_id, integration_id=integration_id, + end_date=end_date, + subledger_id=subledger_id, + include_tiers=include_tiers, + include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33152,7 +33487,10 @@ def get_loyalty_points( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyLedger", + '200': "LoyaltyBalancesWithTiers", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -33166,10 +33504,14 @@ def get_loyalty_points( @validate_call - def get_loyalty_points_with_http_info( + def get_loyalty_ledger_balances_with_http_info( self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, + include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, + include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33182,15 +33524,23 @@ def get_loyalty_points_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LoyaltyLedger]: - """Get customer's full loyalty ledger + ) -> ApiResponse[LoyaltyBalancesWithTiers]: + """Get customer's loyalty balances - Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str + :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. + :type subledger_id: str + :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. + :type include_tiers: bool + :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. + :type include_projected_tier: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33213,9 +33563,13 @@ def get_loyalty_points_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_points_serialize( + _param = self._get_loyalty_ledger_balances_serialize( loyalty_program_id=loyalty_program_id, integration_id=integration_id, + end_date=end_date, + subledger_id=subledger_id, + include_tiers=include_tiers, + include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33223,7 +33577,10 @@ def get_loyalty_points_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyLedger", + '200': "LoyaltyBalancesWithTiers", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -33237,10 +33594,14 @@ def get_loyalty_points_with_http_info( @validate_call - def get_loyalty_points_without_preload_content( + def get_loyalty_ledger_balances_without_preload_content( self, - loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + end_date: Annotated[Optional[datetime], Field(description="Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, + include_tiers: Annotated[Optional[StrictBool], Field(description="Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. ")] = None, + include_projected_tier: Annotated[Optional[StrictBool], Field(description="Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33254,14 +33615,22 @@ def get_loyalty_points_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get customer's full loyalty ledger + """Get customer's loyalty balances - Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. **Note**: If no filtering options are applied, you retrieve all loyalty balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](https://docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data) - :param loyalty_program_id: The identifier for the loyalty program. (required) - :type loyalty_program_id: str + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) :type integration_id: str + :param end_date: Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. + :type subledger_id: str + :param include_tiers: Indicates whether tier information is included in the response. When set to `true`, the response includes information about the current tier and the number of points required to move to next tier. + :type include_tiers: bool + :param include_projected_tier: Indicates whether the customer's projected tier information is included in the response. When set to `true`, the response includes information about the customer's active points and the name of the projected tier. **Note** We recommend filtering by `subledgerId` for better performance. + :type include_projected_tier: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33284,9 +33653,13 @@ def get_loyalty_points_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_points_serialize( + _param = self._get_loyalty_ledger_balances_serialize( loyalty_program_id=loyalty_program_id, integration_id=integration_id, + end_date=end_date, + subledger_id=subledger_id, + include_tiers=include_tiers, + include_projected_tier=include_projected_tier, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33294,7 +33667,10 @@ def get_loyalty_points_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyLedger", + '200': "LoyaltyBalancesWithTiers", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", } response_data = self.api_client.call_api( *_param, @@ -33303,10 +33679,14 @@ def get_loyalty_points_without_preload_content( return response_data.response - def _get_loyalty_points_serialize( + def _get_loyalty_ledger_balances_serialize( self, loyalty_program_id, integration_id, + end_date, + subledger_id, + include_tiers, + include_projected_tier, _request_auth, _content_type, _headers, @@ -33333,6 +33713,31 @@ def _get_loyalty_points_serialize( if integration_id is not None: _path_params['integrationId'] = integration_id # process the query parameters + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if subledger_id is not None: + + _query_params.append(('subledgerId', subledger_id)) + + if include_tiers is not None: + + _query_params.append(('includeTiers', include_tiers)) + + if include_projected_tier is not None: + + _query_params.append(('includeProjectedTier', include_projected_tier)) + # process the header parameters # process the form parameters # process the body parameter @@ -33356,7 +33761,7 @@ def _get_loyalty_points_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_balances', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -33373,9 +33778,10 @@ def _get_loyalty_points_serialize( @validate_call - def get_loyalty_program( + def get_loyalty_points( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33388,13 +33794,15 @@ def get_loyalty_program( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> LoyaltyProgram: - """Get loyalty program + ) -> LoyaltyLedger: + """(Deprecated) Get customer's full loyalty ledger - Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) + Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int + :param loyalty_program_id: The identifier for the loyalty program. (required) + :type loyalty_program_id: str + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33416,9 +33824,11 @@ def get_loyalty_program( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} is deprecated.", DeprecationWarning) - _param = self._get_loyalty_program_serialize( + _param = self._get_loyalty_points_serialize( loyalty_program_id=loyalty_program_id, + integration_id=integration_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33426,7 +33836,7 @@ def get_loyalty_program( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyProgram", + '200': "LoyaltyLedger", } response_data = self.api_client.call_api( *_param, @@ -33440,9 +33850,10 @@ def get_loyalty_program( @validate_call - def get_loyalty_program_with_http_info( + def get_loyalty_points_with_http_info( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33455,13 +33866,15 @@ def get_loyalty_program_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[LoyaltyProgram]: - """Get loyalty program + ) -> ApiResponse[LoyaltyLedger]: + """(Deprecated) Get customer's full loyalty ledger - Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) + Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int + :param loyalty_program_id: The identifier for the loyalty program. (required) + :type loyalty_program_id: str + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33483,9 +33896,11 @@ def get_loyalty_program_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} is deprecated.", DeprecationWarning) - _param = self._get_loyalty_program_serialize( + _param = self._get_loyalty_points_serialize( loyalty_program_id=loyalty_program_id, + integration_id=integration_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33493,7 +33908,7 @@ def get_loyalty_program_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyProgram", + '200': "LoyaltyLedger", } response_data = self.api_client.call_api( *_param, @@ -33507,9 +33922,10 @@ def get_loyalty_program_with_http_info( @validate_call - def get_loyalty_program_without_preload_content( + def get_loyalty_points_without_preload_content( self, - loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_program_id: Annotated[StrictStr, Field(description="The identifier for the loyalty program.")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33523,12 +33939,14 @@ def get_loyalty_program_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get loyalty program + """(Deprecated) Get customer's full loyalty ledger - Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) + Get the loyalty ledger for this profile integration ID. To get the `integrationId` of the profile from a `sessionId`, use the [Update customer session](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). - :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) - :type loyalty_program_id: int + :param loyalty_program_id: The identifier for the loyalty program. (required) + :type loyalty_program_id: str + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33550,9 +33968,11 @@ def get_loyalty_program_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId} is deprecated.", DeprecationWarning) - _param = self._get_loyalty_program_serialize( + _param = self._get_loyalty_points_serialize( loyalty_program_id=loyalty_program_id, + integration_id=integration_id, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33560,7 +33980,7 @@ def get_loyalty_program_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "LoyaltyProgram", + '200': "LoyaltyLedger", } response_data = self.api_client.call_api( *_param, @@ -33569,9 +33989,10 @@ def get_loyalty_program_without_preload_content( return response_data.response - def _get_loyalty_program_serialize( + def _get_loyalty_points_serialize( self, loyalty_program_id, + integration_id, _request_auth, _content_type, _headers, @@ -33595,6 +34016,8 @@ def _get_loyalty_program_serialize( # process the path parameters if loyalty_program_id is not None: _path_params['loyaltyProgramId'] = loyalty_program_id + if integration_id is not None: + _path_params['integrationId'] = integration_id # process the query parameters # process the header parameters # process the form parameters @@ -33619,7 +34042,7 @@ def _get_loyalty_program_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/v1/loyalty_programs/{loyaltyProgramId}', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -33636,17 +34059,9 @@ def _get_loyalty_program_serialize( @validate_call - def get_loyalty_program_transactions( + def get_loyalty_program( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, - transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33659,29 +34074,13 @@ def get_loyalty_program_transactions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GetLoyaltyProgramTransactions200Response: - """List loyalty program transactions + ) -> LoyaltyProgram: + """Get loyalty program - Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. - :type customer_session_ids: List[str] - :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. - :type transaction_uuids: List[str] - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33704,16 +34103,8 @@ def get_loyalty_program_transactions( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_transactions_serialize( + _param = self._get_loyalty_program_serialize( loyalty_program_id=loyalty_program_id, - loyalty_transaction_type=loyalty_transaction_type, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33721,10 +34112,7 @@ def get_loyalty_program_transactions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramTransactions200Response", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '200': "LoyaltyProgram", } response_data = self.api_client.call_api( *_param, @@ -33738,17 +34126,9 @@ def get_loyalty_program_transactions( @validate_call - def get_loyalty_program_transactions_with_http_info( + def get_loyalty_program_with_http_info( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, - transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33761,29 +34141,13 @@ def get_loyalty_program_transactions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GetLoyaltyProgramTransactions200Response]: - """List loyalty program transactions + ) -> ApiResponse[LoyaltyProgram]: + """Get loyalty program - Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. - :type customer_session_ids: List[str] - :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. - :type transaction_uuids: List[str] - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33806,16 +34170,8 @@ def get_loyalty_program_transactions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_loyalty_program_transactions_serialize( + _param = self._get_loyalty_program_serialize( loyalty_program_id=loyalty_program_id, - loyalty_transaction_type=loyalty_transaction_type, - subledger_id=subledger_id, - customer_session_ids=customer_session_ids, - transaction_uuids=transaction_uuids, - start_date=start_date, - end_date=end_date, - page_size=page_size, - skip=skip, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33823,10 +34179,7 @@ def get_loyalty_program_transactions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GetLoyaltyProgramTransactions200Response", - '400': "ErrorResponseWithStatus", - '401': "ErrorResponseWithStatus", - '404': "ErrorResponseWithStatus", + '200': "LoyaltyProgram", } response_data = self.api_client.call_api( *_param, @@ -33840,17 +34193,9 @@ def get_loyalty_program_transactions_with_http_info( @validate_call - def get_loyalty_program_transactions_without_preload_content( + def get_loyalty_program_without_preload_content( self, loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], - loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, - subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, - customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, - transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, - start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, - page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, - skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -33864,28 +34209,734 @@ def get_loyalty_program_transactions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List loyalty program transactions + """Get loyalty program - Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + Get the specified [loyalty program](https://docs.talon.one/docs/product/loyalty-programs/overview). To list all loyalty programs in your Application, use [List loyalty programs](#operation/getLoyaltyPrograms). To list the loyalty programs that a customer profile is part of, use the [List customer data](https://docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) :type loyalty_program_id: int - :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. - :type loyalty_transaction_type: str - :param subledger_id: The ID of the subledger by which we filter the data. - :type subledger_id: str - :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. - :type customer_session_ids: List[str] - :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. - :type transaction_uuids: List[str] - :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type start_date: datetime - :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. - :type end_date: datetime - :param page_size: The number of items in the response. - :type page_size: int - :param skip: The number of items to skip when paging through large result sets. - :type skip: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loyalty_program_serialize( + loyalty_program_id=loyalty_program_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LoyaltyProgram", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_loyalty_program_serialize( + self, + loyalty_program_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'management_key', + 'manager_auth', + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_loyalty_program_profile_ledger_transactions( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetLoyaltyProgramProfileTransactions200Response: + """List customer's loyalty transactions + + Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. + :type subledger_id: str + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loyalty_program_profile_ledger_transactions_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + awaits_activation=awaits_activation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLoyaltyProgramProfileTransactions200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_loyalty_program_profile_ledger_transactions_with_http_info( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetLoyaltyProgramProfileTransactions200Response]: + """List customer's loyalty transactions + + Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. + :type subledger_id: str + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loyalty_program_profile_ledger_transactions_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + awaits_activation=awaits_activation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLoyaltyProgramProfileTransactions200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_loyalty_program_profile_ledger_transactions_without_preload_content( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + integration_id: Annotated[StrictStr, Field(description="The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. ")], + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger.")] = None, + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List customer's loyalty transactions + + Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date or by ledger (subledger or main ledger). If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. **Note:** To retrieve all loyalty program transaction logs in a given loyalty program, use the [List loyalty program transactions](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) endpoint. + + :param loyalty_program_id: Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param integration_id: The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier. (required) + :type integration_id: str + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param subledger_id: The ID of the subledger used to filter the data. Leave this value empty (\"\") to query the main ledger. + :type subledger_id: str + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loyalty_program_profile_ledger_transactions_serialize( + loyalty_program_id=loyalty_program_id, + integration_id=integration_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + subledger_id=subledger_id, + loyalty_transaction_type=loyalty_transaction_type, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + awaits_activation=awaits_activation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLoyaltyProgramProfileTransactions200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_loyalty_program_profile_ledger_transactions_serialize( + self, + loyalty_program_id, + integration_id, + customer_session_ids, + transaction_uuids, + subledger_id, + loyalty_transaction_type, + start_date, + end_date, + page_size, + skip, + awaits_activation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'customerSessionIDs': 'multi', + 'transactionUUIDs': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if loyalty_program_id is not None: + _path_params['loyaltyProgramId'] = loyalty_program_id + if integration_id is not None: + _path_params['integrationId'] = integration_id + # process the query parameters + if customer_session_ids is not None: + + _query_params.append(('customerSessionIDs', customer_session_ids)) + + if transaction_uuids is not None: + + _query_params.append(('transactionUUIDs', transaction_uuids)) + + if subledger_id is not None: + + _query_params.append(('subledgerId', subledger_id)) + + if loyalty_transaction_type is not None: + + _query_params.append(('loyaltyTransactionType', loyalty_transaction_type)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if page_size is not None: + + _query_params.append(('pageSize', page_size)) + + if skip is not None: + + _query_params.append(('skip', skip)) + + if awaits_activation is not None: + + _query_params.append(('awaitsActivation', awaits_activation)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'management_key', + 'manager_auth', + 'api_key_v1' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/ledger_transactions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_loyalty_program_transactions( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetLoyaltyProgramTransactions200Response: + """List loyalty program transactions + + Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + + :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loyalty_program_transactions_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_transaction_type=loyalty_transaction_type, + subledger_id=subledger_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + awaits_activation=awaits_activation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLoyaltyProgramTransactions200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_loyalty_program_transactions_with_http_info( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetLoyaltyProgramTransactions200Response]: + """List loyalty program transactions + + Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + + :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of @@ -33918,6 +34969,113 @@ def get_loyalty_program_transactions_without_preload_content( end_date=end_date, page_size=page_size, skip=skip, + awaits_activation=awaits_activation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetLoyaltyProgramTransactions200Response", + '400': "ErrorResponseWithStatus", + '401': "ErrorResponseWithStatus", + '404': "ErrorResponseWithStatus", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_loyalty_program_transactions_without_preload_content( + self, + loyalty_program_id: Annotated[StrictInt, Field(description="Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. ")], + loyalty_transaction_type: Annotated[Optional[StrictStr], Field(description="Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. ")] = None, + subledger_id: Annotated[Optional[StrictStr], Field(description="The ID of the subledger by which we filter the data.")] = None, + customer_session_ids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. ")] = None, + transaction_uuids: Annotated[Optional[List[StrictStr]], Field(description="Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. ")] = None, + start_date: Annotated[Optional[datetime], Field(description="Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + end_date: Annotated[Optional[datetime], Field(description="Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. ")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="The number of items in the response.")] = None, + skip: Annotated[Optional[StrictInt], Field(description="The number of items to skip when paging through large result sets.")] = None, + awaits_activation: Annotated[Optional[StrictBool], Field(description="If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List loyalty program transactions + + Retrieve loyalty program transaction logs in a given loyalty program with filtering options applied. Manual and imported transactions are also included. **Note:** If no filters are applied, the last 50 loyalty transactions for the given loyalty program are returned. **Important:** To get loyalty transaction logs for a given Integration ID in a loyalty program, we recommend using the Integration API's [Get customer's loyalty logs](https://docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions). + + :param loyalty_program_id: Identifier of the loyalty program. You can get the ID with the [List loyalty programs](https://docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint. (required) + :type loyalty_program_id: int + :param loyalty_transaction_type: Filter results by loyalty transaction type: - `manual`: Loyalty transaction that was done manually. - `session`: Loyalty transaction that resulted from a customer session. - `import`: Loyalty transaction that was imported from a CSV file. + :type loyalty_transaction_type: str + :param subledger_id: The ID of the subledger by which we filter the data. + :type subledger_id: str + :param customer_session_ids: Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, `?customerSessionIDs=id1&customerSessionIDs=id2`. The response contains only data associated with the specified sessions. + :type customer_session_ids: List[str] + :param transaction_uuids: Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, `?transactionUUIDs=uuid1&transactionUUIDs=uuid2`. The response contains only data associated with the specified transactions. + :type transaction_uuids: List[str] + :param start_date: Date and time from which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type start_date: datetime + :param end_date: Date and time by which results are returned. Results are filtered by transaction creation date. **Note:** - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, `T23:59:59` to specify the end of the day. The time zone setting considered is `UTC`. If you do not include a time component, a default time value of `T00:00:00` (midnight) in `UTC` is considered. + :type end_date: datetime + :param page_size: The number of items in the response. + :type page_size: int + :param skip: The number of items to skip when paging through large result sets. + :type skip: int + :param awaits_activation: If `true`: Filters results to include only point transactions that have action-based activation and have not expired. If `false`: Returns a `400` response. + :type awaits_activation: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_loyalty_program_transactions_serialize( + loyalty_program_id=loyalty_program_id, + loyalty_transaction_type=loyalty_transaction_type, + subledger_id=subledger_id, + customer_session_ids=customer_session_ids, + transaction_uuids=transaction_uuids, + start_date=start_date, + end_date=end_date, + page_size=page_size, + skip=skip, + awaits_activation=awaits_activation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -33948,6 +35106,7 @@ def _get_loyalty_program_transactions_serialize( end_date, page_size, skip, + awaits_activation, _request_auth, _content_type, _headers, @@ -34024,6 +35183,10 @@ def _get_loyalty_program_transactions_serialize( _query_params.append(('skip', skip)) + if awaits_activation is not None: + + _query_params.append(('awaitsActivation', awaits_activation)) + # process the header parameters # process the form parameters # process the body parameter diff --git a/talon_one/api_client.py b/talon_one/api_client.py index c09c287..af68d51 100644 --- a/talon_one/api_client.py +++ b/talon_one/api_client.py @@ -91,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/26.01/python' + self.user_agent = 'OpenAPI-Generator/26.02/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/talon_one/configuration.py b/talon_one/configuration.py index b030b18..2535140 100644 --- a/talon_one/configuration.py +++ b/talon_one/configuration.py @@ -556,7 +556,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: \n"\ - "SDK Package Version: 26.01".\ + "SDK Package Version: 26.02".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/talon_one/models/__init__.py b/talon_one/models/__init__.py index 232a80a..c6e6f43 100644 --- a/talon_one/models/__init__.py +++ b/talon_one/models/__init__.py @@ -97,7 +97,7 @@ from talon_one.models.best_prior_price import BestPriorPrice from talon_one.models.best_prior_price_metadata import BestPriorPriceMetadata from talon_one.models.best_prior_price_request import BestPriorPriceRequest -from talon_one.models.best_prior_price_request_target import BestPriorPriceRequestTarget +from talon_one.models.best_prior_target import BestPriorTarget from talon_one.models.binding import Binding from talon_one.models.bulk_application_notification import BulkApplicationNotification from talon_one.models.bulk_operation_on_campaigns import BulkOperationOnCampaigns @@ -156,9 +156,11 @@ from talon_one.models.card_ledger_transaction_log_entry import CardLedgerTransactionLogEntry from talon_one.models.card_ledger_transaction_log_entry_integration_api import CardLedgerTransactionLogEntryIntegrationAPI from talon_one.models.cart_item import CartItem +from talon_one.models.cart_item_filter_template import CartItemFilterTemplate from talon_one.models.catalog import Catalog from talon_one.models.catalog_action_filter import CatalogActionFilter from talon_one.models.catalog_item import CatalogItem +from talon_one.models.catalog_rule import CatalogRule from talon_one.models.catalog_sync_request import CatalogSyncRequest from talon_one.models.catalogs_strikethrough_notification_policy import CatalogsStrikethroughNotificationPolicy from talon_one.models.change import Change @@ -168,6 +170,7 @@ from talon_one.models.collection import Collection from talon_one.models.collection_item import CollectionItem from talon_one.models.collection_without_payload import CollectionWithoutPayload +from talon_one.models.collections_catalog import CollectionsCatalog from talon_one.models.coupon import Coupon from talon_one.models.coupon_constraints import CouponConstraints from talon_one.models.coupon_created_effect_props import CouponCreatedEffectProps @@ -178,7 +181,6 @@ from talon_one.models.coupon_failure_summary import CouponFailureSummary from talon_one.models.coupon_limit_configs import CouponLimitConfigs from talon_one.models.coupon_rejection_reason import CouponRejectionReason -from talon_one.models.coupon_rejections import CouponRejections from talon_one.models.coupon_reservations import CouponReservations from talon_one.models.coupon_search import CouponSearch from talon_one.models.coupon_value import CouponValue @@ -211,6 +213,7 @@ from talon_one.models.deduct_loyalty_points import DeductLoyaltyPoints from talon_one.models.deduct_loyalty_points_effect_props import DeductLoyaltyPointsEffectProps from talon_one.models.delete_coupons_data import DeleteCouponsData +from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest from talon_one.models.delete_user_request import DeleteUserRequest from talon_one.models.effect import Effect from talon_one.models.effect_entity import EffectEntity @@ -251,6 +254,7 @@ from talon_one.models.generate_campaign_tags import GenerateCampaignTags from talon_one.models.generate_coupon_failure_detailed_summary import GenerateCouponFailureDetailedSummary from talon_one.models.generate_coupon_failure_summary import GenerateCouponFailureSummary +from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response from talon_one.models.generate_item_filter_description import GenerateItemFilterDescription from talon_one.models.generate_loyalty_card import GenerateLoyaltyCard from talon_one.models.generate_rule_title import GenerateRuleTitle @@ -408,6 +412,7 @@ from talon_one.models.new_campaign_template import NewCampaignTemplate from talon_one.models.new_catalog import NewCatalog from talon_one.models.new_collection import NewCollection +from talon_one.models.new_collections_catalog import NewCollectionsCatalog from talon_one.models.new_coupon_creation_job import NewCouponCreationJob from talon_one.models.new_coupon_deletion_job import NewCouponDeletionJob from talon_one.models.new_coupons import NewCoupons @@ -557,7 +562,6 @@ from talon_one.models.scim_users_list_response import ScimUsersListResponse from talon_one.models.secondary_deployment import SecondaryDeployment from talon_one.models.session import Session -from talon_one.models.session_coupons import SessionCoupons from talon_one.models.set_discount_effect_props import SetDiscountEffectProps from talon_one.models.set_discount_per_additional_cost_effect_props import SetDiscountPerAdditionalCostEffectProps from talon_one.models.set_discount_per_additional_cost_per_item_effect_props import SetDiscountPerAdditionalCostPerItemEffectProps @@ -614,6 +618,7 @@ from talon_one.models.update_campaign_template import UpdateCampaignTemplate from talon_one.models.update_catalog import UpdateCatalog from talon_one.models.update_collection import UpdateCollection +from talon_one.models.update_collections_catalog import UpdateCollectionsCatalog from talon_one.models.update_coupon import UpdateCoupon from talon_one.models.update_coupon_batch import UpdateCouponBatch from talon_one.models.update_coupons_data import UpdateCouponsData @@ -635,7 +640,6 @@ from talon_one.models.value_map import ValueMap from talon_one.models.webhook import Webhook from talon_one.models.webhook_authentication import WebhookAuthentication -from talon_one.models.webhook_authentication_base import WebhookAuthenticationBase from talon_one.models.webhook_authentication_data_basic import WebhookAuthenticationDataBasic from talon_one.models.webhook_authentication_data_custom import WebhookAuthenticationDataCustom from talon_one.models.webhook_authentication_webhook_ref import WebhookAuthenticationWebhookRef diff --git a/talon_one/models/best_prior_price_request.py b/talon_one/models/best_prior_price_request.py index 21e50b0..0cd754c 100644 --- a/talon_one/models/best_prior_price_request.py +++ b/talon_one/models/best_prior_price_request.py @@ -21,7 +21,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from talon_one.models.best_prior_price_request_target import BestPriorPriceRequestTarget +from talon_one.models.best_prior_target import BestPriorTarget from typing import Optional, Set from typing_extensions import Self @@ -33,7 +33,7 @@ class BestPriorPriceRequest(BaseModel): timeframe_end_date: datetime = Field(description="The end date and time that defines the latest time for retrieving historical SKU prices.", alias="timeframeEndDate") timeframe: StrictStr = Field(description="The number of days prior to the timeframeEndDate. Only prices within this look back period are considered for the best prior price evaluation.") strict_end_date: StrictBool = Field(description="Indicates whether the timeframe includes the start of the current sale. - When `false`, the timeframe includes the start date of the current sale. - When `true`, the timeframe striclty uses the number of days specified in `timeframe`. ", alias="strictEndDate") - target: Optional[BestPriorPriceRequestTarget] = None + target: Optional[BestPriorTarget] = None __properties: ClassVar[List[str]] = ["skus", "timeframeEndDate", "timeframe", "strictEndDate", "target"] model_config = ConfigDict( @@ -94,7 +94,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "timeframeEndDate": obj.get("timeframeEndDate"), "timeframe": obj.get("timeframe"), "strictEndDate": obj.get("strictEndDate"), - "target": BestPriorPriceRequestTarget.from_dict(obj["target"]) if obj.get("target") is not None else None + "target": BestPriorTarget.from_dict(obj["target"]) if obj.get("target") is not None else None }) return _obj diff --git a/talon_one/models/best_prior_price_request_target.py b/talon_one/models/best_prior_target.py similarity index 94% rename from talon_one/models/best_prior_price_request_target.py rename to talon_one/models/best_prior_target.py index 8ee1c3a..ac3af71 100644 --- a/talon_one/models/best_prior_price_request_target.py +++ b/talon_one/models/best_prior_target.py @@ -22,7 +22,7 @@ from typing import Optional, Set from typing_extensions import Self -class BestPriorPriceRequestTarget(BaseModel): +class BestPriorTarget(BaseModel): """ Specifies the target for which the best prior price calculation is taken into consideration. """ # noqa: E501 @@ -55,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of BestPriorPriceRequestTarget from a JSON string""" + """Create an instance of BestPriorTarget from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -80,7 +80,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of BestPriorPriceRequestTarget from a dict""" + """Create an instance of BestPriorTarget from a dict""" if obj is None: return None diff --git a/talon_one/models/campaign_template_params.py b/talon_one/models/campaign_template_params.py index cd00e0e..aa5ec28 100644 --- a/talon_one/models/campaign_template_params.py +++ b/talon_one/models/campaign_template_params.py @@ -36,8 +36,8 @@ class CampaignTemplateParams(BaseModel): @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['string', 'number', 'boolean', 'percent', '(list string)', 'time']): - raise ValueError("must be one of enum values ('string', 'number', 'boolean', 'percent', '(list string)', 'time')") + if value not in set(['string', 'number', 'boolean', 'percent', '(list string)', '(list number)', 'time']): + raise ValueError("must be one of enum values ('string', 'number', 'boolean', 'percent', '(list string)', '(list number)', 'time')") return value model_config = ConfigDict( diff --git a/talon_one/models/card_ledger_points_entry_integration_api.py b/talon_one/models/card_ledger_points_entry_integration_api.py index 5a94073..cd494b0 100644 --- a/talon_one/models/card_ledger_points_entry_integration_api.py +++ b/talon_one/models/card_ledger_points_entry_integration_api.py @@ -39,7 +39,8 @@ class CardLedgerPointsEntryIntegrationAPI(BaseModel): expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. ", alias="expiryDate") subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added in the transaction.") - __properties: ClassVar[List[str]] = ["id", "transactionUUID", "created", "programId", "customerProfileID", "customerSessionId", "name", "startDate", "expiryDate", "subledgerId", "amount"] + validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration") + __properties: ClassVar[List[str]] = ["id", "transactionUUID", "created", "programId", "customerProfileID", "customerSessionId", "name", "startDate", "expiryDate", "subledgerId", "amount", "validityDuration"] model_config = ConfigDict( populate_by_name=True, @@ -102,7 +103,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "startDate": obj.get("startDate"), "expiryDate": obj.get("expiryDate"), "subledgerId": obj.get("subledgerId"), - "amount": obj.get("amount") + "amount": obj.get("amount"), + "validityDuration": obj.get("validityDuration") }) return _obj diff --git a/talon_one/models/card_ledger_transaction_log_entry_integration_api.py b/talon_one/models/card_ledger_transaction_log_entry_integration_api.py index c7a9e43..38dd002 100644 --- a/talon_one/models/card_ledger_transaction_log_entry_integration_api.py +++ b/talon_one/models/card_ledger_transaction_log_entry_integration_api.py @@ -42,7 +42,8 @@ class CardLedgerTransactionLogEntryIntegrationAPI(BaseModel): id: StrictInt = Field(description="ID of the loyalty ledger transaction.") ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId") rule_name: Optional[StrictStr] = Field(default=None, description="The name of the rule that triggered this effect.", alias="ruleName") - __properties: ClassVar[List[str]] = ["transactionUUID", "created", "programId", "cardIdentifier", "customerSessionId", "type", "name", "startDate", "expiryDate", "subledgerId", "amount", "id", "rulesetId", "ruleName"] + validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration") + __properties: ClassVar[List[str]] = ["transactionUUID", "created", "programId", "cardIdentifier", "customerSessionId", "type", "name", "startDate", "expiryDate", "subledgerId", "amount", "id", "rulesetId", "ruleName", "validityDuration"] @field_validator('card_identifier') def card_identifier_validate_regular_expression(cls, value): @@ -122,7 +123,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "amount": obj.get("amount"), "id": obj.get("id"), "rulesetId": obj.get("rulesetId"), - "ruleName": obj.get("ruleName") + "ruleName": obj.get("ruleName"), + "validityDuration": obj.get("validityDuration") }) return _obj diff --git a/talon_one/models/session_coupons.py b/talon_one/models/cart_item_filter_template.py similarity index 78% rename from talon_one/models/session_coupons.py rename to talon_one/models/cart_item_filter_template.py index 34339ea..b2c0888 100644 --- a/talon_one/models/session_coupons.py +++ b/talon_one/models/cart_item_filter_template.py @@ -18,17 +18,17 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self -class SessionCoupons(BaseModel): +class CartItemFilterTemplate(BaseModel): """ - SessionCoupons + A cart item filter template stored in a library entry. Cart item filters in library entries only contain name (no description, as description is at the library entry level). """ # noqa: E501 - session_integration_id: StrictStr = Field(description="The integration ID of the session in which the coupons were applied.", alias="sessionIntegrationId") - coupon_code: Optional[StrictStr] = Field(default=None, description="The coupon codes for which rejection reason is needed.", alias="couponCode") - __properties: ClassVar[List[str]] = ["sessionIntegrationId", "couponCode"] + name: StrictStr = Field(description="The name of the Application cart item filter.") + expression: List[Any] = Field(description="The Talang expression for the cart item filter.") + __properties: ClassVar[List[str]] = ["name", "expression"] model_config = ConfigDict( populate_by_name=True, @@ -48,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of SessionCoupons from a JSON string""" + """Create an instance of CartItemFilterTemplate from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -73,7 +73,7 @@ def to_dict(self) -> Dict[str, Any]: @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of SessionCoupons from a dict""" + """Create an instance of CartItemFilterTemplate from a dict""" if obj is None: return None @@ -81,8 +81,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "sessionIntegrationId": obj.get("sessionIntegrationId"), - "couponCode": obj.get("couponCode") + "name": obj.get("name"), + "expression": obj.get("expression") }) return _obj diff --git a/talon_one/models/catalog_rule.py b/talon_one/models/catalog_rule.py new file mode 100644 index 0000000..eb32955 --- /dev/null +++ b/talon_one/models/catalog_rule.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from talon_one.models.binding import Binding +from typing import Optional, Set +from typing_extensions import Self + +class CatalogRule(BaseModel): + """ + A rule template stored in a catalog entry. Rules in catalog entries only contain title (no description, as description is at the catalog entry level). + """ # noqa: E501 + title: StrictStr = Field(description="A short description of the rule.") + bindings: Optional[List[Binding]] = Field(default=None, description="An array that provides objects with variable names (name) and talang expressions to whose result they are bound (expression) during rule evaluation. The order of the evaluation is decided by the position in the array.") + condition: Annotated[List[Any], Field(min_length=1)] = Field(description="A Talang expression that will be evaluated in the context of the given event.") + effects: List[Dict[str, Any]] = Field(description="An array of effectful Talang expressions in arrays that will be evaluated when a rule matches.") + __properties: ClassVar[List[str]] = ["title", "bindings", "condition", "effects"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CatalogRule from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in bindings (list) + _items = [] + if self.bindings: + for _item_bindings in self.bindings: + if _item_bindings: + _items.append(_item_bindings.to_dict()) + _dict['bindings'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CatalogRule from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "bindings": [Binding.from_dict(_item) for _item in obj["bindings"]] if obj.get("bindings") is not None else None, + "condition": obj.get("condition"), + "effects": obj.get("effects") + }) + return _obj + + diff --git a/talon_one/models/collections_catalog.py b/talon_one/models/collections_catalog.py new file mode 100644 index 0000000..89bdbbb --- /dev/null +++ b/talon_one/models/collections_catalog.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.cart_item_filter_template import CartItemFilterTemplate +from talon_one.models.catalog_rule import CatalogRule +from typing import Optional, Set +from typing_extensions import Self + +class CollectionsCatalog(BaseModel): + """ + CollectionsCatalog + """ # noqa: E501 + id: StrictInt = Field(description="The internal ID of this collection.") + account_id: StrictInt = Field(description="The ID of the account that owns this collection.", alias="accountId") + application_id: StrictInt = Field(description="The ID of the Application that owns this collection.", alias="applicationId") + title: StrictStr = Field(description="A short description of the collection catalog.") + description: Optional[StrictStr] = Field(default=None, description="A longer, more detailed description of the collection catalog.") + category: StrictStr = Field(description="Category used to group collection catalogs.") + source: StrictStr = Field(description="Indicates whether the collection is custom or shipped by Talon.One.") + rules: List[CatalogRule] = Field(description="Array of rule templates in this collection catalog. Rules only contain title (no description, as description is at the collection catalog level).") + cart_item_filters: List[CartItemFilterTemplate] = Field(description="Array of cart item filter templates in this collection catalog. Cart item filters only contain name (no description, as description is at the collection catalog level).", alias="cartItemFilters") + created: datetime = Field(description="Timestamp when the collection was created.") + created_by: StrictInt = Field(description="ID of the user who created the collection.", alias="createdBy") + modified: Optional[datetime] = Field(default=None, description="Timestamp when the collection was last updated.") + modified_by: Optional[StrictInt] = Field(default=None, description="ID of the user who last updated the collection.", alias="modifiedBy") + __properties: ClassVar[List[str]] = ["id", "accountId", "applicationId", "title", "description", "category", "source", "rules", "cartItemFilters", "created", "createdBy", "modified", "modifiedBy"] + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['promotions', 'pricing', 'loyalty', 'custom']): + raise ValueError("must be one of enum values ('promotions', 'pricing', 'loyalty', 'custom')") + return value + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['custom', 'default']): + raise ValueError("must be one of enum values ('custom', 'default')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CollectionsCatalog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item_rules in self.rules: + if _item_rules: + _items.append(_item_rules.to_dict()) + _dict['rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in cart_item_filters (list) + _items = [] + if self.cart_item_filters: + for _item_cart_item_filters in self.cart_item_filters: + if _item_cart_item_filters: + _items.append(_item_cart_item_filters.to_dict()) + _dict['cartItemFilters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionsCatalog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "accountId": obj.get("accountId"), + "applicationId": obj.get("applicationId"), + "title": obj.get("title"), + "description": obj.get("description"), + "category": obj.get("category"), + "source": obj.get("source"), + "rules": [CatalogRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + "cartItemFilters": [CartItemFilterTemplate.from_dict(_item) for _item in obj["cartItemFilters"]] if obj.get("cartItemFilters") is not None else None, + "created": obj.get("created"), + "createdBy": obj.get("createdBy"), + "modified": obj.get("modified"), + "modifiedBy": obj.get("modifiedBy") + }) + return _obj + + diff --git a/talon_one/models/coupon_failure_summary.py b/talon_one/models/coupon_failure_summary.py index 1e30e15..60e777c 100644 --- a/talon_one/models/coupon_failure_summary.py +++ b/talon_one/models/coupon_failure_summary.py @@ -34,11 +34,10 @@ class CouponFailureSummary(BaseModel): status: StrictStr = Field(description="Status defines if the coupon code was applied or rejected.") coupon_code: StrictStr = Field(description="Coupon code passed for evaluation.", alias="couponCode") language: StrictStr = Field(description="Language of the summary.") - short_summary: StrictStr = Field(description="A summary of the reasons for coupon redemption failure.", alias="shortSummary") - long_summary: StrictStr = Field(description="A detailed summary of the reasons for coupon redemption failure based on events of the entire session.", alias="longSummary") + summary: StrictStr = Field(description="A summary of the reasons for coupon redemption failure.") created_at: datetime = Field(description="Timestamp when the request was made.", alias="createdAt") updated_at: datetime = Field(description="Timestamp when the request was last updated.", alias="updatedAt") - __properties: ClassVar[List[str]] = ["id", "eventID", "sessionID", "profileID", "status", "couponCode", "language", "shortSummary", "longSummary", "createdAt", "updatedAt"] + __properties: ClassVar[List[str]] = ["id", "eventID", "sessionID", "profileID", "status", "couponCode", "language", "summary", "createdAt", "updatedAt"] model_config = ConfigDict( populate_by_name=True, @@ -98,8 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "status": obj.get("status"), "couponCode": obj.get("couponCode"), "language": obj.get("language"), - "shortSummary": obj.get("shortSummary"), - "longSummary": obj.get("longSummary"), + "summary": obj.get("summary"), "createdAt": obj.get("createdAt"), "updatedAt": obj.get("updatedAt") }) diff --git a/talon_one/models/coupon_rejections.py b/talon_one/models/delete_loyalty_transactions_request.py similarity index 62% rename from talon_one/models/coupon_rejections.py rename to talon_one/models/delete_loyalty_transactions_request.py index 76a4538..a06726c 100644 --- a/talon_one/models/coupon_rejections.py +++ b/talon_one/models/delete_loyalty_transactions_request.py @@ -17,20 +17,25 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional -from talon_one.models.session_coupons import SessionCoupons from typing import Optional, Set from typing_extensions import Self -class CouponRejections(BaseModel): +class DeleteLoyaltyTransactionsRequest(BaseModel): """ - CouponRejections + Request to delete transactions based on the specified scope. """ # noqa: E501 - session_details: List[SessionCoupons] = Field(description="Array containing details from session like session id and optional coupon code used in the session. Only the first 15 entries will be processed.", alias="sessionDetails") - application_id: StrictInt = Field(description="The application ID for which the coupon was used.", alias="applicationId") - language: Optional[StrictStr] = Field(default=None, description="The language the summary will be generated in.") - __properties: ClassVar[List[str]] = ["sessionDetails", "applicationId", "language"] + scope: StrictStr = Field(description="`AllSubledgers` deletes all transactions for the specified customer profile from all ledgers in the loyalty program. `SelectedSubledgers` deletes all transactions for the specified customer profile only from the given ledgers in the loyalty program. ") + subledger_ids: Optional[List[StrictStr]] = Field(default=None, description="The IDs of the ledgers from which to delete the customer's transactions. This parameter is required if the `scope` is set to `SelectedSubledgers`. To specify the main ledger, provide an empty string (\"\"). ", alias="subledgerIds") + __properties: ClassVar[List[str]] = ["scope", "subledgerIds"] + + @field_validator('scope') + def scope_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['AllSubledgers', 'SelectedSubledgers']): + raise ValueError("must be one of enum values ('AllSubledgers', 'SelectedSubledgers')") + return value model_config = ConfigDict( populate_by_name=True, @@ -50,7 +55,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of CouponRejections from a JSON string""" + """Create an instance of DeleteLoyaltyTransactionsRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -71,18 +76,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of each item in session_details (list) - _items = [] - if self.session_details: - for _item_session_details in self.session_details: - if _item_session_details: - _items.append(_item_session_details.to_dict()) - _dict['sessionDetails'] = _items + # set to None if subledger_ids (nullable) is None + # and model_fields_set contains the field + if self.subledger_ids is None and "subledger_ids" in self.model_fields_set: + _dict['subledgerIds'] = None + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of CouponRejections from a dict""" + """Create an instance of DeleteLoyaltyTransactionsRequest from a dict""" if obj is None: return None @@ -90,9 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "sessionDetails": [SessionCoupons.from_dict(_item) for _item in obj["sessionDetails"]] if obj.get("sessionDetails") is not None else None, - "applicationId": obj.get("applicationId"), - "language": obj.get("language") + "scope": obj.get("scope"), + "subledgerIds": obj.get("subledgerIds") }) return _obj diff --git a/talon_one/models/webhook_authentication_base.py b/talon_one/models/generate_coupon_rejections200_response.py similarity index 70% rename from talon_one/models/webhook_authentication_base.py rename to talon_one/models/generate_coupon_rejections200_response.py index fe784a4..2871203 100644 --- a/talon_one/models/webhook_authentication_base.py +++ b/talon_one/models/generate_coupon_rejections200_response.py @@ -17,26 +17,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from talon_one.models.coupon_failure_summary import CouponFailureSummary from typing import Optional, Set from typing_extensions import Self -class WebhookAuthenticationBase(BaseModel): +class GenerateCouponRejections200Response(BaseModel): """ - WebhookAuthenticationBase + GenerateCouponRejections200Response """ # noqa: E501 - name: StrictStr = Field(description="The name of the webhook authentication.") - type: StrictStr - data: Optional[Any] - __properties: ClassVar[List[str]] = ["name", "type", "data"] - - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value not in set(['basic', 'custom']): - raise ValueError("must be one of enum values ('basic', 'custom')") - return value + data: List[CouponFailureSummary] + __properties: ClassVar[List[str]] = ["data"] model_config = ConfigDict( populate_by_name=True, @@ -56,7 +48,7 @@ def to_json(self) -> str: @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of WebhookAuthenticationBase from a JSON string""" + """Create an instance of GenerateCouponRejections200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,16 +69,18 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if data (nullable) is None - # and model_fields_set contains the field - if self.data is None and "data" in self.model_fields_set: - _dict['data'] = None - + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of WebhookAuthenticationBase from a dict""" + """Create an instance of GenerateCouponRejections200Response from a dict""" if obj is None: return None @@ -94,9 +88,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "name": obj.get("name"), - "type": obj.get("type"), - "data": obj.get("data") + "data": [CouponFailureSummary.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None }) return _obj diff --git a/talon_one/models/ledger_points_entry_integration_api.py b/talon_one/models/ledger_points_entry_integration_api.py index 3c6992a..0876c9f 100644 --- a/talon_one/models/ledger_points_entry_integration_api.py +++ b/talon_one/models/ledger_points_entry_integration_api.py @@ -38,7 +38,8 @@ class LedgerPointsEntryIntegrationAPI(BaseModel): expiry_date: StrictStr = Field(description="Date when points expire. Possible values are: - `unlimited`: Points have no expiration date. - `timestamp value`: Points expire on the given date and time. ", alias="expiryDate") subledger_id: Annotated[str, Field(strict=True, max_length=64)] = Field(description="ID of the subledger.", alias="subledgerId") amount: Union[StrictFloat, StrictInt] = Field(description="Amount of loyalty points added in the transaction.") - __properties: ClassVar[List[str]] = ["id", "transactionUUID", "created", "programId", "customerSessionId", "name", "startDate", "expiryDate", "subledgerId", "amount"] + validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration") + __properties: ClassVar[List[str]] = ["id", "transactionUUID", "created", "programId", "customerSessionId", "name", "startDate", "expiryDate", "subledgerId", "amount", "validityDuration"] model_config = ConfigDict( populate_by_name=True, @@ -100,7 +101,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "startDate": obj.get("startDate"), "expiryDate": obj.get("expiryDate"), "subledgerId": obj.get("subledgerId"), - "amount": obj.get("amount") + "amount": obj.get("amount"), + "validityDuration": obj.get("validityDuration") }) return _obj diff --git a/talon_one/models/ledger_transaction_log_entry_integration_api.py b/talon_one/models/ledger_transaction_log_entry_integration_api.py index bbec7df..75519df 100644 --- a/talon_one/models/ledger_transaction_log_entry_integration_api.py +++ b/talon_one/models/ledger_transaction_log_entry_integration_api.py @@ -43,7 +43,8 @@ class LedgerTransactionLogEntryIntegrationAPI(BaseModel): ruleset_id: Optional[StrictInt] = Field(default=None, description="The ID of the ruleset containing the rule that triggered this effect.", alias="rulesetId") rule_name: Optional[StrictStr] = Field(default=None, description="The name of the rule that triggered this effect.", alias="ruleName") flags: Optional[LoyaltyLedgerEntryFlags] = Field(default=None, description="The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance.") - __properties: ClassVar[List[str]] = ["transactionUUID", "created", "programId", "customerSessionId", "type", "name", "startDate", "expiryDate", "subledgerId", "amount", "id", "rulesetId", "ruleName", "flags"] + validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration") + __properties: ClassVar[List[str]] = ["transactionUUID", "created", "programId", "customerSessionId", "type", "name", "startDate", "expiryDate", "subledgerId", "amount", "id", "rulesetId", "ruleName", "flags", "validityDuration"] @field_validator('type') def type_validate_enum(cls, value): @@ -119,7 +120,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "rulesetId": obj.get("rulesetId"), "ruleName": obj.get("ruleName"), - "flags": LoyaltyLedgerEntryFlags.from_dict(obj["flags"]) if obj.get("flags") is not None else None + "flags": LoyaltyLedgerEntryFlags.from_dict(obj["flags"]) if obj.get("flags") is not None else None, + "validityDuration": obj.get("validityDuration") }) return _obj diff --git a/talon_one/models/loyalty_ledger_entry.py b/talon_one/models/loyalty_ledger_entry.py index c91781a..3c9ea81 100644 --- a/talon_one/models/loyalty_ledger_entry.py +++ b/talon_one/models/loyalty_ledger_entry.py @@ -43,7 +43,8 @@ class LoyaltyLedgerEntry(BaseModel): user_id: Optional[StrictInt] = Field(default=None, description="This is the ID of the user who created this entry, if the addition or subtraction was done manually.", alias="userID") archived: Optional[StrictBool] = Field(default=None, description="Indicates if the entry belongs to the archived session.") flags: Optional[LoyaltyLedgerEntryFlags] = Field(default=None, description="A map of flags providing additional details about the entry.") - __properties: ClassVar[List[str]] = ["created", "programID", "customerProfileID", "cardID", "customerSessionID", "eventID", "type", "amount", "startDate", "expiryDate", "name", "subLedgerID", "userID", "archived", "flags"] + validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration") + __properties: ClassVar[List[str]] = ["created", "programID", "customerProfileID", "cardID", "customerSessionID", "eventID", "type", "amount", "startDate", "expiryDate", "name", "subLedgerID", "userID", "archived", "flags", "validityDuration"] model_config = ConfigDict( populate_by_name=True, @@ -113,7 +114,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "subLedgerID": obj.get("subLedgerID"), "userID": obj.get("userID"), "archived": obj.get("archived"), - "flags": LoyaltyLedgerEntryFlags.from_dict(obj["flags"]) if obj.get("flags") is not None else None + "flags": LoyaltyLedgerEntryFlags.from_dict(obj["flags"]) if obj.get("flags") is not None else None, + "validityDuration": obj.get("validityDuration") }) return _obj diff --git a/talon_one/models/loyalty_program_transaction.py b/talon_one/models/loyalty_program_transaction.py index a5bf4cc..28b0ec9 100644 --- a/talon_one/models/loyalty_program_transaction.py +++ b/talon_one/models/loyalty_program_transaction.py @@ -49,7 +49,8 @@ class LoyaltyProgramTransaction(BaseModel): ruleset_id: Optional[StrictInt] = Field(default=None, description="ID of the ruleset containing the rule that triggered the effect. Applies only for transactions that resulted from a customer session.", alias="rulesetId") rule_name: Optional[StrictStr] = Field(default=None, description="Name of the rule that triggered the effect. Applies only for transactions that resulted from a customer session.", alias="ruleName") flags: Optional[LoyaltyLedgerEntryFlags] = Field(default=None, description="The flags of the transaction, when applicable. The `createsNegativeBalance` flag indicates whether the transaction results in a negative balance.") - __properties: ClassVar[List[str]] = ["id", "transactionUUID", "programId", "campaignId", "created", "type", "amount", "name", "startDate", "expiryDate", "customerProfileId", "cardIdentifier", "subledgerId", "customerSessionId", "importId", "userId", "userEmail", "rulesetId", "ruleName", "flags"] + validity_duration: Optional[StrictStr] = Field(default=None, description="The duration for which the points remain active, relative to the activation date. **Note**: This only applies to points for which `awaitsActivation` is `true` and `expiryDate` is not set. ", alias="validityDuration") + __properties: ClassVar[List[str]] = ["id", "transactionUUID", "programId", "campaignId", "created", "type", "amount", "name", "startDate", "expiryDate", "customerProfileId", "cardIdentifier", "subledgerId", "customerSessionId", "importId", "userId", "userEmail", "rulesetId", "ruleName", "flags", "validityDuration"] @field_validator('type') def type_validate_enum(cls, value): @@ -141,7 +142,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "userEmail": obj.get("userEmail"), "rulesetId": obj.get("rulesetId"), "ruleName": obj.get("ruleName"), - "flags": LoyaltyLedgerEntryFlags.from_dict(obj["flags"]) if obj.get("flags") is not None else None + "flags": LoyaltyLedgerEntryFlags.from_dict(obj["flags"]) if obj.get("flags") is not None else None, + "validityDuration": obj.get("validityDuration") }) return _obj diff --git a/talon_one/models/new_collections_catalog.py b/talon_one/models/new_collections_catalog.py new file mode 100644 index 0000000..740ee27 --- /dev/null +++ b/talon_one/models/new_collections_catalog.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.cart_item_filter_template import CartItemFilterTemplate +from talon_one.models.catalog_rule import CatalogRule +from typing import Optional, Set +from typing_extensions import Self + +class NewCollectionsCatalog(BaseModel): + """ + NewCollectionsCatalog + """ # noqa: E501 + title: StrictStr = Field(description="The display name for the collection catalog.") + description: Optional[StrictStr] = Field(default=None, description="A longer, more detailed description of the collection catalog.") + category: Optional[StrictStr] = Field(default='custom', description="Category used to group collection catalogs.") + rules: Optional[List[CatalogRule]] = Field(default=None, description="Array of rules to store in this collection catalog. Rules should only contain title (no description, as description is at the collection catalog level). At least one rule or cart item filter is required.") + cart_item_filters: Optional[List[CartItemFilterTemplate]] = Field(default=None, description="Array of cart item filters to store in this collection catalog. If not provided, will be extracted from the rules. Cart item filters should only contain name (no description, as description is at the collection catalog level).", alias="cartItemFilters") + __properties: ClassVar[List[str]] = ["title", "description", "category", "rules", "cartItemFilters"] + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['promotions', 'pricing', 'loyalty', 'custom']): + raise ValueError("must be one of enum values ('promotions', 'pricing', 'loyalty', 'custom')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NewCollectionsCatalog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item_rules in self.rules: + if _item_rules: + _items.append(_item_rules.to_dict()) + _dict['rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in cart_item_filters (list) + _items = [] + if self.cart_item_filters: + for _item_cart_item_filters in self.cart_item_filters: + if _item_cart_item_filters: + _items.append(_item_cart_item_filters.to_dict()) + _dict['cartItemFilters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NewCollectionsCatalog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "description": obj.get("description"), + "category": obj.get("category") if obj.get("category") is not None else 'custom', + "rules": [CatalogRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + "cartItemFilters": [CartItemFilterTemplate.from_dict(_item) for _item in obj["cartItemFilters"]] if obj.get("cartItemFilters") is not None else None + }) + return _obj + + diff --git a/talon_one/models/prismatic_event_payload_coupon_based_notifications.py b/talon_one/models/prismatic_event_payload_coupon_based_notifications.py index 1521387..d982c54 100644 --- a/talon_one/models/prismatic_event_payload_coupon_based_notifications.py +++ b/talon_one/models/prismatic_event_payload_coupon_based_notifications.py @@ -46,7 +46,9 @@ class PrismaticEventPayloadCouponBasedNotifications(BaseModel): batch_id: Optional[StrictStr] = Field(default=None, alias="BatchId") attributes: Optional[Dict[str, Any]] = Field(default=None, alias="Attributes") limits: Optional[List[PrismaticEventPayloadCouponBasedNotificationsLimits]] = Field(default=None, alias="Limits") - __properties: ClassVar[List[str]] = ["Id", "Created", "CampaignId", "Value", "UsageLimit", "DiscountLimit", "ReservationLimit", "StartDate", "ExpiryDate", "UsageCounter", "DiscountCounter", "DiscountRemainder", "ReferralId", "RecipientIntegrationId", "ImportId", "BatchId", "Attributes", "Limits"] + source_of_event: StrictStr = Field(alias="SourceOfEvent") + employee_name: StrictStr = Field(alias="EmployeeName") + __properties: ClassVar[List[str]] = ["Id", "Created", "CampaignId", "Value", "UsageLimit", "DiscountLimit", "ReservationLimit", "StartDate", "ExpiryDate", "UsageCounter", "DiscountCounter", "DiscountRemainder", "ReferralId", "RecipientIntegrationId", "ImportId", "BatchId", "Attributes", "Limits", "SourceOfEvent", "EmployeeName"] model_config = ConfigDict( populate_by_name=True, @@ -123,7 +125,9 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "ImportId": obj.get("ImportId"), "BatchId": obj.get("BatchId"), "Attributes": obj.get("Attributes"), - "Limits": [PrismaticEventPayloadCouponBasedNotificationsLimits.from_dict(_item) for _item in obj["Limits"]] if obj.get("Limits") is not None else None + "Limits": [PrismaticEventPayloadCouponBasedNotificationsLimits.from_dict(_item) for _item in obj["Limits"]] if obj.get("Limits") is not None else None, + "SourceOfEvent": obj.get("SourceOfEvent"), + "EmployeeName": obj.get("EmployeeName") }) return _obj diff --git a/talon_one/models/update_collections_catalog.py b/talon_one/models/update_collections_catalog.py new file mode 100644 index 0000000..d958449 --- /dev/null +++ b/talon_one/models/update_collections_catalog.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from talon_one.models.cart_item_filter_template import CartItemFilterTemplate +from talon_one.models.catalog_rule import CatalogRule +from typing import Optional, Set +from typing_extensions import Self + +class UpdateCollectionsCatalog(BaseModel): + """ + UpdateCollectionsCatalog + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The display name for the collection catalog.") + description: Optional[StrictStr] = Field(default=None, description="A longer, more detailed description of the collection catalog.") + category: Optional[StrictStr] = Field(default=None, description="Category used to group collection catalogs.") + rules: Optional[List[CatalogRule]] = Field(default=None, description="Replaces the stored rules. Rules should only contain title (no description, as description is at the collection catalog level).") + cart_item_filters: Optional[List[CartItemFilterTemplate]] = Field(default=None, description="Replaces the stored cart item filters. Cart item filters should only contain name (no description, as description is at the collection catalog level).", alias="cartItemFilters") + __properties: ClassVar[List[str]] = ["title", "description", "category", "rules", "cartItemFilters"] + + @field_validator('category') + def category_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['promotions', 'pricing', 'loyalty', 'custom']): + raise ValueError("must be one of enum values ('promotions', 'pricing', 'loyalty', 'custom')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UpdateCollectionsCatalog from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rules (list) + _items = [] + if self.rules: + for _item_rules in self.rules: + if _item_rules: + _items.append(_item_rules.to_dict()) + _dict['rules'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in cart_item_filters (list) + _items = [] + if self.cart_item_filters: + for _item_cart_item_filters in self.cart_item_filters: + if _item_cart_item_filters: + _items.append(_item_cart_item_filters.to_dict()) + _dict['cartItemFilters'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UpdateCollectionsCatalog from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "description": obj.get("description"), + "category": obj.get("category"), + "rules": [CatalogRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None, + "cartItemFilters": [CartItemFilterTemplate.from_dict(_item) for _item in obj["cartItemFilters"]] if obj.get("cartItemFilters") is not None else None + }) + return _obj + + diff --git a/talon_one/models/webhook_authentication.py b/talon_one/models/webhook_authentication.py index 564565f..e77862e 100644 --- a/talon_one/models/webhook_authentication.py +++ b/talon_one/models/webhook_authentication.py @@ -28,16 +28,16 @@ class WebhookAuthentication(BaseModel): """ WebhookAuthentication """ # noqa: E501 - name: StrictStr = Field(description="The name of the webhook authentication.") - type: StrictStr - data: Optional[Any] id: StrictInt = Field(description="The internal ID of this entity.") created: datetime = Field(description="The time this entity was created.") modified: datetime = Field(description="The time this entity was last modified.") created_by: StrictStr = Field(description="The name of the user who created the webhook authentication.", alias="createdBy") modified_by: StrictStr = Field(description="The name of the user who last modified the webhook authentication.", alias="modifiedBy") webhooks: List[WebhookAuthenticationWebhookRef] - __properties: ClassVar[List[str]] = ["name", "type", "data", "id", "created", "modified", "createdBy", "modifiedBy", "webhooks"] + name: StrictStr = Field(description="The name of the webhook authentication.") + type: StrictStr + data: Optional[Any] + __properties: ClassVar[List[str]] = ["id", "created", "modified", "createdBy", "modifiedBy", "webhooks", "name", "type", "data"] @field_validator('type') def type_validate_enum(cls, value): @@ -109,15 +109,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "name": obj.get("name"), - "type": obj.get("type"), - "data": obj.get("data"), "id": obj.get("id"), "created": obj.get("created"), "modified": obj.get("modified"), "createdBy": obj.get("createdBy"), "modifiedBy": obj.get("modifiedBy"), - "webhooks": [WebhookAuthenticationWebhookRef.from_dict(_item) for _item in obj["webhooks"]] if obj.get("webhooks") is not None else None + "webhooks": [WebhookAuthenticationWebhookRef.from_dict(_item) for _item in obj["webhooks"]] if obj.get("webhooks") is not None else None, + "name": obj.get("name"), + "type": obj.get("type"), + "data": obj.get("data") }) return _obj diff --git a/test/test_activate_loyalty_points_response.py b/test/test_activate_loyalty_points_response.py index fda555f..f7ed659 100644 --- a/test/test_activate_loyalty_points_response.py +++ b/test/test_activate_loyalty_points_response.py @@ -51,7 +51,8 @@ def make_instance(self, include_optional) -> ActivateLoyaltyPointsResponse: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ] ) else: diff --git a/test/test_best_prior_price_request.py b/test/test_best_prior_price_request.py index 2ce25f7..d44f870 100644 --- a/test/test_best_prior_price_request.py +++ b/test/test_best_prior_price_request.py @@ -39,7 +39,7 @@ def make_instance(self, include_optional) -> BestPriorPriceRequest: timeframe_end_date = '2020-11-10T23:00:00Z', timeframe = '30', strict_end_date = True, - target = talon_one.models.best_prior_price_request_target.BestPriorPriceRequest_target( + target = talon_one.models.best_prior_target.BestPriorTarget( target_type = 'AUDIENCE', audience_id = 4, ) ) diff --git a/test/test_best_prior_price_request_target.py b/test/test_best_prior_target.py similarity index 71% rename from test/test_best_prior_price_request_target.py rename to test/test_best_prior_target.py index 1e9101b..8e46815 100644 --- a/test/test_best_prior_price_request_target.py +++ b/test/test_best_prior_target.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.best_prior_price_request_target import BestPriorPriceRequestTarget +from talon_one.models.best_prior_target import BestPriorTarget -class TestBestPriorPriceRequestTarget(unittest.TestCase): - """BestPriorPriceRequestTarget unit test stubs""" +class TestBestPriorTarget(unittest.TestCase): + """BestPriorTarget unit test stubs""" def setUp(self): pass @@ -25,27 +25,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> BestPriorPriceRequestTarget: - """Test BestPriorPriceRequestTarget + def make_instance(self, include_optional) -> BestPriorTarget: + """Test BestPriorTarget include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `BestPriorPriceRequestTarget` + # uncomment below to create an instance of `BestPriorTarget` """ - model = BestPriorPriceRequestTarget() + model = BestPriorTarget() if include_optional: - return BestPriorPriceRequestTarget( + return BestPriorTarget( target_type = 'AUDIENCE', audience_id = 4 ) else: - return BestPriorPriceRequestTarget( + return BestPriorTarget( target_type = 'AUDIENCE', ) """ - def testBestPriorPriceRequestTarget(self): - """Test BestPriorPriceRequestTarget""" + def testBestPriorTarget(self): + """Test BestPriorTarget""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_card_ledger_points_entry_integration_api.py b/test/test_card_ledger_points_entry_integration_api.py index cb35761..99f9626 100644 --- a/test/test_card_ledger_points_entry_integration_api.py +++ b/test/test_card_ledger_points_entry_integration_api.py @@ -45,7 +45,8 @@ def make_instance(self, include_optional) -> CardLedgerPointsEntryIntegrationAPI start_date = '2022-01-02T15:04:05Z07:00', expiry_date = '2022-08-02T15:04:05Z07:00', subledger_id = 'sub-123', - amount = 10.25 + amount = 10.25, + validity_duration = '30D' ) else: return CardLedgerPointsEntryIntegrationAPI( diff --git a/test/test_card_ledger_transaction_log_entry_integration_api.py b/test/test_card_ledger_transaction_log_entry_integration_api.py index 711d21d..e354f6c 100644 --- a/test/test_card_ledger_transaction_log_entry_integration_api.py +++ b/test/test_card_ledger_transaction_log_entry_integration_api.py @@ -48,7 +48,8 @@ def make_instance(self, include_optional) -> CardLedgerTransactionLogEntryIntegr amount = 10.25, id = 123, ruleset_id = 11, - rule_name = 'Add 2 points' + rule_name = 'Add 2 points', + validity_duration = '30D' ) else: return CardLedgerTransactionLogEntryIntegrationAPI( diff --git a/test/test_webhook_authentication_base.py b/test/test_cart_item_filter_template.py similarity index 61% rename from test/test_webhook_authentication_base.py rename to test/test_cart_item_filter_template.py index e3dd331..f38c1e8 100644 --- a/test/test_webhook_authentication_base.py +++ b/test/test_cart_item_filter_template.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.webhook_authentication_base import WebhookAuthenticationBase +from talon_one.models.cart_item_filter_template import CartItemFilterTemplate -class TestWebhookAuthenticationBase(unittest.TestCase): - """WebhookAuthenticationBase unit test stubs""" +class TestCartItemFilterTemplate(unittest.TestCase): + """CartItemFilterTemplate unit test stubs""" def setUp(self): pass @@ -25,30 +25,28 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> WebhookAuthenticationBase: - """Test WebhookAuthenticationBase + def make_instance(self, include_optional) -> CartItemFilterTemplate: + """Test CartItemFilterTemplate include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `WebhookAuthenticationBase` + # uncomment below to create an instance of `CartItemFilterTemplate` """ - model = WebhookAuthenticationBase() + model = CartItemFilterTemplate() if include_optional: - return WebhookAuthenticationBase( - name = 'My basic auth', - type = 'basic', - data = None + return CartItemFilterTemplate( + name = 'Filter items by product', + expression = [filter, [., Session, CartItems], [[Item], [catch, false, [=, [., Item, Category], Kitchen]]]] ) else: - return WebhookAuthenticationBase( - name = 'My basic auth', - type = 'basic', - data = None, + return CartItemFilterTemplate( + name = 'Filter items by product', + expression = [filter, [., Session, CartItems], [[Item], [catch, false, [=, [., Item, Category], Kitchen]]]], ) """ - def testWebhookAuthenticationBase(self): - """Test WebhookAuthenticationBase""" + def testCartItemFilterTemplate(self): + """Test CartItemFilterTemplate""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_coupon_rejections.py b/test/test_catalog_rule.py similarity index 52% rename from test/test_coupon_rejections.py rename to test/test_catalog_rule.py index 834bf47..efc88c0 100644 --- a/test/test_coupon_rejections.py +++ b/test/test_catalog_rule.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.coupon_rejections import CouponRejections +from talon_one.models.catalog_rule import CatalogRule -class TestCouponRejections(unittest.TestCase): - """CouponRejections unit test stubs""" +class TestCatalogRule(unittest.TestCase): + """CatalogRule unit test stubs""" def setUp(self): pass @@ -25,37 +25,41 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> CouponRejections: - """Test CouponRejections + def make_instance(self, include_optional) -> CatalogRule: + """Test CatalogRule include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `CouponRejections` + # uncomment below to create an instance of `CatalogRule` """ - model = CouponRejections() + model = CatalogRule() if include_optional: - return CouponRejections( - session_details = [ - talon_one.models.session_coupons.SessionCoupons( - session_integration_id = 'cc53e4fa-547f-4f5e-8333-76e05c381f67', - coupon_code = 'SUMMER2025', ) + return CatalogRule( + title = 'Give discount via coupon', + bindings = [ + talon_one.models.binding.Binding( + name = 'my property', + type = 'templateParameter', + expression = [string1, string2], + value_type = 'string', + min_value = 0, + max_value = 19.9, + attribute_id = 100, + description = 'This is a template parameter of type `number`.', ) ], - application_id = 123, - language = 'en' + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]] ) else: - return CouponRejections( - session_details = [ - talon_one.models.session_coupons.SessionCoupons( - session_integration_id = 'cc53e4fa-547f-4f5e-8333-76e05c381f67', - coupon_code = 'SUMMER2025', ) - ], - application_id = 123, + return CatalogRule( + title = 'Give discount via coupon', + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ) """ - def testCouponRejections(self): - """Test CouponRejections""" + def testCatalogRule(self): + """Test CatalogRule""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_collections_catalog.py b/test/test_collections_catalog.py new file mode 100644 index 0000000..ca51327 --- /dev/null +++ b/test/test_collections_catalog.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.collections_catalog import CollectionsCatalog + +class TestCollectionsCatalog(unittest.TestCase): + """CollectionsCatalog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> CollectionsCatalog: + """Test CollectionsCatalog + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `CollectionsCatalog` + """ + model = CollectionsCatalog() + if include_optional: + return CollectionsCatalog( + id = 56, + account_id = 56, + application_id = 56, + title = 'High value cart discount', + description = '', + category = 'promotions', + source = 'custom', + rules = [ + talon_one.models.catalog_rule.CatalogRule( + title = 'Give discount via coupon', + bindings = [ + talon_one.models.binding.Binding( + name = 'my property', + type = 'templateParameter', + expression = [string1, string2], + value_type = 'string', + min_value = 0, + max_value = 19.9, + attribute_id = 100, + description = 'This is a template parameter of type `number`.', ) + ], + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ) + ], + cart_item_filters = [ + talon_one.models.cart_item_filter_template.CartItemFilterTemplate( + name = 'Filter items by product', + expression = [filter, [., Session, CartItems], [[Item], [catch, false, [=, [., Item, Category], Kitchen]]]], ) + ], + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = 56, + modified = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + modified_by = 56 + ) + else: + return CollectionsCatalog( + id = 56, + account_id = 56, + application_id = 56, + title = 'High value cart discount', + category = 'promotions', + source = 'custom', + rules = [ + talon_one.models.catalog_rule.CatalogRule( + title = 'Give discount via coupon', + bindings = [ + talon_one.models.binding.Binding( + name = 'my property', + type = 'templateParameter', + expression = [string1, string2], + value_type = 'string', + min_value = 0, + max_value = 19.9, + attribute_id = 100, + description = 'This is a template parameter of type `number`.', ) + ], + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ) + ], + cart_item_filters = [ + talon_one.models.cart_item_filter_template.CartItemFilterTemplate( + name = 'Filter items by product', + expression = [filter, [., Session, CartItems], [[Item], [catch, false, [=, [., Item, Category], Kitchen]]]], ) + ], + created = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + created_by = 56, + ) + """ + + def testCollectionsCatalog(self): + """Test CollectionsCatalog""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_coupon_failure_summary.py b/test/test_coupon_failure_summary.py index dae688c..3b2f3d8 100644 --- a/test/test_coupon_failure_summary.py +++ b/test/test_coupon_failure_summary.py @@ -42,8 +42,7 @@ def make_instance(self, include_optional) -> CouponFailureSummary: status = 'rejected', coupon_code = 'ABC123', language = 'en', - short_summary = 'Session total was less than the required total.', - long_summary = 'There were 5 items in the cart with SKUs 1,2,3,4,5 and the total is $60 which is less than the required cart total.', + summary = 'Session total was less than the required total.', created_at = '2021-07-20T21:59:00Z', updated_at = '2021-07-20T21:59:00Z' ) @@ -54,8 +53,7 @@ def make_instance(self, include_optional) -> CouponFailureSummary: status = 'rejected', coupon_code = 'ABC123', language = 'en', - short_summary = 'Session total was less than the required total.', - long_summary = 'There were 5 items in the cart with SKUs 1,2,3,4,5 and the total is $60 which is less than the required cart total.', + summary = 'Session total was less than the required total.', created_at = '2021-07-20T21:59:00Z', updated_at = '2021-07-20T21:59:00Z', ) diff --git a/test/test_session_coupons.py b/test/test_delete_loyalty_transactions_request.py similarity index 63% rename from test/test_session_coupons.py rename to test/test_delete_loyalty_transactions_request.py index 4433462..dbe8fd6 100644 --- a/test/test_session_coupons.py +++ b/test/test_delete_loyalty_transactions_request.py @@ -14,10 +14,10 @@ import unittest -from talon_one.models.session_coupons import SessionCoupons +from talon_one.models.delete_loyalty_transactions_request import DeleteLoyaltyTransactionsRequest -class TestSessionCoupons(unittest.TestCase): - """SessionCoupons unit test stubs""" +class TestDeleteLoyaltyTransactionsRequest(unittest.TestCase): + """DeleteLoyaltyTransactionsRequest unit test stubs""" def setUp(self): pass @@ -25,27 +25,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> SessionCoupons: - """Test SessionCoupons + def make_instance(self, include_optional) -> DeleteLoyaltyTransactionsRequest: + """Test DeleteLoyaltyTransactionsRequest include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `SessionCoupons` + # uncomment below to create an instance of `DeleteLoyaltyTransactionsRequest` """ - model = SessionCoupons() + model = DeleteLoyaltyTransactionsRequest() if include_optional: - return SessionCoupons( - session_integration_id = 'cc53e4fa-547f-4f5e-8333-76e05c381f67', - coupon_code = 'SUMMER2025' + return DeleteLoyaltyTransactionsRequest( + scope = 'SelectedSubledgers', + subledger_ids = [subledger1, subledger2] ) else: - return SessionCoupons( - session_integration_id = 'cc53e4fa-547f-4f5e-8333-76e05c381f67', + return DeleteLoyaltyTransactionsRequest( + scope = 'SelectedSubledgers', ) """ - def testSessionCoupons(self): - """Test SessionCoupons""" + def testDeleteLoyaltyTransactionsRequest(self): + """Test DeleteLoyaltyTransactionsRequest""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_generate_coupon_rejections200_response.py b/test/test_generate_coupon_rejections200_response.py new file mode 100644 index 0000000..6734504 --- /dev/null +++ b/test/test_generate_coupon_rejections200_response.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.generate_coupon_rejections200_response import GenerateCouponRejections200Response + +class TestGenerateCouponRejections200Response(unittest.TestCase): + """GenerateCouponRejections200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GenerateCouponRejections200Response: + """Test GenerateCouponRejections200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GenerateCouponRejections200Response` + """ + model = GenerateCouponRejections200Response() + if include_optional: + return GenerateCouponRejections200Response( + data = [ + talon_one.models.coupon_failure_summary.CouponFailureSummary( + id = 1, + event_id = 1011, + session_id = '1', + profile_id = 'a48f10dddb5c9493aad194e49bb9c1dac', + status = 'rejected', + coupon_code = 'ABC123', + language = 'en', + summary = 'Session total was less than the required total.', + created_at = '2021-07-20T21:59:00Z', + updated_at = '2021-07-20T21:59:00Z', ) + ] + ) + else: + return GenerateCouponRejections200Response( + data = [ + talon_one.models.coupon_failure_summary.CouponFailureSummary( + id = 1, + event_id = 1011, + session_id = '1', + profile_id = 'a48f10dddb5c9493aad194e49bb9c1dac', + status = 'rejected', + coupon_code = 'ABC123', + language = 'en', + summary = 'Session total was less than the required total.', + created_at = '2021-07-20T21:59:00Z', + updated_at = '2021-07-20T21:59:00Z', ) + ], + ) + """ + + def testGenerateCouponRejections200Response(self): + """Test GenerateCouponRejections200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_loyalty_card_points200_response.py b/test/test_get_loyalty_card_points200_response.py index 056053f..a8edcb9 100644 --- a/test/test_get_loyalty_card_points200_response.py +++ b/test/test_get_loyalty_card_points200_response.py @@ -48,7 +48,8 @@ def make_instance(self, include_optional) -> GetLoyaltyCardPoints200Response: start_date = '2022-01-02T15:04:05Z07:00', expiry_date = '2022-08-02T15:04:05Z07:00', subledger_id = 'sub-123', - amount = 10.25, ) + amount = 10.25, + validity_duration = '30D', ) ] ) else: @@ -66,7 +67,8 @@ def make_instance(self, include_optional) -> GetLoyaltyCardPoints200Response: start_date = '2022-01-02T15:04:05Z07:00', expiry_date = '2022-08-02T15:04:05Z07:00', subledger_id = 'sub-123', - amount = 10.25, ) + amount = 10.25, + validity_duration = '30D', ) ], ) """ diff --git a/test/test_get_loyalty_card_transactions200_response.py b/test/test_get_loyalty_card_transactions200_response.py index 15bdbc7..74b4fbb 100644 --- a/test/test_get_loyalty_card_transactions200_response.py +++ b/test/test_get_loyalty_card_transactions200_response.py @@ -51,7 +51,8 @@ def make_instance(self, include_optional) -> GetLoyaltyCardTransactions200Respon amount = 10.25, id = 123, ruleset_id = 11, - rule_name = 'Add 2 points', ) + rule_name = 'Add 2 points', + validity_duration = '30D', ) ] ) else: @@ -72,7 +73,8 @@ def make_instance(self, include_optional) -> GetLoyaltyCardTransactions200Respon amount = 10.25, id = 123, ruleset_id = 11, - rule_name = 'Add 2 points', ) + rule_name = 'Add 2 points', + validity_duration = '30D', ) ], ) """ diff --git a/test/test_get_loyalty_program_profile_points200_response.py b/test/test_get_loyalty_program_profile_points200_response.py index 5795b76..5ef5e2b 100644 --- a/test/test_get_loyalty_program_profile_points200_response.py +++ b/test/test_get_loyalty_program_profile_points200_response.py @@ -47,7 +47,8 @@ def make_instance(self, include_optional) -> GetLoyaltyProgramProfilePoints200Re start_date = '2022-01-02T15:04:05Z07:00', expiry_date = '2022-08-02T15:04:05Z07:00', subledger_id = 'sub-123', - amount = 10.25, ) + amount = 10.25, + validity_duration = '30D', ) ] ) else: @@ -64,7 +65,8 @@ def make_instance(self, include_optional) -> GetLoyaltyProgramProfilePoints200Re start_date = '2022-01-02T15:04:05Z07:00', expiry_date = '2022-08-02T15:04:05Z07:00', subledger_id = 'sub-123', - amount = 10.25, ) + amount = 10.25, + validity_duration = '30D', ) ], ) """ diff --git a/test/test_get_loyalty_program_profile_transactions200_response.py b/test/test_get_loyalty_program_profile_transactions200_response.py index cc98139..3e214b6 100644 --- a/test/test_get_loyalty_program_profile_transactions200_response.py +++ b/test/test_get_loyalty_program_profile_transactions200_response.py @@ -51,7 +51,8 @@ def make_instance(self, include_optional) -> GetLoyaltyProgramProfileTransaction id = 123, ruleset_id = 11, rule_name = 'Add 2 points', - flags = null, ) + flags = null, + validity_duration = '30D', ) ] ) else: @@ -72,7 +73,8 @@ def make_instance(self, include_optional) -> GetLoyaltyProgramProfileTransaction id = 123, ruleset_id = 11, rule_name = 'Add 2 points', - flags = null, ) + flags = null, + validity_duration = '30D', ) ], ) """ diff --git a/test/test_get_loyalty_program_transactions200_response.py b/test/test_get_loyalty_program_transactions200_response.py index ca03de1..9f04cf1 100644 --- a/test/test_get_loyalty_program_transactions200_response.py +++ b/test/test_get_loyalty_program_transactions200_response.py @@ -57,7 +57,8 @@ def make_instance(self, include_optional) -> GetLoyaltyProgramTransactions200Res user_email = 'john.doe@example.com', ruleset_id = 11, rule_name = '10 points for every $100 spent', - flags = null, ) + flags = null, + validity_duration = '30D', ) ] ) else: @@ -84,7 +85,8 @@ def make_instance(self, include_optional) -> GetLoyaltyProgramTransactions200Res user_email = 'john.doe@example.com', ruleset_id = 11, rule_name = '10 points for every $100 spent', - flags = null, ) + flags = null, + validity_duration = '30D', ) ], ) """ diff --git a/test/test_integration_api.py b/test/test_integration_api.py index 1c2facc..04ce981 100644 --- a/test/test_integration_api.py +++ b/test/test_integration_api.py @@ -26,6 +26,13 @@ def setUp(self) -> None: def tearDown(self) -> None: pass + def test_activate_loyalty_points(self) -> None: + """Test case for activate_loyalty_points + + Activate loyalty points + """ + pass + def test_best_prior_price(self) -> None: """Test case for best_prior_price @@ -89,6 +96,13 @@ def test_delete_customer_data(self) -> None: """ pass + def test_delete_loyalty_transactions_from_ledgers(self) -> None: + """Test case for delete_loyalty_transactions_from_ledgers + + Delete customer's transactions from loyalty ledgers + """ + pass + def test_generate_loyalty_card(self) -> None: """Test case for generate_loyalty_card @@ -208,6 +222,13 @@ def test_track_event_v2(self) -> None: """ pass + def test_unlink_loyalty_card_from_profile(self) -> None: + """Test case for unlink_loyalty_card_from_profile + + Unlink customer profile from a loyalty card + """ + pass + def test_update_audience_customers_attributes(self) -> None: """Test case for update_audience_customers_attributes diff --git a/test/test_ledger_points_entry_integration_api.py b/test/test_ledger_points_entry_integration_api.py index f17f890..752a6b8 100644 --- a/test/test_ledger_points_entry_integration_api.py +++ b/test/test_ledger_points_entry_integration_api.py @@ -44,7 +44,8 @@ def make_instance(self, include_optional) -> LedgerPointsEntryIntegrationAPI: start_date = '2022-01-02T15:04:05Z07:00', expiry_date = '2022-08-02T15:04:05Z07:00', subledger_id = 'sub-123', - amount = 10.25 + amount = 10.25, + validity_duration = '30D' ) else: return LedgerPointsEntryIntegrationAPI( diff --git a/test/test_ledger_transaction_log_entry_integration_api.py b/test/test_ledger_transaction_log_entry_integration_api.py index ade78ae..77e6016 100644 --- a/test/test_ledger_transaction_log_entry_integration_api.py +++ b/test/test_ledger_transaction_log_entry_integration_api.py @@ -49,7 +49,8 @@ def make_instance(self, include_optional) -> LedgerTransactionLogEntryIntegratio ruleset_id = 11, rule_name = 'Add 2 points', flags = talon_one.models.loyalty_ledger_entry_flags.LoyaltyLedgerEntryFlags( - creates_negative_balance = True, ) + creates_negative_balance = True, ), + validity_duration = '30D' ) else: return LedgerTransactionLogEntryIntegrationAPI( diff --git a/test/test_loyalty_ledger.py b/test/test_loyalty_ledger.py index 55e18b3..5d3c348 100644 --- a/test/test_loyalty_ledger.py +++ b/test/test_loyalty_ledger.py @@ -58,7 +58,8 @@ def make_instance(self, include_optional) -> LoyaltyLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], expiring_points = [ talon_one.models.loyalty_ledger_entry.LoyaltyLedgerEntry( @@ -76,7 +77,8 @@ def make_instance(self, include_optional) -> LoyaltyLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], active_points = [ @@ -115,7 +117,8 @@ def make_instance(self, include_optional) -> LoyaltyLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], expiring_points = [ talon_one.models.loyalty_ledger_entry.LoyaltyLedgerEntry( @@ -133,7 +136,8 @@ def make_instance(self, include_optional) -> LoyaltyLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], active_points = [ diff --git a/test/test_loyalty_ledger_entry.py b/test/test_loyalty_ledger_entry.py index 5f6735e..8f56a71 100644 --- a/test/test_loyalty_ledger_entry.py +++ b/test/test_loyalty_ledger_entry.py @@ -50,7 +50,8 @@ def make_instance(self, include_optional) -> LoyaltyLedgerEntry: user_id = 499, archived = False, flags = talon_one.models.loyalty_ledger_entry_flags.LoyaltyLedgerEntryFlags( - creates_negative_balance = True, ) + creates_negative_balance = True, ), + validity_duration = '30D' ) else: return LoyaltyLedgerEntry( diff --git a/test/test_loyalty_ledger_transactions.py b/test/test_loyalty_ledger_transactions.py index d0b733f..b8287b5 100644 --- a/test/test_loyalty_ledger_transactions.py +++ b/test/test_loyalty_ledger_transactions.py @@ -52,7 +52,8 @@ def make_instance(self, include_optional) -> LoyaltyLedgerTransactions: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ] ) else: diff --git a/test/test_loyalty_program_transaction.py b/test/test_loyalty_program_transaction.py index 7bf31b7..9612f1c 100644 --- a/test/test_loyalty_program_transaction.py +++ b/test/test_loyalty_program_transaction.py @@ -55,7 +55,8 @@ def make_instance(self, include_optional) -> LoyaltyProgramTransaction: ruleset_id = 11, rule_name = '10 points for every $100 spent', flags = talon_one.models.loyalty_ledger_entry_flags.LoyaltyLedgerEntryFlags( - creates_negative_balance = True, ) + creates_negative_balance = True, ), + validity_duration = '30D' ) else: return LoyaltyProgramTransaction( diff --git a/test/test_loyalty_sub_ledger.py b/test/test_loyalty_sub_ledger.py index a703ab7..4079ed0 100644 --- a/test/test_loyalty_sub_ledger.py +++ b/test/test_loyalty_sub_ledger.py @@ -57,7 +57,8 @@ def make_instance(self, include_optional) -> LoyaltySubLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], expiring_points = [ talon_one.models.loyalty_ledger_entry.LoyaltyLedgerEntry( @@ -75,7 +76,8 @@ def make_instance(self, include_optional) -> LoyaltySubLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], active_points = [ talon_one.models.loyalty_ledger_entry.LoyaltyLedgerEntry( @@ -93,7 +95,8 @@ def make_instance(self, include_optional) -> LoyaltySubLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], pending_points = [ talon_one.models.loyalty_ledger_entry.LoyaltyLedgerEntry( @@ -111,7 +114,8 @@ def make_instance(self, include_optional) -> LoyaltySubLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], expired_points = [ talon_one.models.loyalty_ledger_entry.LoyaltyLedgerEntry( @@ -129,7 +133,8 @@ def make_instance(self, include_optional) -> LoyaltySubLedger: sub_ledger_id = 'mysubledger', user_id = 499, archived = False, - flags = null, ) + flags = null, + validity_duration = '30D', ) ], current_tier = talon_one.models.tier.Tier( id = 11, diff --git a/test/test_management_api.py b/test/test_management_api.py index 173540f..f10662e 100644 --- a/test/test_management_api.py +++ b/test/test_management_api.py @@ -411,6 +411,13 @@ def test_export_referrals(self) -> None: """ pass + def test_generate_coupon_rejections(self) -> None: + """Test case for generate_coupon_rejections + + Summarize coupon redemption failures in session + """ + pass + def test_get_access_logs_without_total_count(self) -> None: """Test case for get_access_logs_without_total_count @@ -740,6 +747,13 @@ def test_get_loyalty_cards(self) -> None: """ pass + def test_get_loyalty_ledger_balances(self) -> None: + """Test case for get_loyalty_ledger_balances + + Get customer's loyalty balances + """ + pass + def test_get_loyalty_points(self) -> None: """Test case for get_loyalty_points @@ -754,6 +768,13 @@ def test_get_loyalty_program(self) -> None: """ pass + def test_get_loyalty_program_profile_ledger_transactions(self) -> None: + """Test case for get_loyalty_program_profile_ledger_transactions + + List customer's loyalty transactions + """ + pass + def test_get_loyalty_program_transactions(self) -> None: """Test case for get_loyalty_program_transactions diff --git a/test/test_new_collections_catalog.py b/test/test_new_collections_catalog.py new file mode 100644 index 0000000..0f7f716 --- /dev/null +++ b/test/test_new_collections_catalog.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.new_collections_catalog import NewCollectionsCatalog + +class TestNewCollectionsCatalog(unittest.TestCase): + """NewCollectionsCatalog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> NewCollectionsCatalog: + """Test NewCollectionsCatalog + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `NewCollectionsCatalog` + """ + model = NewCollectionsCatalog() + if include_optional: + return NewCollectionsCatalog( + title = 'Customer loyalty boost', + description = '', + category = 'custom', + rules = [ + talon_one.models.catalog_rule.CatalogRule( + title = 'Give discount via coupon', + bindings = [ + talon_one.models.binding.Binding( + name = 'my property', + type = 'templateParameter', + expression = [string1, string2], + value_type = 'string', + min_value = 0, + max_value = 19.9, + attribute_id = 100, + description = 'This is a template parameter of type `number`.', ) + ], + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ) + ], + cart_item_filters = [ + talon_one.models.cart_item_filter_template.CartItemFilterTemplate( + name = 'Filter items by product', + expression = [filter, [., Session, CartItems], [[Item], [catch, false, [=, [., Item, Category], Kitchen]]]], ) + ] + ) + else: + return NewCollectionsCatalog( + title = 'Customer loyalty boost', + ) + """ + + def testNewCollectionsCatalog(self): + """Test NewCollectionsCatalog""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_new_role.py b/test/test_new_role.py index 2164ddf..62fb753 100644 --- a/test/test_new_role.py +++ b/test/test_new_role.py @@ -37,13 +37,13 @@ def make_instance(self, include_optional) -> NewRole: return NewRole( name = 'Campaign Manager', description = 'Manages the campaigns', - acl = '{Role=128, Applications=null}', + acl = '{Role=128}', members = [48, 562, 475, 18] ) else: return NewRole( name = 'Campaign Manager', - acl = '{Role=128, Applications=null}', + acl = '{Role=128}', members = [48, 562, 475, 18], ) """ diff --git a/test/test_prismatic_event_payload_coupon_based_notifications.py b/test/test_prismatic_event_payload_coupon_based_notifications.py index 3ca6751..49c92d6 100644 --- a/test/test_prismatic_event_payload_coupon_based_notifications.py +++ b/test/test_prismatic_event_payload_coupon_based_notifications.py @@ -60,7 +60,9 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNot entities = [ '' ], ) - ] + ], + source_of_event = '', + employee_name = '' ) else: return PrismaticEventPayloadCouponBasedNotifications( @@ -70,6 +72,8 @@ def make_instance(self, include_optional) -> PrismaticEventPayloadCouponBasedNot value = '', usage_limit = 56, usage_counter = 56, + source_of_event = '', + employee_name = '', ) """ diff --git a/test/test_update_collections_catalog.py b/test/test_update_collections_catalog.py new file mode 100644 index 0000000..6ed6775 --- /dev/null +++ b/test/test_update_collections_catalog.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Talon.One API + + Use the Talon.One API to integrate with your application and to manage applications and campaigns: - Use the operations in the [Integration API section](#integration-api) are used to integrate with our platform - Use the operation in the [Management API section](#management-api) to manage applications and campaigns. ## Determining the base URL of the endpoints The API is available at the same hostname as your Campaign Manager deployment. For example, if you access the Campaign Manager at `https://yourbaseurl.talon.one/`, the URL for the [updateCustomerSessionV2](https://docs.talon.one/integration-api#operation/updateCustomerSessionV2) endpoint is `https://yourbaseurl.talon.one/v2/customer_sessions/{Id}` + + The version of the OpenAPI document: + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from talon_one.models.update_collections_catalog import UpdateCollectionsCatalog + +class TestUpdateCollectionsCatalog(unittest.TestCase): + """UpdateCollectionsCatalog unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> UpdateCollectionsCatalog: + """Test UpdateCollectionsCatalog + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `UpdateCollectionsCatalog` + """ + model = UpdateCollectionsCatalog() + if include_optional: + return UpdateCollectionsCatalog( + title = '', + description = '', + category = 'promotions', + rules = [ + talon_one.models.catalog_rule.CatalogRule( + title = 'Give discount via coupon', + bindings = [ + talon_one.models.binding.Binding( + name = 'my property', + type = 'templateParameter', + expression = [string1, string2], + value_type = 'string', + min_value = 0, + max_value = 19.9, + attribute_id = 100, + description = 'This is a template parameter of type `number`.', ) + ], + condition = [and, [couponValid]], + effects = [catch, [noop], [setDiscount, 10% off, [*, [., Session, Total], [/, 10, 100]]]], ) + ], + cart_item_filters = [ + talon_one.models.cart_item_filter_template.CartItemFilterTemplate( + name = 'Filter items by product', + expression = [filter, [., Session, CartItems], [[Item], [catch, false, [=, [., Item, Category], Kitchen]]]], ) + ] + ) + else: + return UpdateCollectionsCatalog( + ) + """ + + def testUpdateCollectionsCatalog(self): + """Test UpdateCollectionsCatalog""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_update_role.py b/test/test_update_role.py index f12c4d6..b3f2e74 100644 --- a/test/test_update_role.py +++ b/test/test_update_role.py @@ -37,7 +37,7 @@ def make_instance(self, include_optional) -> UpdateRole: return UpdateRole( name = 'Campaign Manager', description = 'Manages the campaigns', - acl = '{Role=128, Applications=null}', + acl = '{Role=128}', members = [48, 562, 475, 18] ) else: diff --git a/test/test_update_user.py b/test/test_update_user.py index bf90cfb..e0e0f0f 100644 --- a/test/test_update_user.py +++ b/test/test_update_user.py @@ -38,7 +38,7 @@ def make_instance(self, include_optional) -> UpdateUser: name = 'John Doe', state = 'deactivated', is_admin = False, - policy = '{Role=127, Applications=null}', + policy = '{Role=127}', roles = [1, 3], application_notification_subscriptions = None ) diff --git a/test/test_user.py b/test/test_user.py index daae9ca..d077ba2 100644 --- a/test/test_user.py +++ b/test/test_user.py @@ -44,7 +44,7 @@ def make_instance(self, include_optional) -> User: state = 'invited', invite_token = 'Gy9b8w1irmQtEPo5RmbMmSPheL5h4', is_admin = False, - policy = {Role=127, Applications=null}, + policy = {Role=127}, roles = [71], auth_method = 'basic_auth', application_notification_subscriptions = {}, @@ -63,7 +63,7 @@ def make_instance(self, include_optional) -> User: name = 'John Doe', state = 'invited', invite_token = 'Gy9b8w1irmQtEPo5RmbMmSPheL5h4', - policy = {Role=127, Applications=null}, + policy = {Role=127}, ) """ diff --git a/test/test_webhook_authentication.py b/test/test_webhook_authentication.py index b8e5e40..83c5118 100644 --- a/test/test_webhook_authentication.py +++ b/test/test_webhook_authentication.py @@ -35,9 +35,6 @@ def make_instance(self, include_optional) -> WebhookAuthentication: model = WebhookAuthentication() if include_optional: return WebhookAuthentication( - name = 'My basic auth', - type = 'basic', - data = None, id = 6, created = '2020-06-10T09:05:27.993483Z', modified = '2021-09-12T10:12:42Z', @@ -48,13 +45,13 @@ def make_instance(self, include_optional) -> WebhookAuthentication: id = 6, title = 'Send message', description = 'A webhook to send a coupon to the user.', ) - ] + ], + name = 'My basic auth', + type = 'basic', + data = None ) else: return WebhookAuthentication( - name = 'My basic auth', - type = 'basic', - data = None, id = 6, created = '2020-06-10T09:05:27.993483Z', modified = '2021-09-12T10:12:42Z', @@ -66,6 +63,9 @@ def make_instance(self, include_optional) -> WebhookAuthentication: title = 'Send message', description = 'A webhook to send a coupon to the user.', ) ], + name = 'My basic auth', + type = 'basic', + data = None, ) """