Class: TalonOne::IntegrationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/talon_one_sdk/api/integration_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ IntegrationApi

Returns a new instance of IntegrationApi.



19
20
21
# File 'lib/talon_one_sdk/api/integration_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/talon_one_sdk/api/integration_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#activate_loyalty_points(loyalty_program_id, activate_loyalty_points, opts = {}) ⇒ ActivateLoyaltyPointsResponse

Activate loyalty points Activate points when a defined action occurs. You can activate pending points using one of the following parameters: - ‘sessionId`: Activates all points earned in the specified session. - `transactionUUIDs`: Activates points earned in the transactions specified by the given UUIDs.

Parameters:

Returns:



28
29
30
31
# File 'lib/talon_one_sdk/api/integration_api.rb', line 28

def activate_loyalty_points(loyalty_program_id, activate_loyalty_points, opts = {})
  data, _status_code, _headers = activate_loyalty_points_with_http_info(loyalty_program_id, activate_loyalty_points, opts)
  data
end

#activate_loyalty_points_with_http_info(loyalty_program_id, activate_loyalty_points, opts = {}) ⇒ Array<(ActivateLoyaltyPointsResponse, Integer, Hash)>

Activate loyalty points Activate points when a defined action occurs. You can activate pending points using one of the following parameters: - &#x60;sessionId&#x60;: Activates all points earned in the specified session. - &#x60;transactionUUIDs&#x60;: Activates points earned in the transactions specified by the given UUIDs.

Parameters:

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/talon_one_sdk/api/integration_api.rb', line 39

def activate_loyalty_points_with_http_info(loyalty_program_id, activate_loyalty_points, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.activate_loyalty_points ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.activate_loyalty_points"
  end
  # verify the required parameter 'activate_loyalty_points' is set
  if @api_client.config.client_side_validation && activate_loyalty_points.nil?
    fail ArgumentError, "Missing the required parameter 'activate_loyalty_points' when calling IntegrationApi.activate_loyalty_points"
  end
  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/activate_points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(activate_loyalty_points)

  # return_type
  return_type = opts[:debug_return_type] || 'ActivateLoyaltyPointsResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.activate_loyalty_points",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#activate_loyalty_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#best_prior_price(best_prior_price_request, opts = {}) ⇒ Array<BestPriorPrice>

Fetch best prior price Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe.

Parameters:

  • best_prior_price_request (BestPriorPriceRequest)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



101
102
103
104
# File 'lib/talon_one_sdk/api/integration_api.rb', line 101

def best_prior_price(best_prior_price_request, opts = {})
  data, _status_code, _headers = best_prior_price_with_http_info(best_prior_price_request, opts)
  data
end

#best_prior_price_with_http_info(best_prior_price_request, opts = {}) ⇒ Array<(Array<BestPriorPrice>, Integer, Hash)>

Fetch best prior price Returns the best prior price based on historical pricing data for the specified SKUs within a defined timeframe.

Parameters:

  • best_prior_price_request (BestPriorPriceRequest)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Array<BestPriorPrice>, Integer, Hash)>)

    Array<BestPriorPrice> data, response status code and response headers



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/talon_one_sdk/api/integration_api.rb', line 111

def best_prior_price_with_http_info(best_prior_price_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.best_prior_price ...'
  end
  # verify the required parameter 'best_prior_price_request' is set
  if @api_client.config.client_side_validation && best_prior_price_request.nil?
    fail ArgumentError, "Missing the required parameter 'best_prior_price_request' when calling IntegrationApi.best_prior_price"
  end
  # resource path
  local_var_path = '/v1/best_prior_price'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(best_prior_price_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Array<BestPriorPrice>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.best_prior_price",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#best_prior_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_audience_v2(new_audience, opts = {}) ⇒ Audience

Create audience Create an audience. The audience can be created directly from scratch or can come from third party platforms. > [!note] Audiences can also be created from scratch via the Campaign Manager. See the [docs](docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](docs.talon.one/docs/dev/technology-partners/overview): 1. Set the ‘integration` property to `mparticle`, `segment` etc., depending on a third-party platform. 1. Set `integrationId` to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the `integration` property. 1. Set `integrationId` to the ID of this audience in the 3rd-party platform. To create an audience from scratch, only set the `name` property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder.

Parameters:

  • new_audience (NewAudience)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



169
170
171
172
# File 'lib/talon_one_sdk/api/integration_api.rb', line 169

def create_audience_v2(new_audience, opts = {})
  data, _status_code, _headers = create_audience_v2_with_http_info(new_audience, opts)
  data
end

#create_audience_v2_with_http_info(new_audience, opts = {}) ⇒ Array<(Audience, Integer, Hash)>

Create audience Create an audience. The audience can be created directly from scratch or can come from third party platforms. &gt; [!note] Audiences can also be created from scratch via the Campaign Manager. See the [docs](docs.talon.one/docs/product/audiences/creating-audiences). To create an audience from an existing audience from a [technology partner](docs.talon.one/docs/dev/technology-partners/overview): 1. Set the &#x60;integration&#x60; property to &#x60;mparticle&#x60;, &#x60;segment&#x60; etc., depending on a third-party platform. 1. Set &#x60;integrationId&#x60; to the ID of this audience in a third-party platform. To create an audience from an existing audience in another platform: 1. Do not use the &#x60;integration&#x60; property. 1. Set &#x60;integrationId&#x60; to the ID of this audience in the 3rd-party platform. To create an audience from scratch, only set the &#x60;name&#x60; property. Once you create your first audience, audience-specific rule conditions are enabled in the Rule Builder.

Parameters:

  • new_audience (NewAudience)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Audience, Integer, Hash)>)

    Audience data, response status code and response headers



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/talon_one_sdk/api/integration_api.rb', line 179

def create_audience_v2_with_http_info(new_audience, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_audience_v2 ...'
  end
  # verify the required parameter 'new_audience' is set
  if @api_client.config.client_side_validation && new_audience.nil?
    fail ArgumentError, "Missing the required parameter 'new_audience' when calling IntegrationApi.create_audience_v2"
  end
  # resource path
  local_var_path = '/v2/audiences'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(new_audience)

  # return_type
  return_type = opts[:debug_return_type] || 'Audience'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.create_audience_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_audience_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_coupon_reservation(coupon_value, coupon_reservations, opts = {}) ⇒ Coupon

Create coupon reservation Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. > [!note] Note > - If the **Reservation mandatory** option was selected when creating the > specified coupon, the endpoint creates a hard reservation, meaning only users who have > this coupon code reserved can redeem it. > > Otherwise, the endpoint creates a soft reservation, meaning the coupon > is associated with the specified customer profiles (they show up when using > the [List customer data](docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) > endpoint), but any user can redeem it. > > This can be useful, for example, to display a _coupon wallet_ for customers > when they visit your store. > - If the **Coupon visibility** option was selected when creating the > specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code > will be returned for all customer profiles in the [List customer > data](docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) endpoint. > - This endpoint overrides the coupon reservation limit set when > [the coupon is created](docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint.

Parameters:

  • coupon_value (String)

    The code of the coupon. Important: The coupon code requires [URL encoding](www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode &#x60;SUMMER25%OFF&#x60; as &#x60;SUMMER25%25OFF&#x60;.

  • coupon_reservations (CouponReservations)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



238
239
240
241
# File 'lib/talon_one_sdk/api/integration_api.rb', line 238

def create_coupon_reservation(coupon_value, coupon_reservations, opts = {})
  data, _status_code, _headers = create_coupon_reservation_with_http_info(coupon_value, coupon_reservations, opts)
  data
end

#create_coupon_reservation_with_http_info(coupon_value, coupon_reservations, opts = {}) ⇒ Array<(Coupon, Integer, Hash)>

Create coupon reservation Create a coupon reservation for the specified customer profiles on the specified coupon. You can also create a reservation via the Campaign Manager using the [Create coupon code reservation](docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect. &gt; [!note] Note &gt; - If the **Reservation mandatory** option was selected when creating the &gt; specified coupon, the endpoint creates a hard reservation, meaning only users who have &gt; this coupon code reserved can redeem it. &gt; &gt; Otherwise, the endpoint creates a soft reservation, meaning the coupon &gt; is associated with the specified customer profiles (they show up when using &gt; the [List customer data](docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) &gt; endpoint), but any user can redeem it. &gt; &gt; This can be useful, for example, to display a _coupon wallet_ for customers &gt; when they visit your store. &gt; - If the **Coupon visibility** option was selected when creating the &gt; specified coupon, the coupon code is implicitly soft-reserved for all customers, and the code &gt; will be returned for all customer profiles in the [List customer &gt; data](docs.talon.one/integration-api#tag/Customer-profiles/operation/getCustomerInventory) endpoint. &gt; - This endpoint overrides the coupon reservation limit set when &gt; [the coupon is created](docs.talon.one/docs/product/campaigns/coupons/creating-coupons). To ensure that coupons cannot be reserved after the reservation limit is reached, use the [Create coupon code reservation](docs.talon.one/docs/product/rules/effects/using-effects#reserving-a-coupon-code) effect in the Rule Builder and the [Update customer session](docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint. To delete a reservation, use the [Delete reservation](docs.talon.one/integration-api#tag/Coupons/operation/deleteCouponReservation) endpoint.

Parameters:

  • coupon_value (String)

    The code of the coupon. Important: The coupon code requires [URL encoding](www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode &#x60;SUMMER25%OFF&#x60; as &#x60;SUMMER25%25OFF&#x60;.

  • coupon_reservations (CouponReservations)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Coupon, Integer, Hash)>)

    Coupon data, response status code and response headers



249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/talon_one_sdk/api/integration_api.rb', line 249

def create_coupon_reservation_with_http_info(coupon_value, coupon_reservations, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_coupon_reservation ...'
  end
  # verify the required parameter 'coupon_value' is set
  if @api_client.config.client_side_validation && coupon_value.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_value' when calling IntegrationApi.create_coupon_reservation"
  end
  # verify the required parameter 'coupon_reservations' is set
  if @api_client.config.client_side_validation && coupon_reservations.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_reservations' when calling IntegrationApi.create_coupon_reservation"
  end
  # resource path
  local_var_path = '/v1/coupon_reservations/{couponValue}'.sub('{' + 'couponValue' + '}', CGI.escape(coupon_value.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(coupon_reservations)

  # return_type
  return_type = opts[:debug_return_type] || 'Coupon'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.create_coupon_reservation",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_coupon_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_referral(new_referral, opts = {}) ⇒ Referral

Create referral code for an advocate Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the ‘campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate’s profile. > [!note] Any [referral limits](docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) > set are ignored when you use this endpoint.

Parameters:

  • new_referral (NewReferral)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



311
312
313
314
# File 'lib/talon_one_sdk/api/integration_api.rb', line 311

def create_referral(new_referral, opts = {})
  data, _status_code, _headers = create_referral_with_http_info(new_referral, opts)
  data
end

#create_referral_with_http_info(new_referral, opts = {}) ⇒ Array<(Referral, Integer, Hash)>

Create referral code for an advocate Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the &#x60;campaignId&#x60; parameter, and will be associated with the profile specified in the &#x60;advocateProfileIntegrationId&#x60; parameter as the advocate&#39;s profile. &gt; [!note] Any [referral limits](docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) &gt; set are ignored when you use this endpoint.

Parameters:

  • new_referral (NewReferral)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Referral, Integer, Hash)>)

    Referral data, response status code and response headers



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# File 'lib/talon_one_sdk/api/integration_api.rb', line 321

def create_referral_with_http_info(new_referral, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_referral ...'
  end
  # verify the required parameter 'new_referral' is set
  if @api_client.config.client_side_validation && new_referral.nil?
    fail ArgumentError, "Missing the required parameter 'new_referral' when calling IntegrationApi.create_referral"
  end
  # resource path
  local_var_path = '/v1/referrals'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(new_referral)

  # return_type
  return_type = opts[:debug_return_type] || 'Referral'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.create_referral",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_referral\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_referrals_for_multiple_advocates(new_referrals_for_multiple_advocates, opts = {}) ⇒ CreateReferralsForMultipleAdvocates201Response

Create referral codes for multiple advocates Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the ‘campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate’s profile. > [!note] Any [referral limits](docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) > set are ignored when you use this endpoint.

Parameters:

Options Hash (opts):

  • :silent (String)

    Possible values: &#x60;yes&#x60; or &#x60;no&#x60;. - &#x60;yes&#x60;: Increases the performance of the API call by returning a 204 response. - &#x60;no&#x60;: Returns a 200 response that contains the updated customer profiles. (default to ‘yes’)

Returns:



380
381
382
383
# File 'lib/talon_one_sdk/api/integration_api.rb', line 380

def create_referrals_for_multiple_advocates(new_referrals_for_multiple_advocates, opts = {})
  data, _status_code, _headers = create_referrals_for_multiple_advocates_with_http_info(new_referrals_for_multiple_advocates, opts)
  data
end

#create_referrals_for_multiple_advocates_with_http_info(new_referrals_for_multiple_advocates, opts = {}) ⇒ Array<(CreateReferralsForMultipleAdvocates201Response, Integer, Hash)>

Create referral codes for multiple advocates Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the &#x60;campaignId&#x60; parameter, and one referral code will be associated with one advocate using the profile specified in the &#x60;advocateProfileIntegrationId&#x60; parameter as the advocate&#39;s profile. &gt; [!note] Any [referral limits](docs.talon.one/docs/product/campaigns/settings/managing-campaign-budgets#referral-limits) &gt; set are ignored when you use this endpoint.

Parameters:

Options Hash (opts):

  • :silent (String)

    Possible values: &#x60;yes&#x60; or &#x60;no&#x60;. - &#x60;yes&#x60;: Increases the performance of the API call by returning a 204 response. - &#x60;no&#x60;: Returns a 200 response that contains the updated customer profiles. (default to ‘yes’)

Returns:



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
# File 'lib/talon_one_sdk/api/integration_api.rb', line 391

def create_referrals_for_multiple_advocates_with_http_info(new_referrals_for_multiple_advocates, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_referrals_for_multiple_advocates ...'
  end
  # verify the required parameter 'new_referrals_for_multiple_advocates' is set
  if @api_client.config.client_side_validation && new_referrals_for_multiple_advocates.nil?
    fail ArgumentError, "Missing the required parameter 'new_referrals_for_multiple_advocates' when calling IntegrationApi.create_referrals_for_multiple_advocates"
  end
  # resource path
  local_var_path = '/v1/referrals_for_multiple_advocates'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'silent'] = opts[:'silent'] if !opts[:'silent'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(new_referrals_for_multiple_advocates)

  # return_type
  return_type = opts[:debug_return_type] || 'CreateReferralsForMultipleAdvocates201Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.create_referrals_for_multiple_advocates",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_referrals_for_multiple_advocates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_audience_memberships_v2(audience_id, opts = {}) ⇒ nil

Delete audience memberships Remove all members from this audience.

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


450
451
452
453
# File 'lib/talon_one_sdk/api/integration_api.rb', line 450

def delete_audience_memberships_v2(audience_id, opts = {})
  delete_audience_memberships_v2_with_http_info(audience_id, opts)
  nil
end

#delete_audience_memberships_v2_with_http_info(audience_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete audience memberships Remove all members from this audience.

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
# File 'lib/talon_one_sdk/api/integration_api.rb', line 460

def delete_audience_memberships_v2_with_http_info(audience_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_audience_memberships_v2 ...'
  end
  # verify the required parameter 'audience_id' is set
  if @api_client.config.client_side_validation && audience_id.nil?
    fail ArgumentError, "Missing the required parameter 'audience_id' when calling IntegrationApi.delete_audience_memberships_v2"
  end
  # resource path
  local_var_path = '/v2/audiences/{audienceId}/memberships'.sub('{' + 'audienceId' + '}', CGI.escape(audience_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.delete_audience_memberships_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_audience_memberships_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_audience_v2(audience_id, opts = {}) ⇒ nil

Delete audience Delete an audience created by a third-party integration. > [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. > [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience).

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


513
514
515
516
# File 'lib/talon_one_sdk/api/integration_api.rb', line 513

def delete_audience_v2(audience_id, opts = {})
  delete_audience_v2_with_http_info(audience_id, opts)
  nil
end

#delete_audience_v2_with_http_info(audience_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete audience Delete an audience created by a third-party integration. &gt; [!warning] This endpoint also removes any associations recorded between a customer profile and this audience. &gt; [!note] Audiences can also be deleted via the Campaign Manager. See the [docs](docs.talon.one/docs/product/audiences/managing-audiences#deleting-an-audience).

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
# File 'lib/talon_one_sdk/api/integration_api.rb', line 523

def delete_audience_v2_with_http_info(audience_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_audience_v2 ...'
  end
  # verify the required parameter 'audience_id' is set
  if @api_client.config.client_side_validation && audience_id.nil?
    fail ArgumentError, "Missing the required parameter 'audience_id' when calling IntegrationApi.delete_audience_v2"
  end
  # resource path
  local_var_path = '/v2/audiences/{audienceId}'.sub('{' + 'audienceId' + '}', CGI.escape(audience_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.delete_audience_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_audience_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_coupon_reservation(coupon_value, coupon_reservations, opts = {}) ⇒ nil

Delete coupon reservations Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code.

Parameters:

  • coupon_value (String)

    The code of the coupon. Important: The coupon code requires [URL encoding](www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode &#x60;SUMMER25%OFF&#x60; as &#x60;SUMMER25%25OFF&#x60;.

  • coupon_reservations (CouponReservations)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


577
578
579
580
# File 'lib/talon_one_sdk/api/integration_api.rb', line 577

def delete_coupon_reservation(coupon_value, coupon_reservations, opts = {})
  delete_coupon_reservation_with_http_info(coupon_value, coupon_reservations, opts)
  nil
end

#delete_coupon_reservation_with_http_info(coupon_value, coupon_reservations, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete coupon reservations Remove all the coupon reservations from the provided customer profile integration IDs and the provided coupon code.

Parameters:

  • coupon_value (String)

    The code of the coupon. Important: The coupon code requires [URL encoding](www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode &#x60;SUMMER25%OFF&#x60; as &#x60;SUMMER25%25OFF&#x60;.

  • coupon_reservations (CouponReservations)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
# File 'lib/talon_one_sdk/api/integration_api.rb', line 588

def delete_coupon_reservation_with_http_info(coupon_value, coupon_reservations, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_coupon_reservation ...'
  end
  # verify the required parameter 'coupon_value' is set
  if @api_client.config.client_side_validation && coupon_value.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_value' when calling IntegrationApi.delete_coupon_reservation"
  end
  # verify the required parameter 'coupon_reservations' is set
  if @api_client.config.client_side_validation && coupon_reservations.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_reservations' when calling IntegrationApi.delete_coupon_reservation"
  end
  # resource path
  local_var_path = '/v1/coupon_reservations/{couponValue}'.sub('{' + 'couponValue' + '}', CGI.escape(coupon_value.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(coupon_reservations)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.delete_coupon_reservation",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_coupon_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_customer_data(integration_id, opts = {}) ⇒ nil

Delete customer’s personal data Delete all attributes on the customer profile and on entities that reference this customer profile. > [!warning] Warning > - Customer data is deleted from all Applications in the > [environment](docs.talon.one/docs/product/applications/overview#application-environments) > that the API key belongs to. For example, if you use this endpoint with an API key that belongs > to a sandbox Application, customer data will be deleted from all sandbox Applications. > This is because customer data is shared between Applications from the same environment. > - To preserve performance, we recommend avoiding deleting customer data > during peak-traffic hours.

Parameters:

Returns:

  • (nil)


650
651
652
653
# File 'lib/talon_one_sdk/api/integration_api.rb', line 650

def delete_customer_data(integration_id, opts = {})
  delete_customer_data_with_http_info(integration_id, opts)
  nil
end

#delete_customer_data_with_http_info(integration_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete customer&#39;s personal data Delete all attributes on the customer profile and on entities that reference this customer profile. &gt; [!warning] Warning &gt; - Customer data is deleted from all Applications in the &gt; [environment](docs.talon.one/docs/product/applications/overview#application-environments) &gt; that the API key belongs to. For example, if you use this endpoint with an API key that belongs &gt; to a sandbox Application, customer data will be deleted from all sandbox Applications. &gt; This is because customer data is shared between Applications from the same environment. &gt; - To preserve performance, we recommend avoiding deleting customer data &gt; during peak-traffic hours.

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
# File 'lib/talon_one_sdk/api/integration_api.rb', line 660

def delete_customer_data_with_http_info(integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_customer_data ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.delete_customer_data"
  end
  # resource path
  local_var_path = '/v1/customer_data/{integrationId}'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.delete_customer_data",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_customer_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_loyalty_transactions_from_ledgers(loyalty_program_id, integration_id, delete_loyalty_transactions_request, opts = {}) ⇒ nil

Delete customer’s transactions from loyalty ledgers Delete a customer’s transactions in all loyalty ledgers or a specified ledger. > [!note] To retrieve loyalty transaction logs for a specific customer in a given loyalty program, > use the [List customer’s loyalty transactions](docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions) > endpoint.

Parameters:

Returns:

  • (nil)


715
716
717
718
# File 'lib/talon_one_sdk/api/integration_api.rb', line 715

def delete_loyalty_transactions_from_ledgers(loyalty_program_id, integration_id, delete_loyalty_transactions_request, opts = {})
  delete_loyalty_transactions_from_ledgers_with_http_info(loyalty_program_id, integration_id, delete_loyalty_transactions_request, opts)
  nil
end

#delete_loyalty_transactions_from_ledgers_with_http_info(loyalty_program_id, integration_id, delete_loyalty_transactions_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete customer&#39;s transactions from loyalty ledgers Delete a customer&#39;s transactions in all loyalty ledgers or a specified ledger. &gt; [!note] To retrieve loyalty transaction logs for a specific customer in a given loyalty program, &gt; use the [List customer&#39;s loyalty transactions](docs.talon.one/integration-api#tag/Loyalty/operation/getLoyaltyProgramProfileTransactions) &gt; endpoint.

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
# File 'lib/talon_one_sdk/api/integration_api.rb', line 727

def delete_loyalty_transactions_from_ledgers_with_http_info(loyalty_program_id, integration_id, delete_loyalty_transactions_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_loyalty_transactions_from_ledgers ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.delete_loyalty_transactions_from_ledgers"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.delete_loyalty_transactions_from_ledgers"
  end
  # verify the required parameter 'delete_loyalty_transactions_request' is set
  if @api_client.config.client_side_validation && delete_loyalty_transactions_request.nil?
    fail ArgumentError, "Missing the required parameter 'delete_loyalty_transactions_request' when calling IntegrationApi.delete_loyalty_transactions_from_ledgers"
  end
  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/delete_transactions'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(delete_loyalty_transactions_request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.delete_loyalty_transactions_from_ledgers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_loyalty_transactions_from_ledgers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#generate_loyalty_card(loyalty_program_id, generate_loyalty_card, opts = {}) ⇒ LoyaltyCard

Generate loyalty card Generate a loyalty card in a specified [card-based loyalty program](docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the ‘customerProfileIds` parameter in the request body. > [!note] Note > - The number of customer profiles linked to the loyalty card cannot exceed > the loyalty program’s ‘usersPerCardLimit`. To find the program’s limit, use > the [Get loyalty program](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) > endpoint. > - If the loyalty program has a defined code format, it will be used for the > loyalty card identifier.

Parameters:

Returns:



794
795
796
797
# File 'lib/talon_one_sdk/api/integration_api.rb', line 794

def generate_loyalty_card(loyalty_program_id, generate_loyalty_card, opts = {})
  data, _status_code, _headers = generate_loyalty_card_with_http_info(loyalty_program_id, generate_loyalty_card, opts)
  data
end

#generate_loyalty_card_with_http_info(loyalty_program_id, generate_loyalty_card, opts = {}) ⇒ Array<(LoyaltyCard, Integer, Hash)>

Generate loyalty card Generate a loyalty card in a specified [card-based loyalty program](docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview). To link the card to one or more customer profiles, use the &#x60;customerProfileIds&#x60; parameter in the request body. &gt; [!note] Note &gt; - The number of customer profiles linked to the loyalty card cannot exceed &gt; the loyalty program&#39;s &#x60;usersPerCardLimit&#x60;. To find the program&#39;s limit, use &gt; the [Get loyalty program](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgram) &gt; endpoint. &gt; - If the loyalty program has a defined code format, it will be used for the &gt; loyalty card identifier.

Parameters:

Returns:

  • (Array<(LoyaltyCard, Integer, Hash)>)

    LoyaltyCard data, response status code and response headers



805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
# File 'lib/talon_one_sdk/api/integration_api.rb', line 805

def generate_loyalty_card_with_http_info(loyalty_program_id, generate_loyalty_card, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.generate_loyalty_card ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.generate_loyalty_card"
  end
  # verify the required parameter 'generate_loyalty_card' is set
  if @api_client.config.client_side_validation && generate_loyalty_card.nil?
    fail ArgumentError, "Missing the required parameter 'generate_loyalty_card' when calling IntegrationApi.generate_loyalty_card"
  end
  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(generate_loyalty_card)

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltyCard'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.generate_loyalty_card",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#generate_loyalty_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_achievement_history(integration_id, achievement_id, opts = {}) ⇒ GetCustomerAchievementHistory200Response

List customer’s achievement history Retrieve all progress history of a given customer in the given achievement.

Parameters:

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • achievement_id (Integer)

    The achievement identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :progress_status (Array<String>)

    Filter by customer progress status in the achievement.

  • :start_date (Time)

    Timestamp that filters the results to only contain achievements created on or after the start date.

  • :end_date (Time)

    Timestamp that filters the results to only contain achievements created before or on the end date.

  • :page_size (Integer)

    The number of items in the response. (default to 1000)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

Returns:



873
874
875
876
# File 'lib/talon_one_sdk/api/integration_api.rb', line 873

def get_customer_achievement_history(integration_id, achievement_id, opts = {})
  data, _status_code, _headers = get_customer_achievement_history_with_http_info(integration_id, achievement_id, opts)
  data
end

#get_customer_achievement_history_with_http_info(integration_id, achievement_id, opts = {}) ⇒ Array<(GetCustomerAchievementHistory200Response, Integer, Hash)>

List customer&#39;s achievement history Retrieve all progress history of a given customer in the given achievement.

Parameters:

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • achievement_id (Integer)

    The achievement identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :progress_status (Array<String>)

    Filter by customer progress status in the achievement.

  • :start_date (Time)

    Timestamp that filters the results to only contain achievements created on or after the start date.

  • :end_date (Time)

    Timestamp that filters the results to only contain achievements created before or on the end date.

  • :page_size (Integer)

    The number of items in the response. (default to 1000)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

Returns:



889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
# File 'lib/talon_one_sdk/api/integration_api.rb', line 889

def get_customer_achievement_history_with_http_info(integration_id, achievement_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_customer_achievement_history ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.get_customer_achievement_history"
  end
  # verify the required parameter 'achievement_id' is set
  if @api_client.config.client_side_validation && achievement_id.nil?
    fail ArgumentError, "Missing the required parameter 'achievement_id' when calling IntegrationApi.get_customer_achievement_history"
  end
  allowable_values = ["inprogress", "completed", "expired"]
  if @api_client.config.client_side_validation && opts[:'progress_status'] && !opts[:'progress_status'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"progress_status\", must include one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_customer_achievement_history, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_customer_achievement_history, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/customer_profiles/{integrationId}/achievements/{achievementId}'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s)).sub('{' + 'achievementId' + '}', CGI.escape(achievement_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'progressStatus'] = @api_client.build_collection_param(opts[:'progress_status'], :csv) if !opts[:'progress_status'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetCustomerAchievementHistory200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_customer_achievement_history",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_customer_achievement_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_achievements(integration_id, opts = {}) ⇒ GetCustomerAchievements200Response

List customer’s available achievements Retrieve all the achievements available to a given customer and their progress in them.

Parameters:

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :campaign_ids (Array<String>)

    Filter by one or more Campaign IDs, separated by a comma. Note: If no campaigns are specified, data for all the campaigns in the Application is returned.

  • :achievement_ids (Array<String>)

    Filter by one or more Achievement IDs, separated by a comma. Note: If no achievements are specified, data for all the achievements in the Application is returned.

  • :achievement_status (Array<String>)

    Filter by status of the achievement. Note: If the achievement status is not specified, only data for all active achievements in the Application is returned.

  • :current_progress_status (Array<String>)

    Filter by customer progress status in the achievement.

  • :page_size (Integer)

    The number of items in the response. (default to 1000)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

Returns:



969
970
971
972
# File 'lib/talon_one_sdk/api/integration_api.rb', line 969

def get_customer_achievements(integration_id, opts = {})
  data, _status_code, _headers = get_customer_achievements_with_http_info(integration_id, opts)
  data
end

#get_customer_achievements_with_http_info(integration_id, opts = {}) ⇒ Array<(GetCustomerAchievements200Response, Integer, Hash)>

List customer&#39;s available achievements Retrieve all the achievements available to a given customer and their progress in them.

Parameters:

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :campaign_ids (Array<String>)

    Filter by one or more Campaign IDs, separated by a comma. Note: If no campaigns are specified, data for all the campaigns in the Application is returned.

  • :achievement_ids (Array<String>)

    Filter by one or more Achievement IDs, separated by a comma. Note: If no achievements are specified, data for all the achievements in the Application is returned.

  • :achievement_status (Array<String>)

    Filter by status of the achievement. Note: If the achievement status is not specified, only data for all active achievements in the Application is returned.

  • :current_progress_status (Array<String>)

    Filter by customer progress status in the achievement.

  • :page_size (Integer)

    The number of items in the response. (default to 1000)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

Returns:



985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
# File 'lib/talon_one_sdk/api/integration_api.rb', line 985

def get_customer_achievements_with_http_info(integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_customer_achievements ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.get_customer_achievements"
  end
  allowable_values = ["active", "scheduled"]
  if @api_client.config.client_side_validation && opts[:'achievement_status'] && !opts[:'achievement_status'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"achievement_status\", must include one of #{allowable_values}"
  end
  allowable_values = ["inprogress", "completed", "not_started"]
  if @api_client.config.client_side_validation && opts[:'current_progress_status'] && !opts[:'current_progress_status'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"current_progress_status\", must include one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_customer_achievements, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_customer_achievements, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/customer_profiles/{integrationId}/achievements'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'campaignIds'] = @api_client.build_collection_param(opts[:'campaign_ids'], :csv) if !opts[:'campaign_ids'].nil?
  query_params[:'achievementIds'] = @api_client.build_collection_param(opts[:'achievement_ids'], :csv) if !opts[:'achievement_ids'].nil?
  query_params[:'achievementStatus'] = @api_client.build_collection_param(opts[:'achievement_status'], :csv) if !opts[:'achievement_status'].nil?
  query_params[:'currentProgressStatus'] = @api_client.build_collection_param(opts[:'current_progress_status'], :csv) if !opts[:'current_progress_status'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetCustomerAchievements200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_customer_achievements",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_customer_achievements\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_inventory(integration_id, opts = {}) ⇒ CustomerInventory

List customer data Return the customer inventory regarding entities referencing this customer profile’s ‘integrationId`. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons.

Parameters:

Options Hash (opts):

  • :profile (Boolean)

    Set to &#x60;true&#x60; to include customer profile information in the response.

  • :referrals (Boolean)

    Set to &#x60;true&#x60; to include referral information in the response.

  • :coupons (Boolean)

    Set to &#x60;true&#x60; to include coupon information in the response.

  • :loyalty (Boolean)

    Set to &#x60;true&#x60; to include loyalty information in the response.

  • :giveaways (Boolean)

    Set to &#x60;true&#x60; to include giveaways information in the response.

  • :achievements (Boolean)

    Set to &#x60;true&#x60; to include achievement information in the response.

Returns:



1066
1067
1068
1069
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1066

def get_customer_inventory(integration_id, opts = {})
  data, _status_code, _headers = get_customer_inventory_with_http_info(integration_id, opts)
  data
end

#get_customer_inventory_with_http_info(integration_id, opts = {}) ⇒ Array<(CustomerInventory, Integer, Hash)>

List customer data Return the customer inventory regarding entities referencing this customer profile&#39;s &#x60;integrationId&#x60;. Typical entities returned are: customer profile information, referral codes, loyalty points, loyalty cards and reserved coupons. Reserved coupons also include redeemed coupons.

Parameters:

Options Hash (opts):

  • :profile (Boolean)

    Set to &#x60;true&#x60; to include customer profile information in the response.

  • :referrals (Boolean)

    Set to &#x60;true&#x60; to include referral information in the response.

  • :coupons (Boolean)

    Set to &#x60;true&#x60; to include coupon information in the response.

  • :loyalty (Boolean)

    Set to &#x60;true&#x60; to include loyalty information in the response.

  • :giveaways (Boolean)

    Set to &#x60;true&#x60; to include giveaways information in the response.

  • :achievements (Boolean)

    Set to &#x60;true&#x60; to include achievement information in the response.

Returns:

  • (Array<(CustomerInventory, Integer, Hash)>)

    CustomerInventory data, response status code and response headers



1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1082

def get_customer_inventory_with_http_info(integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_customer_inventory ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.get_customer_inventory"
  end
  # resource path
  local_var_path = '/v1/customer_profiles/{integrationId}/inventory'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil?
  query_params[:'referrals'] = opts[:'referrals'] if !opts[:'referrals'].nil?
  query_params[:'coupons'] = opts[:'coupons'] if !opts[:'coupons'].nil?
  query_params[:'loyalty'] = opts[:'loyalty'] if !opts[:'loyalty'].nil?
  query_params[:'giveaways'] = opts[:'giveaways'] if !opts[:'giveaways'].nil?
  query_params[:'achievements'] = opts[:'achievements'] if !opts[:'achievements'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerInventory'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_customer_inventory",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_customer_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_session(customer_session_id, opts = {}) ⇒ IntegrationCustomerSessionResponse

Get customer session Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2)

Parameters:

  • customer_session_id (String)

    The &#x60;integration ID&#x60; of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager&#39;s Sessions menu, or via the [List Application session](docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1141
1142
1143
1144
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1141

def get_customer_session(customer_session_id, opts = {})
  data, _status_code, _headers = get_customer_session_with_http_info(customer_session_id, opts)
  data
end

#get_customer_session_with_http_info(customer_session_id, opts = {}) ⇒ Array<(IntegrationCustomerSessionResponse, Integer, Hash)>

Get customer session Get the details of the given customer session. You can get the same data via other endpoints that also apply changes, which can help you save requests and increase performance. See: - [Update customer session](#tag/Customer-sessions/operation/updateCustomerSessionV2) - [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2)

Parameters:

  • customer_session_id (String)

    The &#x60;integration ID&#x60; of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager&#39;s Sessions menu, or via the [List Application session](docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1151

def get_customer_session_with_http_info(customer_session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_customer_session ...'
  end
  # verify the required parameter 'customer_session_id' is set
  if @api_client.config.client_side_validation && customer_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_session_id' when calling IntegrationApi.get_customer_session"
  end
  # resource path
  local_var_path = '/v2/customer_sessions/{customerSessionId}'.sub('{' + 'customerSessionId' + '}', CGI.escape(customer_session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IntegrationCustomerSessionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_customer_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_customer_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_loyalty_balances(loyalty_program_id, integration_id, opts = {}) ⇒ LoyaltyBalancesWithTiers

Get customer’s loyalty balances Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. > [!note] If no filtering options are applied, you retrieve all loyalty > balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data)

Parameters:

  • loyalty_program_id (Integer)

    Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_date (Time)

    Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :subledger_id (String)

    The ID of the subledger by which we filter the data.

  • :include_tiers (Boolean)

    Indicates whether tier information is included in the response. When set to &#x60;true&#x60;, the response includes information about the current tier and the number of points required to move to next tier. (default to false)

  • :include_projected_tier (Boolean)

    Indicates whether the customer&#39;s projected tier information is included in the response. When set to &#x60;true&#x60;, the response includes information about the customer&#39;s active points and the name of the projected tier. Note We recommend filtering by &#x60;subledgerId&#x60; for better performance. (default to false)

Returns:



1209
1210
1211
1212
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1209

def get_loyalty_balances(loyalty_program_id, integration_id, opts = {})
  data, _status_code, _headers = get_loyalty_balances_with_http_info(loyalty_program_id, integration_id, opts)
  data
end

#get_loyalty_balances_with_http_info(loyalty_program_id, integration_id, opts = {}) ⇒ Array<(LoyaltyBalancesWithTiers, Integer, Hash)>

Get customer&#39;s loyalty balances Retrieve loyalty ledger balances for the given Integration ID in the specified loyalty program. You can filter balances by date and subledger ID, and include tier-related information in the response. &gt; [!note] If no filtering options are applied, you retrieve all loyalty &gt; balances on the current date for the given integration ID. Loyalty balances are calculated when Talon.One receives your request using the points stored in our database, so retrieving a large number of balances at once can impact performance. For more information, see: - [Managing card-based loyalty program data](docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards) - [Managing profile-based loyalty program data](docs.talon.one/docs/product/loyalty-programs/profile-based/managing-pb-lp-data)

Parameters:

  • loyalty_program_id (Integer)

    Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :end_date (Time)

    Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :subledger_id (String)

    The ID of the subledger by which we filter the data.

  • :include_tiers (Boolean)

    Indicates whether tier information is included in the response. When set to &#x60;true&#x60;, the response includes information about the current tier and the number of points required to move to next tier. (default to false)

  • :include_projected_tier (Boolean)

    Indicates whether the customer&#39;s projected tier information is included in the response. When set to &#x60;true&#x60;, the response includes information about the customer&#39;s active points and the name of the projected tier. Note We recommend filtering by &#x60;subledgerId&#x60; for better performance. (default to false)

Returns:

  • (Array<(LoyaltyBalancesWithTiers, Integer, Hash)>)

    LoyaltyBalancesWithTiers data, response status code and response headers



1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1224

def get_loyalty_balances_with_http_info(loyalty_program_id, integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_loyalty_balances ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.get_loyalty_balances"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.get_loyalty_balances"
  end
  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/balances'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'subledgerId'] = opts[:'subledger_id'] if !opts[:'subledger_id'].nil?
  query_params[:'includeTiers'] = opts[:'include_tiers'] if !opts[:'include_tiers'].nil?
  query_params[:'includeProjectedTier'] = opts[:'include_projected_tier'] if !opts[:'include_projected_tier'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltyBalancesWithTiers'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_loyalty_balances",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_loyalty_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_loyalty_card_balances(loyalty_program_id, loyalty_card_id, opts = {}) ⇒ LoyaltyCardBalances

Get card’s point balances Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned.

Parameters:

Options Hash (opts):

  • :end_date (Time)

    Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :subledger_id (Array<String>)

    Filter results by one or more subledger IDs. Must be exact match.

Returns:



1288
1289
1290
1291
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1288

def get_loyalty_card_balances(loyalty_program_id, loyalty_card_id, opts = {})
  data, _status_code, _headers = get_loyalty_card_balances_with_http_info(loyalty_program_id, loyalty_card_id, opts)
  data
end

#get_loyalty_card_balances_with_http_info(loyalty_program_id, loyalty_card_id, opts = {}) ⇒ Array<(LoyaltyCardBalances, Integer, Hash)>

Get card&#39;s point balances Retrieve loyalty balances for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, all loyalty balances for the given loyalty card are returned.

Parameters:

Options Hash (opts):

  • :end_date (Time)

    Used to return expired, active, and pending loyalty balances before this timestamp. You can enter any past, present, or future timestamp value. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :subledger_id (Array<String>)

    Filter results by one or more subledger IDs. Must be exact match.

Returns:

  • (Array<(LoyaltyCardBalances, Integer, Hash)>)

    LoyaltyCardBalances data, response status code and response headers



1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1301

def get_loyalty_card_balances_with_http_info(loyalty_program_id, loyalty_card_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_loyalty_card_balances ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.get_loyalty_card_balances"
  end
  # verify the required parameter 'loyalty_card_id' is set
  if @api_client.config.client_side_validation && loyalty_card_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_card_id' when calling IntegrationApi.get_loyalty_card_balances"
  end
  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length > 108
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.get_loyalty_card_balances, the character length must be smaller than or equal to 108.'
  end

  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length < 4
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.get_loyalty_card_balances, the character length must be greater than or equal to 4.'
  end

  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/balances'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardId' + '}', CGI.escape(loyalty_card_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'subledgerId'] = @api_client.build_collection_param(opts[:'subledger_id'], :multi) if !opts[:'subledger_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltyCardBalances'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_loyalty_card_balances",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_loyalty_card_balances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_loyalty_card_points(loyalty_program_id, loyalty_card_id, opts = {}) ⇒ GetLoyaltyCardPoints200Response

List card’s unused loyalty points Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - ‘active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past.

Parameters:

Options Hash (opts):

  • :status (String)

    Filter points based on their status. (default to ‘active’)

  • :subledger_id (Array<String>)

    Filter results by one or more subledger IDs. Must be exact match.

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :sort (String)

    The field by which results should be sorted. You can enter one of the following values: - &#x60;startDate&#x60;: Sorts the results by the start date of the points. - &#x60;expiryDate&#x60;: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with &#x60;-&#x60;. Note: You can only sort by one field at a time.

Returns:



1376
1377
1378
1379
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1376

def get_loyalty_card_points(loyalty_program_id, loyalty_card_id, opts = {})
  data, _status_code, _headers = get_loyalty_card_points_with_http_info(loyalty_program_id, loyalty_card_id, opts)
  data
end

#get_loyalty_card_points_with_http_info(loyalty_program_id, loyalty_card_id, opts = {}) ⇒ Array<(GetLoyaltyCardPoints200Response, Integer, Hash)>

List card&#39;s unused loyalty points Get paginated results of loyalty points for a given loyalty card identifier in a card-based loyalty program. This endpoint returns only the balances of unused points on a loyalty card. You can filter points by status: - &#x60;active&#x60;: Points ready to be redeemed. - &#x60;pending&#x60;: Points with a start date in the future. - &#x60;expired&#x60;: Points with an expiration date in the past.

Parameters:

Options Hash (opts):

  • :status (String)

    Filter points based on their status. (default to ‘active’)

  • :subledger_id (Array<String>)

    Filter results by one or more subledger IDs. Must be exact match.

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :sort (String)

    The field by which results should be sorted. You can enter one of the following values: - &#x60;startDate&#x60;: Sorts the results by the start date of the points. - &#x60;expiryDate&#x60;: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with &#x60;-&#x60;. Note: You can only sort by one field at a time.

Returns:



1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1394

def get_loyalty_card_points_with_http_info(loyalty_program_id, loyalty_card_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_loyalty_card_points ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.get_loyalty_card_points"
  end
  # verify the required parameter 'loyalty_card_id' is set
  if @api_client.config.client_side_validation && loyalty_card_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_card_id' when calling IntegrationApi.get_loyalty_card_points"
  end
  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length > 108
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.get_loyalty_card_points, the character length must be smaller than or equal to 108.'
  end

  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length < 4
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.get_loyalty_card_points, the character length must be greater than or equal to 4.'
  end

  allowable_values = ["active", "pending", "expired"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_card_points, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_card_points, must be greater than or equal to 1.'
  end

  allowable_values = ["startDate", "expiryDate"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardId' + '}', CGI.escape(loyalty_card_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'subledgerId'] = @api_client.build_collection_param(opts[:'subledger_id'], :multi) if !opts[:'subledger_id'].nil?
  query_params[:'customerSessionIDs'] = @api_client.build_collection_param(opts[:'customer_session_ids'], :multi) if !opts[:'customer_session_ids'].nil?
  query_params[:'transactionUUIDs'] = @api_client.build_collection_param(opts[:'transaction_uuids'], :multi) if !opts[:'transaction_uuids'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLoyaltyCardPoints200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_loyalty_card_points",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_loyalty_card_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_loyalty_card_transactions(loyalty_program_id, loyalty_card_id, opts = {}) ⇒ GetLoyaltyCardTransactions200Response

List card’s transactions Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned.

Parameters:

Options Hash (opts):

  • :subledger_id (Array<String>)

    Filter results by one or more subledger IDs. Must be exact match.

  • :loyalty_transaction_type (String)

    Filter results by loyalty transaction type: - &#x60;manual&#x60;: Loyalty transaction that was done manually. - &#x60;session&#x60;: Loyalty transaction that resulted from a customer session. - &#x60;import&#x60;: Loyalty transaction that was imported from a CSV file.

  • :start_date (Time)

    Date and time from which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_date (Time)

    Date and time by which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :awaits_activation (Boolean)

    If &#x60;true&#x60;: Filters results to include only point transactions that have action-based activation and have not expired. If &#x60;false&#x60;: Returns a &#x60;400&#x60; response.

Returns:



1492
1493
1494
1495
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1492

def get_loyalty_card_transactions(loyalty_program_id, loyalty_card_id, opts = {})
  data, _status_code, _headers = get_loyalty_card_transactions_with_http_info(loyalty_program_id, loyalty_card_id, opts)
  data
end

#get_loyalty_card_transactions_with_http_info(loyalty_program_id, loyalty_card_id, opts = {}) ⇒ Array<(GetLoyaltyCardTransactions200Response, Integer, Hash)>

List card&#39;s transactions Retrieve loyalty transaction logs for the given loyalty card in the specified loyalty program with filtering options applied. If no filtering options are applied, the last 50 loyalty transactions for the given loyalty card are returned.

Parameters:

Options Hash (opts):

  • :subledger_id (Array<String>)

    Filter results by one or more subledger IDs. Must be exact match.

  • :loyalty_transaction_type (String)

    Filter results by loyalty transaction type: - &#x60;manual&#x60;: Loyalty transaction that was done manually. - &#x60;session&#x60;: Loyalty transaction that resulted from a customer session. - &#x60;import&#x60;: Loyalty transaction that was imported from a CSV file.

  • :start_date (Time)

    Date and time from which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_date (Time)

    Date and time by which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :awaits_activation (Boolean)

    If &#x60;true&#x60;: Filters results to include only point transactions that have action-based activation and have not expired. If &#x60;false&#x60;: Returns a &#x60;400&#x60; response.

Returns:



1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1512

def get_loyalty_card_transactions_with_http_info(loyalty_program_id, loyalty_card_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_loyalty_card_transactions ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.get_loyalty_card_transactions"
  end
  # verify the required parameter 'loyalty_card_id' is set
  if @api_client.config.client_side_validation && loyalty_card_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_card_id' when calling IntegrationApi.get_loyalty_card_transactions"
  end
  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length > 108
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.get_loyalty_card_transactions, the character length must be smaller than or equal to 108.'
  end

  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length < 4
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.get_loyalty_card_transactions, the character length must be greater than or equal to 4.'
  end

  allowable_values = ["manual", "session", "import"]
  if @api_client.config.client_side_validation && opts[:'loyalty_transaction_type'] && !allowable_values.include?(opts[:'loyalty_transaction_type'])
    fail ArgumentError, "invalid value for \"loyalty_transaction_type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_card_transactions, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_card_transactions, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/transactions'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardId' + '}', CGI.escape(loyalty_card_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'subledgerId'] = @api_client.build_collection_param(opts[:'subledger_id'], :multi) if !opts[:'subledger_id'].nil?
  query_params[:'loyaltyTransactionType'] = opts[:'loyalty_transaction_type'] if !opts[:'loyalty_transaction_type'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'customerSessionIDs'] = @api_client.build_collection_param(opts[:'customer_session_ids'], :multi) if !opts[:'customer_session_ids'].nil?
  query_params[:'transactionUUIDs'] = @api_client.build_collection_param(opts[:'transaction_uuids'], :multi) if !opts[:'transaction_uuids'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'awaitsActivation'] = opts[:'awaits_activation'] if !opts[:'awaits_activation'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLoyaltyCardTransactions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_loyalty_card_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_loyalty_card_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_loyalty_program_profile_points(loyalty_program_id, integration_id, opts = {}) ⇒ GetLoyaltyProgramProfilePoints200Response

List customer’s unused loyalty points Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - ‘active`: Points ready to be redeemed. - `pending`: Points with a start date in the future. - `expired`: Points with an expiration date in the past.

Parameters:

  • loyalty_program_id (Integer)

    Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter points based on their status. (default to ‘active’)

  • :subledger_id (String)

    The ID of the subledger by which we filter the data.

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :sort (String)

    The field by which results should be sorted. You can enter one of the following values: - &#x60;startDate&#x60;: Sorts the results by the start date of the points. - &#x60;expiryDate&#x60;: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with &#x60;-&#x60;. Note: You can only sort by one field at a time.

Returns:



1606
1607
1608
1609
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1606

def get_loyalty_program_profile_points(loyalty_program_id, integration_id, opts = {})
  data, _status_code, _headers = get_loyalty_program_profile_points_with_http_info(loyalty_program_id, integration_id, opts)
  data
end

#get_loyalty_program_profile_points_with_http_info(loyalty_program_id, integration_id, opts = {}) ⇒ Array<(GetLoyaltyProgramProfilePoints200Response, Integer, Hash)>

List customer&#39;s unused loyalty points Get paginated results of loyalty points for a given Integration ID in the specified profile-based loyalty program. This endpoint returns only the balances of unused points linked to a customer profile. You can filter points by status: - &#x60;active&#x60;: Points ready to be redeemed. - &#x60;pending&#x60;: Points with a start date in the future. - &#x60;expired&#x60;: Points with an expiration date in the past.

Parameters:

  • loyalty_program_id (Integer)

    Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :status (String)

    Filter points based on their status. (default to ‘active’)

  • :subledger_id (String)

    The ID of the subledger by which we filter the data.

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :sort (String)

    The field by which results should be sorted. You can enter one of the following values: - &#x60;startDate&#x60;: Sorts the results by the start date of the points. - &#x60;expiryDate&#x60;: Sorts the results by the expiry date of the points. By default, results are sorted in ascending order. To sort them in descending order, prefix the field name with &#x60;-&#x60;. Note: You can only sort by one field at a time.

Returns:



1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1624

def get_loyalty_program_profile_points_with_http_info(loyalty_program_id, integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_loyalty_program_profile_points ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.get_loyalty_program_profile_points"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.get_loyalty_program_profile_points"
  end
  allowable_values = ["active", "pending", "expired"]
  if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])
    fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_program_profile_points, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_program_profile_points, must be greater than or equal to 1.'
  end

  allowable_values = ["startDate", "expiryDate"]
  if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort'])
    fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/points'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
  query_params[:'subledgerId'] = opts[:'subledger_id'] if !opts[:'subledger_id'].nil?
  query_params[:'customerSessionIDs'] = @api_client.build_collection_param(opts[:'customer_session_ids'], :multi) if !opts[:'customer_session_ids'].nil?
  query_params[:'transactionUUIDs'] = @api_client.build_collection_param(opts[:'transaction_uuids'], :multi) if !opts[:'transaction_uuids'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLoyaltyProgramProfilePoints200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_loyalty_program_profile_points",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_loyalty_program_profile_points\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_loyalty_program_profile_transactions(loyalty_program_id, integration_id, opts = {}) ⇒ GetLoyaltyProgramProfileTransactions200Response

List customer’s loyalty transactions Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. > [!note] To retrieve all loyalty program transaction logs in a given > loyalty program, use the [List loyalty program transactions](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) > endpoint.

Parameters:

  • loyalty_program_id (Integer)

    Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :subledger_id (String)

    The ID of the subledger by which we filter the data.

  • :loyalty_transaction_type (String)

    Filter results by loyalty transaction type: - &#x60;manual&#x60;: Loyalty transaction that was done manually. - &#x60;session&#x60;: Loyalty transaction that resulted from a customer session. - &#x60;import&#x60;: Loyalty transaction that was imported from a CSV file.

  • :start_date (Time)

    Date and time from which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_date (Time)

    Date and time by which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :awaits_activation (Boolean)

    If &#x60;true&#x60;: Filters results to include only point transactions that have action-based activation and have not expired. If &#x60;false&#x60;: Returns a &#x60;400&#x60; response.

Returns:



1714
1715
1716
1717
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1714

def get_loyalty_program_profile_transactions(loyalty_program_id, integration_id, opts = {})
  data, _status_code, _headers = get_loyalty_program_profile_transactions_with_http_info(loyalty_program_id, integration_id, opts)
  data
end

#get_loyalty_program_profile_transactions_with_http_info(loyalty_program_id, integration_id, opts = {}) ⇒ Array<(GetLoyaltyProgramProfileTransactions200Response, Integer, Hash)>

List customer&#39;s loyalty transactions Retrieve paginated results of loyalty transaction logs for the given Integration ID in the specified loyalty program. You can filter transactions by date. If no filters are applied, the last 50 loyalty transactions for the given integration ID are returned. &gt; [!note] To retrieve all loyalty program transaction logs in a given &gt; loyalty program, use the [List loyalty program transactions](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyProgramTransactions) &gt; endpoint.

Parameters:

  • loyalty_program_id (Integer)

    Identifier of the profile-based loyalty program. You can get the ID with the [List loyalty programs](docs.talon.one/management-api#tag/Loyalty/operation/getLoyaltyPrograms) endpoint.

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :customer_session_ids (Array<String>)

    Filter the results by a list of customer session IDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?customerSessionIDs&#x3D;id1&amp;customerSessionIDs&#x3D;id2&#x60;. The response contains only data associated with the specified sessions.

  • :transaction_uuids (Array<String>)

    Filter the results by a list of transaction UUIDs. To include multiple IDs, repeat the parameter for each one, for example, &#x60;?transactionUUIDs&#x3D;uuid1&amp;transactionUUIDs&#x3D;uuid2&#x60;. The response contains only data associated with the specified transactions.

  • :subledger_id (String)

    The ID of the subledger by which we filter the data.

  • :loyalty_transaction_type (String)

    Filter results by loyalty transaction type: - &#x60;manual&#x60;: Loyalty transaction that was done manually. - &#x60;session&#x60;: Loyalty transaction that resulted from a customer session. - &#x60;import&#x60;: Loyalty transaction that was imported from a CSV file.

  • :start_date (Time)

    Date and time from which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_date (Time)

    Date and time by which results are returned. Results are filtered by transaction creation date. &gt; [!note] Note &gt; - This must be an RFC3339 timestamp string. &gt; - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting &gt; considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :awaits_activation (Boolean)

    If &#x60;true&#x60;: Filters results to include only point transactions that have action-based activation and have not expired. If &#x60;false&#x60;: Returns a &#x60;400&#x60; response.

Returns:



1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1734

def get_loyalty_program_profile_transactions_with_http_info(loyalty_program_id, integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_loyalty_program_profile_transactions ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.get_loyalty_program_profile_transactions"
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.get_loyalty_program_profile_transactions"
  end
  allowable_values = ["manual", "session", "import"]
  if @api_client.config.client_side_validation && opts[:'loyalty_transaction_type'] && !allowable_values.include?(opts[:'loyalty_transaction_type'])
    fail ArgumentError, "invalid value for \"loyalty_transaction_type\", must be one of #{allowable_values}"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_program_profile_transactions, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.get_loyalty_program_profile_transactions, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/loyalty_programs/{loyaltyProgramId}/profile/{integrationId}/transactions'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'customerSessionIDs'] = @api_client.build_collection_param(opts[:'customer_session_ids'], :multi) if !opts[:'customer_session_ids'].nil?
  query_params[:'transactionUUIDs'] = @api_client.build_collection_param(opts[:'transaction_uuids'], :multi) if !opts[:'transaction_uuids'].nil?
  query_params[:'subledgerId'] = opts[:'subledger_id'] if !opts[:'subledger_id'].nil?
  query_params[:'loyaltyTransactionType'] = opts[:'loyalty_transaction_type'] if !opts[:'loyalty_transaction_type'].nil?
  query_params[:'startDate'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'endDate'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'awaitsActivation'] = opts[:'awaits_activation'] if !opts[:'awaits_activation'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetLoyaltyProgramProfileTransactions200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_loyalty_program_profile_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_loyalty_program_profile_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_reserved_customers(coupon_value, opts = {}) ⇒ GetReservedCustomers200Response

List customers that have this coupon reserved Return all customers that have this coupon marked as reserved. This includes hard and soft reservations.

Parameters:

  • coupon_value (String)

    The code of the coupon. Important: The coupon code requires [URL encoding](www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode &#x60;SUMMER25%OFF&#x60; as &#x60;SUMMER25%25OFF&#x60;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1812
1813
1814
1815
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1812

def get_reserved_customers(coupon_value, opts = {})
  data, _status_code, _headers = get_reserved_customers_with_http_info(coupon_value, opts)
  data
end

#get_reserved_customers_with_http_info(coupon_value, opts = {}) ⇒ Array<(GetReservedCustomers200Response, Integer, Hash)>

List customers that have this coupon reserved Return all customers that have this coupon marked as reserved. This includes hard and soft reservations.

Parameters:

  • coupon_value (String)

    The code of the coupon. Important: The coupon code requires [URL encoding](www.w3schools.com/tags//ref_urlencode.asp) if it contains special characters. For example, you must encode &#x60;SUMMER25%OFF&#x60; as &#x60;SUMMER25%25OFF&#x60;.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1822

def get_reserved_customers_with_http_info(coupon_value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_reserved_customers ...'
  end
  # verify the required parameter 'coupon_value' is set
  if @api_client.config.client_side_validation && coupon_value.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_value' when calling IntegrationApi.get_reserved_customers"
  end
  # resource path
  local_var_path = '/v1/coupon_reservations/customerprofiles/{couponValue}'.sub('{' + 'couponValue' + '}', CGI.escape(coupon_value.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetReservedCustomers200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.get_reserved_customers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_reserved_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#integration_get_all_campaigns(opts = {}) ⇒ IntegrationGetAllCampaigns200Response

List all running campaigns Retrieve all running campaigns for the specified Application. You can filter the results by providing specific campaign IDs or a range of start and end dates.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :campaign_ids (Array<String>)

    Filter by one or more campaign IDs, separated by a comma. Note: If no campaigns are specified, data for all the campaigns in the Application is returned.

  • :start_after (Time)

    Filter results to only include campaigns that start on or after the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :start_before (Time)

    Filter results to only include campaigns that start on or before the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_after (Time)

    Filter results to only include campaigns that end on or after the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_before (Time)

    Filter results to only include campaigns that end on or before the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

Returns:



1881
1882
1883
1884
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1881

def integration_get_all_campaigns(opts = {})
  data, _status_code, _headers = integration_get_all_campaigns_with_http_info(opts)
  data
end

#integration_get_all_campaigns_with_http_info(opts = {}) ⇒ Array<(IntegrationGetAllCampaigns200Response, Integer, Hash)>

List all running campaigns Retrieve all running campaigns for the specified Application. You can filter the results by providing specific campaign IDs or a range of start and end dates.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of items in the response. (default to 50)

  • :skip (Integer)

    The number of items to skip when paging through large result sets.

  • :campaign_ids (Array<String>)

    Filter by one or more campaign IDs, separated by a comma. Note: If no campaigns are specified, data for all the campaigns in the Application is returned.

  • :start_after (Time)

    Filter results to only include campaigns that start on or after the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :start_before (Time)

    Filter results to only include campaigns that start on or before the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_after (Time)

    Filter results to only include campaigns that end on or after the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

  • :end_before (Time)

    Filter results to only include campaigns that end on or before the specified timestamp. Note: - It must be an RFC3339 timestamp string. - You can include a time component in your string, for example, &#x60;T23:59:59&#x60; to specify the end of the day. The time zone setting considered is &#x60;UTC&#x60;. If you do not include a time component, a default time value of &#x60;T00:00:00&#x60; (midnight) in &#x60;UTC&#x60; is considered.

Returns:



1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1897

def integration_get_all_campaigns_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.integration_get_all_campaigns ...'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.integration_get_all_campaigns, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling IntegrationApi.integration_get_all_campaigns, must be greater than or equal to 1.'
  end

  # resource path
  local_var_path = '/v1/integration/campaigns'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'campaignIds'] = @api_client.build_collection_param(opts[:'campaign_ids'], :csv) if !opts[:'campaign_ids'].nil?
  query_params[:'startAfter'] = opts[:'start_after'] if !opts[:'start_after'].nil?
  query_params[:'startBefore'] = opts[:'start_before'] if !opts[:'start_before'].nil?
  query_params[:'endAfter'] = opts[:'end_after'] if !opts[:'end_after'].nil?
  query_params[:'endBefore'] = opts[:'end_before'] if !opts[:'end_before'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IntegrationGetAllCampaigns200Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.integration_get_all_campaigns",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#integration_get_all_campaigns\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Link customer profile to card

Loyalty cards](docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as Registered. This affects how it can be used. See the [docs](docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). > [!note

You can link as many customer profiles to a given loyalty card as the > [**card user limit**](docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) > allows.

Parameters:

Returns:



1963
1964
1965
1966
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1963

def link_loyalty_card_to_profile(loyalty_program_id, loyalty_card_id, loyalty_card_registration, opts = {})
  data, _status_code, _headers = link_loyalty_card_to_profile_with_http_info(loyalty_program_id, loyalty_card_id, loyalty_card_registration, opts)
  data
end

Link customer profile to card

Loyalty cards](docs.talon.one/docs/product/loyalty-programs/card-based/card-based-overview) allow customers to collect and spend loyalty points within a [card-based loyalty program](docs.talon.one/docs/product/loyalty-programs/overview#loyalty-program-types). They are useful to gamify loyalty programs and can be used with or without customer profiles linked to them. Link a customer profile to a given loyalty card for the card to be set as Registered. This affects how it can be used. See the [docs](docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card). &gt; [!note

You can link as many customer profiles to a given loyalty card as the &gt; [**card user limit**](docs.talon.one/docs/product/loyalty-programs/card-based/creating-cb-programs) &gt; allows.

Parameters:

Returns:

  • (Array<(LoyaltyCard, Integer, Hash)>)

    LoyaltyCard data, response status code and response headers



1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
# File 'lib/talon_one_sdk/api/integration_api.rb', line 1975

def link_loyalty_card_to_profile_with_http_info(loyalty_program_id, loyalty_card_id, loyalty_card_registration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.link_loyalty_card_to_profile ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.link_loyalty_card_to_profile"
  end
  # verify the required parameter 'loyalty_card_id' is set
  if @api_client.config.client_side_validation && loyalty_card_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_card_id' when calling IntegrationApi.link_loyalty_card_to_profile"
  end
  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length > 108
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.link_loyalty_card_to_profile, the character length must be smaller than or equal to 108.'
  end

  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length < 4
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.link_loyalty_card_to_profile, the character length must be greater than or equal to 4.'
  end

  # verify the required parameter 'loyalty_card_registration' is set
  if @api_client.config.client_side_validation && loyalty_card_registration.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_card_registration' when calling IntegrationApi.link_loyalty_card_to_profile"
  end
  # resource path
  local_var_path = '/v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/link_profile'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardId' + '}', CGI.escape(loyalty_card_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(loyalty_card_registration)

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltyCard'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.link_loyalty_card_to_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#link_loyalty_card_to_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#reopen_customer_session(customer_session_id, opts = {}) ⇒ ReopenSessionResponse

Reopen customer session Reopen a closed [customer session](docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The ‘talon_session_reopened` event is triggered. You can see it in the Events view in the Campaign Manager. - The session state is updated to `open`. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance. <details> <summary><strong>Effects and budgets unimpacted by a session reopening</strong></summary> <div> <p>The following effects and budgets remain in the state they were in when the session closed:</p> <ul> <li>Add free item effect</li> <li>Award giveaway</li> <li>Coupon and referral creation</li> <li>Coupon reservation</li> <li>Custom effect</li> <li>Update attribute value</li> <li>Update cart item attribute value</li> </ul> </div> </details> To see an example of a rollback, see the [Cancelling a session with campaign budgets](docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. > [!note] If your order workflow requires you to create a new session > instead of reopening a session, use the > [Update customer session](docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) > endpoint to cancel a closed session and create a new one.

Parameters:

  • customer_session_id (String)

    The &#x60;integration ID&#x60; of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager&#39;s Sessions menu, or via the [List Application session](docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2049
2050
2051
2052
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2049

def reopen_customer_session(customer_session_id, opts = {})
  data, _status_code, _headers = reopen_customer_session_with_http_info(customer_session_id, opts)
  data
end

#reopen_customer_session_with_http_info(customer_session_id, opts = {}) ⇒ Array<(ReopenSessionResponse, Integer, Hash)>

Reopen customer session Reopen a closed [customer session](docs.talon.one/docs/dev/concepts/entities/customer-sessions). For example, if a session has been completed but still needs to be edited, you can reopen it with this endpoint. A reopen session is treated like a standard open session. When reopening a session: - The &#x60;talon_session_reopened&#x60; event is triggered. You can see it in the Events view in the Campaign Manager. - The session state is updated to &#x60;open&#x60;. - Any modified budgets and triggered effects are rolled back when the session closes. - Depending on the [return policy](docs.talon.one/docs/product/loyalty-programs/managing-loyalty-programs#return-policy) in your loyalty programs, points are rolled back in the following ways: - Pending points are rolled back automatically. - If **Active points deduction** setting is enabled, any points that were earned and activated when the session closed are rolled back. - If **Negative balance** is enabled, the rollback can create a negative points balance. &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Effects and budgets unimpacted by a session reopening&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &lt;p&gt;The following effects and budgets remain in the state they were in when the session closed:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Add free item effect&lt;/li&gt; &lt;li&gt;Award giveaway&lt;/li&gt; &lt;li&gt;Coupon and referral creation&lt;/li&gt; &lt;li&gt;Coupon reservation&lt;/li&gt; &lt;li&gt;Custom effect&lt;/li&gt; &lt;li&gt;Update attribute value&lt;/li&gt; &lt;li&gt;Update cart item attribute value&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/details&gt; To see an example of a rollback, see the [Cancelling a session with campaign budgets](docs.talon.one/docs/dev/tutorials/rolling-back-effects) tutorial. &gt; [!note] If your order workflow requires you to create a new session &gt; instead of reopening a session, use the &gt; [Update customer session](docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) &gt; endpoint to cancel a closed session and create a new one.

Parameters:

  • customer_session_id (String)

    The &#x60;integration ID&#x60; of the customer session. You set this ID when you create a customer session. You can see existing customer session integration IDs in the Campaign Manager&#39;s Sessions menu, or via the [List Application session](docs.talon.one/management-api#tag/Customer-data/operation/getApplicationSessions) endpoint.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ReopenSessionResponse, Integer, Hash)>)

    ReopenSessionResponse data, response status code and response headers



2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2059

def reopen_customer_session_with_http_info(customer_session_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.reopen_customer_session ...'
  end
  # verify the required parameter 'customer_session_id' is set
  if @api_client.config.client_side_validation && customer_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_session_id' when calling IntegrationApi.reopen_customer_session"
  end
  # resource path
  local_var_path = '/v2/customer_sessions/{customerSessionId}/reopen'.sub('{' + 'customerSessionId' + '}', CGI.escape(customer_session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ReopenSessionResponse'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.reopen_customer_session",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#reopen_customer_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#return_cart_items(customer_session_id, return_integration_request, opts = {}) ⇒ IntegrationStateV2

Return cart items Create a new return request for the specified cart items. This endpoint automatically changes the session state from ‘closed` to `partially_returned`. > [!note] This will roll back any effects associated with these cart items. > For more information, see [our documentation on session > states](docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) > and [this tutorial](docs.talon.one/docs/dev/tutorials/partially-returning-a-session). > [!note] To make request processing idempotent for this endpoint, include the `Idempotency-Key` header with an idempotency key in requests. Also: > - Requests with the `Idempotency-Key` header are logged in the Talon.One access logs. > - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. > - Idempotency keys are typically UUID keys and should not exceed 255 characters in length.

Parameters:

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

  • :run_rule_engine (Boolean)

    When set to &#x60;true&#x60;, reevaluates the updated session after items are returned. Only reevaluates campaigns where &#x60;reevaluateOnReturn&#x60; is set to &#x60;true&#x60; and which produced an effect when the session was closed.

Returns:



2115
2116
2117
2118
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2115

def return_cart_items(customer_session_id, return_integration_request, opts = {})
  data, _status_code, _headers = return_cart_items_with_http_info(customer_session_id, return_integration_request, opts)
  data
end

#return_cart_items_with_http_info(customer_session_id, return_integration_request, opts = {}) ⇒ Array<(IntegrationStateV2, Integer, Hash)>

Return cart items Create a new return request for the specified cart items. This endpoint automatically changes the session state from &#x60;closed&#x60; to &#x60;partially_returned&#x60;. &gt; [!note] This will roll back any effects associated with these cart items. &gt; For more information, see [our documentation on session &gt; states](docs.talon.one/docs/dev/concepts/entities/customer-sessions#customer-session-states) &gt; and [this tutorial](docs.talon.one/docs/dev/tutorials/partially-returning-a-session). &gt; [!note] To make request processing idempotent for this endpoint, include the &#x60;Idempotency-Key&#x60; header with an idempotency key in requests. Also: &gt; - Requests with the &#x60;Idempotency-Key&#x60; header are logged in the Talon.One access logs. &gt; - Responses for idempotent requests are stored in the database and expire 24 hours after the request is sent. &gt; - Idempotency keys are typically UUID keys and should not exceed 255 characters in length.

Parameters:

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

  • :run_rule_engine (Boolean)

    When set to &#x60;true&#x60;, reevaluates the updated session after items are returned. Only reevaluates campaigns where &#x60;reevaluateOnReturn&#x60; is set to &#x60;true&#x60; and which produced an effect when the session was closed.

Returns:

  • (Array<(IntegrationStateV2, Integer, Hash)>)

    IntegrationStateV2 data, response status code and response headers



2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2128

def return_cart_items_with_http_info(customer_session_id, return_integration_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.return_cart_items ...'
  end
  # verify the required parameter 'customer_session_id' is set
  if @api_client.config.client_side_validation && customer_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_session_id' when calling IntegrationApi.return_cart_items"
  end
  # verify the required parameter 'return_integration_request' is set
  if @api_client.config.client_side_validation && return_integration_request.nil?
    fail ArgumentError, "Missing the required parameter 'return_integration_request' when calling IntegrationApi.return_cart_items"
  end
  # resource path
  local_var_path = '/v2/customer_sessions/{customerSessionId}/returns'.sub('{' + 'customerSessionId' + '}', CGI.escape(customer_session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?
  query_params[:'runRuleEngine'] = opts[:'run_rule_engine'] if !opts[:'run_rule_engine'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(return_integration_request)

  # return_type
  return_type = opts[:debug_return_type] || 'IntegrationStateV2'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.return_cart_items",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#return_cart_items\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#sync_catalog(catalog_id, catalog_sync_request, opts = {}) ⇒ Catalog

Sync cart item catalog Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique ‘SKU`. > [!important] You can perform only one type of action in a single sync request. Syncing items with duplicate `SKU` values in a single request returns an error message with a `400` status code. For more information, read [managing cart item catalogs](docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The `filters` array contains an object with the following properties: - `attr`: A [cart item attribute](docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - `op`: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the `value` property for the attribute selected in `attr`. The value of `op` can be one of the following: - `EQ`: Equal to `value` - `LT`: Less than `value` - `LE`: Less than or equal to `value` - `GT`: Greater than `value` - `GE`: Greater than or equal to `value` - `IN`: One of the comma-separated values that `value` is set to. Note: `GE`, `LE`, `GT`, `LT` are for numeric values only. - `value`: The value of the attribute selected in `attr`. ### Payload examples Synchronization actions are sent as `PUT` requests. See the structure for each action: <details> <summary><strong>Adding an item to the catalog</strong></summary> <div> “`json { "actions": [ { "payload": { "attributes": { "color": "Navy blue", "type": "shoes" }, "replaceIfExists": true, "sku": "SKU1241028", "price": 100, "product": { "name": "sneakers" } }, "type": "ADD" } ] } “` </div> </details> <details> <summary><strong>Adding multiple items to the catalog</strong></summary> <div> “`json { "actions": [ { "payload": { "attributes": { "color": "Navy blue", "type": "shoes" }, "replaceIfExists": true, "sku": "SKU1241027", "price": 100, "product": { "name": "sneakers" } }, "type": "ADD" }, { "payload": { "attributes": { "color": "Navy blue", "type": "shoes" }, "replaceIfExists": true, "sku": "SKU1241028", "price": 100, "product": { "name": "sneakers" } }, "type": "ADD" } ] } “` </div> </details> <details> <summary><strong>Updating the attributes of an item in the catalog</strong></summary> <div> “`json { "actions": [ { "payload": { "attributes": { "age": 11, "origin": "germany" }, "createIfNotExists": false, "sku": "SKU1241028", "product": { "name": "sneakers" } }, "type": "PATCH" } ] } “` </div> </details> <details> <summary><strong>Updating the attributes of multiple items in the catalog</strong></summary> <div> “`json { "actions": [ { "payload": { "attributes": { "color": "red" }, "filters": [ { "attr": "color", "op": "EQ", "value": "blue" } ] }, "type": "PATCH_MANY" } ] } “` </div> </details> <details> <summary><strong>Removing an item from the catalog</strong></summary> <div> “`json { "actions": [ { "payload": { "sku": "SKU1241028" }, "type": "REMOVE" } ] } “` </div> </details> <details> <summary><strong>Removing multiple items from the catalog</strong></summary> <div> “`json { "actions": [ { "payload": { "filters": [ { "attr": "color", "op": "EQ", "value": "blue" } ] }, "type": "REMOVE_MANY" } ] } “` </div> </details> <details> <summary><strong>Removing shoes of sizes above 45 from the catalog</strong></summary> <div> <p> Let’s imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:</p> “‘json { "actions": [ { "payload": { "filters": [ { "attr": "size", "op": "GT", "value": "45" } ] }, "type": "REMOVE_MANY" } ] } “` </div> </details>

Parameters:

  • catalog_id (Integer)

    The ID of the catalog. You can find the ID in the Campaign Manager in Account &gt; Tools &gt; **Cart item catalogs**.

  • catalog_sync_request (CatalogSyncRequest)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2193
2194
2195
2196
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2193

def sync_catalog(catalog_id, catalog_sync_request, opts = {})
  data, _status_code, _headers = sync_catalog_with_http_info(catalog_id, catalog_sync_request, opts)
  data
end

#sync_catalog_with_http_info(catalog_id, catalog_sync_request, opts = {}) ⇒ Array<(Catalog, Integer, Hash)>

Sync cart item catalog Perform the following actions for a given cart item catalog: - Add an item to the catalog. - Add multiple items to the catalog. - Update the attributes of an item in the catalog. - Update the attributes of multiple items in the catalog. - Remove an item from the catalog. - Remove multiple items from the catalog. You can either add, update, or delete up to 1000 cart items in a single request. Each item synced to a catalog must have a unique &#x60;SKU&#x60;. &gt; [!important] You can perform only one type of action in a single sync request. Syncing items with duplicate &#x60;SKU&#x60; values in a single request returns an error message with a &#x60;400&#x60; status code. For more information, read [managing cart item catalogs](docs.talon.one/docs/product/account/dev-tools/managing-cart-item-catalogs). ### Filtering cart items Use [cart item attributes](docs.talon.one/docs/product/account/dev-tools/managing-attributes) to filter items and select the ones you want to edit or delete when editing or deleting more than one item at a time. The &#x60;filters&#x60; array contains an object with the following properties: - &#x60;attr&#x60;: A [cart item attribute](docs.talon.one/docs/product/account/dev-tools/managing-attributes) connected to the catalog. It is applied to all items in the catalog. - &#x60;op&#x60;: The filtering operator indicating the relationship between the value of each cart item in the catalog and the value of the &#x60;value&#x60; property for the attribute selected in &#x60;attr&#x60;. The value of &#x60;op&#x60; can be one of the following: - &#x60;EQ&#x60;: Equal to &#x60;value&#x60; - &#x60;LT&#x60;: Less than &#x60;value&#x60; - &#x60;LE&#x60;: Less than or equal to &#x60;value&#x60; - &#x60;GT&#x60;: Greater than &#x60;value&#x60; - &#x60;GE&#x60;: Greater than or equal to &#x60;value&#x60; - &#x60;IN&#x60;: One of the comma-separated values that &#x60;value&#x60; is set to. Note: &#x60;GE&#x60;, &#x60;LE&#x60;, &#x60;GT&#x60;, &#x60;LT&#x60; are for numeric values only. - &#x60;value&#x60;: The value of the attribute selected in &#x60;attr&#x60;. ### Payload examples Synchronization actions are sent as &#x60;PUT&#x60; requests. See the structure for each action: &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Adding an item to the catalog&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &#x60;&#x60;&#x60;json { &quot;actions&quot;: [ { &quot;payload&quot;: { &quot;attributes&quot;: { &quot;color&quot;: &quot;Navy blue&quot;, &quot;type&quot;: &quot;shoes&quot; }, &quot;replaceIfExists&quot;: true, &quot;sku&quot;: &quot;SKU1241028&quot;, &quot;price&quot;: 100, &quot;product&quot;: { &quot;name&quot;: &quot;sneakers&quot; } }, &quot;type&quot;: &quot;ADD&quot; } ] } &#x60;&#x60;&#x60; &lt;/div&gt; &lt;/details&gt; &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Adding multiple items to the catalog&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &#x60;&#x60;&#x60;json { &quot;actions&quot;: [ { &quot;payload&quot;: { &quot;attributes&quot;: { &quot;color&quot;: &quot;Navy blue&quot;, &quot;type&quot;: &quot;shoes&quot; }, &quot;replaceIfExists&quot;: true, &quot;sku&quot;: &quot;SKU1241027&quot;, &quot;price&quot;: 100, &quot;product&quot;: { &quot;name&quot;: &quot;sneakers&quot; } }, &quot;type&quot;: &quot;ADD&quot; }, { &quot;payload&quot;: { &quot;attributes&quot;: { &quot;color&quot;: &quot;Navy blue&quot;, &quot;type&quot;: &quot;shoes&quot; }, &quot;replaceIfExists&quot;: true, &quot;sku&quot;: &quot;SKU1241028&quot;, &quot;price&quot;: 100, &quot;product&quot;: { &quot;name&quot;: &quot;sneakers&quot; } }, &quot;type&quot;: &quot;ADD&quot; } ] } &#x60;&#x60;&#x60; &lt;/div&gt; &lt;/details&gt; &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Updating the attributes of an item in the catalog&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &#x60;&#x60;&#x60;json { &quot;actions&quot;: [ { &quot;payload&quot;: { &quot;attributes&quot;: { &quot;age&quot;: 11, &quot;origin&quot;: &quot;germany&quot; }, &quot;createIfNotExists&quot;: false, &quot;sku&quot;: &quot;SKU1241028&quot;, &quot;product&quot;: { &quot;name&quot;: &quot;sneakers&quot; } }, &quot;type&quot;: &quot;PATCH&quot; } ] } &#x60;&#x60;&#x60; &lt;/div&gt; &lt;/details&gt; &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Updating the attributes of multiple items in the catalog&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &#x60;&#x60;&#x60;json { &quot;actions&quot;: [ { &quot;payload&quot;: { &quot;attributes&quot;: { &quot;color&quot;: &quot;red&quot; }, &quot;filters&quot;: [ { &quot;attr&quot;: &quot;color&quot;, &quot;op&quot;: &quot;EQ&quot;, &quot;value&quot;: &quot;blue&quot; } ] }, &quot;type&quot;: &quot;PATCH_MANY&quot; } ] } &#x60;&#x60;&#x60; &lt;/div&gt; &lt;/details&gt; &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Removing an item from the catalog&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &#x60;&#x60;&#x60;json { &quot;actions&quot;: [ { &quot;payload&quot;: { &quot;sku&quot;: &quot;SKU1241028&quot; }, &quot;type&quot;: &quot;REMOVE&quot; } ] } &#x60;&#x60;&#x60; &lt;/div&gt; &lt;/details&gt; &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Removing multiple items from the catalog&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &#x60;&#x60;&#x60;json { &quot;actions&quot;: [ { &quot;payload&quot;: { &quot;filters&quot;: [ { &quot;attr&quot;: &quot;color&quot;, &quot;op&quot;: &quot;EQ&quot;, &quot;value&quot;: &quot;blue&quot; } ] }, &quot;type&quot;: &quot;REMOVE_MANY&quot; } ] } &#x60;&#x60;&#x60; &lt;/div&gt; &lt;/details&gt; &lt;details&gt; &lt;summary&gt;&lt;strong&gt;Removing shoes of sizes above 45 from the catalog&lt;/strong&gt;&lt;/summary&gt; &lt;div&gt; &lt;p&gt; Let&#39;s imagine that we have a shoe store and we have decided to stop selling shoes larger than size 45. We can remove from the catalog all the shoes of sizes above 45 with a single action:&lt;/p&gt; &#x60;&#x60;&#x60;json { &quot;actions&quot;: [ { &quot;payload&quot;: { &quot;filters&quot;: [ { &quot;attr&quot;: &quot;size&quot;, &quot;op&quot;: &quot;GT&quot;, &quot;value&quot;: &quot;45&quot; } ] }, &quot;type&quot;: &quot;REMOVE_MANY&quot; } ] } &#x60;&#x60;&#x60; &lt;/div&gt; &lt;/details&gt;

Parameters:

  • catalog_id (Integer)

    The ID of the catalog. You can find the ID in the Campaign Manager in Account &gt; Tools &gt; **Cart item catalogs**.

  • catalog_sync_request (CatalogSyncRequest)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Catalog, Integer, Hash)>)

    Catalog data, response status code and response headers



2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2204

def sync_catalog_with_http_info(catalog_id, catalog_sync_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.sync_catalog ...'
  end
  # verify the required parameter 'catalog_id' is set
  if @api_client.config.client_side_validation && catalog_id.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_id' when calling IntegrationApi.sync_catalog"
  end
  # verify the required parameter 'catalog_sync_request' is set
  if @api_client.config.client_side_validation && catalog_sync_request.nil?
    fail ArgumentError, "Missing the required parameter 'catalog_sync_request' when calling IntegrationApi.sync_catalog"
  end
  # resource path
  local_var_path = '/v1/catalogs/{catalogId}/sync'.sub('{' + 'catalogId' + '}', CGI.escape(catalog_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(catalog_sync_request)

  # return_type
  return_type = opts[:debug_return_type] || 'Catalog'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.sync_catalog",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#sync_catalog\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#track_event_v2(integration_event_v2_request, opts = {}) ⇒ IntegrationEventV2Response

Track event Triggers a custom event. To use this endpoint: 1. Define a [custom event](docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the Events view in the Campaign Manager. Talon.One also offers a set of [built-in events](docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). > [!note] Note > - ‘profileId` is required even though the schema does not specify it. > - If the customer profile ID is new, a new profile is automatically created but the `customer_profile_created` [built-in event ](docs.talon.one/docs/dev/concepts/entities/events) is not triggered. > - We recommend sending requests sequentially. See [Managing parallel requests](docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.

Parameters:

  • integration_event_v2_request (IntegrationEventV2Request)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :silent (String)

    Possible values: &#x60;yes&#x60; or &#x60;no&#x60;. - &#x60;yes&#x60;: Increases the performance of the API call by returning a 204 response. - &#x60;no&#x60;: Returns a 200 response that contains the updated customer profiles. (default to ‘yes’)

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

  • :force_complete_evaluation (Boolean)

    Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires &#x60;dry&#x3D;true&#x60;. (default to false)

Returns:



2269
2270
2271
2272
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2269

def track_event_v2(integration_event_v2_request, opts = {})
  data, _status_code, _headers = track_event_v2_with_http_info(integration_event_v2_request, opts)
  data
end

#track_event_v2_with_http_info(integration_event_v2_request, opts = {}) ⇒ Array<(IntegrationEventV2Response, Integer, Hash)>

Track event Triggers a custom event. To use this endpoint: 1. Define a [custom event](docs.talon.one/docs/dev/concepts/entities/events#creating-a-custom-event) in the Campaign Manager. 1. Update or create a rule to check for this event. 1. Trigger the event with this endpoint. After you have successfully sent an event to Talon.One, you can list the received events in the Events view in the Campaign Manager. Talon.One also offers a set of [built-in events](docs.talon.one/docs/dev/concepts/entities/events). Ensure you do not create a custom event when you can use a built-in event. For example, use this endpoint to trigger an event when a customer shares a link to a product. See the [tutorial](docs.talon.one/docs/product/tutorials/referrals/incentivizing-product-link-sharing). &gt; [!note] Note &gt; - &#x60;profileId&#x60; is required even though the schema does not specify it. &gt; - If the customer profile ID is new, a new profile is automatically created but the &#x60;customer_profile_created&#x60; [built-in event ](docs.talon.one/docs/dev/concepts/entities/events) is not triggered. &gt; - We recommend sending requests sequentially. See [Managing parallel requests](docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). &gt; - [Archived campaigns](docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation.

Parameters:

  • integration_event_v2_request (IntegrationEventV2Request)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :silent (String)

    Possible values: &#x60;yes&#x60; or &#x60;no&#x60;. - &#x60;yes&#x60;: Increases the performance of the API call by returning a 204 response. - &#x60;no&#x60;: Returns a 200 response that contains the updated customer profiles. (default to ‘yes’)

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

  • :force_complete_evaluation (Boolean)

    Forces evaluation for all matching campaigns regardless of the [campaign evaluation mode](docs.talon.one/docs/product/applications/managing-campaign-evaluation#setting-campaign-evaluation-mode). Requires &#x60;dry&#x3D;true&#x60;. (default to false)

Returns:

  • (Array<(IntegrationEventV2Response, Integer, Hash)>)

    IntegrationEventV2Response data, response status code and response headers



2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2282

def track_event_v2_with_http_info(integration_event_v2_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.track_event_v2 ...'
  end
  # verify the required parameter 'integration_event_v2_request' is set
  if @api_client.config.client_side_validation && integration_event_v2_request.nil?
    fail ArgumentError, "Missing the required parameter 'integration_event_v2_request' when calling IntegrationApi.track_event_v2"
  end
  # resource path
  local_var_path = '/v2/events'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'silent'] = opts[:'silent'] if !opts[:'silent'].nil?
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?
  query_params[:'forceCompleteEvaluation'] = opts[:'force_complete_evaluation'] if !opts[:'force_complete_evaluation'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(integration_event_v2_request)

  # return_type
  return_type = opts[:debug_return_type] || 'IntegrationEventV2Response'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.track_event_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#track_event_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Unlink customer profile from a loyalty card Unlink a customer profile from a [registered](docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card) loyalty card. To get the ‘integrationId` of a customer profile, you can use the [Update customer session](docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint.

Parameters:

Returns:



2345
2346
2347
2348
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2345

def unlink_loyalty_card_from_profile(loyalty_program_id, loyalty_card_id, loyalty_card_registration, opts = {})
  data, _status_code, _headers = unlink_loyalty_card_from_profile_with_http_info(loyalty_program_id, loyalty_card_id, loyalty_card_registration, opts)
  data
end

Unlink customer profile from a loyalty card Unlink a customer profile from a [registered](docs.talon.one/docs/product/loyalty-programs/card-based/managing-loyalty-cards#linking-customer-profiles-to-a-loyalty-card) loyalty card. To get the &#x60;integrationId&#x60; of a customer profile, you can use the [Update customer session](docs.talon.one/integration-api#tag/Customer-sessions/operation/updateCustomerSessionV2) endpoint.

Parameters:

Returns:

  • (Array<(LoyaltyCard, Integer, Hash)>)

    LoyaltyCard data, response status code and response headers



2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2357

def unlink_loyalty_card_from_profile_with_http_info(loyalty_program_id, loyalty_card_id, loyalty_card_registration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.unlink_loyalty_card_from_profile ...'
  end
  # verify the required parameter 'loyalty_program_id' is set
  if @api_client.config.client_side_validation && loyalty_program_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_program_id' when calling IntegrationApi.unlink_loyalty_card_from_profile"
  end
  # verify the required parameter 'loyalty_card_id' is set
  if @api_client.config.client_side_validation && loyalty_card_id.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_card_id' when calling IntegrationApi.unlink_loyalty_card_from_profile"
  end
  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length > 108
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.unlink_loyalty_card_from_profile, the character length must be smaller than or equal to 108.'
  end

  if @api_client.config.client_side_validation && loyalty_card_id.to_s.length < 4
    fail ArgumentError, 'invalid value for "loyalty_card_id" when calling IntegrationApi.unlink_loyalty_card_from_profile, the character length must be greater than or equal to 4.'
  end

  # verify the required parameter 'loyalty_card_registration' is set
  if @api_client.config.client_side_validation && loyalty_card_registration.nil?
    fail ArgumentError, "Missing the required parameter 'loyalty_card_registration' when calling IntegrationApi.unlink_loyalty_card_from_profile"
  end
  # resource path
  local_var_path = '/v2/loyalty_programs/{loyaltyProgramId}/cards/{loyaltyCardId}/unlink_profile'.sub('{' + 'loyaltyProgramId' + '}', CGI.escape(loyalty_program_id.to_s)).sub('{' + 'loyaltyCardId' + '}', CGI.escape(loyalty_card_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(loyalty_card_registration)

  # return_type
  return_type = opts[:debug_return_type] || 'LoyaltyCard'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.unlink_loyalty_card_from_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#unlink_loyalty_card_from_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_audience_customers_attributes(audience_id, body, opts = {}) ⇒ nil

Update profile attributes for all customers in audience Update the specified profile attributes to the provided values for all customers in the specified audience.

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • body (Object)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


2432
2433
2434
2435
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2432

def update_audience_customers_attributes(audience_id, body, opts = {})
  update_audience_customers_attributes_with_http_info(audience_id, body, opts)
  nil
end

#update_audience_customers_attributes_with_http_info(audience_id, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update profile attributes for all customers in audience Update the specified profile attributes to the provided values for all customers in the specified audience.

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • body (Object)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2443

def update_audience_customers_attributes_with_http_info(audience_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_audience_customers_attributes ...'
  end
  # verify the required parameter 'audience_id' is set
  if @api_client.config.client_side_validation && audience_id.nil?
    fail ArgumentError, "Missing the required parameter 'audience_id' when calling IntegrationApi.update_audience_customers_attributes"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_audience_customers_attributes"
  end
  # resource path
  local_var_path = '/v2/audience_customers/{audienceId}/attributes'.sub('{' + 'audienceId' + '}', CGI.escape(audience_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(body)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.update_audience_customers_attributes",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_audience_customers_attributes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_audience_v2(audience_id, update_audience, opts = {}) ⇒ Audience

Update audience name Update the name of the given audience created by a third-party integration. Sending a request to this endpoint does not trigger the Rule Engine. To update the audience’s members, use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint.

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • update_audience (UpdateAudience)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



2506
2507
2508
2509
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2506

def update_audience_v2(audience_id, update_audience, opts = {})
  data, _status_code, _headers = update_audience_v2_with_http_info(audience_id, update_audience, opts)
  data
end

#update_audience_v2_with_http_info(audience_id, update_audience, opts = {}) ⇒ Array<(Audience, Integer, Hash)>

Update audience name Update the name of the given audience created by a third-party integration. Sending a request to this endpoint does not trigger the Rule Engine. To update the audience&#39;s members, use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint.

Parameters:

  • audience_id (Integer)

    The ID of the audience.

  • update_audience (UpdateAudience)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Audience, Integer, Hash)>)

    Audience data, response status code and response headers



2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2517

def update_audience_v2_with_http_info(audience_id, update_audience, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_audience_v2 ...'
  end
  # verify the required parameter 'audience_id' is set
  if @api_client.config.client_side_validation && audience_id.nil?
    fail ArgumentError, "Missing the required parameter 'audience_id' when calling IntegrationApi.update_audience_v2"
  end
  # verify the required parameter 'update_audience' is set
  if @api_client.config.client_side_validation && update_audience.nil?
    fail ArgumentError, "Missing the required parameter 'update_audience' when calling IntegrationApi.update_audience_v2"
  end
  # resource path
  local_var_path = '/v2/audiences/{audienceId}'.sub('{' + 'audienceId' + '}', CGI.escape(audience_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(update_audience)

  # return_type
  return_type = opts[:debug_return_type] || 'Audience'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.update_audience_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_audience_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_profile_audiences(customer_profile_audience_request, opts = {}) ⇒ nil

Update multiple customer profiles’ audiences Add customer profiles to or remove them from an audience. The endpoint supports 1000 audience actions (‘add` or `remove`) per request. > [!note] You can also do this using the > [Update audience](docs.talon.one/docs/product/rules/effects/using-effects#updating-an-audience) > effect.

Parameters:

Returns:

  • (nil)


2579
2580
2581
2582
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2579

def update_customer_profile_audiences(customer_profile_audience_request, opts = {})
  update_customer_profile_audiences_with_http_info(customer_profile_audience_request, opts)
  nil
end

#update_customer_profile_audiences_with_http_info(customer_profile_audience_request, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update multiple customer profiles&#39; audiences Add customer profiles to or remove them from an audience. The endpoint supports 1000 audience actions (&#x60;add&#x60; or &#x60;remove&#x60;) per request. &gt; [!note] You can also do this using the &gt; [Update audience](docs.talon.one/docs/product/rules/effects/using-effects#updating-an-audience) &gt; effect.

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2589

def update_customer_profile_audiences_with_http_info(customer_profile_audience_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_profile_audiences ...'
  end
  # verify the required parameter 'customer_profile_audience_request' is set
  if @api_client.config.client_side_validation && customer_profile_audience_request.nil?
    fail ArgumentError, "Missing the required parameter 'customer_profile_audience_request' when calling IntegrationApi.update_customer_profile_audiences"
  end
  # resource path
  local_var_path = '/v2/customer_audiences'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_profile_audience_request)

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.update_customer_profile_audiences",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_profile_audiences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_profile_v2(integration_id, customer_profile_integration_request_v2, opts = {}) ⇒ CustomerProfileIntegrationResponseV2

Update customer profile Update or create a [Customer Profile](docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. > [!note] Note > - Updating a customer profile returns a response with the requested integration state. > - You can use the ‘responseContent` property to save yourself extra API calls. For example, you can get > the customer profile details directly without extra requests. > - We recommend sending requests sequentially. > See [Managing parallel requests](docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). > - [Archived campaigns](docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when `runRuleEngine` is `true`.

Parameters:

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • customer_profile_integration_request_v2 (CustomerProfileIntegrationRequestV2)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :run_rule_engine (Boolean)

    Indicates whether to run the Rule Engine. If &#x60;true&#x60;, the response includes: - The effects generated by the triggered campaigns are returned in the &#x60;effects&#x60; property. - The created coupons and referral objects. If &#x60;false&#x60;: - The rules are not executed and the &#x60;effects&#x60; property is always empty. - The response time improves. - You cannot use &#x60;responseContent&#x60; in the body. (default to false)

  • :dry (Boolean) — default: Only works when &#x60;runRuleEngine&#x3D;true&#x60;

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;. When set to &#x60;true&#x60;, you can use the &#x60;evaluableCampaignIds&#x60; body property to select specific campaigns to run.

Returns:



2650
2651
2652
2653
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2650

def update_customer_profile_v2(integration_id, customer_profile_integration_request_v2, opts = {})
  data, _status_code, _headers = update_customer_profile_v2_with_http_info(integration_id, customer_profile_integration_request_v2, opts)
  data
end

#update_customer_profile_v2_with_http_info(integration_id, customer_profile_integration_request_v2, opts = {}) ⇒ Array<(CustomerProfileIntegrationResponseV2, Integer, Hash)>

Update customer profile Update or create a [Customer Profile](docs.talon.one/docs/dev/concepts/entities/customer-profiles). This endpoint triggers the Rule Builder. You can use this endpoint to: - Set attributes on the given customer profile. Ensure you create the attributes in the Campaign Manager, first. - Modify the audience the customer profile is a member of. &gt; [!note] Note &gt; - Updating a customer profile returns a response with the requested integration state. &gt; - You can use the &#x60;responseContent&#x60; property to save yourself extra API calls. For example, you can get &gt; the customer profile details directly without extra requests. &gt; - We recommend sending requests sequentially. &gt; See [Managing parallel requests](docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). &gt; - [Archived campaigns](docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered in rule evaluation when &#x60;runRuleEngine&#x60; is &#x60;true&#x60;.

Parameters:

  • integration_id (String)

    The integration identifier for this customer profile. Must be: - Unique within the deployment. - Stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Once set, you cannot update this identifier.

  • customer_profile_integration_request_v2 (CustomerProfileIntegrationRequestV2)

    body

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :run_rule_engine (Boolean)

    Indicates whether to run the Rule Engine. If &#x60;true&#x60;, the response includes: - The effects generated by the triggered campaigns are returned in the &#x60;effects&#x60; property. - The created coupons and referral objects. If &#x60;false&#x60;: - The rules are not executed and the &#x60;effects&#x60; property is always empty. - The response time improves. - You cannot use &#x60;responseContent&#x60; in the body. (default to false)

  • :dry (Boolean) — default: Only works when &#x60;runRuleEngine&#x3D;true&#x60;

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;. When set to &#x60;true&#x60;, you can use the &#x60;evaluableCampaignIds&#x60; body property to select specific campaigns to run.

Returns:



2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2663

def update_customer_profile_v2_with_http_info(integration_id, customer_profile_integration_request_v2, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_profile_v2 ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.update_customer_profile_v2"
  end
  # verify the required parameter 'customer_profile_integration_request_v2' is set
  if @api_client.config.client_side_validation && customer_profile_integration_request_v2.nil?
    fail ArgumentError, "Missing the required parameter 'customer_profile_integration_request_v2' when calling IntegrationApi.update_customer_profile_v2"
  end
  # resource path
  local_var_path = '/v2/customer_profiles/{integrationId}'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'runRuleEngine'] = opts[:'run_rule_engine'] if !opts[:'run_rule_engine'].nil?
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(customer_profile_integration_request_v2)

  # return_type
  return_type = opts[:debug_return_type] || 'CustomerProfileIntegrationResponseV2'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.update_customer_profile_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_profile_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_profiles_v2(multiple_customer_profile_integration_request, opts = {}) ⇒ MultipleCustomerProfileIntegrationResponseV2

Update multiple customer profiles Update (or create) up to 1000 [customer profiles](docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The ‘integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](docs.talon.one/integration-api#tag/Customer-sessions). > [!note] This endpoint does not trigger the Rule Engine. > To trigger the Rule Engine for customer profile updates, > use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint.

Parameters:

Options Hash (opts):

  • :silent (String)

    Possible values: &#x60;yes&#x60; or &#x60;no&#x60;. - &#x60;yes&#x60;: Increases the performance of the API call by returning a 204 response. - &#x60;no&#x60;: Returns a 200 response that contains the updated customer profiles. (default to ‘yes’)

Returns:



2728
2729
2730
2731
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2728

def update_customer_profiles_v2(multiple_customer_profile_integration_request, opts = {})
  data, _status_code, _headers = update_customer_profiles_v2_with_http_info(multiple_customer_profile_integration_request, opts)
  data
end

#update_customer_profiles_v2_with_http_info(multiple_customer_profile_integration_request, opts = {}) ⇒ Array<(MultipleCustomerProfileIntegrationResponseV2, Integer, Hash)>

Update multiple customer profiles Update (or create) up to 1000 [customer profiles](docs.talon.one/docs/dev/concepts/entities/customer-profiles) in 1 request. The &#x60;integrationId&#x60; must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](docs.talon.one/integration-api#tag/Customer-sessions). &gt; [!note] This endpoint does not trigger the Rule Engine. &gt; To trigger the Rule Engine for customer profile updates, &gt; use the [Update customer profile](#tag/Customer-profiles/operation/updateCustomerProfileV2) endpoint.

Parameters:

Options Hash (opts):

  • :silent (String)

    Possible values: &#x60;yes&#x60; or &#x60;no&#x60;. - &#x60;yes&#x60;: Increases the performance of the API call by returning a 204 response. - &#x60;no&#x60;: Returns a 200 response that contains the updated customer profiles. (default to ‘yes’)

Returns:



2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2739

def update_customer_profiles_v2_with_http_info(multiple_customer_profile_integration_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_profiles_v2 ...'
  end
  # verify the required parameter 'multiple_customer_profile_integration_request' is set
  if @api_client.config.client_side_validation && multiple_customer_profile_integration_request.nil?
    fail ArgumentError, "Missing the required parameter 'multiple_customer_profile_integration_request' when calling IntegrationApi.update_customer_profiles_v2"
  end
  # resource path
  local_var_path = '/v2/customer_profiles'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'silent'] = opts[:'silent'] if !opts[:'silent'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(multiple_customer_profile_integration_request)

  # return_type
  return_type = opts[:debug_return_type] || 'MultipleCustomerProfileIntegrationResponseV2'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.update_customer_profiles_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_profiles_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_session_v2(customer_session_id, integration_request, opts = {}) ⇒ IntegrationStateV2

Update customer session Update or create a [customer session](docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer’s cart with Talon.One. > [!note] Note > - The currency for the session and the cart items in it is the currency set for the Application linked to this session. > - [Archived campaigns](docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the ‘state` parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the `profileId` parameter in the request body to a customer profile’s ‘integrationId`. - While you can create an anonymous session with `profileId=""`, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. > [!note] Note > - If the specified profile does not exist, an empty profile is **created automatically**. > You can update it with [Update customer profile](docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). > - Updating a customer session returns a response with the new integration state. Use the `responseContent` property to save yourself extra API calls. > For example, you can get the customer profile details directly without extra requests. > - We recommend sending requests sequentially. See [Managing parallel requests](docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](docs.talon.one/docs/dev/tutorials/integrating-talon-one).

Parameters:

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;. When set to &#x60;true&#x60;: - The endpoint considers only the payload that you pass when closing the session. When you do not use the &#x60;dry&#x60; parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the &#x60;evaluableCampaignIds&#x60; body property to select specific campaigns to run. [See the docs](docs.talon.one/docs/dev/integration-api/dry-requests).

  • :now (Time)

    A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). &gt; [!note] Note &gt; - It must be an RFC3339 timestamp string. &gt; - It can only be a date in the future. &gt; - It can only be used if the &#x60;dry&#x60; parameter in the query is set to &#x60;true&#x60;.

Returns:



2801
2802
2803
2804
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2801

def update_customer_session_v2(customer_session_id, integration_request, opts = {})
  data, _status_code, _headers = update_customer_session_v2_with_http_info(customer_session_id, integration_request, opts)
  data
end

#update_customer_session_v2_with_http_info(customer_session_id, integration_request, opts = {}) ⇒ Array<(IntegrationStateV2, Integer, Hash)>

Update customer session Update or create a [customer session](docs.talon.one/docs/dev/concepts/entities/customer-sessions). The endpoint responds with the potential promotion rule [effects](docs.talon.one/docs/dev/integration-api/api-effects) that match the current cart. For example, use this endpoint to share the contents of a customer&#39;s cart with Talon.One. &gt; [!note] Note &gt; - The currency for the session and the cart items in it is the currency set for the Application linked to this session. &gt; - [Archived campaigns](docs.talon.one/docs/product/campaigns/managing-campaigns#archiving-a-campaign) are not considered for rule evaluation. ### Session management To use this endpoint, start by learning about [customer sessions](docs.talon.one/docs/dev/concepts/entities/customer-sessions) and their states and refer to the &#x60;state&#x60; parameter documentation the request body schema docs below. ### Sessions and customer profiles - To link a session to a customer profile, set the &#x60;profileId&#x60; parameter in the request body to a customer profile&#39;s &#x60;integrationId&#x60;. - While you can create an anonymous session with &#x60;profileId&#x3D;&quot;&quot;&#x60;, we recommend you use a guest ID instead. - A profile can be linked to simultaneous sessions in different Applications. Either: - Use unique session integration IDs or, - Use the same session integration ID across all of the Applications. &gt; [!note] Note &gt; - If the specified profile does not exist, an empty profile is **created automatically**. &gt; You can update it with [Update customer profile](docs.talon.one/integration-api#tag/Customer-profiles/operation/updateCustomerProfileV2). &gt; - Updating a customer session returns a response with the new integration state. Use the &#x60;responseContent&#x60; property to save yourself extra API calls. &gt; For example, you can get the customer profile details directly without extra requests. &gt; - We recommend sending requests sequentially. See [Managing parallel requests](docs.talon.one/docs/dev/getting-started/integration-tutorial#managing-parallel-requests). For more information, see: - The introductory video in [Getting started](docs.talon.one/docs/dev/getting-started/overview). - The [integration tutorial](docs.talon.one/docs/dev/tutorials/integrating-talon-one).

Parameters:

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;. When set to &#x60;true&#x60;: - The endpoint considers only the payload that you pass when closing the session. When you do not use the &#x60;dry&#x60; parameter, the endpoint behaves as a typical PUT endpoint. Each update builds upon the previous ones. - You can use the &#x60;evaluableCampaignIds&#x60; body property to select specific campaigns to run. [See the docs](docs.talon.one/docs/dev/integration-api/dry-requests).

  • :now (Time)

    A timestamp value of a future date that acts as a current date when included in the query. Use this parameter, for example, to test campaigns that would be evaluated for this customer session in the future (say, [scheduled campaigns](docs.talon.one/docs/product/campaigns/settings/managing-campaign-schedule)). &gt; [!note] Note &gt; - It must be an RFC3339 timestamp string. &gt; - It can only be a date in the future. &gt; - It can only be used if the &#x60;dry&#x60; parameter in the query is set to &#x60;true&#x60;.

Returns:

  • (Array<(IntegrationStateV2, Integer, Hash)>)

    IntegrationStateV2 data, response status code and response headers



2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
# File 'lib/talon_one_sdk/api/integration_api.rb', line 2814

def update_customer_session_v2_with_http_info(customer_session_id, integration_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_session_v2 ...'
  end
  # verify the required parameter 'customer_session_id' is set
  if @api_client.config.client_side_validation && customer_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_session_id' when calling IntegrationApi.update_customer_session_v2"
  end
  # verify the required parameter 'integration_request' is set
  if @api_client.config.client_side_validation && integration_request.nil?
    fail ArgumentError, "Missing the required parameter 'integration_request' when calling IntegrationApi.update_customer_session_v2"
  end
  # resource path
  local_var_path = '/v2/customer_sessions/{customerSessionId}'.sub('{' + 'customerSessionId' + '}', CGI.escape(customer_session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?
  query_params[:'now'] = opts[:'now'] if !opts[:'now'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(integration_request)

  # return_type
  return_type = opts[:debug_return_type] || 'IntegrationStateV2'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :operation => :"IntegrationApi.update_customer_session_v2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_session_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end