ultracart_rest_api_v2_typescript 4.1.124 → 4.1.126

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.
@@ -796,6 +796,7 @@ src/models/Metric.ts
796
796
  src/models/ModelError.ts
797
797
  src/models/Notification.ts
798
798
  src/models/OauthDeviceAuthorizationResponse.ts
799
+ src/models/OauthMeResponse.ts
799
800
  src/models/OauthRevokeSuccessResponse.ts
800
801
  src/models/OauthTokenResponse.ts
801
802
  src/models/Order.ts
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # UltraCart Typescript SDK
2
- ## ultracart_rest_api_v2_typescript@4.1.124
2
+ ## ultracart_rest_api_v2_typescript@4.1.126
3
3
 
4
4
  Every API method call has a sample for every language SDK. See https://github.com/UltraCart/sdk_samples
5
5
 
6
6
  Installation
7
7
 
8
8
  ```
9
- npm install ultracart_rest_api_v2_typescript@4.1.124 --save
9
+ npm install ultracart_rest_api_v2_typescript@4.1.126 --save
10
10
  ```
11
11
 
12
12
  ```typescript
@@ -85,6 +85,8 @@ Not every change is committed to every SDK.
85
85
 
86
86
  | Version | Date | Comments |
87
87
  | --: | :-: | --- |
88
+ | 4.1.126 | 08/10/2026 | oauth - add /oauth/me method to assist application in indentifying the connected account |
89
+ | 4.1.125 | 08/06/2026 | order api - ability to query by bin and last 4 in unlimited scenarios for chargeback order association |
88
90
  | 4.1.124 | 08/04/2026 | customer - method to remove customer profile from email suppression |
89
91
  | 4.1.123 | 08/04/2026 | customer - method to remove customer profile from email suppression |
90
92
  | 4.1.122 | 07/29/2026 | auto order api - new methods for payment information and rebill |
@@ -68,6 +68,19 @@ export interface OauthApiInterface {
68
68
  * Initiate a device authorization flow.
69
69
  */
70
70
  oauthDeviceAuthorize(requestParameters: OauthDeviceAuthorizeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthDeviceAuthorizationResponse>;
71
+ /**
72
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
73
+ * @summary Identify the merchant account this access token belongs to.
74
+ * @param {*} [options] Override http request option.
75
+ * @throws {RequiredError}
76
+ * @memberof OauthApiInterface
77
+ */
78
+ oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
79
+ /**
80
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
81
+ * Identify the merchant account this access token belongs to.
82
+ */
83
+ oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
71
84
  /**
72
85
  * Revokes the OAuth application associated with the specified client_id and token.
73
86
  * @summary Revoke this OAuth application.
@@ -108,6 +121,16 @@ export declare class OauthApi extends runtime.BaseAPI implements OauthApiInterfa
108
121
  * Initiate a device authorization flow.
109
122
  */
110
123
  oauthDeviceAuthorize(requestParameters: OauthDeviceAuthorizeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthDeviceAuthorizationResponse>;
124
+ /**
125
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
126
+ * Identify the merchant account this access token belongs to.
127
+ */
128
+ oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
129
+ /**
130
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
131
+ * Identify the merchant account this access token belongs to.
132
+ */
133
+ oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
111
134
  /**
112
135
  * Revokes the OAuth application associated with the specified client_id and token.
113
136
  * Revoke this OAuth application.
@@ -253,6 +253,56 @@ var OauthApi = /** @class */ (function (_super) {
253
253
  });
254
254
  });
255
255
  };
256
+ /**
257
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
258
+ * Identify the merchant account this access token belongs to.
259
+ */
260
+ OauthApi.prototype.oauthMeRaw = function (initOverrides) {
261
+ return __awaiter(this, void 0, void 0, function () {
262
+ var queryParameters, headerParameters, _a, _b, response;
263
+ return __generator(this, function (_c) {
264
+ switch (_c.label) {
265
+ case 0:
266
+ queryParameters = {};
267
+ headerParameters = {};
268
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
269
+ // oauth required
270
+ _a = headerParameters;
271
+ _b = "Authorization";
272
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", [])];
273
+ case 1:
274
+ // oauth required
275
+ _a[_b] = _c.sent();
276
+ _c.label = 2;
277
+ case 2: return [4 /*yield*/, this.request({
278
+ path: "/oauth/me",
279
+ method: 'GET',
280
+ headers: headerParameters,
281
+ query: queryParameters,
282
+ }, initOverrides)];
283
+ case 3:
284
+ response = _c.sent();
285
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
286
+ }
287
+ });
288
+ });
289
+ };
290
+ /**
291
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
292
+ * Identify the merchant account this access token belongs to.
293
+ */
294
+ OauthApi.prototype.oauthMe = function (initOverrides) {
295
+ return __awaiter(this, void 0, void 0, function () {
296
+ return __generator(this, function (_a) {
297
+ switch (_a.label) {
298
+ case 0: return [4 /*yield*/, this.oauthMeRaw(initOverrides)];
299
+ case 1:
300
+ _a.sent();
301
+ return [2 /*return*/];
302
+ }
303
+ });
304
+ });
305
+ };
256
306
  /**
257
307
  * Revokes the OAuth application associated with the specified client_id and token.
258
308
  * Revoke this OAuth application.
@@ -61,7 +61,6 @@ export declare const ItemThirdPartyEmailMarketingProviderNameEnum: {
61
61
  readonly Lyris: "Lyris";
62
62
  readonly LyrisHq: "LyrisHQ";
63
63
  readonly MailChimp: "MailChimp";
64
- readonly SilverPop: "SilverPop";
65
64
  };
66
65
  export type ItemThirdPartyEmailMarketingProviderNameEnum = typeof ItemThirdPartyEmailMarketingProviderNameEnum[keyof typeof ItemThirdPartyEmailMarketingProviderNameEnum];
67
66
  /**
@@ -29,8 +29,7 @@ exports.ItemThirdPartyEmailMarketingProviderNameEnum = {
29
29
  Klaviyo: 'Klaviyo',
30
30
  Lyris: 'Lyris',
31
31
  LyrisHq: 'LyrisHQ',
32
- MailChimp: 'MailChimp',
33
- SilverPop: 'SilverPop'
32
+ MailChimp: 'MailChimp'
34
33
  };
35
34
  /**
36
35
  * Check if a given object implements the ItemThirdPartyEmailMarketing interface.
@@ -0,0 +1,55 @@
1
+ /**
2
+ * UltraCart Rest API V2
3
+ * UltraCart REST API Version 2
4
+ *
5
+ * The version of the OpenAPI document: 2.0.0
6
+ * Contact: support@ultracart.com
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface OauthMeResponse
16
+ */
17
+ export interface OauthMeResponse {
18
+ /**
19
+ * The name of your application as the merchant approved it.
20
+ * @type {string}
21
+ * @memberof OauthMeResponse
22
+ */
23
+ application_name?: string;
24
+ /**
25
+ * Your application's client_id. Null when authenticating with a simple key, which is not tied to an application.
26
+ * @type {string}
27
+ * @memberof OauthMeResponse
28
+ */
29
+ client_id?: string;
30
+ /**
31
+ * The UltraCart merchant account that authorized your application. Stable, and the value to key your own records on.
32
+ * @type {string}
33
+ * @memberof OauthMeResponse
34
+ */
35
+ merchant_id?: string;
36
+ /**
37
+ * The account's company name, suitable for displaying to your user. The merchant can change this, so display it rather than storing it as an identifier.
38
+ * @type {string}
39
+ * @memberof OauthMeResponse
40
+ */
41
+ merchant_name?: string;
42
+ /**
43
+ * The permissions the merchant granted. May be narrower than the permissions your application currently requests.
44
+ * @type {Array<string>}
45
+ * @memberof OauthMeResponse
46
+ */
47
+ scopes?: Array<string>;
48
+ }
49
+ /**
50
+ * Check if a given object implements the OauthMeResponse interface.
51
+ */
52
+ export declare function instanceOfOauthMeResponse(value: object): boolean;
53
+ export declare function OauthMeResponseFromJSON(json: any): OauthMeResponse;
54
+ export declare function OauthMeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthMeResponse;
55
+ export declare function OauthMeResponseToJSON(value?: OauthMeResponse | null): any;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * UltraCart Rest API V2
6
+ * UltraCart REST API Version 2
7
+ *
8
+ * The version of the OpenAPI document: 2.0.0
9
+ * Contact: support@ultracart.com
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.OauthMeResponseToJSON = exports.OauthMeResponseFromJSONTyped = exports.OauthMeResponseFromJSON = exports.instanceOfOauthMeResponse = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ /**
19
+ * Check if a given object implements the OauthMeResponse interface.
20
+ */
21
+ function instanceOfOauthMeResponse(value) {
22
+ var isInstance = true;
23
+ return isInstance;
24
+ }
25
+ exports.instanceOfOauthMeResponse = instanceOfOauthMeResponse;
26
+ function OauthMeResponseFromJSON(json) {
27
+ return OauthMeResponseFromJSONTyped(json, false);
28
+ }
29
+ exports.OauthMeResponseFromJSON = OauthMeResponseFromJSON;
30
+ function OauthMeResponseFromJSONTyped(json, ignoreDiscriminator) {
31
+ if ((json === undefined) || (json === null)) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'application_name': !(0, runtime_1.exists)(json, 'application_name') ? undefined : json['application_name'],
36
+ 'client_id': !(0, runtime_1.exists)(json, 'client_id') ? undefined : json['client_id'],
37
+ 'merchant_id': !(0, runtime_1.exists)(json, 'merchant_id') ? undefined : json['merchant_id'],
38
+ 'merchant_name': !(0, runtime_1.exists)(json, 'merchant_name') ? undefined : json['merchant_name'],
39
+ 'scopes': !(0, runtime_1.exists)(json, 'scopes') ? undefined : json['scopes'],
40
+ };
41
+ }
42
+ exports.OauthMeResponseFromJSONTyped = OauthMeResponseFromJSONTyped;
43
+ function OauthMeResponseToJSON(value) {
44
+ if (value === undefined) {
45
+ return undefined;
46
+ }
47
+ if (value === null) {
48
+ return null;
49
+ }
50
+ return {
51
+ 'application_name': value.application_name,
52
+ 'client_id': value.client_id,
53
+ 'merchant_id': value.merchant_id,
54
+ 'merchant_name': value.merchant_name,
55
+ 'scopes': value.scopes,
56
+ };
57
+ }
58
+ exports.OauthMeResponseToJSON = OauthMeResponseToJSON;
@@ -45,6 +45,12 @@ export interface OauthTokenResponse {
45
45
  * @memberof OauthTokenResponse
46
46
  */
47
47
  expires_in?: string;
48
+ /**
49
+ * The UltraCart merchant account that authorized this token. Use it to map the token to the merchant within your own system. Also returned by GET /oauth/me along with the account name.
50
+ * @type {string}
51
+ * @memberof OauthTokenResponse
52
+ */
53
+ merchant_id?: string;
48
54
  /**
49
55
  * The refresh token that should be used to fetch a new access token when the expiration occurs
50
56
  * @type {string}
@@ -43,6 +43,7 @@ function OauthTokenResponseFromJSONTyped(json, ignoreDiscriminator) {
43
43
  'error_description': !(0, runtime_1.exists)(json, 'error_description') ? undefined : json['error_description'],
44
44
  'error_uri': !(0, runtime_1.exists)(json, 'error_uri') ? undefined : json['error_uri'],
45
45
  'expires_in': !(0, runtime_1.exists)(json, 'expires_in') ? undefined : json['expires_in'],
46
+ 'merchant_id': !(0, runtime_1.exists)(json, 'merchant_id') ? undefined : json['merchant_id'],
46
47
  'refresh_token': !(0, runtime_1.exists)(json, 'refresh_token') ? undefined : json['refresh_token'],
47
48
  'scope': !(0, runtime_1.exists)(json, 'scope') ? undefined : json['scope'],
48
49
  'token_type': !(0, runtime_1.exists)(json, 'token_type') ? undefined : json['token_type'],
@@ -62,6 +63,7 @@ function OauthTokenResponseToJSON(value) {
62
63
  'error_description': value.error_description,
63
64
  'error_uri': value.error_uri,
64
65
  'expires_in': value.expires_in,
66
+ 'merchant_id': value.merchant_id,
65
67
  'refresh_token': value.refresh_token,
66
68
  'scope': value.scope,
67
69
  'token_type': value.token_type,
@@ -16,6 +16,18 @@ import { OrderQueryPaymentTransactionFilter } from './OrderQueryPaymentTransacti
16
16
  * @interface OrderQuery
17
17
  */
18
18
  export interface OrderQuery {
19
+ /**
20
+ * First six digits (BIN) of the credit card number. Must be specified together with card_last4 and a payment_date_begin/payment_date_end range. Requires query_target=cache.
21
+ * @type {string}
22
+ * @memberof OrderQuery
23
+ */
24
+ card_bin?: string;
25
+ /**
26
+ * Last four digits of the credit card number. Must be specified together with card_bin and a payment_date_begin/payment_date_end range. Always supply four digits, including for American Express. Requires query_target=cache.
27
+ * @type {string}
28
+ * @memberof OrderQuery
29
+ */
30
+ card_last4?: string;
19
31
  /**
20
32
  * CC Email
21
33
  * @type {string}
@@ -185,7 +197,7 @@ export interface OrderQuery {
185
197
  */
186
198
  payment_method?: OrderQueryPaymentMethodEnum;
187
199
  /**
188
- * Exact-match filters on the detail name/value pairs of a single payment transaction, AND-ed against the same transaction. Requires query_target=cache which uses the ElasticSearch cache. The origin or database path cannot search transaction details. The rotating gateway is just another pair, name equals rotatingTransactionGatewayCode or rotatingTransactionGatewayName.
200
+ * Exact-match filters on the detail name/value pairs of a single payment transaction, AND-ed against the same transaction. Requires query_target=cache. The origin or database path cannot search transaction details. The rotating gateway is just another pair, name equals rotatingTransactionGatewayCode or rotatingTransactionGatewayName.
189
201
  * @type {Array<OrderQueryPaymentTransactionFilter>}
190
202
  * @memberof OrderQuery
191
203
  */
@@ -80,6 +80,8 @@ function OrderQueryFromJSONTyped(json, ignoreDiscriminator) {
80
80
  return json;
81
81
  }
82
82
  return {
83
+ 'card_bin': !(0, runtime_1.exists)(json, 'card_bin') ? undefined : json['card_bin'],
84
+ 'card_last4': !(0, runtime_1.exists)(json, 'card_last4') ? undefined : json['card_last4'],
83
85
  'cc_email': !(0, runtime_1.exists)(json, 'cc_email') ? undefined : json['cc_email'],
84
86
  'channel_partner_code': !(0, runtime_1.exists)(json, 'channel_partner_code') ? undefined : json['channel_partner_code'],
85
87
  'channel_partner_order_id': !(0, runtime_1.exists)(json, 'channel_partner_order_id') ? undefined : json['channel_partner_order_id'],
@@ -135,6 +137,8 @@ function OrderQueryToJSON(value) {
135
137
  return null;
136
138
  }
137
139
  return {
140
+ 'card_bin': value.card_bin,
141
+ 'card_last4': value.card_last4,
138
142
  'cc_email': value.cc_email,
139
143
  'channel_partner_code': value.channel_partner_code,
140
144
  'channel_partner_order_id': value.channel_partner_order_id,
@@ -767,6 +767,7 @@ export * from './Metric';
767
767
  export * from './ModelError';
768
768
  export * from './Notification';
769
769
  export * from './OauthDeviceAuthorizationResponse';
770
+ export * from './OauthMeResponse';
770
771
  export * from './OauthRevokeSuccessResponse';
771
772
  export * from './OauthTokenResponse';
772
773
  export * from './Order';
@@ -785,6 +785,7 @@ __exportStar(require("./Metric"), exports);
785
785
  __exportStar(require("./ModelError"), exports);
786
786
  __exportStar(require("./Notification"), exports);
787
787
  __exportStar(require("./OauthDeviceAuthorizationResponse"), exports);
788
+ __exportStar(require("./OauthMeResponse"), exports);
788
789
  __exportStar(require("./OauthRevokeSuccessResponse"), exports);
789
790
  __exportStar(require("./OauthTokenResponse"), exports);
790
791
  __exportStar(require("./Order"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultracart_rest_api_v2_typescript",
3
- "version": "4.1.124",
3
+ "version": "4.1.126",
4
4
  "description": "UltraCart Rest TypeScript SDK",
5
5
  "author": "UltraCart",
6
6
  "repository": {
@@ -93,6 +93,21 @@ export interface OauthApiInterface {
93
93
  */
94
94
  oauthDeviceAuthorize(requestParameters: OauthDeviceAuthorizeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthDeviceAuthorizationResponse>;
95
95
 
96
+ /**
97
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
98
+ * @summary Identify the merchant account this access token belongs to.
99
+ * @param {*} [options] Override http request option.
100
+ * @throws {RequiredError}
101
+ * @memberof OauthApiInterface
102
+ */
103
+ oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
104
+
105
+ /**
106
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
107
+ * Identify the merchant account this access token belongs to.
108
+ */
109
+ oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
110
+
96
111
  /**
97
112
  * Revokes the OAuth application associated with the specified client_id and token.
98
113
  * @summary Revoke this OAuth application.
@@ -277,6 +292,38 @@ export class OauthApi extends runtime.BaseAPI implements OauthApiInterface {
277
292
  return await response.value();
278
293
  }
279
294
 
295
+ /**
296
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
297
+ * Identify the merchant account this access token belongs to.
298
+ */
299
+ async oauthMeRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
300
+ const queryParameters: any = {};
301
+
302
+ const headerParameters: runtime.HTTPHeaders = {};
303
+
304
+ if (this.configuration && this.configuration.accessToken) {
305
+ // oauth required
306
+ headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", []);
307
+ }
308
+
309
+ const response = await this.request({
310
+ path: `/oauth/me`,
311
+ method: 'GET',
312
+ headers: headerParameters,
313
+ query: queryParameters,
314
+ }, initOverrides);
315
+
316
+ return new runtime.VoidApiResponse(response);
317
+ }
318
+
319
+ /**
320
+ * Returns the UltraCart merchant account that authorized your application, along with the permissions that were granted. Call it immediately after exchanging your authorization code so you can display the connected account to your user and map it within your own system. Any OAuth access token may call this endpoint regardless of the permissions it holds. The granted permissions are the ones the merchant approved, which may be narrower than the permissions your application currently requests, because permissions are recorded when the merchant authorizes and do not change afterwards. If you add a permission to your application, already connected merchants keep the permissions they originally approved until they authorize again, so read this list rather than assuming your application\'s configured permissions.
321
+ * Identify the merchant account this access token belongs to.
322
+ */
323
+ async oauthMe(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
324
+ await this.oauthMeRaw(initOverrides);
325
+ }
326
+
280
327
  /**
281
328
  * Revokes the OAuth application associated with the specified client_id and token.
282
329
  * Revoke this OAuth application.
@@ -67,8 +67,7 @@ export const ItemThirdPartyEmailMarketingProviderNameEnum = {
67
67
  Klaviyo: 'Klaviyo',
68
68
  Lyris: 'Lyris',
69
69
  LyrisHq: 'LyrisHQ',
70
- MailChimp: 'MailChimp',
71
- SilverPop: 'SilverPop'
70
+ MailChimp: 'MailChimp'
72
71
  } as const;
73
72
  export type ItemThirdPartyEmailMarketingProviderNameEnum = typeof ItemThirdPartyEmailMarketingProviderNameEnum[keyof typeof ItemThirdPartyEmailMarketingProviderNameEnum];
74
73
 
@@ -0,0 +1,99 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * UltraCart Rest API V2
5
+ * UltraCart REST API Version 2
6
+ *
7
+ * The version of the OpenAPI document: 2.0.0
8
+ * Contact: support@ultracart.com
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface OauthMeResponse
20
+ */
21
+ export interface OauthMeResponse {
22
+ /**
23
+ * The name of your application as the merchant approved it.
24
+ * @type {string}
25
+ * @memberof OauthMeResponse
26
+ */
27
+ application_name?: string;
28
+ /**
29
+ * Your application's client_id. Null when authenticating with a simple key, which is not tied to an application.
30
+ * @type {string}
31
+ * @memberof OauthMeResponse
32
+ */
33
+ client_id?: string;
34
+ /**
35
+ * The UltraCart merchant account that authorized your application. Stable, and the value to key your own records on.
36
+ * @type {string}
37
+ * @memberof OauthMeResponse
38
+ */
39
+ merchant_id?: string;
40
+ /**
41
+ * The account's company name, suitable for displaying to your user. The merchant can change this, so display it rather than storing it as an identifier.
42
+ * @type {string}
43
+ * @memberof OauthMeResponse
44
+ */
45
+ merchant_name?: string;
46
+ /**
47
+ * The permissions the merchant granted. May be narrower than the permissions your application currently requests.
48
+ * @type {Array<string>}
49
+ * @memberof OauthMeResponse
50
+ */
51
+ scopes?: Array<string>;
52
+ }
53
+
54
+
55
+
56
+ /**
57
+ * Check if a given object implements the OauthMeResponse interface.
58
+ */
59
+ export function instanceOfOauthMeResponse(value: object): boolean {
60
+ let isInstance = true;
61
+
62
+ return isInstance;
63
+ }
64
+
65
+ export function OauthMeResponseFromJSON(json: any): OauthMeResponse {
66
+ return OauthMeResponseFromJSONTyped(json, false);
67
+ }
68
+
69
+ export function OauthMeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthMeResponse {
70
+ if ((json === undefined) || (json === null)) {
71
+ return json;
72
+ }
73
+ return {
74
+
75
+ 'application_name': !exists(json, 'application_name') ? undefined : json['application_name'],
76
+ 'client_id': !exists(json, 'client_id') ? undefined : json['client_id'],
77
+ 'merchant_id': !exists(json, 'merchant_id') ? undefined : json['merchant_id'],
78
+ 'merchant_name': !exists(json, 'merchant_name') ? undefined : json['merchant_name'],
79
+ 'scopes': !exists(json, 'scopes') ? undefined : json['scopes'],
80
+ };
81
+ }
82
+
83
+ export function OauthMeResponseToJSON(value?: OauthMeResponse | null): any {
84
+ if (value === undefined) {
85
+ return undefined;
86
+ }
87
+ if (value === null) {
88
+ return null;
89
+ }
90
+ return {
91
+
92
+ 'application_name': value.application_name,
93
+ 'client_id': value.client_id,
94
+ 'merchant_id': value.merchant_id,
95
+ 'merchant_name': value.merchant_name,
96
+ 'scopes': value.scopes,
97
+ };
98
+ }
99
+
@@ -49,6 +49,12 @@ export interface OauthTokenResponse {
49
49
  * @memberof OauthTokenResponse
50
50
  */
51
51
  expires_in?: string;
52
+ /**
53
+ * The UltraCart merchant account that authorized this token. Use it to map the token to the merchant within your own system. Also returned by GET /oauth/me along with the account name.
54
+ * @type {string}
55
+ * @memberof OauthTokenResponse
56
+ */
57
+ merchant_id?: string;
52
58
  /**
53
59
  * The refresh token that should be used to fetch a new access token when the expiration occurs
54
60
  * @type {string}
@@ -104,6 +110,7 @@ export function OauthTokenResponseFromJSONTyped(json: any, ignoreDiscriminator:
104
110
  'error_description': !exists(json, 'error_description') ? undefined : json['error_description'],
105
111
  'error_uri': !exists(json, 'error_uri') ? undefined : json['error_uri'],
106
112
  'expires_in': !exists(json, 'expires_in') ? undefined : json['expires_in'],
113
+ 'merchant_id': !exists(json, 'merchant_id') ? undefined : json['merchant_id'],
107
114
  'refresh_token': !exists(json, 'refresh_token') ? undefined : json['refresh_token'],
108
115
  'scope': !exists(json, 'scope') ? undefined : json['scope'],
109
116
  'token_type': !exists(json, 'token_type') ? undefined : json['token_type'],
@@ -124,6 +131,7 @@ export function OauthTokenResponseToJSON(value?: OauthTokenResponse | null): any
124
131
  'error_description': value.error_description,
125
132
  'error_uri': value.error_uri,
126
133
  'expires_in': value.expires_in,
134
+ 'merchant_id': value.merchant_id,
127
135
  'refresh_token': value.refresh_token,
128
136
  'scope': value.scope,
129
137
  'token_type': value.token_type,
@@ -26,6 +26,18 @@ import {
26
26
  * @interface OrderQuery
27
27
  */
28
28
  export interface OrderQuery {
29
+ /**
30
+ * First six digits (BIN) of the credit card number. Must be specified together with card_last4 and a payment_date_begin/payment_date_end range. Requires query_target=cache.
31
+ * @type {string}
32
+ * @memberof OrderQuery
33
+ */
34
+ card_bin?: string;
35
+ /**
36
+ * Last four digits of the credit card number. Must be specified together with card_bin and a payment_date_begin/payment_date_end range. Always supply four digits, including for American Express. Requires query_target=cache.
37
+ * @type {string}
38
+ * @memberof OrderQuery
39
+ */
40
+ card_last4?: string;
29
41
  /**
30
42
  * CC Email
31
43
  * @type {string}
@@ -195,7 +207,7 @@ export interface OrderQuery {
195
207
  */
196
208
  payment_method?: OrderQueryPaymentMethodEnum;
197
209
  /**
198
- * Exact-match filters on the detail name/value pairs of a single payment transaction, AND-ed against the same transaction. Requires query_target=cache which uses the ElasticSearch cache. The origin or database path cannot search transaction details. The rotating gateway is just another pair, name equals rotatingTransactionGatewayCode or rotatingTransactionGatewayName.
210
+ * Exact-match filters on the detail name/value pairs of a single payment transaction, AND-ed against the same transaction. Requires query_target=cache. The origin or database path cannot search transaction details. The rotating gateway is just another pair, name equals rotatingTransactionGatewayCode or rotatingTransactionGatewayName.
199
211
  * @type {Array<OrderQueryPaymentTransactionFilter>}
200
212
  * @memberof OrderQuery
201
213
  */
@@ -367,6 +379,8 @@ export function OrderQueryFromJSONTyped(json: any, ignoreDiscriminator: boolean)
367
379
  }
368
380
  return {
369
381
 
382
+ 'card_bin': !exists(json, 'card_bin') ? undefined : json['card_bin'],
383
+ 'card_last4': !exists(json, 'card_last4') ? undefined : json['card_last4'],
370
384
  'cc_email': !exists(json, 'cc_email') ? undefined : json['cc_email'],
371
385
  'channel_partner_code': !exists(json, 'channel_partner_code') ? undefined : json['channel_partner_code'],
372
386
  'channel_partner_order_id': !exists(json, 'channel_partner_order_id') ? undefined : json['channel_partner_order_id'],
@@ -423,6 +437,8 @@ export function OrderQueryToJSON(value?: OrderQuery | null): any {
423
437
  }
424
438
  return {
425
439
 
440
+ 'card_bin': value.card_bin,
441
+ 'card_last4': value.card_last4,
426
442
  'cc_email': value.cc_email,
427
443
  'channel_partner_code': value.channel_partner_code,
428
444
  'channel_partner_order_id': value.channel_partner_order_id,
@@ -769,6 +769,7 @@ export * from './Metric';
769
769
  export * from './ModelError';
770
770
  export * from './Notification';
771
771
  export * from './OauthDeviceAuthorizationResponse';
772
+ export * from './OauthMeResponse';
772
773
  export * from './OauthRevokeSuccessResponse';
773
774
  export * from './OauthTokenResponse';
774
775
  export * from './Order';