ultracart_api 4.1.3 → 4.1.4
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 +47 -56
- data/lib/ultracart_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f73cdbb14f7434757e125f441e7177359ed026f60e7289828d3140794743701
|
4
|
+
data.tar.gz: 6749494d14fd1bce606f95c178229622137981d48b2448ea2db11c044a7adb43
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a35199b5568393b6f8e69353771dbc1cc9fbfbe300b1bf281106c7b36636a48b38f97f3f7e1582a57b501bfd16ede57f85ba8b6cdbc0907df3f6298a2573d1e6
|
7
|
+
data.tar.gz: 8603ec97f9a44dc3e15f5d2442e46f734b65785be3d3eea59685ca4cdb1e140034b3345b640c11ddbed7c2a16626aa36d29f2f334b4fd00f8cd874426e9af4da
|
data/README.md
CHANGED
@@ -1,89 +1,79 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
UltracartClient - the Ruby gem for the UltraCart Rest API V2
|
1
|
+
# UltraCart Ruby SDK
|
4
2
|
|
5
3
|
UltraCart REST API Version 2
|
6
4
|
|
5
|
+
Note: Every method has a sample for every language. See https://github.com/UltraCart/sdk_samples
|
6
|
+
|
7
7
|
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
8
|
|
9
9
|
- API version: 2.0.0
|
10
|
-
- Package version: 4.1.
|
10
|
+
- Package version: 4.1.4
|
11
11
|
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
12
|
-
For more information, please visit [http://www.ultracart.com/api/](http://www.ultracart.com/api/)
|
12
|
+
- For more information, please visit [http://www.ultracart.com/api/](http://www.ultracart.com/api/)
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
To build the Ruby code into a gem:
|
16
|
+
gemfile:
|
19
17
|
|
20
18
|
```shell
|
21
|
-
gem
|
19
|
+
gem 'ultracart_api', '4.1.4'
|
22
20
|
```
|
23
21
|
|
24
|
-
|
22
|
+
install:
|
25
23
|
|
26
24
|
```shell
|
27
|
-
gem install
|
28
|
-
```
|
29
|
-
|
30
|
-
(for development, run `gem install --dev ./ultracart_api-4.1.3.gem` to install the development dependencies)
|
31
|
-
|
32
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
33
|
-
|
34
|
-
Finally add this to the Gemfile:
|
35
|
-
|
36
|
-
gem 'ultracart_api', '~> 4.1.3'
|
37
|
-
|
38
|
-
### Install from Git
|
39
|
-
|
40
|
-
If the Ruby gem is hosted at a git repository: https://github.com/UltraCart/rest_api_v2_sdk_ruby, then add the following in the Gemfile:
|
41
|
-
|
42
|
-
gem 'ultracart_api', :git => 'https://github.com/UltraCart/rest_api_v2_sdk_ruby.git'
|
43
|
-
|
44
|
-
### Include the Ruby code directly
|
45
|
-
|
46
|
-
Include the Ruby code directly using `-I` as follows:
|
47
|
-
|
48
|
-
```shell
|
49
|
-
ruby -Ilib script.rb
|
25
|
+
gem install ultracart_api
|
50
26
|
```
|
51
27
|
|
52
28
|
## Getting Started
|
53
29
|
|
54
|
-
Please follow the [installation](#installation) procedure and then run the following code:
|
55
|
-
|
56
30
|
```ruby
|
57
|
-
# Load the gem
|
58
31
|
require 'ultracart_api'
|
32
|
+
require_relative '../constants'
|
59
33
|
|
60
|
-
#
|
61
|
-
UltracartClient.
|
62
|
-
# Configure OAuth2 access token for authorization: ultraCartOauth
|
63
|
-
config.access_token = 'YOUR ACCESS TOKEN'
|
34
|
+
# OrderApi.getOrder() retrieves a single order for a given order_id.
|
35
|
+
order_api = UltracartClient::OrderApi.new_using_api_key(Constants::API_KEY)
|
64
36
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
37
|
+
# The expansion variable instructs UltraCart how much information to return. The order object is large and
|
38
|
+
# while it's easily manageable for a single order, when querying thousands of orders, is useful to reduce
|
39
|
+
# payload size.
|
40
|
+
# see www.ultracart.com/api/ for all the expansion fields available (this list below may become stale)
|
41
|
+
=begin
|
42
|
+
Possible Order Expansions:
|
43
|
+
affiliate affiliate.ledger auto_order
|
44
|
+
billing channel_partner checkout
|
45
|
+
coupon customer_profile digital_order
|
46
|
+
edi fraud_score gift
|
47
|
+
gift_certificate internal item
|
48
|
+
linked_shipment marketing payment
|
49
|
+
payment.transaction quote salesforce
|
50
|
+
shipping shipping.tracking_number_details summary
|
51
|
+
taxes
|
52
|
+
=end
|
53
|
+
expansion = "item,summary,billing,shipping,shipping.tracking_number_details"
|
70
54
|
|
71
|
-
|
72
|
-
click_query = UltracartClient::AffiliateClickQuery.new # AffiliateClickQuery | Click query
|
55
|
+
order_id = 'DEMO-0009104390'
|
73
56
|
opts = {
|
74
|
-
|
75
|
-
_offset: 56, # Integer | Pagination of the record set. Offset is a zero based index.
|
76
|
-
_expand: '_expand_example' # String | The object expansion to perform on the result. Only option is link.
|
57
|
+
'_expand' => expansion
|
77
58
|
}
|
78
59
|
|
79
60
|
begin
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
61
|
+
api_response = order_api.get_order(order_id, opts)
|
62
|
+
|
63
|
+
# Check for errors
|
64
|
+
if api_response.error
|
65
|
+
puts "Developer Message: #{api_response.error.developer_message}"
|
66
|
+
puts "User Message: #{api_response.error.user_message}"
|
67
|
+
exit
|
68
|
+
end
|
86
69
|
|
70
|
+
order = api_response.order
|
71
|
+
|
72
|
+
# Using inspect instead of var_dump for Ruby-style object representation
|
73
|
+
puts order.inspect
|
74
|
+
rescue StandardError => e
|
75
|
+
puts "An error occurred: #{e.message}"
|
76
|
+
end
|
87
77
|
```
|
88
78
|
|
89
79
|
## Documentation for API Endpoints
|
@@ -1526,6 +1516,7 @@ Not every change is committed to every SDK.
|
|
1526
1516
|
|
1527
1517
|
| Version | Date | Comments |
|
1528
1518
|
| --: | :-: | --- |
|
1519
|
+
| 4.1.4 | 03/07/2025 | updated github readme.md |
|
1529
1520
|
| 4.1.3 | 03/07/2025 | updated github readme.md files |
|
1530
1521
|
| 4.1.2 | 03/05/2025 | added ChannelPartnerOrder.use_prior_payment_information_from_order_id |
|
1531
1522
|
| 4.1.1 | 02/28/2025 | auto order pause method |
|