Class: CyberSource::AgentCapabilitiesApi

Inherits:
Object
  • Object
show all
Defined in:
lib/cybersource_rest_client/api/agent_capabilities_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default, config) ⇒ AgentCapabilitiesApi

Returns a new instance of AgentCapabilitiesApi.



18
19
20
21
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 18

def initialize(api_client = ApiClient.default, config)
  @api_client = api_client
  @api_client.set_configuration(config)
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#activate_agent_key(agent_id, key_id, opts = {}) ⇒ AddAgentKeyResponse201

Activate a key Activate a deactivated key. Raises 404 if agent or key not found, 403 if agent is deactivated.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

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

    the optional parameters

Returns:



30
31
32
33
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 30

def activate_agent_key(agent_id, key_id, opts = {})
  data, status_code, headers = activate_agent_key_with_http_info(agent_id, key_id, opts)
  return data, status_code, headers
end

#activate_agent_key_with_http_info(agent_id, key_id, opts = {}) ⇒ Array<(AddAgentKeyResponse201, Fixnum, Hash)>

Activate a key Activate a deactivated key. Raises 404 if agent or key not found, 403 if agent is deactivated.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

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

    the optional parameters

Returns:

  • (Array<(AddAgentKeyResponse201, Fixnum, Hash)>)

    AddAgentKeyResponse201 data, response status code and response headers



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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 41

def activate_agent_key_with_http_info(agent_id, key_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.activate_agent_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.activate_agent_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling AgentCapabilitiesApi.activate_agent_key"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}/keys/{keyId}/activate'.sub('{' + 'agentId' + '}', agent_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'POST' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["activate_agent_key","activate_agent_key_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["activate_agent_key","activate_agent_key_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AddAgentKeyResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#activate_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#add_agent_key(agent_id, key_request, opts = {}) ⇒ AddAgentKeyResponse201

Add a key to an agent [category 1 — Agent_Capabilities] Upload a Base64-encoded public key for an agent.

Parameters:

  • agent_id

    Unique agent identifier

  • key_request

    Key creation request

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

    the optional parameters

Returns:



119
120
121
122
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 119

def add_agent_key(agent_id, key_request, opts = {})
  data, status_code, headers = add_agent_key_with_http_info(agent_id, key_request, opts)
  return data, status_code, headers
end

#add_agent_key_with_http_info(agent_id, key_request, opts = {}) ⇒ Array<(AddAgentKeyResponse201, Fixnum, Hash)>

Add a key to an agent [category 1 — Agent_Capabilities] Upload a Base64-encoded public key for an agent.

Parameters:

  • agent_id

    Unique agent identifier

  • key_request

    Key creation request

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

    the optional parameters

Returns:

  • (Array<(AddAgentKeyResponse201, Fixnum, Hash)>)

    AddAgentKeyResponse201 data, response status code and response headers



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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 130

def add_agent_key_with_http_info(agent_id, key_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.add_agent_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.add_agent_key"
  end
  # verify the required parameter 'key_request' is set
  if @api_client.config.client_side_validation && key_request.nil?
    fail ArgumentError, "Missing the required parameter 'key_request' when calling AgentCapabilitiesApi.add_agent_key"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}/keys'.sub('{' + 'agentId' + '}', agent_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(key_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'KeyRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["add_agent_key","add_agent_key_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["add_agent_key","add_agent_key_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AddAgentKeyResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#add_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#cancel_checkout(session_id, opts = {}) ⇒ InlineResponse20018

Cancel Checkout ACP Cancels an active ACP checkout session. No charge is made to the buyer. This call is safe to make multiple times — cancelling an already-cancelled session returns a successful response without error. Sessions also expire automatically after 30 minutes of inactivity, so explicit cancellation is optional but recommended to release any reserved inventory immediately.

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to cancel. Obtained from the `id` field in the Create Session response.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:



212
213
214
215
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 212

def cancel_checkout(session_id, opts = {})
  data, status_code, headers = cancel_checkout_with_http_info(session_id, opts)
  return data, status_code, headers
end

#cancel_checkout_with_http_info(session_id, opts = {}) ⇒ Array<(InlineResponse20018, Fixnum, Hash)>

Cancel Checkout ACP Cancels an active ACP checkout session. No charge is made to the buyer. This call is safe to make multiple times — cancelling an already-cancelled session returns a successful response without error. Sessions also expire automatically after 30 minutes of inactivity, so explicit cancellation is optional but recommended to release any reserved inventory immediately.

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to cancel. Obtained from the `id` field in the Create Session response.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:

  • (Array<(InlineResponse20018, Fixnum, Hash)>)

    InlineResponse20018 data, response status code and response headers



229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 229

def cancel_checkout_with_http_info(session_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.cancel_checkout ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.cancel_checkout"
  end
  # resource path
  local_var_path = 'icc/v1/checkout_sessions/{session_id}/cancel'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
  header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
  header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
  header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
  header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  if 'POST' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["cancel_checkout","cancel_checkout_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["cancel_checkout","cancel_checkout_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20018',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#cancel_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#cancel_purchase_intent(instruction_id, agentic_cancel_purchase_intent_request, opts = {}) ⇒ AgenticCreatePurchaseIntentResponse200

Cancel a purchase intent Cancel an existing purchase intent (instruction) identified by its instructionId. The agent calls this endpoint when the consumer decides to abandon the purchase before payment credentials have been used. Requires device information and assurance data for identity verification. Returns status CANCELLED (HTTP 200) on success, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required before cancellation can proceed.

Parameters:

  • instruction_id
  • agentic_cancel_purchase_intent_request

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



310
311
312
313
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 310

def cancel_purchase_intent(instruction_id, agentic_cancel_purchase_intent_request, opts = {})
  data, status_code, headers = cancel_purchase_intent_with_http_info(instruction_id, agentic_cancel_purchase_intent_request, opts)
  return data, status_code, headers
end

#cancel_purchase_intent_with_http_info(instruction_id, agentic_cancel_purchase_intent_request, opts = {}) ⇒ Array<(AgenticCreatePurchaseIntentResponse200, Fixnum, Hash)>

Cancel a purchase intent Cancel an existing purchase intent (instruction) identified by its instructionId. The agent calls this endpoint when the consumer decides to abandon the purchase before payment credentials have been used. Requires device information and assurance data for identity verification. Returns status CANCELLED (HTTP 200) on success, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required before cancellation can proceed.

Parameters:

  • instruction_id
  • agentic_cancel_purchase_intent_request

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



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
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 321

def cancel_purchase_intent_with_http_info(instruction_id, agentic_cancel_purchase_intent_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.cancel_purchase_intent ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'instruction_id' is set
  if @api_client.config.client_side_validation && instruction_id.nil?
    fail ArgumentError, "Missing the required parameter 'instruction_id' when calling AgentCapabilitiesApi.cancel_purchase_intent"
  end
  # verify the required parameter 'agentic_cancel_purchase_intent_request' is set
  if @api_client.config.client_side_validation && agentic_cancel_purchase_intent_request.nil?
    fail ArgumentError, "Missing the required parameter 'agentic_cancel_purchase_intent_request' when calling AgentCapabilitiesApi.cancel_purchase_intent"
  end
  # resource path
  local_var_path = 'icc/v1/instructions/{instructionId}/cancel'.sub('{' + 'instructionId' + '}', instruction_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agentic_cancel_purchase_intent_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgenticCancelPurchaseIntentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["cancel_purchase_intent","cancel_purchase_intent_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["cancel_purchase_intent","cancel_purchase_intent_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgenticCreatePurchaseIntentResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#cancel_purchase_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#complete_checkout(session_id, acp_complete_checkout_request, opts = {}) ⇒ InlineResponse20017

Complete Checkout ACP Final step of the ACP checkout flow. Submits payment and buyer information to place the order with the merchant. On success, the session transitions to completed and an order_id is returned confirming the merchant accepted the order. Once completed, the session is immutable — it cannot be updated or cancelled. Payment token: The payment.token must be a valid token from the payment provider configured for the merchant (e.g. a tokenized card from Stripe or Braintree). ACG forwards the token to the merchant's payment processor — it is never stored.

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to complete.

  • acp_complete_checkout_request

    Final buyer and payment details needed to place the order. Both `buyer` and `payment` may have been provided in earlier Create/Update calls; if so, they can be omitted here. At least a valid payment token is required to process the transaction.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:



404
405
406
407
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 404

def complete_checkout(session_id, acp_complete_checkout_request, opts = {})
  data, status_code, headers = complete_checkout_with_http_info(session_id, acp_complete_checkout_request, opts)
  return data, status_code, headers
end

#complete_checkout_with_http_info(session_id, acp_complete_checkout_request, opts = {}) ⇒ Array<(InlineResponse20017, Fixnum, Hash)>

Complete Checkout ACP Final step of the ACP checkout flow. Submits payment and buyer information to place the order with the merchant. On success, the session transitions to `completed` and an `order_id` is returned confirming the merchant accepted the order. Once completed, the session is immutable — it cannot be updated or cancelled. Payment token: The `payment.token` must be a valid token from the payment provider configured for the merchant (e.g. a tokenized card from Stripe or Braintree). ACG forwards the token to the merchant's payment processor — it is never stored.

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to complete.

  • acp_complete_checkout_request

    Final buyer and payment details needed to place the order. Both `buyer` and `payment` may have been provided in earlier Create/Update calls; if so, they can be omitted here. At least a valid payment token is required to process the transaction.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:

  • (Array<(InlineResponse20017, Fixnum, Hash)>)

    InlineResponse20017 data, response status code and response headers



422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 422

def complete_checkout_with_http_info(session_id, acp_complete_checkout_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.complete_checkout ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.complete_checkout"
  end
  # verify the required parameter 'acp_complete_checkout_request' is set
  if @api_client.config.client_side_validation && acp_complete_checkout_request.nil?
    fail ArgumentError, "Missing the required parameter 'acp_complete_checkout_request' when calling AgentCapabilitiesApi.complete_checkout"
  end
  # resource path
  local_var_path = 'icc/v1/checkout_sessions/{session_id}/complete'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
  header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
  header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
  header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
  header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(acp_complete_checkout_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AcpCompleteCheckoutRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["complete_checkout","complete_checkout_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["complete_checkout","complete_checkout_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20017',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#complete_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#confirm_transaction_events(instruction_id, agentic_confirm_transaction_events_request, opts = {}) ⇒ AgenticConfirmTransactionEventsResponse202

Confirm transaction events Confirm transaction events for a completed purchase. The agent calls this endpoint after the payment has been submitted to notify the Intelligent Commerce Connect of the transaction outcome. The request includes processor information (transaction type, status, approval codes), order details (shipping, tracking, product information), and merchant information. Returns HTTP 202 acknowledging receipt of the confirmation.

Parameters:

  • instruction_id

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



505
506
507
508
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 505

def confirm_transaction_events(instruction_id, agentic_confirm_transaction_events_request, opts = {})
  data, status_code, headers = confirm_transaction_events_with_http_info(instruction_id, agentic_confirm_transaction_events_request, opts)
  return data, status_code, headers
end

#confirm_transaction_events_with_http_info(instruction_id, agentic_confirm_transaction_events_request, opts = {}) ⇒ Array<(AgenticConfirmTransactionEventsResponse202, Fixnum, Hash)>

Confirm transaction events Confirm transaction events for a completed purchase. The agent calls this endpoint after the payment has been submitted to notify the Intelligent Commerce Connect of the transaction outcome. The request includes processor information (transaction type, status, approval codes), order details (shipping, tracking, product information), and merchant information. Returns HTTP 202 acknowledging receipt of the confirmation.

Parameters:

  • instruction_id

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



516
517
518
519
520
521
522
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
570
571
572
573
574
575
576
577
578
579
580
581
582
583
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 516

def confirm_transaction_events_with_http_info(instruction_id, agentic_confirm_transaction_events_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.confirm_transaction_events ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'instruction_id' is set
  if @api_client.config.client_side_validation && instruction_id.nil?
    fail ArgumentError, "Missing the required parameter 'instruction_id' when calling AgentCapabilitiesApi.confirm_transaction_events"
  end
  # verify the required parameter 'agentic_confirm_transaction_events_request' is set
  if @api_client.config.client_side_validation && agentic_confirm_transaction_events_request.nil?
    fail ArgumentError, "Missing the required parameter 'agentic_confirm_transaction_events_request' when calling AgentCapabilitiesApi.confirm_transaction_events"
  end
  # resource path
  local_var_path = 'icc/v1/instructions/{instructionId}/confirmations'.sub('{' + 'instructionId' + '}', instruction_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agentic_confirm_transaction_events_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgenticConfirmTransactionEventsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["confirm_transaction_events","confirm_transaction_events_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["confirm_transaction_events","confirm_transaction_events_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgenticConfirmTransactionEventsResponse202',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#confirm_transaction_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#create_checkout_session(acp_create_checkout_session_request, opts = {}) ⇒ InlineResponse20113

Create Checkout Session ACP Step 1 of the ACP checkout flow. Initiates a new ACP checkout session with the buyer's cart. ACG validates item availability against the merchant's catalog, calculates initial pricing and tax, and returns a session object with a unique id. Store the id — every subsequent call in this checkout flow (update, complete, cancel) requires it. The session remains active for 30 minutes. A new session must be created after expiry. Idempotency: Supply an Idempotency-Key header to safely retry this call without creating duplicate sessions.

Parameters:

  • acp_create_checkout_session_request

    The cart contents and buyer context for this checkout session. `items` is required. `buyer` and `fulfillment_address` are optional on creation and can be provided via Update Session before completing checkout.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:



598
599
600
601
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 598

def create_checkout_session(acp_create_checkout_session_request, opts = {})
  data, status_code, headers = create_checkout_session_with_http_info(acp_create_checkout_session_request, opts)
  return data, status_code, headers
end

#create_checkout_session_with_http_info(acp_create_checkout_session_request, opts = {}) ⇒ Array<(InlineResponse20113, Fixnum, Hash)>

Create Checkout Session ACP Step 1 of the ACP checkout flow. Initiates a new ACP checkout session with the buyer's cart. ACG validates item availability against the merchant's catalog, calculates initial pricing and tax, and returns a session object with a unique `id`. Store the `id` — every subsequent call in this checkout flow (update, complete, cancel) requires it. The session remains active for 30 minutes. A new session must be created after expiry. Idempotency: Supply an `Idempotency-Key` header to safely retry this call without creating duplicate sessions.

Parameters:

  • acp_create_checkout_session_request

    The cart contents and buyer context for this checkout session. `items` is required. `buyer` and `fulfillment_address` are optional on creation and can be provided via Update Session before completing checkout.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:

  • (Array<(InlineResponse20113, Fixnum, Hash)>)

    InlineResponse20113 data, response status code and response headers



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
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 615

def create_checkout_session_with_http_info(acp_create_checkout_session_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.create_checkout_session ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'acp_create_checkout_session_request' is set
  if @api_client.config.client_side_validation && acp_create_checkout_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'acp_create_checkout_session_request' when calling AgentCapabilitiesApi.create_checkout_session"
  end
  # resource path
  local_var_path = 'icc/v1/checkout_sessions'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
  header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
  header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
  header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
  header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(acp_create_checkout_session_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AcpCreateCheckoutSessionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["create_checkout_session","create_checkout_session_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["create_checkout_session","create_checkout_session_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20113',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#create_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#deactivate_agent_key(agent_id, key_id, opts = {}) ⇒ nil

Deactivate a key Deactivate a key (soft delete). Raises 404 if key not found.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

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

    the optional parameters

Returns:

  • (nil)


694
695
696
697
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 694

def deactivate_agent_key(agent_id, key_id, opts = {})
  data, status_code, headers = deactivate_agent_key_with_http_info(agent_id, key_id, opts)
  return data, status_code, headers
end

#deactivate_agent_key_with_http_info(agent_id, key_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Deactivate a key Deactivate a key (soft delete). Raises 404 if key not found.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 705

def deactivate_agent_key_with_http_info(agent_id, key_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.deactivate_agent_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.deactivate_agent_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling AgentCapabilitiesApi.deactivate_agent_key"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}/keys/{keyId}'.sub('{' + 'agentId' + '}', agent_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'DELETE' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["deactivate_agent_key","deactivate_agent_key_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["deactivate_agent_key","deactivate_agent_key_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#deactivate_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#enroll_card(agentic_card_enrollment_request, opts = {}) ⇒ AgenticCardEnrollmentResponse200

Enroll a card Enroll a payment card for agentic or e-commerce transactions. This is typically the first step in the Intelligent Commerce payment lifecycle — the agent calls this endpoint to register a consumer's card, creating a tokenized reference that can be used in subsequent purchase instructions and payment credential retrieval. Requires device information, consumer identity, billing details, and payment instrument references. Returns a status of ACTIVE (HTTP 200) if enrollment completes immediately, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required. Call this endpoint when a consumer wants to add a new payment card or when setting up a card for agentic payment flows.

Parameters:

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

    the optional parameters

Returns:



781
782
783
784
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 781

def enroll_card(agentic_card_enrollment_request, opts = {})
  data, status_code, headers = enroll_card_with_http_info(agentic_card_enrollment_request, opts)
  return data, status_code, headers
end

#enroll_card_with_http_info(agentic_card_enrollment_request, opts = {}) ⇒ Array<(AgenticCardEnrollmentResponse200, Fixnum, Hash)>

Enroll a card Enroll a payment card for agentic or e-commerce transactions. This is typically the first step in the Intelligent Commerce payment lifecycle — the agent calls this endpoint to register a consumer's card, creating a tokenized reference that can be used in subsequent purchase instructions and payment credential retrieval. Requires device information, consumer identity, billing details, and payment instrument references. Returns a status of ACTIVE (HTTP 200) if enrollment completes immediately, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required. Call this endpoint when a consumer wants to add a new payment card or when setting up a card for agentic payment flows.

Parameters:

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

    the optional parameters

Returns:



791
792
793
794
795
796
797
798
799
800
801
802
803
804
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 791

def enroll_card_with_http_info(agentic_card_enrollment_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.enroll_card ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agentic_card_enrollment_request' is set
  if @api_client.config.client_side_validation && agentic_card_enrollment_request.nil?
    fail ArgumentError, "Missing the required parameter 'agentic_card_enrollment_request' when calling AgentCapabilitiesApi.enroll_card"
  end
  # resource path
  local_var_path = 'icc/v1/tokens'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agentic_card_enrollment_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgenticCardEnrollmentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["enroll_card","enroll_card_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["enroll_card","enroll_card_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgenticCardEnrollmentResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#enroll_card\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_agent(agent_id, opts = {}) ⇒ AgentRegistrationResponse201

Get an agent [category 1 — Agent_Capabilities] Get agent by ID with all keys. Raises 404 if agent not found.

Parameters:

  • agent_id

    Unique agent identifier

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

    the optional parameters

Returns:



862
863
864
865
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 862

def get_agent(agent_id, opts = {})
  data, status_code, headers = get_agent_with_http_info(agent_id, opts)
  return data, status_code, headers
end

#get_agent_key(agent_id, key_id, opts = {}) ⇒ AddAgentKeyResponse201

Get a key by agent and key ID Get a specific key by agent ID and key ID. Raises 404 if key not found.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

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

    the optional parameters

Returns:



946
947
948
949
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 946

def get_agent_key(agent_id, key_id, opts = {})
  data, status_code, headers = get_agent_key_with_http_info(agent_id, key_id, opts)
  return data, status_code, headers
end

#get_agent_key_with_http_info(agent_id, key_id, opts = {}) ⇒ Array<(AddAgentKeyResponse201, Fixnum, Hash)>

Get a key by agent and key ID Get a specific key by agent ID and key ID. Raises 404 if key not found.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

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

    the optional parameters

Returns:

  • (Array<(AddAgentKeyResponse201, Fixnum, Hash)>)

    AddAgentKeyResponse201 data, response status code and response headers



957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 957

def get_agent_key_with_http_info(agent_id, key_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.get_agent_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.get_agent_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling AgentCapabilitiesApi.get_agent_key"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}/keys/{keyId}'.sub('{' + 'agentId' + '}', agent_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_agent_key","get_agent_key_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["get_agent_key","get_agent_key_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AddAgentKeyResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#get_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_agent_with_http_info(agent_id, opts = {}) ⇒ Array<(AgentRegistrationResponse201, Fixnum, Hash)>

Get an agent [category 1 — Agent_Capabilities] Get agent by ID with all keys. Raises 404 if agent not found.

Parameters:

  • agent_id

    Unique agent identifier

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

    the optional parameters

Returns:



872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 872

def get_agent_with_http_info(agent_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.get_agent ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.get_agent"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}'.sub('{' + 'agentId' + '}', agent_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_agent","get_agent_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["get_agent","get_agent_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgentRegistrationResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#get_agent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#get_checkout_session(session_id, acp_get_checkout_session_request, opts = {}) ⇒ InlineResponse20113

Get Checkout Session ACP Retrieves the current state of an ACP checkout session, including line items, buyer information, and current totals. Use this to: - Verify session status before presenting a checkout summary to the buyer - Resume an interrupted checkout flow - Poll for status after an async operation - Confirm a session has not expired before submitting payment

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to retrieve. Obtained from the `id` field in the Create Session response.

  • acp_get_checkout_session_request

    Empty request body.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:



1042
1043
1044
1045
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1042

def get_checkout_session(session_id, acp_get_checkout_session_request, opts = {})
  data, status_code, headers = get_checkout_session_with_http_info(session_id, acp_get_checkout_session_request, opts)
  return data, status_code, headers
end

#get_checkout_session_with_http_info(session_id, acp_get_checkout_session_request, opts = {}) ⇒ Array<(InlineResponse20113, Fixnum, Hash)>

Get Checkout Session ACP Retrieves the current state of an ACP checkout session, including line items, buyer information, and current totals. Use this to: - Verify session status before presenting a checkout summary to the buyer - Resume an interrupted checkout flow - Poll for status after an async operation - Confirm a session has not expired before submitting payment

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to retrieve. Obtained from the `id` field in the Create Session response.

  • acp_get_checkout_session_request

    Empty request body.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:

  • (Array<(InlineResponse20113, Fixnum, Hash)>)

    InlineResponse20113 data, response status code and response headers



1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
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/cybersource_rest_client/api/agent_capabilities_api.rb', line 1060

def get_checkout_session_with_http_info(session_id, acp_get_checkout_session_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.get_checkout_session ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.get_checkout_session"
  end
  # verify the required parameter 'acp_get_checkout_session_request' is set
  if @api_client.config.client_side_validation && acp_get_checkout_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'acp_get_checkout_session_request' when calling AgentCapabilitiesApi.get_checkout_session"
  end
  # resource path
  local_var_path = 'icc/v1/checkout_sessions/{session_id}'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
  header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
  header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
  header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
  header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(acp_get_checkout_session_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Object', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["get_checkout_session","get_checkout_session_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["get_checkout_session","get_checkout_session_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20113',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#get_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#initiate_purchase_intent(agentic_create_purchase_intent_request, opts = {}) ⇒ AgenticCreatePurchaseIntentResponse200

Initiate a purchase intent Create a new purchase intent (instruction) for an agentic transaction. The agent calls this endpoint after a card has been enrolled to define what the consumer wants to buy. The request includes payment instrument references, device and assurance data, mandates (spending limits, merchant preferences, and product descriptions), and optional buyer information. Return an instructionId (HTTP 200) if the intent is created immediately, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required. The instructionId returned is used in all subsequent operations - update, cancel, retrieve credentials, and confirm transaction.

Parameters:

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

    the optional parameters

Returns:



1142
1143
1144
1145
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1142

def initiate_purchase_intent(agentic_create_purchase_intent_request, opts = {})
  data, status_code, headers = initiate_purchase_intent_with_http_info(agentic_create_purchase_intent_request, opts)
  return data, status_code, headers
end

#initiate_purchase_intent_with_http_info(agentic_create_purchase_intent_request, opts = {}) ⇒ Array<(AgenticCreatePurchaseIntentResponse200, Fixnum, Hash)>

Initiate a purchase intent Create a new purchase intent (instruction) for an agentic transaction. The agent calls this endpoint after a card has been enrolled to define what the consumer wants to buy. The request includes payment instrument references, device and assurance data, mandates (spending limits, merchant preferences, and product descriptions), and optional buyer information. Return an instructionId (HTTP 200) if the intent is created immediately, or PENDING (HTTP 202) with pendingEvents if cardholder authentication is required. The instructionId returned is used in all subsequent operations - update, cancel, retrieve credentials, and confirm transaction.

Parameters:

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

    the optional parameters

Returns:



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
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1152

def initiate_purchase_intent_with_http_info(agentic_create_purchase_intent_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.initiate_purchase_intent ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agentic_create_purchase_intent_request' is set
  if @api_client.config.client_side_validation && agentic_create_purchase_intent_request.nil?
    fail ArgumentError, "Missing the required parameter 'agentic_create_purchase_intent_request' when calling AgentCapabilitiesApi.initiate_purchase_intent"
  end
  # resource path
  local_var_path = 'icc/v1/instructions'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agentic_create_purchase_intent_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgenticCreatePurchaseIntentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["initiate_purchase_intent","initiate_purchase_intent_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["initiate_purchase_intent","initiate_purchase_intent_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgenticCreatePurchaseIntentResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#initiate_purchase_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#list_agent_keys(agent_id, opts = {}) ⇒ ListAgentKeysResponse200

List keys for an agent [category 1 — Agent_Capabilities] List all keys for a specific agent with pagination.

Parameters:

  • agent_id

    Unique agent identifier

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-indexed) (default to 1)

  • :page_size (Integer)

    Items per page (max 100) (default to 30)

Returns:



1225
1226
1227
1228
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1225

def list_agent_keys(agent_id, opts = {})
  data, status_code, headers = list_agent_keys_with_http_info(agent_id, opts)
  return data, status_code, headers
end

#list_agent_keys_with_http_info(agent_id, opts = {}) ⇒ Array<(ListAgentKeysResponse200, Fixnum, Hash)>

List keys for an agent [category 1 — Agent_Capabilities] List all keys for a specific agent with pagination.

Parameters:

  • agent_id

    Unique agent identifier

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

    the optional parameters

Options Hash (opts):

  • :page (Integer)

    Page number (1-indexed)

  • :page_size (Integer)

    Items per page (max 100)

Returns:

  • (Array<(ListAgentKeysResponse200, Fixnum, Hash)>)

    ListAgentKeysResponse200 data, response status code and response headers



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
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1237

def list_agent_keys_with_http_info(agent_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.list_agent_keys ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.list_agent_keys"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}/keys'.sub('{' + 'agentId' + '}', agent_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
  query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'GET' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["list_agent_keys","list_agent_keys_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["list_agent_keys","list_agent_keys_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ListAgentKeysResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#list_agent_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#register_agent(agent_request, opts = {}) ⇒ AgentRegistrationResponse201

Register an agent Register a new AI agent in the VARS. Once registered, the agent can upload public keys that merchants and Visa services use to verify request signatures. Raises 409 if domain, contactEmail, or tokenRequestorId already exists.

Parameters:

  • agent_request

    Agent registration request

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

    the optional parameters

Returns:



1312
1313
1314
1315
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1312

def register_agent(agent_request, opts = {})
  data, status_code, headers = register_agent_with_http_info(agent_request, opts)
  return data, status_code, headers
end

#register_agent_with_http_info(agent_request, opts = {}) ⇒ Array<(AgentRegistrationResponse201, Fixnum, Hash)>

Register an agent Register a new AI agent in the VARS. Once registered, the agent can upload public keys that merchants and Visa services use to verify request signatures. Raises 409 if domain, contactEmail, or tokenRequestorId already exists.

Parameters:

  • agent_request

    Agent registration request

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

    the optional parameters

Returns:



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
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1322

def register_agent_with_http_info(agent_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.register_agent ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_request' is set
  if @api_client.config.client_side_validation && agent_request.nil?
    fail ArgumentError, "Missing the required parameter 'agent_request' when calling AgentCapabilitiesApi.register_agent"
  end
  # resource path
  local_var_path = 'icc/v1/agents'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agent_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["register_agent","register_agent_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["register_agent","register_agent_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgentRegistrationResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#register_agent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#retrieve_payment_credentials(instruction_id, agentic_retrieve_payment_credentials_request, opts = {}) ⇒ AgenticRetrievePaymentCredentialsResponse200

Retrieve payment credentials Retrieve tokenized payment credentials for a purchase intent to complete the transaction at a merchant. The agent calls this endpoint after a purchase intent has been created and approved, providing transaction-level details including order information, merchant details, payment options, and production information. Returns COMPLETED (HTTP 200) with a signed payload containing encrypted payment credentials (authorization token and JWS-signed payload), or PENDING (HTTP 202) with pendingEvents if additional cardholder authentication is required. The signed payload is used by the merchant's payment processor to complete the transaction.

Parameters:

  • instruction_id

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



1394
1395
1396
1397
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1394

def retrieve_payment_credentials(instruction_id, agentic_retrieve_payment_credentials_request, opts = {})
  data, status_code, headers = retrieve_payment_credentials_with_http_info(instruction_id, agentic_retrieve_payment_credentials_request, opts)
  return data, status_code, headers
end

#retrieve_payment_credentials_with_http_info(instruction_id, agentic_retrieve_payment_credentials_request, opts = {}) ⇒ Array<(AgenticRetrievePaymentCredentialsResponse200, Fixnum, Hash)>

Retrieve payment credentials Retrieve tokenized payment credentials for a purchase intent to complete the transaction at a merchant. The agent calls this endpoint after a purchase intent has been created and approved, providing transaction-level details including order information, merchant details, payment options, and production information. Returns COMPLETED (HTTP 200) with a signed payload containing encrypted payment credentials (authorization token and JWS-signed payload), or PENDING (HTTP 202) with pendingEvents if additional cardholder authentication is required. The signed payload is used by the merchant's payment processor to complete the transaction.

Parameters:

  • instruction_id

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1405

def retrieve_payment_credentials_with_http_info(instruction_id, agentic_retrieve_payment_credentials_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.retrieve_payment_credentials ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'instruction_id' is set
  if @api_client.config.client_side_validation && instruction_id.nil?
    fail ArgumentError, "Missing the required parameter 'instruction_id' when calling AgentCapabilitiesApi.retrieve_payment_credentials"
  end
  # verify the required parameter 'agentic_retrieve_payment_credentials_request' is set
  if @api_client.config.client_side_validation && agentic_retrieve_payment_credentials_request.nil?
    fail ArgumentError, "Missing the required parameter 'agentic_retrieve_payment_credentials_request' when calling AgentCapabilitiesApi.retrieve_payment_credentials"
  end
  # resource path
  local_var_path = 'icc/v1/instructions/{instructionId}/credentials'.sub('{' + 'instructionId' + '}', instruction_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agentic_retrieve_payment_credentials_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgenticRetrievePaymentCredentialsRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["retrieve_payment_credentials","retrieve_payment_credentials_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["retrieve_payment_credentials","retrieve_payment_credentials_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgenticRetrievePaymentCredentialsResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#retrieve_payment_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#ucp_cancel_checkout(session_id, opts = {}) ⇒ InlineResponse20114

Cancel Checkout UCP Cancels an active UCP checkout session. No charge is made. This operation is idempotent — cancelling an already-cancelled session returns a successful response. Sessions also expire automatically after 30 minutes of inactivity.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to cancel.

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

    the optional parameters

Returns:



1480
1481
1482
1483
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1480

def ucp_cancel_checkout(session_id, opts = {})
  data, status_code, headers = ucp_cancel_checkout_with_http_info(session_id, opts)
  return data, status_code, headers
end

#ucp_cancel_checkout_with_http_info(session_id, opts = {}) ⇒ Array<(InlineResponse20114, Fixnum, Hash)>

Cancel Checkout UCP Cancels an active UCP checkout session. No charge is made. This operation is idempotent — cancelling an already-cancelled session returns a successful response. Sessions also expire automatically after 30 minutes of inactivity.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to cancel.

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

    the optional parameters

Returns:

  • (Array<(InlineResponse20114, Fixnum, Hash)>)

    InlineResponse20114 data, response status code and response headers



1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
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
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1490

def ucp_cancel_checkout_with_http_info(session_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.ucp_cancel_checkout ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.ucp_cancel_checkout"
  end
  # resource path
  local_var_path = 'icc/v1/checkout-sessions/{session_id}/cancel'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  if 'POST' == 'POST'
    post_body = '{}'
  else
    post_body = nil
  end
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["ucp_cancel_checkout","ucp_cancel_checkout_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["ucp_cancel_checkout","ucp_cancel_checkout_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20114',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#ucp_cancel_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#ucp_complete_checkout(session_id, opts = {}) ⇒ InlineResponse20114

Complete Checkout UCP Final step of the UCP checkout flow. Finalizes the session and places the order with the merchant. ACG translates the UCP completion request to the merchant's checkout API. On success, the session transitions to completed. An order_id is not returned in the UCP response — use the ACP Complete endpoint if you need order confirmation details. Always use an idempotency-key to prevent duplicate orders on network retries.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to complete.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Strongly recommended. A unique key that ensures this order is placed exactly once on retries. Lowercase per UCP spec.

  • :ucp_complete_checkout_request (UcpCompleteCheckoutRequest)

    UCP completion payload containing payment instrument and optional risk signals. If payment context was already provided in the Create or Update call, the body can be omitted. Risk signals are logged for fraud analysis and are not forwarded to the merchant.

Returns:



1565
1566
1567
1568
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1565

def ucp_complete_checkout(session_id, opts = {})
  data, status_code, headers = ucp_complete_checkout_with_http_info(session_id, opts)
  return data, status_code, headers
end

#ucp_complete_checkout_with_http_info(session_id, opts = {}) ⇒ Array<(InlineResponse20114, Fixnum, Hash)>

Complete Checkout UCP Final step of the UCP checkout flow. Finalizes the session and places the order with the merchant. ACG translates the UCP completion request to the merchant's checkout API. On success, the session transitions to `completed`. An `order_id` is not returned in the UCP response — use the ACP Complete endpoint if you need order confirmation details. Always use an `idempotency-key` to prevent duplicate orders on network retries.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to complete.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Strongly recommended. A unique key that ensures this order is placed exactly once on retries. Lowercase per UCP spec.

  • :ucp_complete_checkout_request (UcpCompleteCheckoutRequest)

    UCP completion payload containing payment instrument and optional risk signals. If payment context was already provided in the Create or Update call, the body can be omitted. Risk signals are logged for fraud analysis and are not forwarded to the merchant.

Returns:

  • (Array<(InlineResponse20114, Fixnum, Hash)>)

    InlineResponse20114 data, response status code and response headers



1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1577

def ucp_complete_checkout_with_http_info(session_id, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.ucp_complete_checkout ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.ucp_complete_checkout"
  end
  # resource path
  local_var_path = 'icc/v1/checkout-sessions/{session_id}/complete'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(opts[:'ucp_complete_checkout_request'])
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UcpCompleteCheckoutRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["ucp_complete_checkout","ucp_complete_checkout_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["ucp_complete_checkout","ucp_complete_checkout_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20114',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#ucp_complete_checkout\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#ucp_create_checkout_session(ucp_create_checkout_session_request, opts = {}) ⇒ InlineResponse20114

Create Checkout Session UCP Step 1 of the UCP checkout flow. Creates a new UCP checkout session using Google's Universal Commerce Protocol format. ACG translates the UCP request into the internal ACP format, applies merchant pricing, and returns a UCP-format session response with a session id. UCP uses line_items (instead of items) and lowercase header names (idempotency-key) per the UCP specification. Store the id from the response — it is required for all subsequent UCP calls.

Parameters:

  • ucp_create_checkout_session_request

    UCP checkout session creation payload containing line items, buyer details, currency, and optional payment, fulfillment, and discount information.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key (UUID recommended) to ensure this request is processed exactly once. Lowercase per UCP specification.

Returns:



1650
1651
1652
1653
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1650

def ucp_create_checkout_session(ucp_create_checkout_session_request, opts = {})
  data, status_code, headers = ucp_create_checkout_session_with_http_info(ucp_create_checkout_session_request, opts)
  return data, status_code, headers
end

#ucp_create_checkout_session_with_http_info(ucp_create_checkout_session_request, opts = {}) ⇒ Array<(InlineResponse20114, Fixnum, Hash)>

Create Checkout Session UCP Step 1 of the UCP checkout flow. Creates a new UCP checkout session using Google's Universal Commerce Protocol format. ACG translates the UCP request into the internal ACP format, applies merchant pricing, and returns a UCP-format session response with a session `id`. UCP uses `line_items` (instead of `items`) and lowercase header names (`idempotency-key`) per the UCP specification. Store the `id` from the response — it is required for all subsequent UCP calls.

Parameters:

  • ucp_create_checkout_session_request

    UCP checkout session creation payload containing line items, buyer details, currency, and optional payment, fulfillment, and discount information.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key (UUID recommended) to ensure this request is processed exactly once. Lowercase per UCP specification.

Returns:

  • (Array<(InlineResponse20114, Fixnum, Hash)>)

    InlineResponse20114 data, response status code and response headers



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
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1661

def ucp_create_checkout_session_with_http_info(ucp_create_checkout_session_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.ucp_create_checkout_session ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'ucp_create_checkout_session_request' is set
  if @api_client.config.client_side_validation && ucp_create_checkout_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'ucp_create_checkout_session_request' when calling AgentCapabilitiesApi.ucp_create_checkout_session"
  end
  # resource path
  local_var_path = 'icc/v1/checkout-sessions'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(ucp_create_checkout_session_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UcpCreateCheckoutSessionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["ucp_create_checkout_session","ucp_create_checkout_session_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["ucp_create_checkout_session","ucp_create_checkout_session_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20114',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#ucp_create_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#ucp_get_checkout_session(session_id, ucp_get_checkout_session_request, opts = {}) ⇒ InlineResponse20114

Get Checkout Session UCP Retrieves the current state of a UCP checkout session. Use this to verify session status, retrieve updated totals after a fulfillment change, or resume a session after an interruption.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to retrieve. Obtained from the `id` field in the Create Session response.

  • ucp_get_checkout_session_request

    Empty request body.

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

    the optional parameters

Returns:



1734
1735
1736
1737
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1734

def ucp_get_checkout_session(session_id, ucp_get_checkout_session_request, opts = {})
  data, status_code, headers = ucp_get_checkout_session_with_http_info(session_id, ucp_get_checkout_session_request, opts)
  return data, status_code, headers
end

#ucp_get_checkout_session_with_http_info(session_id, ucp_get_checkout_session_request, opts = {}) ⇒ Array<(InlineResponse20114, Fixnum, Hash)>

Get Checkout Session UCP Retrieves the current state of a UCP checkout session. Use this to verify session status, retrieve updated totals after a fulfillment change, or resume a session after an interruption.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to retrieve. Obtained from the `id` field in the Create Session response.

  • ucp_get_checkout_session_request

    Empty request body.

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

    the optional parameters

Returns:

  • (Array<(InlineResponse20114, Fixnum, Hash)>)

    InlineResponse20114 data, response status code and response headers



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
1806
1807
1808
1809
1810
1811
1812
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1745

def ucp_get_checkout_session_with_http_info(session_id, ucp_get_checkout_session_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.ucp_get_checkout_session ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.ucp_get_checkout_session"
  end
  # verify the required parameter 'ucp_get_checkout_session_request' is set
  if @api_client.config.client_side_validation && ucp_get_checkout_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'ucp_get_checkout_session_request' when calling AgentCapabilitiesApi.ucp_get_checkout_session"
  end
  # resource path
  local_var_path = 'icc/v1/checkout-sessions/{session_id}'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(ucp_get_checkout_session_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'Object', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "false"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["ucp_get_checkout_session","ucp_get_checkout_session_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["ucp_get_checkout_session","ucp_get_checkout_session_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20114',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#ucp_get_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#ucp_update_checkout_session(session_id, ucp_update_checkout_session_request, opts = {}) ⇒ InlineResponse20114

Update Checkout Session UCP Modifies an active UCP checkout session and returns the updated session state. Use this to change line item quantities, update fulfillment address or method, or apply discount codes. Totals are recalculated and returned in the response. Only the fields you include in the request body are updated.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to update.

  • ucp_update_checkout_session_request

    UCP session update payload. All fields are optional — only fields you include will be applied.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key for idempotency. Lowercase per UCP spec.

Returns:



1822
1823
1824
1825
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1822

def ucp_update_checkout_session(session_id, ucp_update_checkout_session_request, opts = {})
  data, status_code, headers = ucp_update_checkout_session_with_http_info(session_id, ucp_update_checkout_session_request, opts)
  return data, status_code, headers
end

#ucp_update_checkout_session_with_http_info(session_id, ucp_update_checkout_session_request, opts = {}) ⇒ Array<(InlineResponse20114, Fixnum, Hash)>

Update Checkout Session UCP Modifies an active UCP checkout session and returns the updated session state. Use this to change line item quantities, update fulfillment address or method, or apply discount codes. Totals are recalculated and returned in the response. Only the fields you include in the request body are updated.

Parameters:

  • session_id

    The unique identifier of the UCP checkout session to update.

  • ucp_update_checkout_session_request

    UCP session update payload. All fields are optional — only fields you include will be applied.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key for idempotency. Lowercase per UCP spec.

Returns:

  • (Array<(InlineResponse20114, Fixnum, Hash)>)

    InlineResponse20114 data, response status code and response headers



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
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1834

def ucp_update_checkout_session_with_http_info(session_id, ucp_update_checkout_session_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.ucp_update_checkout_session ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.ucp_update_checkout_session"
  end
  # verify the required parameter 'ucp_update_checkout_session_request' is set
  if @api_client.config.client_side_validation && ucp_update_checkout_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'ucp_update_checkout_session_request' when calling AgentCapabilitiesApi.ucp_update_checkout_session"
  end
  # resource path
  local_var_path = 'icc/v1/checkout-sessions/{session_id}'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(ucp_update_checkout_session_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'UcpUpdateCheckoutSessionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["ucp_update_checkout_session","ucp_update_checkout_session_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["ucp_update_checkout_session","ucp_update_checkout_session_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20114',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#ucp_update_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#update_agent(agent_id, agent_update, opts = {}) ⇒ AgentRegistrationResponse201

Update an agent [category 1 — Agent_Capabilities] Update agent information. Updatable fields are name, domain, description, contactEmail, and agentMetadata. Extra fields (e.g. tokenRequestorId, keys) will return 422 Validation Error. Raises 404 if agent not found, 403 if agent is deactivated, 409 if new domain or contactEmail already exists.

Parameters:

  • agent_id

    Unique agent identifier

  • agent_update

    Agent update request

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

    the optional parameters

Returns:



1911
1912
1913
1914
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1911

def update_agent(agent_id, agent_update, opts = {})
  data, status_code, headers = update_agent_with_http_info(agent_id, agent_update, opts)
  return data, status_code, headers
end

#update_agent_key(agent_id, key_id, key_update, opts = {}) ⇒ AddAgentKeyResponse201

Update a key Update key information. Updatable fields are keyName, publicKey, algorithm, and expirationDate. Raises 404 if agent or key not found, 403 if agent or key is deactivated, 409 if new keyName already exists.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

  • key_update

    Key update request

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

    the optional parameters

Returns:



1999
2000
2001
2002
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1999

def update_agent_key(agent_id, key_id, key_update, opts = {})
  data, status_code, headers = update_agent_key_with_http_info(agent_id, key_id, key_update, opts)
  return data, status_code, headers
end

#update_agent_key_with_http_info(agent_id, key_id, key_update, opts = {}) ⇒ Array<(AddAgentKeyResponse201, Fixnum, Hash)>

Update a key Update key information. Updatable fields are keyName, publicKey, algorithm, and expirationDate. Raises 404 if agent or key not found, 403 if agent or key is deactivated, 409 if new keyName already exists.

Parameters:

  • agent_id

    Unique agent identifier

  • key_id

    Unique key identifier

  • key_update

    Key update request

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

    the optional parameters

Returns:

  • (Array<(AddAgentKeyResponse201, Fixnum, Hash)>)

    AddAgentKeyResponse201 data, response status code and response headers



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
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 2011

def update_agent_key_with_http_info(agent_id, key_id, key_update, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.update_agent_key ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.update_agent_key"
  end
  # verify the required parameter 'key_id' is set
  if @api_client.config.client_side_validation && key_id.nil?
    fail ArgumentError, "Missing the required parameter 'key_id' when calling AgentCapabilitiesApi.update_agent_key"
  end
  # verify the required parameter 'key_update' is set
  if @api_client.config.client_side_validation && key_update.nil?
    fail ArgumentError, "Missing the required parameter 'key_update' when calling AgentCapabilitiesApi.update_agent_key"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}/keys/{keyId}'.sub('{' + 'agentId' + '}', agent_id.to_s).sub('{' + 'keyId' + '}', key_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(key_update)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'KeyUpdate', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_agent_key","update_agent_key_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["update_agent_key","update_agent_key_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AddAgentKeyResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#update_agent_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#update_agent_with_http_info(agent_id, agent_update, opts = {}) ⇒ Array<(AgentRegistrationResponse201, Fixnum, Hash)>

Update an agent [category 1 — Agent_Capabilities] Update agent information. Updatable fields are name, domain, description, contactEmail, and agentMetadata. Extra fields (e.g. tokenRequestorId, keys) will return 422 Validation Error. Raises 404 if agent not found, 403 if agent is deactivated, 409 if new domain or contactEmail already exists.

Parameters:

  • agent_id

    Unique agent identifier

  • agent_update

    Agent update request

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

    the optional parameters

Returns:



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
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 1922

def update_agent_with_http_info(agent_id, agent_update, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.update_agent ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'agent_id' is set
  if @api_client.config.client_side_validation && agent_id.nil?
    fail ArgumentError, "Missing the required parameter 'agent_id' when calling AgentCapabilitiesApi.update_agent"
  end
  # verify the required parameter 'agent_update' is set
  if @api_client.config.client_side_validation && agent_update.nil?
    fail ArgumentError, "Missing the required parameter 'agent_update' when calling AgentCapabilitiesApi.update_agent"
  end
  # resource path
  local_var_path = 'icc/v1/agents/{agentId}'.sub('{' + 'agentId' + '}', agent_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agent_update)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgentUpdate', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_agent","update_agent_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["update_agent","update_agent_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgentRegistrationResponse201',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#update_agent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#update_checkout_session(session_id, acp_update_checkout_session_request, opts = {}) ⇒ InlineResponse20113

Update Checkout Session ACP Modifies an active ACP checkout session and returns the updated session state with recalculated totals. Use this to: - Add, remove, or change quantities of cart items - Apply or remove discount codes - Update the buyer's shipping address or contact details - Trigger re-calculation of shipping costs and tax Only fields included in the request body are updated — omitted fields retain their current values. Idempotency: Supply an Idempotency-Key to safely retry updates without applying them twice.

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to update. Obtained from the `id` field in the Create Session response.

  • acp_update_checkout_session_request

    Fields to update. All fields are optional — only included fields are changed. To replace the cart entirely, provide the full `items` array.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:



2098
2099
2100
2101
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 2098

def update_checkout_session(session_id, acp_update_checkout_session_request, opts = {})
  data, status_code, headers = update_checkout_session_with_http_info(session_id, acp_update_checkout_session_request, opts)
  return data, status_code, headers
end

#update_checkout_session_with_http_info(session_id, acp_update_checkout_session_request, opts = {}) ⇒ Array<(InlineResponse20113, Fixnum, Hash)>

Update Checkout Session ACP Modifies an active ACP checkout session and returns the updated session state with recalculated totals. Use this to: - Add, remove, or change quantities of cart items - Apply or remove discount codes - Update the buyer's shipping address or contact details - Trigger re-calculation of shipping costs and tax Only fields included in the request body are updated — omitted fields retain their current values. Idempotency: Supply an `Idempotency-Key` to safely retry updates without applying them twice.

Parameters:

  • session_id

    The unique identifier of the ACP checkout session to update. Obtained from the `id` field in the Create Session response.

  • acp_update_checkout_session_request

    Fields to update. All fields are optional — only included fields are changed. To replace the cart entirely, provide the full `items` array.

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

    the optional parameters

Options Hash (opts):

  • :idempotency_key (String)

    Client-generated unique key to ensure this request is processed exactly once. If a request with the same key was already processed, the original response is returned.

  • :accept_language (String)

    Preferred language for the response (e.g. `en-US`, `fr-FR`). Passed to the merchant backend for localized content.

  • :user_agent (String)

    Client user agent string identifying the AI agent platform and version.

  • :request_id (String)

    Unique request identifier for distributed tracing and debugging. Echoed back in the response headers.

  • :signature (String)

    Request signature for payload integrity verification.

  • :timestamp (String)

    ISO 8601 timestamp of when the request was generated. Used in conjunction with Signature for replay protection.

  • :api_version (String)

    ACP specification version the client is targeting (e.g. `2024-01-01`). When omitted, the latest supported version is assumed.

Returns:

  • (Array<(InlineResponse20113, Fixnum, Hash)>)

    InlineResponse20113 data, response status code and response headers



2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
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
2186
2187
2188
2189
2190
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 2116

def update_checkout_session_with_http_info(session_id, acp_update_checkout_session_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.update_checkout_session ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'session_id' is set
  if @api_client.config.client_side_validation && session_id.nil?
    fail ArgumentError, "Missing the required parameter 'session_id' when calling AgentCapabilitiesApi.update_checkout_session"
  end
  # verify the required parameter 'acp_update_checkout_session_request' is set
  if @api_client.config.client_side_validation && acp_update_checkout_session_request.nil?
    fail ArgumentError, "Missing the required parameter 'acp_update_checkout_session_request' when calling AgentCapabilitiesApi.update_checkout_session"
  end
  # resource path
  local_var_path = 'icc/v1/checkout_sessions/{session_id}'.sub('{' + 'session_id' + '}', session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])
  header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
  header_params[:'Accept-Language'] = opts[:'accept_language'] if !opts[:'accept_language'].nil?
  header_params[:'User-Agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?
  header_params[:'Request-Id'] = opts[:'request_id'] if !opts[:'request_id'].nil?
  header_params[:'Signature'] = opts[:'signature'] if !opts[:'signature'].nil?
  header_params[:'Timestamp'] = opts[:'timestamp'] if !opts[:'timestamp'].nil?
  header_params[:'API-Version'] = opts[:'api_version'] if !opts[:'api_version'].nil?

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(acp_update_checkout_session_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AcpUpdateCheckoutSessionRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_checkout_session","update_checkout_session_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["update_checkout_session","update_checkout_session_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse20113',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#update_checkout_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end

#update_purchase_intent(instruction_id, agentic_update_purchase_intent_request, opts = {}) ⇒ AgenticCreatePurchaseIntentResponse200

Update a purchase intent Update an existing purchase intent (instruction) identified by its instructionId. The agent calls this endpoint when the consumer modifies their order — for example, changing the quantity, updating mandates, switching payment instruments, or changing shipping details. The request body has the same structure as the initiate request. Returns the same instructionId (HTTP 200) on success, or PENDING (HTTP 202) with pendingEvents if additional cardholder authentication is required for the updated intent.

Parameters:

  • instruction_id

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



2199
2200
2201
2202
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 2199

def update_purchase_intent(instruction_id, agentic_update_purchase_intent_request, opts = {})
  data, status_code, headers = update_purchase_intent_with_http_info(instruction_id, agentic_update_purchase_intent_request, opts)
  return data, status_code, headers
end

#update_purchase_intent_with_http_info(instruction_id, agentic_update_purchase_intent_request, opts = {}) ⇒ Array<(AgenticCreatePurchaseIntentResponse200, Fixnum, Hash)>

Update a purchase intent Update an existing purchase intent (instruction) identified by its instructionId. The agent calls this endpoint when the consumer modifies their order — for example, changing the quantity, updating mandates, switching payment instruments, or changing shipping details. The request body has the same structure as the initiate request. Returns the same instructionId (HTTP 200) on success, or PENDING (HTTP 202) with pendingEvents if additional cardholder authentication is required for the updated intent.

Parameters:

  • instruction_id

    Unique identifier for the purchase intent instruction.

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

    the optional parameters

Returns:



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
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
# File 'lib/cybersource_rest_client/api/agent_capabilities_api.rb', line 2210

def update_purchase_intent_with_http_info(instruction_id, agentic_update_purchase_intent_request, opts = {})

  if @api_client.config.debugging
      begin
        raise
            @api_client.config.logger.debug 'Calling API: AgentCapabilitiesApi.update_purchase_intent ...'
        rescue
            puts 'Cannot write to log'
        end
  end
  # verify the required parameter 'instruction_id' is set
  if @api_client.config.client_side_validation && instruction_id.nil?
    fail ArgumentError, "Missing the required parameter 'instruction_id' when calling AgentCapabilitiesApi.update_purchase_intent"
  end
  # verify the required parameter 'agentic_update_purchase_intent_request' is set
  if @api_client.config.client_side_validation && agentic_update_purchase_intent_request.nil?
    fail ArgumentError, "Missing the required parameter 'agentic_update_purchase_intent_request' when calling AgentCapabilitiesApi.update_purchase_intent"
  end
  # resource path
  local_var_path = 'icc/v1/instructions/{instructionId}'.sub('{' + 'instructionId' + '}', instruction_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/hal+json;charset=utf-8'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json;charset=utf-8'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(agentic_update_purchase_intent_request)
  sdk_tracker = SdkTracker.new
  post_body = sdk_tracker.insert_developer_id_tracker(post_body, 'AgenticUpdatePurchaseIntentRequest', @api_client.config.host, @api_client.merchantconfig.defaultDeveloperId)
  inbound_mle_status = "mandatory"
  if MLEUtility.check_is_mle_for_API(@api_client.merchantconfig, inbound_mle_status, ["update_purchase_intent","update_purchase_intent_with_http_info"])
    begin
      post_body = MLEUtility.encrypt_request_payload(@api_client.merchantconfig, post_body)
    rescue
      raise
    end
  end

  is_response_mle_for_api = MLEUtility.check_is_response_mle_for_api(@api_client.merchantconfig, ["update_purchase_intent","update_purchase_intent_with_http_info"])

  auth_names = []
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'AgenticCreatePurchaseIntentResponse200',
    :isResponseMLEForApi => is_response_mle_for_api)
  if @api_client.config.debugging
    begin
    raise
        @api_client.config.logger.debug "API called: AgentCapabilitiesApi#update_purchase_intent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
    rescue
        puts 'Cannot write to log'
    end
  end
  return data, status_code, headers
end