ultracart_api 4.1.164 → 4.1.167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/docs/AutoOrderApi.md +79 -23
- data/docs/ChannelPartnerApi.md +12 -12
- data/docs/CheckoutApi.md +17 -16
- data/docs/CouponApi.md +22 -22
- data/docs/CustomerApi.md +3 -3
- data/docs/EmailCommseqEmailReviewStatus.md +32 -0
- data/docs/EmailCommseqEmailReviewStatusResponse.md +26 -0
- data/docs/EmailCommseqEmailReviewStatusesRequest.md +18 -0
- data/docs/EmailCommseqEmailReviewStatusesResponse.md +26 -0
- data/docs/FraudApi.md +210 -9
- data/docs/GiftCertificateApi.md +2 -4
- data/docs/OrderApi.md +140 -13
- data/docs/StorefrontApi.md +112 -2
- data/lib/ultracart_api/api/storefront_api.rb +143 -0
- data/lib/ultracart_api/models/email_commseq_email_review_status.rb +324 -0
- data/lib/ultracart_api/models/email_commseq_email_review_status_response.rb +256 -0
- data/lib/ultracart_api/models/email_commseq_email_review_statuses_request.rb +222 -0
- data/lib/ultracart_api/models/email_commseq_email_review_statuses_response.rb +258 -0
- data/lib/ultracart_api/version.rb +1 -1
- data/lib/ultracart_api.rb +4 -0
- metadata +9 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# UltracartClient::EmailCommseqEmailReviewStatusesResponse
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **error** | [**Error**](Error.md) | | [optional] |
|
|
8
|
+
| **metadata** | [**ResponseMetadata**](ResponseMetadata.md) | | [optional] |
|
|
9
|
+
| **review_statuses** | [**Array<EmailCommseqEmailReviewStatus>**](EmailCommseqEmailReviewStatus.md) | | [optional] |
|
|
10
|
+
| **success** | **Boolean** | Indicates if API call was successful | [optional] |
|
|
11
|
+
| **warning** | [**Warning**](Warning.md) | | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'ultracart_api'
|
|
17
|
+
|
|
18
|
+
instance = UltracartClient::EmailCommseqEmailReviewStatusesResponse.new(
|
|
19
|
+
error: null,
|
|
20
|
+
metadata: null,
|
|
21
|
+
review_statuses: null,
|
|
22
|
+
success: null,
|
|
23
|
+
warning: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
data/docs/FraudApi.md
CHANGED
|
@@ -23,8 +23,25 @@ Adds one email address to the fraud decline list for this merchant account.
|
|
|
23
23
|
|
|
24
24
|
### Examples
|
|
25
25
|
|
|
26
|
+
```ruby
|
|
27
|
+
# frozen_string_literal: true
|
|
28
|
+
|
|
29
|
+
require 'ultracart_api'
|
|
30
|
+
require_relative '../constants'
|
|
31
|
+
|
|
32
|
+
# decline_email is a shortcut for telling UltraCart to decline orders from a specific email
|
|
33
|
+
# address. It is the quick alternative to building a full "address email" fraud rule by hand.
|
|
34
|
+
|
|
35
|
+
fraud_api = UltracartClient::FraudApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
|
36
|
+
|
|
37
|
+
decline_request = UltracartClient::FraudDeclineEmailRequest.new(
|
|
38
|
+
email: 'chargeback-charlie@example.com'
|
|
39
|
+
)
|
|
26
40
|
|
|
27
|
-
(
|
|
41
|
+
fraud_api.decline_email(decline_request)
|
|
42
|
+
|
|
43
|
+
puts "Declined email: #{decline_request.email}"
|
|
44
|
+
```
|
|
28
45
|
|
|
29
46
|
|
|
30
47
|
#### Using the decline_email_with_http_info variant
|
|
@@ -76,8 +93,36 @@ Deletes a fraud rule for this merchant account.
|
|
|
76
93
|
|
|
77
94
|
### Examples
|
|
78
95
|
|
|
79
|
-
|
|
80
|
-
|
|
96
|
+
```ruby
|
|
97
|
+
# frozen_string_literal: true
|
|
98
|
+
|
|
99
|
+
require 'ultracart_api'
|
|
100
|
+
require_relative '../constants'
|
|
101
|
+
|
|
102
|
+
# delete_fraud_rule removes a fraud rule by its oid.
|
|
103
|
+
#
|
|
104
|
+
# To keep this sample self-contained it first inserts a throwaway rule, then deletes it using
|
|
105
|
+
# the oid returned from the insert. In your own code you would already have the oid of the rule
|
|
106
|
+
# you want to remove (for example from search_fraud_rules).
|
|
107
|
+
|
|
108
|
+
fraud_api = UltracartClient::FraudApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
|
109
|
+
|
|
110
|
+
# Insert a rule so we have something to delete.
|
|
111
|
+
rule = UltracartClient::FraudRuleInsertRequest.new(
|
|
112
|
+
rule_type: 'credit card single transaction exceeds',
|
|
113
|
+
amount_threshold: 2500.00,
|
|
114
|
+
failure_action: 'Flag For Review',
|
|
115
|
+
auto_note: 'Temporary rule created by the delete_fraud_rule sample'
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
insert_response = fraud_api.insert_fraud_rule(rule)
|
|
119
|
+
fraud_rule_oid = insert_response.fraud_rule.fraud_rule_oid
|
|
120
|
+
puts "Inserted temporary rule, oid = #{fraud_rule_oid}"
|
|
121
|
+
|
|
122
|
+
# Now delete it.
|
|
123
|
+
fraud_api.delete_fraud_rule(fraud_rule_oid)
|
|
124
|
+
puts "Deleted fraud rule oid = #{fraud_rule_oid}"
|
|
125
|
+
```
|
|
81
126
|
|
|
82
127
|
|
|
83
128
|
#### Using the delete_fraud_rule_with_http_info variant
|
|
@@ -129,8 +174,42 @@ Creates one or more fraud rules for this merchant account derived from an existi
|
|
|
129
174
|
|
|
130
175
|
### Examples
|
|
131
176
|
|
|
132
|
-
|
|
133
|
-
|
|
177
|
+
```ruby
|
|
178
|
+
# frozen_string_literal: true
|
|
179
|
+
|
|
180
|
+
require 'ultracart_api'
|
|
181
|
+
require_relative '../constants'
|
|
182
|
+
|
|
183
|
+
# establish_fraud_rules_from_order is a shortcut that derives fraud rules from an existing order.
|
|
184
|
+
# Point it at an order you have identified as fraudulent and tell it which attributes of that
|
|
185
|
+
# order to turn into rules: the email, the credit card, the ip address, and/or the address.
|
|
186
|
+
# It creates the matching rules and returns them. This is the fast way to "block everything
|
|
187
|
+
# associated with this bad order" instead of building each rule by hand.
|
|
188
|
+
#
|
|
189
|
+
# Not every filter produces a rule; the order must actually have that attribute. For example an
|
|
190
|
+
# order with no stored card data will not produce a credit card rule.
|
|
191
|
+
|
|
192
|
+
fraud_api = UltracartClient::FraudApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
|
193
|
+
|
|
194
|
+
request = UltracartClient::FraudRuleFromOrderRequest.new(
|
|
195
|
+
order_id: 'DEMO-0009104434',
|
|
196
|
+
establish_email_filter: true,
|
|
197
|
+
establish_card_filter: true,
|
|
198
|
+
establish_ip_filter: true,
|
|
199
|
+
establish_address_filter: true,
|
|
200
|
+
failure_action: 'Flag For Review',
|
|
201
|
+
auto_note: 'Established from fraudulent order DEMO-0009104434'
|
|
202
|
+
)
|
|
203
|
+
|
|
204
|
+
api_response = fraud_api.establish_fraud_rules_from_order(request)
|
|
205
|
+
|
|
206
|
+
fraud_rules = api_response.fraud_rules
|
|
207
|
+
puts "Established #{fraud_rules.length} rule(s) from the order:"
|
|
208
|
+
|
|
209
|
+
fraud_rules.each do |fraud_rule|
|
|
210
|
+
puts " oid #{fraud_rule.fraud_rule_oid} - #{fraud_rule.rule_type} - #{fraud_rule.auto_note}"
|
|
211
|
+
end
|
|
212
|
+
```
|
|
134
213
|
|
|
135
214
|
|
|
136
215
|
#### Using the establish_fraud_rules_from_order_with_http_info variant
|
|
@@ -182,8 +261,34 @@ Returns the dropdown values required to build valid fraud rule insert and search
|
|
|
182
261
|
|
|
183
262
|
### Examples
|
|
184
263
|
|
|
264
|
+
```ruby
|
|
265
|
+
# frozen_string_literal: true
|
|
266
|
+
|
|
267
|
+
require 'ultracart_api'
|
|
268
|
+
require_relative '../constants'
|
|
269
|
+
|
|
270
|
+
# get_fraud_lookup_values returns the lookup values used when building fraud rules:
|
|
271
|
+
# the allowed countries, affiliates, ip range types, rule groups, and rule types.
|
|
272
|
+
# Call this first when constructing a rule so you supply valid values.
|
|
273
|
+
|
|
274
|
+
fraud_api = UltracartClient::FraudApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
|
275
|
+
|
|
276
|
+
api_response = fraud_api.get_fraud_lookup_values
|
|
185
277
|
|
|
186
|
-
|
|
278
|
+
lookup_values = api_response.fraud_lookup_values
|
|
279
|
+
|
|
280
|
+
puts 'Rule types:'
|
|
281
|
+
puts lookup_values.rule_types.inspect
|
|
282
|
+
|
|
283
|
+
puts 'Rule groups:'
|
|
284
|
+
puts lookup_values.rule_groups.inspect
|
|
285
|
+
|
|
286
|
+
puts 'IP range types:'
|
|
287
|
+
puts lookup_values.ip_range_types.inspect
|
|
288
|
+
|
|
289
|
+
puts 'Countries:'
|
|
290
|
+
puts lookup_values.countries.inspect
|
|
291
|
+
```
|
|
187
292
|
|
|
188
293
|
|
|
189
294
|
#### Using the get_fraud_lookup_values_with_http_info variant
|
|
@@ -233,8 +338,79 @@ Creates a fraud rule for this merchant account. Field names in the request body
|
|
|
233
338
|
|
|
234
339
|
### Examples
|
|
235
340
|
|
|
236
|
-
|
|
237
|
-
|
|
341
|
+
```ruby
|
|
342
|
+
# frozen_string_literal: true
|
|
343
|
+
|
|
344
|
+
require 'ultracart_api'
|
|
345
|
+
require_relative '../constants'
|
|
346
|
+
|
|
347
|
+
# insert_fraud_rule creates a single fraud rule. Each rule has a rule_type (what it inspects),
|
|
348
|
+
# a failure_action (what happens when it matches), and type-specific fields such as an amount
|
|
349
|
+
# threshold, country code, ip address, or email.
|
|
350
|
+
#
|
|
351
|
+
# This sample has some fun and inserts several rules of different types in one run. Call
|
|
352
|
+
# get_fraud_lookup_values.rb to see every valid rule_type and the other lookup values.
|
|
353
|
+
|
|
354
|
+
fraud_api = UltracartClient::FraudApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
|
355
|
+
|
|
356
|
+
rules = []
|
|
357
|
+
|
|
358
|
+
# 1. Decline any order placed with a known-bad email address.
|
|
359
|
+
rules << UltracartClient::FraudRuleInsertRequest.new(
|
|
360
|
+
rule_type: 'address email',
|
|
361
|
+
email: 'chargeback-charlie@example.com',
|
|
362
|
+
failure_action: 'Decline Transaction',
|
|
363
|
+
auto_note: 'Known chargeback email - decline on sight'
|
|
364
|
+
)
|
|
365
|
+
|
|
366
|
+
# 2. Flag large single credit card transactions over $1,000 for manual review.
|
|
367
|
+
rules << UltracartClient::FraudRuleInsertRequest.new(
|
|
368
|
+
rule_type: 'credit card single transaction exceeds',
|
|
369
|
+
amount_threshold: 1000.00,
|
|
370
|
+
failure_action: 'Flag For Review',
|
|
371
|
+
auto_note: 'Large single transaction - review before shipping'
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
# 3. Decline orders that ship outside the United States.
|
|
375
|
+
rules << UltracartClient::FraudRuleInsertRequest.new(
|
|
376
|
+
rule_type: 'address not in country',
|
|
377
|
+
country_code: 'US',
|
|
378
|
+
failure_action: 'Decline Transaction',
|
|
379
|
+
auto_note: 'Domestic shipping only'
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
# 4. Decline transactions originating from a specific bad IP address.
|
|
383
|
+
rules << UltracartClient::FraudRuleInsertRequest.new(
|
|
384
|
+
rule_type: 'ip matches',
|
|
385
|
+
ip_address: '203.0.113.66',
|
|
386
|
+
ip_range_type: 'address',
|
|
387
|
+
failure_action: 'Decline Transaction',
|
|
388
|
+
auto_note: 'Blocked IP address'
|
|
389
|
+
)
|
|
390
|
+
|
|
391
|
+
# 5. Flag prepaid credit cards for review.
|
|
392
|
+
rules << UltracartClient::FraudRuleInsertRequest.new(
|
|
393
|
+
rule_type: 'credit card block prepaid',
|
|
394
|
+
failure_action: 'Flag For Review',
|
|
395
|
+
auto_note: 'Prepaid card - take a closer look'
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
# 6. Flag a customer IP making more than 10 transactions in a single day.
|
|
399
|
+
rules << UltracartClient::FraudRuleInsertRequest.new(
|
|
400
|
+
rule_type: 'ip daily transaction count exceeds',
|
|
401
|
+
count_threshold: 10,
|
|
402
|
+
ip_range_type: 'address',
|
|
403
|
+
user_action: 'Attempted',
|
|
404
|
+
failure_action: 'Flag For Review',
|
|
405
|
+
auto_note: 'IP velocity - more than 10 orders in a day'
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
rules.each do |rule|
|
|
409
|
+
api_response = fraud_api.insert_fraud_rule(rule)
|
|
410
|
+
created = api_response.fraud_rule
|
|
411
|
+
puts "Inserted '#{rule.rule_type}' rule, oid = #{created.fraud_rule_oid}"
|
|
412
|
+
end
|
|
413
|
+
```
|
|
238
414
|
|
|
239
415
|
|
|
240
416
|
#### Using the insert_fraud_rule_with_http_info variant
|
|
@@ -286,8 +462,33 @@ Searches fraud rules for this merchant account using semantic filter fields. Pag
|
|
|
286
462
|
|
|
287
463
|
### Examples
|
|
288
464
|
|
|
465
|
+
```ruby
|
|
466
|
+
# frozen_string_literal: true
|
|
467
|
+
|
|
468
|
+
require 'ultracart_api'
|
|
469
|
+
require_relative '../constants'
|
|
470
|
+
|
|
471
|
+
# search_fraud_rules returns the fraud rules that match the supplied criteria. Every field on the
|
|
472
|
+
# FraudRuleSearchRequest is optional; supply only the ones you want to filter on. Pagination and
|
|
473
|
+
# sort are passed as options (_limit, _offset, _sort).
|
|
474
|
+
#
|
|
475
|
+
# This sample searches for every rule whose action is "Decline Transaction".
|
|
476
|
+
|
|
477
|
+
fraud_api = UltracartClient::FraudApi.new_using_api_key(Constants::API_KEY, Constants::VERIFY_SSL, Constants::DEBUG_MODE)
|
|
478
|
+
|
|
479
|
+
search_request = UltracartClient::FraudRuleSearchRequest.new(
|
|
480
|
+
failure_action: 'Decline Transaction'
|
|
481
|
+
)
|
|
289
482
|
|
|
290
|
-
(
|
|
483
|
+
api_response = fraud_api.search_fraud_rules(search_request, { _limit: 200, _offset: 0 })
|
|
484
|
+
|
|
485
|
+
fraud_rules = api_response.fraud_rules
|
|
486
|
+
puts "Found #{fraud_rules.length} rule(s) with action 'Decline Transaction'"
|
|
487
|
+
|
|
488
|
+
fraud_rules.each do |fraud_rule|
|
|
489
|
+
puts " oid #{fraud_rule.fraud_rule_oid} - #{fraud_rule.rule_type} - #{fraud_rule.auto_note}"
|
|
490
|
+
end
|
|
491
|
+
```
|
|
291
492
|
|
|
292
493
|
|
|
293
494
|
#### Using the search_fraud_rules_with_http_info variant
|
data/docs/GiftCertificateApi.md
CHANGED
|
@@ -470,10 +470,8 @@ api = UltracartClient::GiftCertificateApi.new_using_api_key(Constants::API_KEY,
|
|
|
470
470
|
def get_gift_certificates_chuck(api, offset, limit)
|
|
471
471
|
expansion = 'ledger'.freeze
|
|
472
472
|
query = UltracartClient::GiftCertificateQuery.new # leaving this empty, so no filtering, and I should get all records returned.
|
|
473
|
-
api_response = api.get_gift_certificates_by_query(query, { _limit
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
[]
|
|
473
|
+
api_response = api.get_gift_certificates_by_query(query, { :'_limit' => limit, :'_offset' => offset, :'_expand' => expansion })
|
|
474
|
+
api_response.gift_certificates unless api_response.gift_certificates.nil? []
|
|
477
475
|
end
|
|
478
476
|
|
|
479
477
|
|
data/docs/OrderApi.md
CHANGED
|
@@ -1300,8 +1300,48 @@ Retrieves the customer activity associated with the email address on this order.
|
|
|
1300
1300
|
|
|
1301
1301
|
### Examples
|
|
1302
1302
|
|
|
1303
|
+
```ruby
|
|
1304
|
+
require 'ultracart_api'
|
|
1305
|
+
require_relative '../constants'
|
|
1303
1306
|
|
|
1304
|
-
|
|
1307
|
+
# getOrderCustomerActivity returns the customer activity associated with the email address on an order.
|
|
1308
|
+
# This includes email engagement history, email list and segment membership, lifetime metrics and email
|
|
1309
|
+
# suppression status.
|
|
1310
|
+
#
|
|
1311
|
+
# A customer profile is NOT required and is not consulted. The activity is keyed off the email address on
|
|
1312
|
+
# the order, so this works for guest orders that have never had a customer profile established. For the
|
|
1313
|
+
# page views captured during the session that placed the order, use get_order_page_view_history instead.
|
|
1314
|
+
#
|
|
1315
|
+
# If the order has no valid email address, email and customer_activity both come back nil. That is a
|
|
1316
|
+
# successful response rather than an error - without an email there is no activity record to find.
|
|
1317
|
+
#
|
|
1318
|
+
# Note: activity.ts is a unix timestamp in milliseconds, not an ISO 8601 string like most dates in this API.
|
|
1319
|
+
#
|
|
1320
|
+
# Possible Errors:
|
|
1321
|
+
# order_id does not start with the merchant id -> "Path parameter 'order_id' does not start with the merchant id. Check your parameter value and call log."
|
|
1322
|
+
order_api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY)
|
|
1323
|
+
|
|
1324
|
+
order_id = 'DEMO-0009104976'
|
|
1325
|
+
|
|
1326
|
+
begin
|
|
1327
|
+
api_response = order_api.get_order_customer_activity(order_id)
|
|
1328
|
+
customer_activity = api_response.customer_activity
|
|
1329
|
+
|
|
1330
|
+
puts "Customer activity for: #{api_response.email}"
|
|
1331
|
+
|
|
1332
|
+
if customer_activity.nil?
|
|
1333
|
+
puts 'No customer activity found for this order.'
|
|
1334
|
+
else
|
|
1335
|
+
puts "Globally unsubscribed: #{customer_activity.global_unsubscribed}"
|
|
1336
|
+
puts "Spam complaint: #{customer_activity.spam_complaint}"
|
|
1337
|
+
|
|
1338
|
+
# Using inspect instead of var_dump for Ruby-style object representation
|
|
1339
|
+
puts customer_activity.activities.inspect
|
|
1340
|
+
end
|
|
1341
|
+
rescue StandardError => e
|
|
1342
|
+
puts "An error occurred: #{e.message}"
|
|
1343
|
+
end
|
|
1344
|
+
```
|
|
1305
1345
|
|
|
1306
1346
|
|
|
1307
1347
|
#### Using the get_order_customer_activity_with_http_info variant
|
|
@@ -1426,8 +1466,52 @@ Retrieves email delivery records associated with the specified order id.
|
|
|
1426
1466
|
|
|
1427
1467
|
### Examples
|
|
1428
1468
|
|
|
1469
|
+
```ruby
|
|
1470
|
+
require 'ultracart_api'
|
|
1471
|
+
require_relative '../constants'
|
|
1429
1472
|
|
|
1430
|
-
|
|
1473
|
+
# getOrderEmails returns the delivery records for every email UltraCart sent regarding an order, oldest
|
|
1474
|
+
# first. Each record carries the subject and send time plus delivery, open, click and bounce status,
|
|
1475
|
+
# which makes this useful evidence that a customer was notified about their order.
|
|
1476
|
+
#
|
|
1477
|
+
# A customer profile is NOT required. These records are tied to the order id itself.
|
|
1478
|
+
#
|
|
1479
|
+
# An order with no email history, or one whose emails were all suppressed, comes back with an empty emails
|
|
1480
|
+
# array. That is a successful response rather than an error.
|
|
1481
|
+
#
|
|
1482
|
+
# The internal flag marks messages sent to merchant staff rather than to the customer. Filter those out
|
|
1483
|
+
# if you only want what the customer actually received.
|
|
1484
|
+
#
|
|
1485
|
+
# Possible Errors:
|
|
1486
|
+
# order_id does not start with the merchant id -> "Path parameter 'order_id' does not start with the merchant id. Check your parameter value and call log."
|
|
1487
|
+
order_api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY)
|
|
1488
|
+
|
|
1489
|
+
order_id = 'DEMO-0009104976'
|
|
1490
|
+
|
|
1491
|
+
begin
|
|
1492
|
+
api_response = order_api.get_order_emails(order_id)
|
|
1493
|
+
emails = api_response.emails || []
|
|
1494
|
+
|
|
1495
|
+
if emails.empty?
|
|
1496
|
+
puts 'No emails were sent for this order.'
|
|
1497
|
+
else
|
|
1498
|
+
emails.each do |email|
|
|
1499
|
+
puts "#{email.send_dts} - #{email.email} - #{email.subject}"
|
|
1500
|
+
|
|
1501
|
+
status = []
|
|
1502
|
+
status << "delivered #{email.delivery_dts}" if email.delivered
|
|
1503
|
+
status << "opened #{email.opened_dts}" if email.opened
|
|
1504
|
+
status << "clicked #{email.clicked_dts}" if email.clicked
|
|
1505
|
+
status << "skipped: #{email.skip_reason}" if email.skipped
|
|
1506
|
+
status << "bounced #{email.bounce_type}/#{email.bounce_sub_type}" if email.bounce_type
|
|
1507
|
+
|
|
1508
|
+
puts " #{status.empty? ? 'no delivery events recorded' : status.join(', ')}"
|
|
1509
|
+
end
|
|
1510
|
+
end
|
|
1511
|
+
rescue StandardError => e
|
|
1512
|
+
puts "An error occurred: #{e.message}"
|
|
1513
|
+
end
|
|
1514
|
+
```
|
|
1431
1515
|
|
|
1432
1516
|
|
|
1433
1517
|
#### Using the get_order_emails_with_http_info variant
|
|
@@ -1479,8 +1563,51 @@ Retrieves the page views captured during the session that placed this order.
|
|
|
1479
1563
|
|
|
1480
1564
|
### Examples
|
|
1481
1565
|
|
|
1566
|
+
```ruby
|
|
1567
|
+
require 'ultracart_api'
|
|
1568
|
+
require_relative '../constants'
|
|
1482
1569
|
|
|
1483
|
-
|
|
1570
|
+
# getOrderPageViewHistory returns the page views captured during the session that placed an order, along
|
|
1571
|
+
# with the referrer that started that session.
|
|
1572
|
+
#
|
|
1573
|
+
# A customer profile is NOT required. These page views are keyed off an analytics client id stored on the
|
|
1574
|
+
# order itself, so this works for guest orders. For the email engagement side of customer activity, use
|
|
1575
|
+
# get_order_customer_activity instead.
|
|
1576
|
+
#
|
|
1577
|
+
# An order placed outside the storefront, such as a phone order or an order imported from a channel
|
|
1578
|
+
# partner, will have no analytics session attached. In that case page_views comes back empty. That is a
|
|
1579
|
+
# successful response rather than an error.
|
|
1580
|
+
#
|
|
1581
|
+
# Note: view_dts is an ISO 8601 string here. Be aware that the ts field on get_order_customer_activity is
|
|
1582
|
+
# unix milliseconds instead, so do not assume the two methods format dates the same way.
|
|
1583
|
+
#
|
|
1584
|
+
# Possible Errors:
|
|
1585
|
+
# order_id does not start with the merchant id -> "Path parameter 'order_id' does not start with the merchant id. Check your parameter value and call log."
|
|
1586
|
+
order_api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY)
|
|
1587
|
+
|
|
1588
|
+
order_id = 'DEMO-0009104976'
|
|
1589
|
+
|
|
1590
|
+
begin
|
|
1591
|
+
api_response = order_api.get_order_page_view_history(order_id)
|
|
1592
|
+
page_views = api_response.page_views || []
|
|
1593
|
+
|
|
1594
|
+
puts "Session referrer: #{api_response.referrer || '(none captured)'}"
|
|
1595
|
+
|
|
1596
|
+
if page_views.empty?
|
|
1597
|
+
puts 'No page views were captured for this order.'
|
|
1598
|
+
else
|
|
1599
|
+
page_views.each do |page_view|
|
|
1600
|
+
time_on_page = page_view.time_on_page ? " (#{page_view.time_on_page}s on page)" : ''
|
|
1601
|
+
puts "#{page_view.view_dts} - #{page_view.url}#{time_on_page}"
|
|
1602
|
+
end
|
|
1603
|
+
|
|
1604
|
+
# Using inspect instead of var_dump for Ruby-style object representation
|
|
1605
|
+
puts page_views.inspect
|
|
1606
|
+
end
|
|
1607
|
+
rescue StandardError => e
|
|
1608
|
+
puts "An error occurred: #{e.message}"
|
|
1609
|
+
end
|
|
1610
|
+
```
|
|
1484
1611
|
|
|
1485
1612
|
|
|
1486
1613
|
#### Using the get_order_page_view_history_with_http_info variant
|
|
@@ -2283,7 +2410,7 @@ begin
|
|
|
2283
2410
|
cc_token = 'F893C8CBAE34830177F9EA9D97205400'
|
|
2284
2411
|
cvv_token = '3FA7577E42F7580177F9EAA2FF1F5900'
|
|
2285
2412
|
|
|
2286
|
-
get_response = checkout_api.get_cart(_expand
|
|
2413
|
+
get_response = checkout_api.get_cart({:'_expand' => expansion})
|
|
2287
2414
|
if get_response.errors&.length&.positive?
|
|
2288
2415
|
# handle errors here.
|
|
2289
2416
|
abort('System error. Could not retrieve shopping cart.')
|
|
@@ -2308,7 +2435,7 @@ begin
|
|
|
2308
2435
|
|
|
2309
2436
|
# If the customer already has a customer profile, then load that profile and pull the shipping/billing from there.
|
|
2310
2437
|
# otherwise populate it manually.
|
|
2311
|
-
customer_response = customer_api.get_customer_by_email(email, { _expand
|
|
2438
|
+
customer_response = customer_api.get_customer_by_email(email, { :'_expand' => 'shipping,billing,cards' })
|
|
2312
2439
|
if customer_response&.customer
|
|
2313
2440
|
|
|
2314
2441
|
cp = customer_response.customer # cp is short for 'customer profile'
|
|
@@ -2378,7 +2505,7 @@ begin
|
|
|
2378
2505
|
# the optimal shipping method estimates and ensure that you don't error
|
|
2379
2506
|
# by selecting a shipping method that is somehow excluded from the possible
|
|
2380
2507
|
# list for whatever reason (restrictions, locations, item-level constraints, etc)
|
|
2381
|
-
update_response = checkout_api.update_cart(cart, _expand
|
|
2508
|
+
update_response = checkout_api.update_cart(cart, {:'_expand' => expansion})
|
|
2382
2509
|
cart = update_response.cart
|
|
2383
2510
|
|
|
2384
2511
|
# for shipping, check the estimates and select one. for a completely non-interactive checkout such as this,
|
|
@@ -2392,7 +2519,7 @@ begin
|
|
|
2392
2519
|
end
|
|
2393
2520
|
end
|
|
2394
2521
|
|
|
2395
|
-
update_response = checkout_api.update_cart(cart, _expand
|
|
2522
|
+
update_response = checkout_api.update_cart(cart, {:'_expand' => expansion})
|
|
2396
2523
|
cart = update_response.cart
|
|
2397
2524
|
|
|
2398
2525
|
# validate the cart to ensure everything is in order.
|
|
@@ -2577,7 +2704,7 @@ expansion = "items" # for this example, we're going to change the items after
|
|
|
2577
2704
|
|
|
2578
2705
|
# Step 1. Duplicate the order
|
|
2579
2706
|
order_id_to_duplicate = 'DEMO-0009104436'
|
|
2580
|
-
api_response = order_api.duplicate_order(order_id_to_duplicate, opts = { _expand
|
|
2707
|
+
api_response = order_api.duplicate_order(order_id_to_duplicate, opts = { :'_expand' => expansion })
|
|
2581
2708
|
new_order = api_response.order
|
|
2582
2709
|
|
|
2583
2710
|
# Step 2. Update the items. I will create a new items array and assign it to the order to remove the old ones completely.
|
|
@@ -2600,7 +2727,7 @@ item.weight = weight
|
|
|
2600
2727
|
|
|
2601
2728
|
items << item
|
|
2602
2729
|
new_order.items = items
|
|
2603
|
-
update_response = order_api.update_order(new_order.order_id, new_order, opts = { _expand
|
|
2730
|
+
update_response = order_api.update_order(new_order.order_id, new_order, opts = { :'_expand' => expansion })
|
|
2604
2731
|
|
|
2605
2732
|
updated_order = update_response.order
|
|
2606
2733
|
|
|
@@ -2697,7 +2824,7 @@ expansion = "items"
|
|
|
2697
2824
|
|
|
2698
2825
|
# Step 1. Retrieve the order
|
|
2699
2826
|
order_id = 'DEMO-0009104436'
|
|
2700
|
-
order = order_api.get_order(order_id, opts = { _expand
|
|
2827
|
+
order = order_api.get_order(order_id, opts = { :'_expand' => expansion }).order
|
|
2701
2828
|
|
|
2702
2829
|
order.items.each do |item|
|
|
2703
2830
|
item.quantity_refunded = item.quantity
|
|
@@ -3221,13 +3348,13 @@ order_api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY)
|
|
|
3221
3348
|
expansion = "checkout" # see the get_order sample for expansion discussion
|
|
3222
3349
|
|
|
3223
3350
|
order_id = 'DEMO-0009104976'
|
|
3224
|
-
order = order_api.get_order(order_id, opts = { _expand
|
|
3351
|
+
order = order_api.get_order(order_id, opts = { :'_expand' => expansion }).order
|
|
3225
3352
|
|
|
3226
3353
|
p order
|
|
3227
3354
|
|
|
3228
3355
|
# TODO: do some updates to the order.
|
|
3229
3356
|
|
|
3230
|
-
api_response = order_api.update_order(order_id, order, opts = { _expand
|
|
3357
|
+
api_response = order_api.update_order(order_id, order, opts = { :'_expand' => expansion })
|
|
3231
3358
|
|
|
3232
3359
|
if api_response.error
|
|
3233
3360
|
puts api_response.error.developer_message
|
|
@@ -3330,7 +3457,7 @@ order_api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY)
|
|
|
3330
3457
|
expansion = "checkout" # see the get_order sample for expansion discussion
|
|
3331
3458
|
|
|
3332
3459
|
order_id = 'DEMO-0009104976'
|
|
3333
|
-
order = order_api.get_order(order_id, opts = { _expand
|
|
3460
|
+
order = order_api.get_order(order_id, opts = { :'_expand' => expansion }).order
|
|
3334
3461
|
|
|
3335
3462
|
p order
|
|
3336
3463
|
|
data/docs/StorefrontApi.md
CHANGED
|
@@ -86,6 +86,8 @@ All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
|
|
86
86
|
| [**get_email_postcard**](StorefrontApi.md#get_email_postcard) | **GET** /storefront/{storefront_oid}/email/postcards/{commseq_postcard_uuid} | Get email postcard |
|
|
87
87
|
| [**get_email_postcards**](StorefrontApi.md#get_email_postcards) | **GET** /storefront/{storefront_oid}/email/postcards | Get email postcards |
|
|
88
88
|
| [**get_email_postcards_multiple**](StorefrontApi.md#get_email_postcards_multiple) | **POST** /storefront/{storefront_oid}/email/postcards/multiple | Get email postcards multiple |
|
|
89
|
+
| [**get_email_review_status**](StorefrontApi.md#get_email_review_status) | **GET** /storefront/{storefront_oid}/email/emails/{commseq_email_uuid}/review_status | Get the review status of an email |
|
|
90
|
+
| [**get_email_review_statuses_multiple**](StorefrontApi.md#get_email_review_statuses_multiple) | **POST** /storefront/{storefront_oid}/email/emails/review_status/multiple | Get the review status of multiple emails |
|
|
89
91
|
| [**get_email_segment**](StorefrontApi.md#get_email_segment) | **GET** /storefront/{storefront_oid}/email/segments/{email_segment_uuid} | Get email segment |
|
|
90
92
|
| [**get_email_segment_customer_editor_url**](StorefrontApi.md#get_email_segment_customer_editor_url) | **GET** /storefront/{storefront_oid}/email/segments/{email_segment_uuid}/customers/{email_customer_uuid}/editor_url | Get email segment customers editor URL |
|
|
91
93
|
| [**get_email_segment_customers**](StorefrontApi.md#get_email_segment_customers) | **GET** /storefront/{storefront_oid}/email/segments/{email_segment_uuid}/customers | Get email segment customers |
|
|
@@ -1312,8 +1314,9 @@ Delete file manager directory
|
|
|
1312
1314
|
|
|
1313
1315
|
### Examples
|
|
1314
1316
|
|
|
1317
|
+
```ruby
|
|
1315
1318
|
|
|
1316
|
-
|
|
1319
|
+
```
|
|
1317
1320
|
|
|
1318
1321
|
|
|
1319
1322
|
#### Using the delete_fs_file_with_http_info variant
|
|
@@ -4549,6 +4552,112 @@ end
|
|
|
4549
4552
|
- **Accept**: application/json
|
|
4550
4553
|
|
|
4551
4554
|
|
|
4555
|
+
## get_email_review_status
|
|
4556
|
+
|
|
4557
|
+
> <EmailCommseqEmailReviewStatusResponse> get_email_review_status(storefront_oid, commseq_email_uuid)
|
|
4558
|
+
|
|
4559
|
+
Get the review status of an email
|
|
4560
|
+
|
|
4561
|
+
|
|
4562
|
+
### Examples
|
|
4563
|
+
|
|
4564
|
+
|
|
4565
|
+
(No example for this operation).
|
|
4566
|
+
|
|
4567
|
+
|
|
4568
|
+
#### Using the get_email_review_status_with_http_info variant
|
|
4569
|
+
|
|
4570
|
+
This returns an Array which contains the response data, status code and headers.
|
|
4571
|
+
|
|
4572
|
+
> <Array(<EmailCommseqEmailReviewStatusResponse>, Integer, Hash)> get_email_review_status_with_http_info(storefront_oid, commseq_email_uuid)
|
|
4573
|
+
|
|
4574
|
+
```ruby
|
|
4575
|
+
begin
|
|
4576
|
+
# Get the review status of an email
|
|
4577
|
+
data, status_code, headers = api_instance.get_email_review_status_with_http_info(storefront_oid, commseq_email_uuid)
|
|
4578
|
+
p status_code # => 2xx
|
|
4579
|
+
p headers # => { ... }
|
|
4580
|
+
p data # => <EmailCommseqEmailReviewStatusResponse>
|
|
4581
|
+
rescue UltracartClient::ApiError => e
|
|
4582
|
+
puts "Error when calling StorefrontApi->get_email_review_status_with_http_info: #{e}"
|
|
4583
|
+
end
|
|
4584
|
+
```
|
|
4585
|
+
|
|
4586
|
+
### Parameters
|
|
4587
|
+
|
|
4588
|
+
| Name | Type | Description | Notes |
|
|
4589
|
+
| ---- | ---- | ----------- | ----- |
|
|
4590
|
+
| **storefront_oid** | **Integer** | | |
|
|
4591
|
+
| **commseq_email_uuid** | **String** | | |
|
|
4592
|
+
|
|
4593
|
+
### Return type
|
|
4594
|
+
|
|
4595
|
+
[**EmailCommseqEmailReviewStatusResponse**](EmailCommseqEmailReviewStatusResponse.md)
|
|
4596
|
+
|
|
4597
|
+
### Authorization
|
|
4598
|
+
|
|
4599
|
+
[ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
|
4600
|
+
|
|
4601
|
+
### HTTP request headers
|
|
4602
|
+
|
|
4603
|
+
- **Content-Type**: Not defined
|
|
4604
|
+
- **Accept**: application/json
|
|
4605
|
+
|
|
4606
|
+
|
|
4607
|
+
## get_email_review_statuses_multiple
|
|
4608
|
+
|
|
4609
|
+
> <EmailCommseqEmailReviewStatusesResponse> get_email_review_statuses_multiple(storefront_oid, email_commseq_email_review_statuses_request)
|
|
4610
|
+
|
|
4611
|
+
Get the review status of multiple emails
|
|
4612
|
+
|
|
4613
|
+
Returns one entry per requested email, in the order requested, so a caller polling a campaign does not have to reconcile a short response.
|
|
4614
|
+
|
|
4615
|
+
|
|
4616
|
+
### Examples
|
|
4617
|
+
|
|
4618
|
+
|
|
4619
|
+
(No example for this operation).
|
|
4620
|
+
|
|
4621
|
+
|
|
4622
|
+
#### Using the get_email_review_statuses_multiple_with_http_info variant
|
|
4623
|
+
|
|
4624
|
+
This returns an Array which contains the response data, status code and headers.
|
|
4625
|
+
|
|
4626
|
+
> <Array(<EmailCommseqEmailReviewStatusesResponse>, Integer, Hash)> get_email_review_statuses_multiple_with_http_info(storefront_oid, email_commseq_email_review_statuses_request)
|
|
4627
|
+
|
|
4628
|
+
```ruby
|
|
4629
|
+
begin
|
|
4630
|
+
# Get the review status of multiple emails
|
|
4631
|
+
data, status_code, headers = api_instance.get_email_review_statuses_multiple_with_http_info(storefront_oid, email_commseq_email_review_statuses_request)
|
|
4632
|
+
p status_code # => 2xx
|
|
4633
|
+
p headers # => { ... }
|
|
4634
|
+
p data # => <EmailCommseqEmailReviewStatusesResponse>
|
|
4635
|
+
rescue UltracartClient::ApiError => e
|
|
4636
|
+
puts "Error when calling StorefrontApi->get_email_review_statuses_multiple_with_http_info: #{e}"
|
|
4637
|
+
end
|
|
4638
|
+
```
|
|
4639
|
+
|
|
4640
|
+
### Parameters
|
|
4641
|
+
|
|
4642
|
+
| Name | Type | Description | Notes |
|
|
4643
|
+
| ---- | ---- | ----------- | ----- |
|
|
4644
|
+
| **storefront_oid** | **Integer** | | |
|
|
4645
|
+
| **email_commseq_email_review_statuses_request** | [**EmailCommseqEmailReviewStatusesRequest**](EmailCommseqEmailReviewStatusesRequest.md) | Request of email uuids | |
|
|
4646
|
+
|
|
4647
|
+
### Return type
|
|
4648
|
+
|
|
4649
|
+
[**EmailCommseqEmailReviewStatusesResponse**](EmailCommseqEmailReviewStatusesResponse.md)
|
|
4650
|
+
|
|
4651
|
+
### Authorization
|
|
4652
|
+
|
|
4653
|
+
[ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
|
4654
|
+
|
|
4655
|
+
### HTTP request headers
|
|
4656
|
+
|
|
4657
|
+
- **Content-Type**: application/json
|
|
4658
|
+
- **Accept**: application/json
|
|
4659
|
+
|
|
4660
|
+
|
|
4552
4661
|
## get_email_segment
|
|
4553
4662
|
|
|
4554
4663
|
> <EmailSegmentResponse> get_email_segment(storefront_oid, email_segment_uuid)
|
|
@@ -9398,8 +9507,9 @@ Update email sending domain
|
|
|
9398
9507
|
|
|
9399
9508
|
### Examples
|
|
9400
9509
|
|
|
9510
|
+
```ruby
|
|
9401
9511
|
|
|
9402
|
-
|
|
9512
|
+
```
|
|
9403
9513
|
|
|
9404
9514
|
|
|
9405
9515
|
#### Using the update_email_sending_domain_with_http_info variant
|