ultracart_api 4.1.12 → 4.1.14
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 +4 -2
- data/docs/AffiliateApi.md +123 -167
- data/docs/AutoOrderApi.md +1250 -903
- data/docs/ChannelPartnerApi.md +1678 -1121
- data/docs/ChargebackApi.md +297 -405
- data/docs/CheckoutApi.md +1622 -1424
- data/docs/Conversation.md +4 -0
- data/docs/ConversationApi.md +4820 -6315
- data/docs/CouponApi.md +1522 -1443
- data/docs/CustomerApi.md +2570 -1845
- data/docs/DatawarehouseApi.md +555 -723
- data/docs/FulfillmentApi.md +567 -441
- data/docs/GiftCertificateApi.md +617 -598
- data/docs/IntegrationLogApi.md +290 -385
- data/docs/ItemApi.md +2174 -1746
- data/docs/ItemRestriction.md +2 -0
- data/docs/OauthApi.md +203 -163
- data/docs/OrderApi.md +2774 -2177
- data/docs/SsoApi.md +223 -288
- data/docs/StorefrontApi.md +9692 -12967
- data/docs/TaxApi.md +1541 -2017
- data/docs/UserApi.md +606 -790
- data/docs/WebhookApi.md +787 -628
- data/docs/WorkflowApi.md +666 -879
- data/lib/ultracart_api/models/conversation.rb +21 -1
- data/lib/ultracart_api/models/item_restriction.rb +11 -1
- data/lib/ultracart_api/version.rb +1 -1
- metadata +2 -2
data/docs/ItemRestriction.md
CHANGED
@@ -6,6 +6,7 @@
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
7
7
|
| **exclude_coupon** | **Boolean** | Exclude coupons | [optional] |
|
8
8
|
| **exclude_from_free_promotion** | **Boolean** | Exclude from free promotion | [optional] |
|
9
|
+
| **exclude_from_loyalty** | **Boolean** | Exclude from loyalty. Must be set to true or false to save. Null is ignored for backwards SDK compatibility | [optional] |
|
9
10
|
| **items** | [**Array<ItemRestrictionItem>**](ItemRestrictionItem.md) | Items | [optional] |
|
10
11
|
| **maximum_quantity** | **Integer** | Maximum quantity | [optional] |
|
11
12
|
| **minimum_quantity** | **Integer** | Minimum quantity (defaults to 1) | [optional] |
|
@@ -21,6 +22,7 @@ require 'ultracart_api'
|
|
21
22
|
instance = UltracartClient::ItemRestriction.new(
|
22
23
|
exclude_coupon: null,
|
23
24
|
exclude_from_free_promotion: null,
|
25
|
+
exclude_from_loyalty: null,
|
24
26
|
items: null,
|
25
27
|
maximum_quantity: null,
|
26
28
|
minimum_quantity: null,
|
data/docs/OauthApi.md
CHANGED
@@ -1,163 +1,203 @@
|
|
1
|
-
# UltracartClient::OauthApi
|
2
|
-
|
3
|
-
All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
4
|
-
|
5
|
-
| Method | HTTP request | Description |
|
6
|
-
| ------ | ------------ | ----------- |
|
7
|
-
| [**oauth_access_token**](OauthApi.md#oauth_access_token) | **POST** /oauth/token | Exchange authorization code for access token. |
|
8
|
-
| [**oauth_revoke**](OauthApi.md#oauth_revoke) | **POST** /oauth/revoke | Revoke this OAuth application. |
|
9
|
-
|
10
|
-
|
11
|
-
## oauth_access_token
|
12
|
-
|
13
|
-
> <OauthTokenResponse> oauth_access_token(client_id, grant_type, opts)
|
14
|
-
|
15
|
-
Exchange authorization code for access token.
|
16
|
-
|
17
|
-
The final leg in the OAuth process which exchanges the specified access token for the access code needed to make API calls.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
require 'ultracart_api'
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
1
|
+
# UltracartClient::OauthApi
|
2
|
+
|
3
|
+
All URIs are relative to *https://secure.ultracart.com/rest/v2*
|
4
|
+
|
5
|
+
| Method | HTTP request | Description |
|
6
|
+
| ------ | ------------ | ----------- |
|
7
|
+
| [**oauth_access_token**](OauthApi.md#oauth_access_token) | **POST** /oauth/token | Exchange authorization code for access token. |
|
8
|
+
| [**oauth_revoke**](OauthApi.md#oauth_revoke) | **POST** /oauth/revoke | Revoke this OAuth application. |
|
9
|
+
|
10
|
+
|
11
|
+
## oauth_access_token
|
12
|
+
|
13
|
+
> <OauthTokenResponse> oauth_access_token(client_id, grant_type, opts)
|
14
|
+
|
15
|
+
Exchange authorization code for access token.
|
16
|
+
|
17
|
+
The final leg in the OAuth process which exchanges the specified access token for the access code needed to make API calls.
|
18
|
+
|
19
|
+
|
20
|
+
### Examples
|
21
|
+
|
22
|
+
```ruby
|
23
|
+
require 'ultracart_api'
|
24
|
+
require_relative '../constants'
|
25
|
+
|
26
|
+
=begin
|
27
|
+
|
28
|
+
The first step in implementing an OAuth authorization to your UltraCart Developer Application is
|
29
|
+
creating a Client ID and Secret. See the following doc for instructions on doing so:
|
30
|
+
https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/3488907265/Developer+Applications+-+Creating+a+Client+ID+and+Secret+for+an+OAuth+Application
|
31
|
+
|
32
|
+
The second step is to construct an authorize url for your customers to follow and authorize your application.
|
33
|
+
See the oauthAuthorize.rb for an example on constructing that url.
|
34
|
+
|
35
|
+
This method, OAuth.oauth_access_token() will be called from within your redirect script, i.e. that web page the
|
36
|
+
customer is redirected to by UltraCart after successfully authorizing your application.
|
37
|
+
|
38
|
+
This example illustrates how to retrieve the code parameter and exchange it for an access_token and refresh_token.
|
39
|
+
|
40
|
+
Once you have your Client ID and Secret created, our OAuth security follows the industry standards.
|
41
|
+
1. Construct an authorize url for your customers.
|
42
|
+
2. Your customers will follow the link and authorize your application.
|
43
|
+
3. Store their oauth credentials as best fits your application.
|
44
|
+
|
45
|
+
Parameters this script should expect:
|
46
|
+
code -> used to exchange for an access token
|
47
|
+
state -> whatever you passed in your authorize url
|
48
|
+
error -> if you have a problem with your application configure. Possible values are:
|
49
|
+
invalid_request -> your authorize url has expired
|
50
|
+
access_denied -> user said 'no' and did not grant access.
|
51
|
+
|
52
|
+
Parameters you will use to retrieve a token:
|
53
|
+
code -> the value provided as a query parameter from UltraCart, required if grant_type is 'authorization_code'
|
54
|
+
client_id -> your client id (see doc link at top of this file)
|
55
|
+
grant_type -> 'authorization_code' or 'refresh_token'
|
56
|
+
redirect_url -> The URI that you redirect the browser to start the authorization process
|
57
|
+
refresh_token -> if grant_type = 'refresh_token', you have to provide the refresh token. makes sense, yes?
|
58
|
+
|
59
|
+
See OauthTokenResponse for fields that are returned from this call.
|
60
|
+
All SDKs have the same field names with slight differences in capitalization and underscores.
|
61
|
+
https://github.com/UltraCart/rest_api_v2_sdk_csharp/blob/master/src/com.ultracart.admin.v2/Model/OauthTokenResponse.cs
|
62
|
+
|
63
|
+
=end
|
64
|
+
|
65
|
+
client_id = "5e31ce86e17f02015a35257c47151544" # this is given to you when you create your application (see the doc link above)
|
66
|
+
grant_type = "authorization_code"
|
67
|
+
redirect_url = "https://www.mywebsite.com/oauth/redirect_here.php"
|
68
|
+
state = "denmark" # this is whatever you used when you created your authorize url (see oauthAuthorize.rb)
|
69
|
+
|
70
|
+
code = params['code'] # Assuming this is running in a web framework that provides params
|
71
|
+
refresh_token = nil
|
72
|
+
|
73
|
+
oauth_api = UltracartClient::OauthApi.new_using_api_key(Constants::API_KEY)
|
74
|
+
api_response = oauth_api.oauth_access_token(client_id, grant_type, code, redirect_url, refresh_token)
|
75
|
+
|
76
|
+
# api_response is an OauthTokenResponse object.
|
77
|
+
puts api_response.inspect
|
78
|
+
refresh_token = api_response.refresh_token
|
79
|
+
expires_in = api_response.expires_in
|
80
|
+
```
|
81
|
+
|
82
|
+
|
83
|
+
#### Using the oauth_access_token_with_http_info variant
|
84
|
+
|
85
|
+
This returns an Array which contains the response data, status code and headers.
|
86
|
+
|
87
|
+
> <Array(<OauthTokenResponse>, Integer, Hash)> oauth_access_token_with_http_info(client_id, grant_type, opts)
|
88
|
+
|
89
|
+
```ruby
|
90
|
+
begin
|
91
|
+
# Exchange authorization code for access token.
|
92
|
+
data, status_code, headers = api_instance.oauth_access_token_with_http_info(client_id, grant_type, opts)
|
93
|
+
p status_code # => 2xx
|
94
|
+
p headers # => { ... }
|
95
|
+
p data # => <OauthTokenResponse>
|
96
|
+
rescue UltracartClient::ApiError => e
|
97
|
+
puts "Error when calling OauthApi->oauth_access_token_with_http_info: #{e}"
|
98
|
+
end
|
99
|
+
```
|
100
|
+
|
101
|
+
### Parameters
|
102
|
+
|
103
|
+
| Name | Type | Description | Notes |
|
104
|
+
| ---- | ---- | ----------- | ----- |
|
105
|
+
| **client_id** | **String** | The OAuth application client_id. | |
|
106
|
+
| **grant_type** | **String** | Type of grant | |
|
107
|
+
| **code** | **String** | Authorization code received back from the browser redirect | [optional] |
|
108
|
+
| **redirect_uri** | **String** | The URI that you redirect the browser to start the authorization process | [optional] |
|
109
|
+
| **refresh_token** | **String** | The refresh token received during the original grant_type=authorization_code that can be used to return a new access token | [optional] |
|
110
|
+
|
111
|
+
### Return type
|
112
|
+
|
113
|
+
[**OauthTokenResponse**](OauthTokenResponse.md)
|
114
|
+
|
115
|
+
### Authorization
|
116
|
+
|
117
|
+
[ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
118
|
+
|
119
|
+
### HTTP request headers
|
120
|
+
|
121
|
+
- **Content-Type**: application/x-www-form-urlencoded
|
122
|
+
- **Accept**: application/json
|
123
|
+
|
124
|
+
|
125
|
+
## oauth_revoke
|
126
|
+
|
127
|
+
> <OauthRevokeSuccessResponse> oauth_revoke(client_id, token)
|
128
|
+
|
129
|
+
Revoke this OAuth application.
|
130
|
+
|
131
|
+
Revokes the OAuth application associated with the specified client_id and token.
|
132
|
+
|
133
|
+
|
134
|
+
### Examples
|
135
|
+
|
136
|
+
```ruby
|
137
|
+
require 'ultracart_api'
|
138
|
+
require_relative '../constants'
|
139
|
+
|
140
|
+
=begin
|
141
|
+
|
142
|
+
This is a last feature of the UltraCart OAuth Security Implementation.
|
143
|
+
oauthRevoke is used to kill an access token.
|
144
|
+
Call this method when a customer desires to terminate using your Developer Application.
|
145
|
+
|
146
|
+
|
147
|
+
The first step in implementing an OAuth authorization to your UltraCart Developer Application is
|
148
|
+
creating a Client ID and Secret. See the following doc for instructions on doing so:
|
149
|
+
https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/3488907265/Developer+Applications+-+Creating+a+Client+ID+and+Secret+for+an+OAuth+Application
|
150
|
+
|
151
|
+
=end
|
152
|
+
|
153
|
+
client_id = "5e31ce86e17f02015a35257c47151544" # this is given to you when you create your application (see the doc link above)
|
154
|
+
access_token = "123456789012345678901234567890" # this is stored by your application somewhere somehow.
|
155
|
+
|
156
|
+
oauth_api = UltracartClient::OauthApi.new_using_api_key(Constants::API_KEY)
|
157
|
+
api_response = oauth_api.oauth_revoke(client_id, access_token)
|
158
|
+
|
159
|
+
# api_response is an OauthRevokeSuccessResponse object.
|
160
|
+
puts api_response.inspect
|
161
|
+
successful = api_response.successful
|
162
|
+
message = api_response.message
|
163
|
+
```
|
164
|
+
|
165
|
+
|
166
|
+
#### Using the oauth_revoke_with_http_info variant
|
167
|
+
|
168
|
+
This returns an Array which contains the response data, status code and headers.
|
169
|
+
|
170
|
+
> <Array(<OauthRevokeSuccessResponse>, Integer, Hash)> oauth_revoke_with_http_info(client_id, token)
|
171
|
+
|
172
|
+
```ruby
|
173
|
+
begin
|
174
|
+
# Revoke this OAuth application.
|
175
|
+
data, status_code, headers = api_instance.oauth_revoke_with_http_info(client_id, token)
|
176
|
+
p status_code # => 2xx
|
177
|
+
p headers # => { ... }
|
178
|
+
p data # => <OauthRevokeSuccessResponse>
|
179
|
+
rescue UltracartClient::ApiError => e
|
180
|
+
puts "Error when calling OauthApi->oauth_revoke_with_http_info: #{e}"
|
181
|
+
end
|
182
|
+
```
|
183
|
+
|
184
|
+
### Parameters
|
185
|
+
|
186
|
+
| Name | Type | Description | Notes |
|
187
|
+
| ---- | ---- | ----------- | ----- |
|
188
|
+
| **client_id** | **String** | The OAuth application client_id. | |
|
189
|
+
| **token** | **String** | The OAuth access token that is to be revoked.. | |
|
190
|
+
|
191
|
+
### Return type
|
192
|
+
|
193
|
+
[**OauthRevokeSuccessResponse**](OauthRevokeSuccessResponse.md)
|
194
|
+
|
195
|
+
### Authorization
|
196
|
+
|
197
|
+
[ultraCartBrowserApiKey](../README.md#ultraCartBrowserApiKey), [ultraCartOauth](../README.md#ultraCartOauth), [ultraCartSimpleApiKey](../README.md#ultraCartSimpleApiKey)
|
198
|
+
|
199
|
+
### HTTP request headers
|
200
|
+
|
201
|
+
- **Content-Type**: application/x-www-form-urlencoded
|
202
|
+
- **Accept**: application/json
|
203
|
+
|