klaviyo-api-sdk 17.0.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/README.md +932 -414
- data/klaviyo-api-sdk.gemspec +1 -1
- data/lib/klaviyo-api-sdk/api/accounts_api.rb +12 -12
- data/lib/klaviyo-api-sdk/api/campaigns_api.rb +215 -155
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +585 -381
- data/lib/klaviyo-api-sdk/api/client_api.rb +100 -0
- data/lib/klaviyo-api-sdk/api/conversations_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/coupons_api.rb +187 -108
- data/lib/klaviyo-api-sdk/api/custom_objects_api.rb +2755 -83
- data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/events_api.rb +72 -58
- data/lib/klaviyo-api-sdk/api/flows_api.rb +238 -152
- data/lib/klaviyo-api-sdk/api/forms_api.rb +81 -60
- data/lib/klaviyo-api-sdk/api/images_api.rb +48 -27
- data/lib/klaviyo-api-sdk/api/lists_api.rb +113 -88
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +184 -156
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +445 -226
- data/lib/klaviyo-api-sdk/api/reporting_api.rb +76 -27
- data/lib/klaviyo-api-sdk/api/reviews_api.rb +38 -31
- data/lib/klaviyo-api-sdk/api/segments_api.rb +107 -82
- data/lib/klaviyo-api-sdk/api/tags_api.rb +164 -128
- data/lib/klaviyo-api-sdk/api/templates_api.rb +113 -60
- data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +24 -17
- data/lib/klaviyo-api-sdk/api/web_feeds_api.rb +41 -27
- data/lib/klaviyo-api-sdk/api/webhooks_api.rb +73 -31
- data/lib/klaviyo-api-sdk/api_client.rb +1 -1
- data/lib/klaviyo-api-sdk/models/action_output_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/action_output_condition_filter.rb +78 -195
- data/lib/klaviyo-api-sdk/models/action_output_split_action_data.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters.rb → action_output_split_action_data_action_output_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{action_output_condition_condition_group.rb → action_output_split_action_data_action_output_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/age_gate_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/api_schema_property.rb +301 -0
- data/lib/klaviyo-api-sdk/models/back_in_stock_email_consent_checkbox_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/base_event_create_query_bulk_entry_resource_object_attributes.rb +15 -2
- data/lib/klaviyo-api-sdk/models/base_style_properties.rb +15 -5
- data/lib/klaviyo-api-sdk/models/button_action.rb +1 -0
- data/lib/klaviyo-api-sdk/models/button_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/button_styles.rb +25 -3
- data/lib/klaviyo-api-sdk/models/{action_output_condition_filter2.rb → button_styles_height.rb} +3 -7
- data/lib/klaviyo-api-sdk/models/cart_content.rb +277 -0
- data/lib/klaviyo-api-sdk/models/cart_content_properties.rb +236 -0
- data/lib/klaviyo-api-sdk/models/checkboxes_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/conditional_branch_action_data_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/constant_property_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/{price_drop_condition_filter2.rb → constant_property_mapping_value.rb} +6 -16
- data/lib/klaviyo-api-sdk/models/content_experiment_action.rb +1 -1
- data/lib/klaviyo-api-sdk/models/{send_push_notification_action_content_experiment_action_data.rb → content_experiment_action_data.rb} +6 -5
- data/lib/klaviyo-api-sdk/models/{send_push_notification_action_current_experiment.rb → content_experiment_action_data_current_experiment.rb} +6 -6
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter2.rb → content_experiment_action_data_main_action.rb} +3 -16
- data/lib/klaviyo-api-sdk/models/countdown_timer_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/coupon_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/custom_css.rb +231 -0
- data/lib/klaviyo-api-sdk/models/custom_html.rb +292 -0
- data/lib/klaviyo-api-sdk/models/custom_html_properties.rb +263 -0
- data/lib/klaviyo-api-sdk/models/custom_object_date_trigger.rb +450 -0
- data/lib/klaviyo-api-sdk/models/custom_object_property_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/custom_object_relationship_source.rb +328 -0
- data/lib/klaviyo-api-sdk/models/date_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/display_options.rb +24 -4
- data/lib/klaviyo-api-sdk/models/dropdown_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/email_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/email_subscription_parameters.rb +13 -9
- data/lib/klaviyo-api-sdk/models/email_unsubscription_parameters.rb +13 -9
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes.rb +292 -0
- data/lib/klaviyo-api-sdk/models/embedded_object_schema_resource_object_attributes_source_mapping.rb +224 -0
- data/lib/klaviyo-api-sdk/models/event_create_query_v2_resource_object_attributes.rb +15 -2
- data/lib/klaviyo-api-sdk/models/events_bulk_create_query_resource_object_attributes.rb +14 -1
- data/lib/klaviyo-api-sdk/models/flow_definition_profile_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/flow_definition_triggers_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/flow_email.rb +1 -1
- data/lib/klaviyo-api-sdk/models/flow_push_notification.rb +14 -4
- data/lib/klaviyo-api-sdk/models/flow_sms.rb +15 -2
- data/lib/klaviyo-api-sdk/models/form_create_query_resource_object_attributes.rb +2 -2
- data/lib/klaviyo-api-sdk/models/html_text_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen.rb +305 -0
- data/lib/klaviyo-api-sdk/models/iaf_deeplink_to_screen_properties.rb +220 -0
- data/lib/klaviyo-api-sdk/models/image_action.rb +1 -0
- data/lib/klaviyo-api-sdk/models/image_block_cropping_properties.rb +0 -35
- data/lib/klaviyo-api-sdk/models/image_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/low_inventory_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/low_inventory_trigger.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_filter.rb → low_inventory_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{low_inventory_condition_condition_group.rb → low_inventory_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/metric_aggregate_query_resource_object_attributes.rb +2 -2
- data/lib/klaviyo-api-sdk/models/metric_property_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/metric_property_condition_filter.rb +87 -195
- data/lib/klaviyo-api-sdk/models/metric_trigger.rb +2 -1
- data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters.rb → metric_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{flow_email_additional_filters_condition_groups_inner.rb → metric_trigger_trigger_filter_condition_groups_inner.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/mobile_push_content_create.rb +18 -5
- data/lib/klaviyo-api-sdk/models/mobile_push_content_update.rb +18 -5
- data/lib/klaviyo-api-sdk/models/mobile_push_options_on_open.rb +2 -1
- data/lib/klaviyo-api-sdk/models/multi_branch_split_branch_branch_filter_condition_groups_inner_conditions_inner.rb +5 -0
- data/lib/klaviyo-api-sdk/models/object_record_bulk_delete_job_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/{flow_push_notification_additional_filters_condition_groups_inner.rb → object_record_delete_job_create_query_resource_object_relationships.rb} +13 -15
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_create_query_resource_object_relationships_object_records.rb +220 -0
- data/lib/klaviyo-api-sdk/models/object_record_delete_job_rels_records_data_inner.rb +238 -0
- data/lib/klaviyo-api-sdk/models/object_record_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object.rb +246 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_attributes.rb +322 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships.rb +218 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type.rb +218 -0
- data/lib/klaviyo-api-sdk/models/object_schema_create_query_resource_object_relationships_object_type_data.rb +238 -0
- data/lib/klaviyo-api-sdk/models/object_schema_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object.rb +252 -0
- data/lib/klaviyo-api-sdk/models/object_schema_partial_update_query_resource_object_attributes.rb +302 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_create_meta.rb +237 -0
- data/lib/klaviyo-api-sdk/models/{metric_property_condition_condition_group.rb → object_schema_relationship_create_query.rb} +14 -14
- data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters_condition_groups_inner.rb → object_schema_relationship_create_query_data_inner.rb} +37 -15
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_meta.rb +224 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_delete_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_partial_update_query_data.rb +247 -0
- data/lib/klaviyo-api-sdk/models/object_schema_relationship_update_meta.rb +246 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes.rb +307 -0
- data/lib/klaviyo-api-sdk/models/object_type_create_query_resource_object_attributes_object_schema.rb +224 -0
- data/lib/klaviyo-api-sdk/models/object_type_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/onsite_profile_meta.rb +13 -4
- data/lib/klaviyo-api-sdk/models/open_tracking_subscription_parameters.rb +258 -0
- data/lib/klaviyo-api-sdk/models/open_tracking_unsubscription_parameters.rb +258 -0
- data/lib/klaviyo-api-sdk/models/opt_in_code_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/patch_identifiers.rb +227 -0
- data/lib/klaviyo-api-sdk/models/phone_number_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/price_drop_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/price_drop_trigger.rb +2 -6
- data/lib/klaviyo-api-sdk/models/{flow_sms_additional_filters.rb → price_drop_trigger_trigger_filter.rb} +4 -4
- data/lib/klaviyo-api-sdk/models/{price_drop_condition_condition_group.rb → price_drop_trigger_trigger_filter_condition_groups_inner.rb} +3 -3
- data/lib/klaviyo-api-sdk/models/profile_event_tracked_properties.rb +19 -9
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_email_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/{profile_has_not_received_push_message_condition_timeframe_filter.rb → profile_has_not_received_email_message_condition_timeframe_filter.rb} +1 -1
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_push_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_has_not_received_sms_message_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_meta.rb +13 -4
- data/lib/klaviyo-api-sdk/models/profile_not_in_flow_condition.rb +1 -1
- data/lib/klaviyo-api-sdk/models/profile_object_schema_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_create_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query.rb +225 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_delete_query_data_inner.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/profile_object_schema_relationship_partial_update_query_data.rb +247 -0
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_priority_condition.rb +2 -2
- data/lib/klaviyo-api-sdk/models/profile_predictive_analytics_channel_affinity_rank_condition.rb +2 -2
- data/lib/klaviyo-api-sdk/models/profile_relationship_source.rb +330 -0
- data/lib/klaviyo-api-sdk/models/property_filter.rb +237 -0
- data/lib/klaviyo-api-sdk/models/property_source.rb +254 -0
- data/lib/klaviyo-api-sdk/models/push_action_button.rb +1 -5
- data/lib/klaviyo-api-sdk/models/push_action_button_definition.rb +261 -0
- data/lib/klaviyo-api-sdk/models/push_on_open_web_url.rb +268 -0
- data/lib/klaviyo-api-sdk/models/quote_style.rb +21 -1
- data/lib/klaviyo-api-sdk/models/radio_buttons_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/redirect_properties.rb +2 -5
- data/lib/klaviyo-api-sdk/models/related_id_path.rb +273 -0
- data/lib/klaviyo-api-sdk/models/review_block_styles.rb +13 -13
- data/lib/klaviyo-api-sdk/models/review_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/reviewer_name_style.rb +21 -1
- data/lib/klaviyo-api-sdk/models/row_v0_blocks_inner.rb +1 -0
- data/lib/klaviyo-api-sdk/models/signup_counter_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/simple_property_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/simple_relationship_mapping.rb +287 -0
- data/lib/klaviyo-api-sdk/models/simple_relationship_mapping_source.rb +105 -0
- data/lib/klaviyo-api-sdk/models/sms_consent_checkbox_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/sms_disclosure_link_text_style.rb +319 -0
- data/lib/klaviyo-api-sdk/models/sms_disclosure_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/sms_disclosure_styles.rb +1 -1
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object.rb +237 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes.rb +235 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_create_query_resource_object_attributes_property_mappings_inner.rb +104 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_enum.rb +35 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query.rb +223 -0
- data/lib/klaviyo-api-sdk/models/source_mapping_partial_update_query_resource_object.rb +252 -0
- data/lib/klaviyo-api-sdk/models/spin_to_win_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/string_phone_operator_string_array_filter.rb +1 -1
- data/lib/klaviyo-api-sdk/models/table_fallback_image_sub_block.rb +0 -13
- data/lib/klaviyo-api-sdk/models/table_image_sub_block.rb +0 -13
- data/lib/klaviyo-api-sdk/models/template_definition.rb +1 -0
- data/lib/klaviyo-api-sdk/models/text_properties.rb +11 -1
- data/lib/klaviyo-api-sdk/models/version.rb +39 -4
- data/lib/klaviyo-api-sdk/models/version_properties.rb +14 -4
- data/lib/klaviyo-api-sdk/models/version_styles.rb +15 -6
- data/lib/klaviyo-api-sdk/models/version_triggers_inner.rb +1 -0
- data/lib/klaviyo-api-sdk.rb +86 -23
- data/lib/klaviyo-api-sdk.rb.bak +87 -24
- metadata +88 -25
- data/lib/klaviyo-api-sdk/models/custom_object_property_condition_filter.rb +0 -117
- data/lib/klaviyo-api-sdk/models/flow_email_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/flow_push_notification_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/flow_sms_additional_filters_condition_groups_inner_conditions_inner.rb +0 -116
- data/lib/klaviyo-api-sdk/models/metric_property_condition_filter2.rb +0 -117
- data/lib/klaviyo-api-sdk/models/price_drop_condition_filter.rb +0 -225
|
@@ -19,9 +19,10 @@ module KlaviyoAPI
|
|
|
19
19
|
@api_client = api_client
|
|
20
20
|
end
|
|
21
21
|
# Bulk Create Coupon Codes
|
|
22
|
-
# Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:write`
|
|
22
|
+
# Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/bulk_create_coupon_codes.json)
|
|
23
23
|
# @param coupon_code_create_job_create_query [CouponCodeCreateJobCreateQuery]
|
|
24
24
|
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
25
26
|
# @return [Hash<String, Object>]
|
|
26
27
|
def bulk_create_coupon_codes(coupon_code_create_job_create_query, opts = {})
|
|
27
28
|
data, _status_code, _headers = bulk_create_coupon_codes_with_http_info(coupon_code_create_job_create_query, opts)
|
|
@@ -35,9 +36,10 @@ module KlaviyoAPI
|
|
|
35
36
|
alias create_coupon_code_bulk_create_job bulk_create_coupon_codes
|
|
36
37
|
|
|
37
38
|
# Bulk Create Coupon Codes
|
|
38
|
-
# Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:write`
|
|
39
|
+
# Create a coupon-code-bulk-create-job to bulk create a list of coupon codes. Max number of coupon codes per job we allow for is 1000. Max number of jobs queued at once we allow for is 100.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/bulk_create_coupon_codes.json)
|
|
39
40
|
# @param coupon_code_create_job_create_query [CouponCodeCreateJobCreateQuery]
|
|
40
41
|
# @param [Hash] opts the optional parameters
|
|
42
|
+
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
41
43
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
42
44
|
def bulk_create_coupon_codes_with_http_info(coupon_code_create_job_create_query, opts = {})
|
|
43
45
|
if @api_client.config.debugging
|
|
@@ -47,16 +49,21 @@ module KlaviyoAPI
|
|
|
47
49
|
if @api_client.config.client_side_validation && coupon_code_create_job_create_query.nil?
|
|
48
50
|
fail ArgumentError, "Missing the required parameter 'coupon_code_create_job_create_query' when calling CouponsApi.bulk_create_coupon_codes"
|
|
49
51
|
end
|
|
52
|
+
allowable_values = ["completed_at", "completed_count", "created_at", "errors", "expires_at", "failed_count", "id", "status", "total_count"]
|
|
53
|
+
if @api_client.config.client_side_validation && opts[:'fields_coupon_code_bulk_create_job'] && !opts[:'fields_coupon_code_bulk_create_job'].all? { |item| allowable_values.include?(item) }
|
|
54
|
+
fail ArgumentError, "invalid value for \"fields_coupon_code_bulk_create_job\", must include one of #{allowable_values}"
|
|
55
|
+
end
|
|
50
56
|
# resource path
|
|
51
57
|
local_var_path = '/api/coupon-code-bulk-create-jobs'
|
|
52
58
|
|
|
53
59
|
# query parameters
|
|
54
60
|
query_params = opts[:query_params] || {}
|
|
61
|
+
query_params[:'fields[coupon-code-bulk-create-job]'] = @api_client.build_collection_param(opts[:'fields_coupon_code_bulk_create_job'], :csv) if !opts[:'fields_coupon_code_bulk_create_job'].nil?
|
|
55
62
|
|
|
56
63
|
# header parameters
|
|
57
64
|
header_params = opts[:header_params] || {}
|
|
58
65
|
# klaviyo api revision
|
|
59
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
66
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
60
67
|
# HTTP header 'Accept' (if needed)
|
|
61
68
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
62
69
|
# HTTP header 'Content-Type'
|
|
@@ -101,9 +108,10 @@ module KlaviyoAPI
|
|
|
101
108
|
alias create_coupon_code_bulk_create_job_with_http_info bulk_create_coupon_codes_with_http_info
|
|
102
109
|
|
|
103
110
|
# Create Coupon
|
|
104
|
-
# Creates a new coupon.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write`
|
|
111
|
+
# Creates a new coupon.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_coupon.json)
|
|
105
112
|
# @param coupon_create_query [CouponCreateQuery]
|
|
106
113
|
# @param [Hash] opts the optional parameters
|
|
114
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
107
115
|
# @return [Hash<String, Object>]
|
|
108
116
|
def create_coupon(coupon_create_query, opts = {})
|
|
109
117
|
data, _status_code, _headers = create_coupon_with_http_info(coupon_create_query, opts)
|
|
@@ -111,9 +119,10 @@ module KlaviyoAPI
|
|
|
111
119
|
end
|
|
112
120
|
|
|
113
121
|
# Create Coupon
|
|
114
|
-
# Creates a new coupon.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write`
|
|
122
|
+
# Creates a new coupon.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_coupon.json)
|
|
115
123
|
# @param coupon_create_query [CouponCreateQuery]
|
|
116
124
|
# @param [Hash] opts the optional parameters
|
|
125
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
117
126
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
118
127
|
def create_coupon_with_http_info(coupon_create_query, opts = {})
|
|
119
128
|
if @api_client.config.debugging
|
|
@@ -123,16 +132,21 @@ module KlaviyoAPI
|
|
|
123
132
|
if @api_client.config.client_side_validation && coupon_create_query.nil?
|
|
124
133
|
fail ArgumentError, "Missing the required parameter 'coupon_create_query' when calling CouponsApi.create_coupon"
|
|
125
134
|
end
|
|
135
|
+
allowable_values = ["description", "external_id", "id", "monitor_configuration"]
|
|
136
|
+
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
|
137
|
+
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
|
138
|
+
end
|
|
126
139
|
# resource path
|
|
127
140
|
local_var_path = '/api/coupons'
|
|
128
141
|
|
|
129
142
|
# query parameters
|
|
130
143
|
query_params = opts[:query_params] || {}
|
|
144
|
+
query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil?
|
|
131
145
|
|
|
132
146
|
# header parameters
|
|
133
147
|
header_params = opts[:header_params] || {}
|
|
134
148
|
# klaviyo api revision
|
|
135
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
149
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
136
150
|
# HTTP header 'Accept' (if needed)
|
|
137
151
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
138
152
|
# HTTP header 'Content-Type'
|
|
@@ -171,9 +185,10 @@ module KlaviyoAPI
|
|
|
171
185
|
end
|
|
172
186
|
|
|
173
187
|
# Create Coupon Code
|
|
174
|
-
# Synchronously creates a coupon code for the given coupon.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write`
|
|
188
|
+
# Synchronously creates a coupon code for the given coupon.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_coupon_code.json)
|
|
175
189
|
# @param coupon_code_create_query [CouponCodeCreateQuery]
|
|
176
190
|
# @param [Hash] opts the optional parameters
|
|
191
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
177
192
|
# @return [Hash<String, Object>]
|
|
178
193
|
def create_coupon_code(coupon_code_create_query, opts = {})
|
|
179
194
|
data, _status_code, _headers = create_coupon_code_with_http_info(coupon_code_create_query, opts)
|
|
@@ -181,9 +196,10 @@ module KlaviyoAPI
|
|
|
181
196
|
end
|
|
182
197
|
|
|
183
198
|
# Create Coupon Code
|
|
184
|
-
# Synchronously creates a coupon code for the given coupon.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write`
|
|
199
|
+
# Synchronously creates a coupon code for the given coupon.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/create_coupon_code.json)
|
|
185
200
|
# @param coupon_code_create_query [CouponCodeCreateQuery]
|
|
186
201
|
# @param [Hash] opts the optional parameters
|
|
202
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
187
203
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
188
204
|
def create_coupon_code_with_http_info(coupon_code_create_query, opts = {})
|
|
189
205
|
if @api_client.config.debugging
|
|
@@ -193,16 +209,21 @@ module KlaviyoAPI
|
|
|
193
209
|
if @api_client.config.client_side_validation && coupon_code_create_query.nil?
|
|
194
210
|
fail ArgumentError, "Missing the required parameter 'coupon_code_create_query' when calling CouponsApi.create_coupon_code"
|
|
195
211
|
end
|
|
212
|
+
allowable_values = ["expires_at", "id", "status", "unique_code"]
|
|
213
|
+
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
|
214
|
+
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
|
215
|
+
end
|
|
196
216
|
# resource path
|
|
197
217
|
local_var_path = '/api/coupon-codes'
|
|
198
218
|
|
|
199
219
|
# query parameters
|
|
200
220
|
query_params = opts[:query_params] || {}
|
|
221
|
+
query_params[:'fields[coupon-code]'] = @api_client.build_collection_param(opts[:'fields_coupon_code'], :csv) if !opts[:'fields_coupon_code'].nil?
|
|
201
222
|
|
|
202
223
|
# header parameters
|
|
203
224
|
header_params = opts[:header_params] || {}
|
|
204
225
|
# klaviyo api revision
|
|
205
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
226
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
206
227
|
# HTTP header 'Accept' (if needed)
|
|
207
228
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
208
229
|
# HTTP header 'Content-Type'
|
|
@@ -241,7 +262,7 @@ module KlaviyoAPI
|
|
|
241
262
|
end
|
|
242
263
|
|
|
243
264
|
# Delete Coupon
|
|
244
|
-
# Delete the coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write`
|
|
265
|
+
# Delete the coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_coupon.json)
|
|
245
266
|
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
|
246
267
|
# @param [Hash] opts the optional parameters
|
|
247
268
|
# @return [nil]
|
|
@@ -251,7 +272,7 @@ module KlaviyoAPI
|
|
|
251
272
|
end
|
|
252
273
|
|
|
253
274
|
# Delete Coupon
|
|
254
|
-
# Delete the coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write`
|
|
275
|
+
# Delete the coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_coupon.json)
|
|
255
276
|
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
|
256
277
|
# @param [Hash] opts the optional parameters
|
|
257
278
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -272,7 +293,7 @@ module KlaviyoAPI
|
|
|
272
293
|
# header parameters
|
|
273
294
|
header_params = opts[:header_params] || {}
|
|
274
295
|
# klaviyo api revision
|
|
275
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
296
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
276
297
|
# HTTP header 'Accept' (if needed)
|
|
277
298
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
278
299
|
|
|
@@ -306,7 +327,7 @@ module KlaviyoAPI
|
|
|
306
327
|
end
|
|
307
328
|
|
|
308
329
|
# Delete Coupon Code
|
|
309
|
-
# Deletes a coupon code specified by the given identifier synchronously. If a profile has been assigned to the coupon code, an exception will be raised<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write`
|
|
330
|
+
# Deletes a coupon code specified by the given identifier synchronously. If a profile has been assigned to the coupon code, an exception will be raised<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_coupon_code.json)
|
|
310
331
|
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
|
311
332
|
# @param [Hash] opts the optional parameters
|
|
312
333
|
# @return [nil]
|
|
@@ -316,7 +337,7 @@ module KlaviyoAPI
|
|
|
316
337
|
end
|
|
317
338
|
|
|
318
339
|
# Delete Coupon Code
|
|
319
|
-
# Deletes a coupon code specified by the given identifier synchronously. If a profile has been assigned to the coupon code, an exception will be raised<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write`
|
|
340
|
+
# Deletes a coupon code specified by the given identifier synchronously. If a profile has been assigned to the coupon code, an exception will be raised<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/delete_coupon_code.json)
|
|
320
341
|
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
|
321
342
|
# @param [Hash] opts the optional parameters
|
|
322
343
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
@@ -337,7 +358,7 @@ module KlaviyoAPI
|
|
|
337
358
|
# header parameters
|
|
338
359
|
header_params = opts[:header_params] || {}
|
|
339
360
|
# klaviyo api revision
|
|
340
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
361
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
341
362
|
# HTTP header 'Accept' (if needed)
|
|
342
363
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
343
364
|
|
|
@@ -371,11 +392,11 @@ module KlaviyoAPI
|
|
|
371
392
|
end
|
|
372
393
|
|
|
373
394
|
# Get Bulk Create Coupon Code Jobs
|
|
374
|
-
# Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
395
|
+
# Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_bulk_create_coupon_code_jobs.json)
|
|
375
396
|
# @param [Hash] opts the optional parameters
|
|
376
|
-
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
377
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
378
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
397
|
+
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
398
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`
|
|
399
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
379
400
|
# @return [Hash<String, Object>]
|
|
380
401
|
def get_bulk_create_coupon_code_jobs(opts = {})
|
|
381
402
|
data, _status_code, _headers = get_bulk_create_coupon_code_jobs_with_http_info(opts)
|
|
@@ -386,17 +407,17 @@ module KlaviyoAPI
|
|
|
386
407
|
alias get_coupon_code_bulk_create_jobs get_bulk_create_coupon_code_jobs
|
|
387
408
|
|
|
388
409
|
# Get Bulk Create Coupon Code Jobs
|
|
389
|
-
# Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
410
|
+
# Get all coupon code bulk create jobs. Returns a maximum of 100 jobs per request.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_bulk_create_coupon_code_jobs.json)
|
|
390
411
|
# @param [Hash] opts the optional parameters
|
|
391
|
-
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
392
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
393
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
412
|
+
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
413
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`status`: `equals`
|
|
414
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
394
415
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
395
416
|
def get_bulk_create_coupon_code_jobs_with_http_info(opts = {})
|
|
396
417
|
if @api_client.config.debugging
|
|
397
418
|
@api_client.config.logger.debug 'Calling API: CouponsApi.get_bulk_create_coupon_code_jobs ...'
|
|
398
419
|
end
|
|
399
|
-
allowable_values = ["completed_at", "completed_count", "created_at", "errors", "expires_at", "failed_count", "status", "total_count"]
|
|
420
|
+
allowable_values = ["completed_at", "completed_count", "created_at", "errors", "expires_at", "failed_count", "id", "status", "total_count"]
|
|
400
421
|
if @api_client.config.client_side_validation && opts[:'fields_coupon_code_bulk_create_job'] && !opts[:'fields_coupon_code_bulk_create_job'].all? { |item| allowable_values.include?(item) }
|
|
401
422
|
fail ArgumentError, "invalid value for \"fields_coupon_code_bulk_create_job\", must include one of #{allowable_values}"
|
|
402
423
|
end
|
|
@@ -412,7 +433,7 @@ module KlaviyoAPI
|
|
|
412
433
|
# header parameters
|
|
413
434
|
header_params = opts[:header_params] || {}
|
|
414
435
|
# klaviyo api revision
|
|
415
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
436
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
416
437
|
# HTTP header 'Accept' (if needed)
|
|
417
438
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
418
439
|
|
|
@@ -449,12 +470,12 @@ module KlaviyoAPI
|
|
|
449
470
|
alias get_coupon_code_bulk_create_jobs_with_http_info get_bulk_create_coupon_code_jobs_with_http_info
|
|
450
471
|
|
|
451
472
|
# Get Bulk Create Coupon Codes Job
|
|
452
|
-
# Get a coupon code bulk create job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
473
|
+
# Get a coupon code bulk create job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_bulk_create_coupon_codes_job.json)
|
|
453
474
|
# @param job_id [String] ID of the job to retrieve.
|
|
454
475
|
# @param [Hash] opts the optional parameters
|
|
455
|
-
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
456
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
457
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
476
|
+
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
477
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
478
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
458
479
|
# @return [Hash<String, Object>]
|
|
459
480
|
def get_bulk_create_coupon_codes_job(job_id, opts = {})
|
|
460
481
|
data, _status_code, _headers = get_bulk_create_coupon_codes_job_with_http_info(job_id, opts)
|
|
@@ -465,12 +486,12 @@ module KlaviyoAPI
|
|
|
465
486
|
alias get_coupon_code_bulk_create_job get_bulk_create_coupon_codes_job
|
|
466
487
|
|
|
467
488
|
# Get Bulk Create Coupon Codes Job
|
|
468
|
-
# Get a coupon code bulk create job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
489
|
+
# Get a coupon code bulk create job with the given job ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_bulk_create_coupon_codes_job.json)
|
|
469
490
|
# @param job_id [String] ID of the job to retrieve.
|
|
470
491
|
# @param [Hash] opts the optional parameters
|
|
471
|
-
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
472
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
473
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
492
|
+
# @option opts [Array<String>] :fields_coupon_code_bulk_create_job For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
493
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
494
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
474
495
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
475
496
|
def get_bulk_create_coupon_codes_job_with_http_info(job_id, opts = {})
|
|
476
497
|
if @api_client.config.debugging
|
|
@@ -480,11 +501,11 @@ module KlaviyoAPI
|
|
|
480
501
|
if @api_client.config.client_side_validation && job_id.nil?
|
|
481
502
|
fail ArgumentError, "Missing the required parameter 'job_id' when calling CouponsApi.get_bulk_create_coupon_codes_job"
|
|
482
503
|
end
|
|
483
|
-
allowable_values = ["completed_at", "completed_count", "created_at", "errors", "expires_at", "failed_count", "status", "total_count"]
|
|
504
|
+
allowable_values = ["completed_at", "completed_count", "created_at", "errors", "expires_at", "failed_count", "id", "status", "total_count"]
|
|
484
505
|
if @api_client.config.client_side_validation && opts[:'fields_coupon_code_bulk_create_job'] && !opts[:'fields_coupon_code_bulk_create_job'].all? { |item| allowable_values.include?(item) }
|
|
485
506
|
fail ArgumentError, "invalid value for \"fields_coupon_code_bulk_create_job\", must include one of #{allowable_values}"
|
|
486
507
|
end
|
|
487
|
-
allowable_values = ["expires_at", "status", "unique_code"]
|
|
508
|
+
allowable_values = ["expires_at", "id", "status", "unique_code"]
|
|
488
509
|
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
|
489
510
|
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
|
490
511
|
end
|
|
@@ -504,7 +525,7 @@ module KlaviyoAPI
|
|
|
504
525
|
# header parameters
|
|
505
526
|
header_params = opts[:header_params] || {}
|
|
506
527
|
# klaviyo api revision
|
|
507
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
528
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
508
529
|
# HTTP header 'Accept' (if needed)
|
|
509
530
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
510
531
|
|
|
@@ -541,10 +562,10 @@ module KlaviyoAPI
|
|
|
541
562
|
alias get_coupon_code_bulk_create_job_with_http_info get_bulk_create_coupon_codes_job_with_http_info
|
|
542
563
|
|
|
543
564
|
# Get Coupon
|
|
544
|
-
# Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
565
|
+
# Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon.json)
|
|
545
566
|
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
|
546
567
|
# @param [Hash] opts the optional parameters
|
|
547
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
568
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
548
569
|
# @return [Hash<String, Object>]
|
|
549
570
|
def get_coupon(id, opts = {})
|
|
550
571
|
data, _status_code, _headers = get_coupon_with_http_info(id, opts)
|
|
@@ -552,10 +573,10 @@ module KlaviyoAPI
|
|
|
552
573
|
end
|
|
553
574
|
|
|
554
575
|
# Get Coupon
|
|
555
|
-
# Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
576
|
+
# Get a specific coupon with the given coupon ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon.json)
|
|
556
577
|
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
|
557
578
|
# @param [Hash] opts the optional parameters
|
|
558
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
579
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
559
580
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
560
581
|
def get_coupon_with_http_info(id, opts = {})
|
|
561
582
|
if @api_client.config.debugging
|
|
@@ -565,7 +586,7 @@ module KlaviyoAPI
|
|
|
565
586
|
if @api_client.config.client_side_validation && id.nil?
|
|
566
587
|
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon"
|
|
567
588
|
end
|
|
568
|
-
allowable_values = ["description", "external_id", "monitor_configuration"]
|
|
589
|
+
allowable_values = ["description", "external_id", "id", "monitor_configuration"]
|
|
569
590
|
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
|
570
591
|
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
|
571
592
|
end
|
|
@@ -579,7 +600,7 @@ module KlaviyoAPI
|
|
|
579
600
|
# header parameters
|
|
580
601
|
header_params = opts[:header_params] || {}
|
|
581
602
|
# klaviyo api revision
|
|
582
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
603
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
583
604
|
# HTTP header 'Accept' (if needed)
|
|
584
605
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
585
606
|
|
|
@@ -613,12 +634,12 @@ module KlaviyoAPI
|
|
|
613
634
|
end
|
|
614
635
|
|
|
615
636
|
# Get Coupon Code
|
|
616
|
-
# Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read`
|
|
637
|
+
# Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_code.json)
|
|
617
638
|
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
|
618
639
|
# @param [Hash] opts the optional parameters
|
|
619
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
620
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
621
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
640
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
641
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
642
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
622
643
|
# @return [Hash<String, Object>]
|
|
623
644
|
def get_coupon_code(id, opts = {})
|
|
624
645
|
data, _status_code, _headers = get_coupon_code_with_http_info(id, opts)
|
|
@@ -626,12 +647,12 @@ module KlaviyoAPI
|
|
|
626
647
|
end
|
|
627
648
|
|
|
628
649
|
# Get Coupon Code
|
|
629
|
-
# Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read`
|
|
650
|
+
# Returns a Coupon Code specified by the given identifier.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_code.json)
|
|
630
651
|
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
|
631
652
|
# @param [Hash] opts the optional parameters
|
|
632
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
633
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
634
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
653
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
654
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
655
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
635
656
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
636
657
|
def get_coupon_code_with_http_info(id, opts = {})
|
|
637
658
|
if @api_client.config.debugging
|
|
@@ -641,11 +662,11 @@ module KlaviyoAPI
|
|
|
641
662
|
if @api_client.config.client_side_validation && id.nil?
|
|
642
663
|
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_code"
|
|
643
664
|
end
|
|
644
|
-
allowable_values = ["expires_at", "status", "unique_code"]
|
|
665
|
+
allowable_values = ["expires_at", "id", "status", "unique_code"]
|
|
645
666
|
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
|
646
667
|
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
|
647
668
|
end
|
|
648
|
-
allowable_values = ["description", "external_id", "monitor_configuration"]
|
|
669
|
+
allowable_values = ["description", "external_id", "id", "monitor_configuration"]
|
|
649
670
|
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
|
650
671
|
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
|
651
672
|
end
|
|
@@ -665,7 +686,7 @@ module KlaviyoAPI
|
|
|
665
686
|
# header parameters
|
|
666
687
|
header_params = opts[:header_params] || {}
|
|
667
688
|
# klaviyo api revision
|
|
668
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
689
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
669
690
|
# HTTP header 'Accept' (if needed)
|
|
670
691
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
671
692
|
|
|
@@ -699,11 +720,12 @@ module KlaviyoAPI
|
|
|
699
720
|
end
|
|
700
721
|
|
|
701
722
|
# Get Coupon Code IDs for Coupon
|
|
702
|
-
# Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
723
|
+
# Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_code_ids_for_coupon.json)
|
|
703
724
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
704
725
|
# @param [Hash] opts the optional parameters
|
|
705
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
706
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
726
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`
|
|
727
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
728
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
707
729
|
# @return [Hash<String, Object>]
|
|
708
730
|
def get_coupon_code_ids_for_coupon(id, opts = {})
|
|
709
731
|
data, _status_code, _headers = get_coupon_code_ids_for_coupon_with_http_info(id, opts)
|
|
@@ -720,11 +742,12 @@ module KlaviyoAPI
|
|
|
720
742
|
alias get_coupon_relationships_codes get_coupon_code_ids_for_coupon
|
|
721
743
|
|
|
722
744
|
# Get Coupon Code IDs for Coupon
|
|
723
|
-
# Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
745
|
+
# Gets a list of coupon code relationships associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_code_ids_for_coupon.json)
|
|
724
746
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
725
747
|
# @param [Hash] opts the optional parameters
|
|
726
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
727
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
748
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`
|
|
749
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
750
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
728
751
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
729
752
|
def get_coupon_code_ids_for_coupon_with_http_info(id, opts = {})
|
|
730
753
|
if @api_client.config.debugging
|
|
@@ -734,6 +757,14 @@ module KlaviyoAPI
|
|
|
734
757
|
if @api_client.config.client_side_validation && id.nil?
|
|
735
758
|
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_code_ids_for_coupon"
|
|
736
759
|
end
|
|
760
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
761
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupon_code_ids_for_coupon, must be smaller than or equal to 100.'
|
|
762
|
+
end
|
|
763
|
+
|
|
764
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
765
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupon_code_ids_for_coupon, must be greater than or equal to 1.'
|
|
766
|
+
end
|
|
767
|
+
|
|
737
768
|
# resource path
|
|
738
769
|
local_var_path = '/api/coupons/{id}/relationships/coupon-codes'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
739
770
|
|
|
@@ -741,11 +772,12 @@ module KlaviyoAPI
|
|
|
741
772
|
query_params = opts[:query_params] || {}
|
|
742
773
|
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
|
743
774
|
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
775
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
744
776
|
|
|
745
777
|
# header parameters
|
|
746
778
|
header_params = opts[:header_params] || {}
|
|
747
779
|
# klaviyo api revision
|
|
748
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
780
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
749
781
|
# HTTP header 'Accept' (if needed)
|
|
750
782
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
751
783
|
|
|
@@ -788,13 +820,14 @@ module KlaviyoAPI
|
|
|
788
820
|
alias get_coupon_relationships_codes_with_http_info get_coupon_code_ids_for_coupon_with_http_info
|
|
789
821
|
|
|
790
822
|
# Get Coupon Codes
|
|
791
|
-
# Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read`
|
|
792
|
-
# @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
823
|
+
# Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_codes.json)
|
|
824
|
+
# @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`
|
|
793
825
|
# @param [Hash] opts the optional parameters
|
|
794
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
795
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
796
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
797
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
826
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
827
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
828
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
829
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
830
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
798
831
|
# @return [Hash<String, Object>]
|
|
799
832
|
def get_coupon_codes(filter, opts = {})
|
|
800
833
|
data, _status_code, _headers = get_coupon_codes_with_http_info(filter, opts)
|
|
@@ -802,13 +835,14 @@ module KlaviyoAPI
|
|
|
802
835
|
end
|
|
803
836
|
|
|
804
837
|
# Get Coupon Codes
|
|
805
|
-
# Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read`
|
|
806
|
-
# @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
838
|
+
# Gets a list of coupon codes associated with a coupon/coupons or a profile/profiles. A coupon/coupons or a profile/profiles must be provided as required filter params.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_codes.json)
|
|
839
|
+
# @param filter [String] For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`
|
|
807
840
|
# @param [Hash] opts the optional parameters
|
|
808
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
809
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
810
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
811
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
841
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
842
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
843
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#relationships
|
|
844
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
845
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
812
846
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
813
847
|
def get_coupon_codes_with_http_info(filter, opts = {})
|
|
814
848
|
if @api_client.config.debugging
|
|
@@ -818,11 +852,11 @@ module KlaviyoAPI
|
|
|
818
852
|
if @api_client.config.client_side_validation && filter.nil?
|
|
819
853
|
fail ArgumentError, "Missing the required parameter 'filter' when calling CouponsApi.get_coupon_codes"
|
|
820
854
|
end
|
|
821
|
-
allowable_values = ["expires_at", "status", "unique_code"]
|
|
855
|
+
allowable_values = ["expires_at", "id", "status", "unique_code"]
|
|
822
856
|
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
|
823
857
|
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
|
824
858
|
end
|
|
825
|
-
allowable_values = ["description", "external_id", "monitor_configuration"]
|
|
859
|
+
allowable_values = ["description", "external_id", "id", "monitor_configuration"]
|
|
826
860
|
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
|
827
861
|
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
|
828
862
|
end
|
|
@@ -830,6 +864,14 @@ module KlaviyoAPI
|
|
|
830
864
|
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
|
831
865
|
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
|
832
866
|
end
|
|
867
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
868
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupon_codes, must be smaller than or equal to 100.'
|
|
869
|
+
end
|
|
870
|
+
|
|
871
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
872
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupon_codes, must be greater than or equal to 1.'
|
|
873
|
+
end
|
|
874
|
+
|
|
833
875
|
# resource path
|
|
834
876
|
local_var_path = '/api/coupon-codes'
|
|
835
877
|
|
|
@@ -840,11 +882,12 @@ module KlaviyoAPI
|
|
|
840
882
|
query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil?
|
|
841
883
|
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
|
842
884
|
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
885
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
843
886
|
|
|
844
887
|
# header parameters
|
|
845
888
|
header_params = opts[:header_params] || {}
|
|
846
889
|
# klaviyo api revision
|
|
847
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
890
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
848
891
|
# HTTP header 'Accept' (if needed)
|
|
849
892
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
850
893
|
|
|
@@ -878,12 +921,13 @@ module KlaviyoAPI
|
|
|
878
921
|
end
|
|
879
922
|
|
|
880
923
|
# Get Coupon Codes for Coupon
|
|
881
|
-
# Gets a list of coupon codes associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
924
|
+
# Gets a list of coupon codes associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_codes_for_coupon.json)
|
|
882
925
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
883
926
|
# @param [Hash] opts the optional parameters
|
|
884
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
885
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
886
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
927
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
928
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`
|
|
929
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
930
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
887
931
|
# @return [Hash<String, Object>]
|
|
888
932
|
def get_coupon_codes_for_coupon(id, opts = {})
|
|
889
933
|
data, _status_code, _headers = get_coupon_codes_for_coupon_with_http_info(id, opts)
|
|
@@ -897,12 +941,13 @@ module KlaviyoAPI
|
|
|
897
941
|
alias get_codes_for_coupon get_coupon_codes_for_coupon
|
|
898
942
|
|
|
899
943
|
# Get Coupon Codes for Coupon
|
|
900
|
-
# Gets a list of coupon codes associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read`
|
|
944
|
+
# Gets a list of coupon codes associated with the given coupon id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupon-codes:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_codes_for_coupon.json)
|
|
901
945
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
902
946
|
# @param [Hash] opts the optional parameters
|
|
903
|
-
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
904
|
-
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
905
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
947
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
948
|
+
# @option opts [String] :filter For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#filtering<br>Allowed field(s)/operator(s):<br>`expires_at`: `greater-or-equal`, `greater-than`, `less-or-equal`, `less-than`<br>`status`: `equals`<br>`coupon.id`: `any`, `equals`<br>`profile.id`: `any`, `equals`
|
|
949
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
950
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
906
951
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
907
952
|
def get_coupon_codes_for_coupon_with_http_info(id, opts = {})
|
|
908
953
|
if @api_client.config.debugging
|
|
@@ -912,10 +957,18 @@ module KlaviyoAPI
|
|
|
912
957
|
if @api_client.config.client_side_validation && id.nil?
|
|
913
958
|
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_codes_for_coupon"
|
|
914
959
|
end
|
|
915
|
-
allowable_values = ["expires_at", "status", "unique_code"]
|
|
960
|
+
allowable_values = ["expires_at", "id", "status", "unique_code"]
|
|
916
961
|
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
|
917
962
|
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
|
918
963
|
end
|
|
964
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
965
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupon_codes_for_coupon, must be smaller than or equal to 100.'
|
|
966
|
+
end
|
|
967
|
+
|
|
968
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
969
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupon_codes_for_coupon, must be greater than or equal to 1.'
|
|
970
|
+
end
|
|
971
|
+
|
|
919
972
|
# resource path
|
|
920
973
|
local_var_path = '/api/coupons/{id}/coupon-codes'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
921
974
|
|
|
@@ -924,11 +977,12 @@ module KlaviyoAPI
|
|
|
924
977
|
query_params[:'fields[coupon-code]'] = @api_client.build_collection_param(opts[:'fields_coupon_code'], :csv) if !opts[:'fields_coupon_code'].nil?
|
|
925
978
|
query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
|
|
926
979
|
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
980
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
927
981
|
|
|
928
982
|
# header parameters
|
|
929
983
|
header_params = opts[:header_params] || {}
|
|
930
984
|
# klaviyo api revision
|
|
931
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
985
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
932
986
|
# HTTP header 'Accept' (if needed)
|
|
933
987
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
934
988
|
|
|
@@ -968,10 +1022,10 @@ module KlaviyoAPI
|
|
|
968
1022
|
alias get_codes_for_coupon_with_http_info get_coupon_codes_for_coupon_with_http_info
|
|
969
1023
|
|
|
970
1024
|
# Get Coupon For Coupon Code
|
|
971
|
-
# Get the coupon associated with a given coupon code ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
1025
|
+
# Get the coupon associated with a given coupon code ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_for_coupon_code.json)
|
|
972
1026
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
973
1027
|
# @param [Hash] opts the optional parameters
|
|
974
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1028
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
975
1029
|
# @return [Hash<String, Object>]
|
|
976
1030
|
def get_coupon_for_coupon_code(id, opts = {})
|
|
977
1031
|
data, _status_code, _headers = get_coupon_for_coupon_code_with_http_info(id, opts)
|
|
@@ -982,10 +1036,10 @@ module KlaviyoAPI
|
|
|
982
1036
|
alias get_coupon_code_coupon get_coupon_for_coupon_code
|
|
983
1037
|
|
|
984
1038
|
# Get Coupon For Coupon Code
|
|
985
|
-
# Get the coupon associated with a given coupon code ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
1039
|
+
# Get the coupon associated with a given coupon code ID.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_for_coupon_code.json)
|
|
986
1040
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
987
1041
|
# @param [Hash] opts the optional parameters
|
|
988
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1042
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
989
1043
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
990
1044
|
def get_coupon_for_coupon_code_with_http_info(id, opts = {})
|
|
991
1045
|
if @api_client.config.debugging
|
|
@@ -995,7 +1049,7 @@ module KlaviyoAPI
|
|
|
995
1049
|
if @api_client.config.client_side_validation && id.nil?
|
|
996
1050
|
fail ArgumentError, "Missing the required parameter 'id' when calling CouponsApi.get_coupon_for_coupon_code"
|
|
997
1051
|
end
|
|
998
|
-
allowable_values = ["description", "external_id", "monitor_configuration"]
|
|
1052
|
+
allowable_values = ["description", "external_id", "id", "monitor_configuration"]
|
|
999
1053
|
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
|
1000
1054
|
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
|
1001
1055
|
end
|
|
@@ -1009,7 +1063,7 @@ module KlaviyoAPI
|
|
|
1009
1063
|
# header parameters
|
|
1010
1064
|
header_params = opts[:header_params] || {}
|
|
1011
1065
|
# klaviyo api revision
|
|
1012
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1066
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1013
1067
|
# HTTP header 'Accept' (if needed)
|
|
1014
1068
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1015
1069
|
|
|
@@ -1046,7 +1100,7 @@ module KlaviyoAPI
|
|
|
1046
1100
|
alias get_coupon_code_coupon_with_http_info get_coupon_for_coupon_code_with_http_info
|
|
1047
1101
|
|
|
1048
1102
|
# Get Coupon ID for Coupon Code
|
|
1049
|
-
# Gets the coupon relationship associated with the given coupon code id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
1103
|
+
# Gets the coupon relationship associated with the given coupon code id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_id_for_coupon_code.json)
|
|
1050
1104
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
1051
1105
|
# @param [Hash] opts the optional parameters
|
|
1052
1106
|
# @return [Hash<String, Object>]
|
|
@@ -1059,7 +1113,7 @@ module KlaviyoAPI
|
|
|
1059
1113
|
alias get_coupon_relationships_coupon_codes get_coupon_id_for_coupon_code
|
|
1060
1114
|
|
|
1061
1115
|
# Get Coupon ID for Coupon Code
|
|
1062
|
-
# Gets the coupon relationship associated with the given coupon code id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
1116
|
+
# Gets the coupon relationship associated with the given coupon code id<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupon_id_for_coupon_code.json)
|
|
1063
1117
|
# @param id [String] The ID of the coupon to look up the relationship of.
|
|
1064
1118
|
# @param [Hash] opts the optional parameters
|
|
1065
1119
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
@@ -1080,7 +1134,7 @@ module KlaviyoAPI
|
|
|
1080
1134
|
# header parameters
|
|
1081
1135
|
header_params = opts[:header_params] || {}
|
|
1082
1136
|
# klaviyo api revision
|
|
1083
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1137
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1084
1138
|
# HTTP header 'Accept' (if needed)
|
|
1085
1139
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1086
1140
|
|
|
@@ -1117,10 +1171,11 @@ module KlaviyoAPI
|
|
|
1117
1171
|
alias get_coupon_relationships_coupon_codes_with_http_info get_coupon_id_for_coupon_code_with_http_info
|
|
1118
1172
|
|
|
1119
1173
|
# Get Coupons
|
|
1120
|
-
# Get all coupons in an account. To learn more, see our [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
1174
|
+
# Get all coupons in an account. To learn more, see our [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupons.json)
|
|
1121
1175
|
# @param [Hash] opts the optional parameters
|
|
1122
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1123
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1176
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1177
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1178
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
1124
1179
|
# @return [Hash<String, Object>]
|
|
1125
1180
|
def get_coupons(opts = {})
|
|
1126
1181
|
data, _status_code, _headers = get_coupons_with_http_info(opts)
|
|
@@ -1128,19 +1183,28 @@ module KlaviyoAPI
|
|
|
1128
1183
|
end
|
|
1129
1184
|
|
|
1130
1185
|
# Get Coupons
|
|
1131
|
-
# Get all coupons in an account. To learn more, see our [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read`
|
|
1186
|
+
# Get all coupons in an account. To learn more, see our [Coupons API guide](https://developers.klaviyo.com/en/docs/use_klaviyos_coupons_api).<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `750/m` **Scopes:** `coupons:read` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/get_coupons.json)
|
|
1132
1187
|
# @param [Hash] opts the optional parameters
|
|
1133
|
-
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1134
|
-
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-
|
|
1188
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1189
|
+
# @option opts [String] :page_cursor For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#pagination
|
|
1190
|
+
# @option opts [Integer] :page_size Default: 100. Min: 1. Max: 100. (default to 100)
|
|
1135
1191
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1136
1192
|
def get_coupons_with_http_info(opts = {})
|
|
1137
1193
|
if @api_client.config.debugging
|
|
1138
1194
|
@api_client.config.logger.debug 'Calling API: CouponsApi.get_coupons ...'
|
|
1139
1195
|
end
|
|
1140
|
-
allowable_values = ["description", "external_id", "monitor_configuration"]
|
|
1196
|
+
allowable_values = ["description", "external_id", "id", "monitor_configuration"]
|
|
1141
1197
|
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
|
1142
1198
|
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
|
1143
1199
|
end
|
|
1200
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100
|
|
1201
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupons, must be smaller than or equal to 100.'
|
|
1202
|
+
end
|
|
1203
|
+
|
|
1204
|
+
if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
|
|
1205
|
+
fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling CouponsApi.get_coupons, must be greater than or equal to 1.'
|
|
1206
|
+
end
|
|
1207
|
+
|
|
1144
1208
|
# resource path
|
|
1145
1209
|
local_var_path = '/api/coupons'
|
|
1146
1210
|
|
|
@@ -1148,11 +1212,12 @@ module KlaviyoAPI
|
|
|
1148
1212
|
query_params = opts[:query_params] || {}
|
|
1149
1213
|
query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil?
|
|
1150
1214
|
query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil?
|
|
1215
|
+
query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
1151
1216
|
|
|
1152
1217
|
# header parameters
|
|
1153
1218
|
header_params = opts[:header_params] || {}
|
|
1154
1219
|
# klaviyo api revision
|
|
1155
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1220
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1156
1221
|
# HTTP header 'Accept' (if needed)
|
|
1157
1222
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1158
1223
|
|
|
@@ -1186,10 +1251,11 @@ module KlaviyoAPI
|
|
|
1186
1251
|
end
|
|
1187
1252
|
|
|
1188
1253
|
# Update Coupon
|
|
1189
|
-
# *Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write`
|
|
1254
|
+
# *Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_coupon.json)
|
|
1190
1255
|
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
|
1191
1256
|
# @param coupon_update_query [CouponUpdateQuery]
|
|
1192
1257
|
# @param [Hash] opts the optional parameters
|
|
1258
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1193
1259
|
# @return [Hash<String, Object>]
|
|
1194
1260
|
def update_coupon(id, coupon_update_query, opts = {})
|
|
1195
1261
|
data, _status_code, _headers = update_coupon_with_http_info(id, coupon_update_query, opts)
|
|
@@ -1197,10 +1263,11 @@ module KlaviyoAPI
|
|
|
1197
1263
|
end
|
|
1198
1264
|
|
|
1199
1265
|
# Update Coupon
|
|
1200
|
-
# *Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write`
|
|
1266
|
+
# *Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `coupons:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_coupon.json)
|
|
1201
1267
|
# @param id [String] The internal id of a Coupon is equivalent to its external id stored within an integration.
|
|
1202
1268
|
# @param coupon_update_query [CouponUpdateQuery]
|
|
1203
1269
|
# @param [Hash] opts the optional parameters
|
|
1270
|
+
# @option opts [Array<String>] :fields_coupon For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1204
1271
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1205
1272
|
def update_coupon_with_http_info(id, coupon_update_query, opts = {})
|
|
1206
1273
|
if @api_client.config.debugging
|
|
@@ -1214,16 +1281,21 @@ module KlaviyoAPI
|
|
|
1214
1281
|
if @api_client.config.client_side_validation && coupon_update_query.nil?
|
|
1215
1282
|
fail ArgumentError, "Missing the required parameter 'coupon_update_query' when calling CouponsApi.update_coupon"
|
|
1216
1283
|
end
|
|
1284
|
+
allowable_values = ["description", "external_id", "id", "monitor_configuration"]
|
|
1285
|
+
if @api_client.config.client_side_validation && opts[:'fields_coupon'] && !opts[:'fields_coupon'].all? { |item| allowable_values.include?(item) }
|
|
1286
|
+
fail ArgumentError, "invalid value for \"fields_coupon\", must include one of #{allowable_values}"
|
|
1287
|
+
end
|
|
1217
1288
|
# resource path
|
|
1218
1289
|
local_var_path = '/api/coupons/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1219
1290
|
|
|
1220
1291
|
# query parameters
|
|
1221
1292
|
query_params = opts[:query_params] || {}
|
|
1293
|
+
query_params[:'fields[coupon]'] = @api_client.build_collection_param(opts[:'fields_coupon'], :csv) if !opts[:'fields_coupon'].nil?
|
|
1222
1294
|
|
|
1223
1295
|
# header parameters
|
|
1224
1296
|
header_params = opts[:header_params] || {}
|
|
1225
1297
|
# klaviyo api revision
|
|
1226
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1298
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1227
1299
|
# HTTP header 'Accept' (if needed)
|
|
1228
1300
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1229
1301
|
# HTTP header 'Content-Type'
|
|
@@ -1262,10 +1334,11 @@ module KlaviyoAPI
|
|
|
1262
1334
|
end
|
|
1263
1335
|
|
|
1264
1336
|
# Update Coupon Code
|
|
1265
|
-
# Updates a coupon code specified by the given identifier synchronously. We allow updating the 'status' and 'expires_at' of coupon codes.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write`
|
|
1337
|
+
# Updates a coupon code specified by the given identifier synchronously. We allow updating the 'status' and 'expires_at' of coupon codes.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_coupon_code.json)
|
|
1266
1338
|
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
|
1267
1339
|
# @param coupon_code_update_query [CouponCodeUpdateQuery]
|
|
1268
1340
|
# @param [Hash] opts the optional parameters
|
|
1341
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1269
1342
|
# @return [Hash<String, Object>]
|
|
1270
1343
|
def update_coupon_code(id, coupon_code_update_query, opts = {})
|
|
1271
1344
|
data, _status_code, _headers = update_coupon_code_with_http_info(id, coupon_code_update_query, opts)
|
|
@@ -1273,10 +1346,11 @@ module KlaviyoAPI
|
|
|
1273
1346
|
end
|
|
1274
1347
|
|
|
1275
1348
|
# Update Coupon Code
|
|
1276
|
-
# Updates a coupon code specified by the given identifier synchronously. We allow updating the 'status' and 'expires_at' of coupon codes.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write`
|
|
1349
|
+
# Updates a coupon code specified by the given identifier synchronously. We allow updating the 'status' and 'expires_at' of coupon codes.<br><br>*Rate limits*:<br>Burst: `350/s`<br>Steady: `3500/m` **Scopes:** `coupon-codes:write` [OpenAPI Spec](https://raw.githubusercontent.com/klaviyo/openapi/main/openapi/stable/apis/update_coupon_code.json)
|
|
1277
1350
|
# @param id [String] The id of a coupon code is a combination of its unique code and the id of the coupon it is associated with.
|
|
1278
1351
|
# @param coupon_code_update_query [CouponCodeUpdateQuery]
|
|
1279
1352
|
# @param [Hash] opts the optional parameters
|
|
1353
|
+
# @option opts [Array<String>] :fields_coupon_code For more information please visit https://developers.klaviyo.com/en/v2026-07-15/reference/api-overview#sparse-fieldsets
|
|
1280
1354
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
|
1281
1355
|
def update_coupon_code_with_http_info(id, coupon_code_update_query, opts = {})
|
|
1282
1356
|
if @api_client.config.debugging
|
|
@@ -1290,16 +1364,21 @@ module KlaviyoAPI
|
|
|
1290
1364
|
if @api_client.config.client_side_validation && coupon_code_update_query.nil?
|
|
1291
1365
|
fail ArgumentError, "Missing the required parameter 'coupon_code_update_query' when calling CouponsApi.update_coupon_code"
|
|
1292
1366
|
end
|
|
1367
|
+
allowable_values = ["expires_at", "id", "status", "unique_code"]
|
|
1368
|
+
if @api_client.config.client_side_validation && opts[:'fields_coupon_code'] && !opts[:'fields_coupon_code'].all? { |item| allowable_values.include?(item) }
|
|
1369
|
+
fail ArgumentError, "invalid value for \"fields_coupon_code\", must include one of #{allowable_values}"
|
|
1370
|
+
end
|
|
1293
1371
|
# resource path
|
|
1294
1372
|
local_var_path = '/api/coupon-codes/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
1295
1373
|
|
|
1296
1374
|
# query parameters
|
|
1297
1375
|
query_params = opts[:query_params] || {}
|
|
1376
|
+
query_params[:'fields[coupon-code]'] = @api_client.build_collection_param(opts[:'fields_coupon_code'], :csv) if !opts[:'fields_coupon_code'].nil?
|
|
1298
1377
|
|
|
1299
1378
|
# header parameters
|
|
1300
1379
|
header_params = opts[:header_params] || {}
|
|
1301
1380
|
# klaviyo api revision
|
|
1302
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-
|
|
1381
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2026-07-15"
|
|
1303
1382
|
# HTTP header 'Accept' (if needed)
|
|
1304
1383
|
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
|
1305
1384
|
# HTTP header 'Content-Type'
|