ultracart_rest_api_v2_typescript 4.1.27 → 4.1.29

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.
@@ -675,6 +675,7 @@ src/models/OauthTokenResponse.ts
675
675
  src/models/Order.ts
676
676
  src/models/OrderAffiliate.ts
677
677
  src/models/OrderAffiliateLedger.ts
678
+ src/models/OrderAssignToAffiliateRequest.ts
678
679
  src/models/OrderAutoOrder.ts
679
680
  src/models/OrderBilling.ts
680
681
  src/models/OrderBuysafe.ts
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # UltraCart Typescript SDK
2
- ## ultracart_rest_api_v2_typescript@4.1.27
2
+ ## ultracart_rest_api_v2_typescript@4.1.29
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.27 --save
9
+ npm install ultracart_rest_api_v2_typescript@4.1.29 --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.29 | 11/13/2025 | conversations - AI capabilities flag for generate coupon |
89
+ | 4.1.28 | 11/07/2025 | OrderApi.assignToAffiliate |
88
90
  | 4.1.27 | 11/06/2025 | conversation ai knowledge base changes |
89
91
  | 4.1.26 | 10/20/2025 | conversation api bug fixes |
90
92
  | 4.1.25 | 10/20/2025 | conversation api bug fix for bad url on agent profile kb upload |
@@ -10,11 +10,16 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import { AccountsReceivableRetryConfig, AccountsReceivableRetryConfigResponse, AccountsReceivableRetryStatsResponse, BaseResponse, Order, OrderByTokenQuery, OrderEdiDocumentsResponse, OrderFormat, OrderFormatResponse, OrderInvoiceResponse, OrderPackingSlipResponse, OrderProcessPaymentRequest, OrderProcessPaymentResponse, OrderQuery, OrderQueryBatch, OrderRefundableResponse, OrderReplacement, OrderReplacementResponse, OrderResponse, OrderTokenResponse, OrderValidationRequest, OrderValidationResponse, OrdersResponse, ReplaceOrderItemIdRequest } from '../models';
13
+ import { AccountsReceivableRetryConfig, AccountsReceivableRetryConfigResponse, AccountsReceivableRetryStatsResponse, BaseResponse, Order, OrderAssignToAffiliateRequest, OrderByTokenQuery, OrderEdiDocumentsResponse, OrderFormat, OrderFormatResponse, OrderInvoiceResponse, OrderPackingSlipResponse, OrderProcessPaymentRequest, OrderProcessPaymentResponse, OrderQuery, OrderQueryBatch, OrderRefundableResponse, OrderReplacement, OrderReplacementResponse, OrderResponse, OrderTokenResponse, OrderValidationRequest, OrderValidationResponse, OrdersResponse, ReplaceOrderItemIdRequest } from '../models';
14
14
  export interface AdjustOrderTotalRequest {
15
15
  orderId: string;
16
16
  desiredTotal: string;
17
17
  }
18
+ export interface AssignToAffiliateRequest {
19
+ orderId: string;
20
+ assignToAffiliateRequest: OrderAssignToAffiliateRequest;
21
+ expand?: string;
22
+ }
18
23
  export interface BlockRefundOnOrderRequest {
19
24
  orderId: string;
20
25
  blockReason?: string;
@@ -181,6 +186,22 @@ export interface OrderApiInterface {
181
186
  * Adjusts an order total
182
187
  */
183
188
  adjustOrderTotal(requestParameters: AdjustOrderTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseResponse>;
189
+ /**
190
+ * Assigns an order to an affiliate.
191
+ * @summary Assigns an order to an affiliate
192
+ * @param {string} orderId The order id to assign to the affiliate.
193
+ * @param {OrderAssignToAffiliateRequest} assignToAffiliateRequest Assign to affiliate request
194
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
195
+ * @param {*} [options] Override http request option.
196
+ * @throws {RequiredError}
197
+ * @memberof OrderApiInterface
198
+ */
199
+ assignToAffiliateRaw(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderResponse>>;
200
+ /**
201
+ * Assigns an order to an affiliate.
202
+ * Assigns an order to an affiliate
203
+ */
204
+ assignToAffiliate(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderResponse>;
184
205
  /**
185
206
  * Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.
186
207
  * @summary Set a refund block on an order
@@ -661,6 +682,16 @@ export declare class OrderApi extends runtime.BaseAPI implements OrderApiInterfa
661
682
  * Adjusts an order total
662
683
  */
663
684
  adjustOrderTotal(requestParameters: AdjustOrderTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseResponse>;
685
+ /**
686
+ * Assigns an order to an affiliate.
687
+ * Assigns an order to an affiliate
688
+ */
689
+ assignToAffiliateRaw(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderResponse>>;
690
+ /**
691
+ * Assigns an order to an affiliate.
692
+ * Assigns an order to an affiliate
693
+ */
694
+ assignToAffiliate(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderResponse>;
664
695
  /**
665
696
  * Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.
666
697
  * Set a refund block on an order
@@ -137,6 +137,73 @@ var OrderApi = /** @class */ (function (_super) {
137
137
  });
138
138
  });
139
139
  };
140
+ /**
141
+ * Assigns an order to an affiliate.
142
+ * Assigns an order to an affiliate
143
+ */
144
+ OrderApi.prototype.assignToAffiliateRaw = function (requestParameters, initOverrides) {
145
+ return __awaiter(this, void 0, void 0, function () {
146
+ var queryParameters, headerParameters, _a, _b, response;
147
+ return __generator(this, function (_c) {
148
+ switch (_c.label) {
149
+ case 0:
150
+ if (requestParameters.orderId === null || requestParameters.orderId === undefined) {
151
+ throw new runtime.RequiredError('orderId', 'Required parameter requestParameters.orderId was null or undefined when calling assignToAffiliate.');
152
+ }
153
+ if (requestParameters.assignToAffiliateRequest === null || requestParameters.assignToAffiliateRequest === undefined) {
154
+ throw new runtime.RequiredError('assignToAffiliateRequest', 'Required parameter requestParameters.assignToAffiliateRequest was null or undefined when calling assignToAffiliate.');
155
+ }
156
+ queryParameters = {};
157
+ if (requestParameters.expand !== undefined) {
158
+ queryParameters['_expand'] = requestParameters.expand;
159
+ }
160
+ headerParameters = {};
161
+ headerParameters['Content-Type'] = 'application/json';
162
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
163
+ // oauth required
164
+ _a = headerParameters;
165
+ _b = "Authorization";
166
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["order_write"])];
167
+ case 1:
168
+ // oauth required
169
+ _a[_b] = _c.sent();
170
+ _c.label = 2;
171
+ case 2:
172
+ if (this.configuration && this.configuration.apiKey) {
173
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
174
+ }
175
+ return [4 /*yield*/, this.request({
176
+ path: "/order/orders/{order_id}/assignToAffiliate".replace("{".concat("order_id", "}"), encodeURIComponent(String(requestParameters.orderId))),
177
+ method: 'POST',
178
+ headers: headerParameters,
179
+ query: queryParameters,
180
+ body: (0, models_1.OrderAssignToAffiliateRequestToJSON)(requestParameters.assignToAffiliateRequest),
181
+ }, initOverrides)];
182
+ case 3:
183
+ response = _c.sent();
184
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.OrderResponseFromJSON)(jsonValue); })];
185
+ }
186
+ });
187
+ });
188
+ };
189
+ /**
190
+ * Assigns an order to an affiliate.
191
+ * Assigns an order to an affiliate
192
+ */
193
+ OrderApi.prototype.assignToAffiliate = function (requestParameters, initOverrides) {
194
+ return __awaiter(this, void 0, void 0, function () {
195
+ var response;
196
+ return __generator(this, function (_a) {
197
+ switch (_a.label) {
198
+ case 0: return [4 /*yield*/, this.assignToAffiliateRaw(requestParameters, initOverrides)];
199
+ case 1:
200
+ response = _a.sent();
201
+ return [4 /*yield*/, response.value()];
202
+ case 2: return [2 /*return*/, _a.sent()];
203
+ }
204
+ });
205
+ });
206
+ };
140
207
  /**
141
208
  * Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.
142
209
  * Set a refund block on an order
@@ -83,6 +83,12 @@ export interface ConversationMessage {
83
83
  * @memberof ConversationMessage
84
84
  */
85
85
  message_epoch?: number;
86
+ /**
87
+ *
88
+ * @type {string}
89
+ * @memberof ConversationMessage
90
+ */
91
+ message_type?: string;
86
92
  /**
87
93
  *
88
94
  * @type {Array<ConversationMessageTranslation>}
@@ -53,6 +53,7 @@ function ConversationMessageFromJSONTyped(json, ignoreDiscriminator) {
53
53
  'merchant_id': !(0, runtime_1.exists)(json, 'merchant_id') ? undefined : json['merchant_id'],
54
54
  'message_dts': !(0, runtime_1.exists)(json, 'message_dts') ? undefined : json['message_dts'],
55
55
  'message_epoch': !(0, runtime_1.exists)(json, 'message_epoch') ? undefined : json['message_epoch'],
56
+ 'message_type': !(0, runtime_1.exists)(json, 'message_type') ? undefined : json['message_type'],
56
57
  'translations': !(0, runtime_1.exists)(json, 'translations') ? undefined : (json['translations'].map(ConversationMessageTranslation_1.ConversationMessageTranslationFromJSON)),
57
58
  'transport_statuses': !(0, runtime_1.exists)(json, 'transport_statuses') ? undefined : (json['transport_statuses'].map(ConversationMessageTransportStatus_1.ConversationMessageTransportStatusFromJSON)),
58
59
  'type': !(0, runtime_1.exists)(json, 'type') ? undefined : json['type'],
@@ -79,6 +80,7 @@ function ConversationMessageToJSON(value) {
79
80
  'merchant_id': value.merchant_id,
80
81
  'message_dts': value.message_dts,
81
82
  'message_epoch': value.message_epoch,
83
+ 'message_type': value.message_type,
82
84
  'translations': value.translations === undefined ? undefined : (value.translations.map(ConversationMessageTranslation_1.ConversationMessageTranslationToJSON)),
83
85
  'transport_statuses': value.transport_statuses === undefined ? undefined : (value.transport_statuses.map(ConversationMessageTransportStatus_1.ConversationMessageTransportStatusToJSON)),
84
86
  'type': value.type,
@@ -34,6 +34,12 @@ export interface ConversationVirtualAgentCapabilities {
34
34
  * @memberof ConversationVirtualAgentCapabilities
35
35
  */
36
36
  delay_subscription?: boolean;
37
+ /**
38
+ * Permission flag to allow this Agent to generate coupons based upon the agent prompt instructions
39
+ * @type {boolean}
40
+ * @memberof ConversationVirtualAgentCapabilities
41
+ */
42
+ generate_coupon?: boolean;
37
43
  /**
38
44
  *
39
45
  * @type {boolean}
@@ -45,6 +45,7 @@ function ConversationVirtualAgentCapabilitiesFromJSONTyped(json, ignoreDiscrimin
45
45
  'access_storefront_and_item': !(0, runtime_1.exists)(json, 'access_storefront_and_item') ? undefined : json['access_storefront_and_item'],
46
46
  'cancel_subscription': !(0, runtime_1.exists)(json, 'cancel_subscription') ? undefined : json['cancel_subscription'],
47
47
  'delay_subscription': !(0, runtime_1.exists)(json, 'delay_subscription') ? undefined : json['delay_subscription'],
48
+ 'generate_coupon': !(0, runtime_1.exists)(json, 'generate_coupon') ? undefined : json['generate_coupon'],
48
49
  'lookup_order_information': !(0, runtime_1.exists)(json, 'lookup_order_information') ? undefined : json['lookup_order_information'],
49
50
  'lookup_subscription_information': !(0, runtime_1.exists)(json, 'lookup_subscription_information') ? undefined : json['lookup_subscription_information'],
50
51
  'open_support_ticket': !(0, runtime_1.exists)(json, 'open_support_ticket') ? undefined : json['open_support_ticket'],
@@ -71,6 +72,7 @@ function ConversationVirtualAgentCapabilitiesToJSON(value) {
71
72
  'access_storefront_and_item': value.access_storefront_and_item,
72
73
  'cancel_subscription': value.cancel_subscription,
73
74
  'delay_subscription': value.delay_subscription,
75
+ 'generate_coupon': value.generate_coupon,
74
76
  'lookup_order_information': value.lookup_order_information,
75
77
  'lookup_subscription_information': value.lookup_subscription_information,
76
78
  'open_support_ticket': value.open_support_ticket,
@@ -0,0 +1,43 @@
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 OrderAssignToAffiliateRequest
16
+ */
17
+ export interface OrderAssignToAffiliateRequest {
18
+ /**
19
+ * Affiliate email to associate with the order
20
+ * @type {string}
21
+ * @memberof OrderAssignToAffiliateRequest
22
+ */
23
+ affiliate_email?: string;
24
+ /**
25
+ * Affiliate id to associate with the order
26
+ * @type {number}
27
+ * @memberof OrderAssignToAffiliateRequest
28
+ */
29
+ affiliate_id?: number;
30
+ /**
31
+ * Affiliate sub id to associate with the order
32
+ * @type {string}
33
+ * @memberof OrderAssignToAffiliateRequest
34
+ */
35
+ affiliate_sub_id?: string;
36
+ }
37
+ /**
38
+ * Check if a given object implements the OrderAssignToAffiliateRequest interface.
39
+ */
40
+ export declare function instanceOfOrderAssignToAffiliateRequest(value: object): boolean;
41
+ export declare function OrderAssignToAffiliateRequestFromJSON(json: any): OrderAssignToAffiliateRequest;
42
+ export declare function OrderAssignToAffiliateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderAssignToAffiliateRequest;
43
+ export declare function OrderAssignToAffiliateRequestToJSON(value?: OrderAssignToAffiliateRequest | null): any;
@@ -0,0 +1,54 @@
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.OrderAssignToAffiliateRequestToJSON = exports.OrderAssignToAffiliateRequestFromJSONTyped = exports.OrderAssignToAffiliateRequestFromJSON = exports.instanceOfOrderAssignToAffiliateRequest = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ /**
19
+ * Check if a given object implements the OrderAssignToAffiliateRequest interface.
20
+ */
21
+ function instanceOfOrderAssignToAffiliateRequest(value) {
22
+ var isInstance = true;
23
+ return isInstance;
24
+ }
25
+ exports.instanceOfOrderAssignToAffiliateRequest = instanceOfOrderAssignToAffiliateRequest;
26
+ function OrderAssignToAffiliateRequestFromJSON(json) {
27
+ return OrderAssignToAffiliateRequestFromJSONTyped(json, false);
28
+ }
29
+ exports.OrderAssignToAffiliateRequestFromJSON = OrderAssignToAffiliateRequestFromJSON;
30
+ function OrderAssignToAffiliateRequestFromJSONTyped(json, ignoreDiscriminator) {
31
+ if ((json === undefined) || (json === null)) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'affiliate_email': !(0, runtime_1.exists)(json, 'affiliate_email') ? undefined : json['affiliate_email'],
36
+ 'affiliate_id': !(0, runtime_1.exists)(json, 'affiliate_id') ? undefined : json['affiliate_id'],
37
+ 'affiliate_sub_id': !(0, runtime_1.exists)(json, 'affiliate_sub_id') ? undefined : json['affiliate_sub_id'],
38
+ };
39
+ }
40
+ exports.OrderAssignToAffiliateRequestFromJSONTyped = OrderAssignToAffiliateRequestFromJSONTyped;
41
+ function OrderAssignToAffiliateRequestToJSON(value) {
42
+ if (value === undefined) {
43
+ return undefined;
44
+ }
45
+ if (value === null) {
46
+ return null;
47
+ }
48
+ return {
49
+ 'affiliate_email': value.affiliate_email,
50
+ 'affiliate_id': value.affiliate_id,
51
+ 'affiliate_sub_id': value.affiliate_sub_id,
52
+ };
53
+ }
54
+ exports.OrderAssignToAffiliateRequestToJSON = OrderAssignToAffiliateRequestToJSON;
@@ -649,6 +649,7 @@ export * from './OauthTokenResponse';
649
649
  export * from './Order';
650
650
  export * from './OrderAffiliate';
651
651
  export * from './OrderAffiliateLedger';
652
+ export * from './OrderAssignToAffiliateRequest';
652
653
  export * from './OrderAutoOrder';
653
654
  export * from './OrderBilling';
654
655
  export * from './OrderBuysafe';
@@ -667,6 +667,7 @@ __exportStar(require("./OauthTokenResponse"), exports);
667
667
  __exportStar(require("./Order"), exports);
668
668
  __exportStar(require("./OrderAffiliate"), exports);
669
669
  __exportStar(require("./OrderAffiliateLedger"), exports);
670
+ __exportStar(require("./OrderAssignToAffiliateRequest"), exports);
670
671
  __exportStar(require("./OrderAutoOrder"), exports);
671
672
  __exportStar(require("./OrderBilling"), exports);
672
673
  __exportStar(require("./OrderBuysafe"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultracart_rest_api_v2_typescript",
3
- "version": "4.1.27",
3
+ "version": "4.1.29",
4
4
  "description": "UltraCart Rest TypeScript SDK",
5
5
  "author": "UltraCart",
6
6
  "repository": {
@@ -33,6 +33,9 @@ import {
33
33
  Order,
34
34
  OrderFromJSON,
35
35
  OrderToJSON,
36
+ OrderAssignToAffiliateRequest,
37
+ OrderAssignToAffiliateRequestFromJSON,
38
+ OrderAssignToAffiliateRequestToJSON,
36
39
  OrderByTokenQuery,
37
40
  OrderByTokenQueryFromJSON,
38
41
  OrderByTokenQueryToJSON,
@@ -97,6 +100,12 @@ export interface AdjustOrderTotalRequest {
97
100
  desiredTotal: string;
98
101
  }
99
102
 
103
+ export interface AssignToAffiliateRequest {
104
+ orderId: string;
105
+ assignToAffiliateRequest: OrderAssignToAffiliateRequest;
106
+ expand?: string;
107
+ }
108
+
100
109
  export interface BlockRefundOnOrderRequest {
101
110
  orderId: string;
102
111
  blockReason?: string;
@@ -293,6 +302,24 @@ export interface OrderApiInterface {
293
302
  */
294
303
  adjustOrderTotal(requestParameters: AdjustOrderTotalRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<BaseResponse>;
295
304
 
305
+ /**
306
+ * Assigns an order to an affiliate.
307
+ * @summary Assigns an order to an affiliate
308
+ * @param {string} orderId The order id to assign to the affiliate.
309
+ * @param {OrderAssignToAffiliateRequest} assignToAffiliateRequest Assign to affiliate request
310
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
311
+ * @param {*} [options] Override http request option.
312
+ * @throws {RequiredError}
313
+ * @memberof OrderApiInterface
314
+ */
315
+ assignToAffiliateRaw(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderResponse>>;
316
+
317
+ /**
318
+ * Assigns an order to an affiliate.
319
+ * Assigns an order to an affiliate
320
+ */
321
+ assignToAffiliate(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderResponse>;
322
+
296
323
  /**
297
324
  * Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.
298
325
  * @summary Set a refund block on an order
@@ -868,6 +895,58 @@ export class OrderApi extends runtime.BaseAPI implements OrderApiInterface {
868
895
  return await response.value();
869
896
  }
870
897
 
898
+ /**
899
+ * Assigns an order to an affiliate.
900
+ * Assigns an order to an affiliate
901
+ */
902
+ async assignToAffiliateRaw(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderResponse>> {
903
+ if (requestParameters.orderId === null || requestParameters.orderId === undefined) {
904
+ throw new runtime.RequiredError('orderId','Required parameter requestParameters.orderId was null or undefined when calling assignToAffiliate.');
905
+ }
906
+
907
+ if (requestParameters.assignToAffiliateRequest === null || requestParameters.assignToAffiliateRequest === undefined) {
908
+ throw new runtime.RequiredError('assignToAffiliateRequest','Required parameter requestParameters.assignToAffiliateRequest was null or undefined when calling assignToAffiliate.');
909
+ }
910
+
911
+ const queryParameters: any = {};
912
+
913
+ if (requestParameters.expand !== undefined) {
914
+ queryParameters['_expand'] = requestParameters.expand;
915
+ }
916
+
917
+ const headerParameters: runtime.HTTPHeaders = {};
918
+
919
+ headerParameters['Content-Type'] = 'application/json';
920
+
921
+ if (this.configuration && this.configuration.accessToken) {
922
+ // oauth required
923
+ headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["order_write"]);
924
+ }
925
+
926
+ if (this.configuration && this.configuration.apiKey) {
927
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
928
+ }
929
+
930
+ const response = await this.request({
931
+ path: `/order/orders/{order_id}/assignToAffiliate`.replace(`{${"order_id"}}`, encodeURIComponent(String(requestParameters.orderId))),
932
+ method: 'POST',
933
+ headers: headerParameters,
934
+ query: queryParameters,
935
+ body: OrderAssignToAffiliateRequestToJSON(requestParameters.assignToAffiliateRequest),
936
+ }, initOverrides);
937
+
938
+ return new runtime.JSONApiResponse(response, (jsonValue) => OrderResponseFromJSON(jsonValue));
939
+ }
940
+
941
+ /**
942
+ * Assigns an order to an affiliate.
943
+ * Assigns an order to an affiliate
944
+ */
945
+ async assignToAffiliate(requestParameters: AssignToAffiliateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OrderResponse> {
946
+ const response = await this.assignToAffiliateRaw(requestParameters, initOverrides);
947
+ return await response.value();
948
+ }
949
+
871
950
  /**
872
951
  * Sets a refund block on an order to prevent a user from performing a refund. Commonly used when a chargeback has been received.
873
952
  * Set a refund block on an order
@@ -98,6 +98,12 @@ export interface ConversationMessage {
98
98
  * @memberof ConversationMessage
99
99
  */
100
100
  message_epoch?: number;
101
+ /**
102
+ *
103
+ * @type {string}
104
+ * @memberof ConversationMessage
105
+ */
106
+ message_type?: string;
101
107
  /**
102
108
  *
103
109
  * @type {Array<ConversationMessageTranslation>}
@@ -167,6 +173,7 @@ export function ConversationMessageFromJSONTyped(json: any, ignoreDiscriminator:
167
173
  'merchant_id': !exists(json, 'merchant_id') ? undefined : json['merchant_id'],
168
174
  'message_dts': !exists(json, 'message_dts') ? undefined : json['message_dts'],
169
175
  'message_epoch': !exists(json, 'message_epoch') ? undefined : json['message_epoch'],
176
+ 'message_type': !exists(json, 'message_type') ? undefined : json['message_type'],
170
177
  'translations': !exists(json, 'translations') ? undefined : ((json['translations'] as Array<any>).map(ConversationMessageTranslationFromJSON)),
171
178
  'transport_statuses': !exists(json, 'transport_statuses') ? undefined : ((json['transport_statuses'] as Array<any>).map(ConversationMessageTransportStatusFromJSON)),
172
179
  'type': !exists(json, 'type') ? undefined : json['type'],
@@ -194,6 +201,7 @@ export function ConversationMessageToJSON(value?: ConversationMessage | null): a
194
201
  'merchant_id': value.merchant_id,
195
202
  'message_dts': value.message_dts,
196
203
  'message_epoch': value.message_epoch,
204
+ 'message_type': value.message_type,
197
205
  'translations': value.translations === undefined ? undefined : ((value.translations as Array<any>).map(ConversationMessageTranslationToJSON)),
198
206
  'transport_statuses': value.transport_statuses === undefined ? undefined : ((value.transport_statuses as Array<any>).map(ConversationMessageTransportStatusToJSON)),
199
207
  'type': value.type,
@@ -44,6 +44,12 @@ export interface ConversationVirtualAgentCapabilities {
44
44
  * @memberof ConversationVirtualAgentCapabilities
45
45
  */
46
46
  delay_subscription?: boolean;
47
+ /**
48
+ * Permission flag to allow this Agent to generate coupons based upon the agent prompt instructions
49
+ * @type {boolean}
50
+ * @memberof ConversationVirtualAgentCapabilities
51
+ */
52
+ generate_coupon?: boolean;
47
53
  /**
48
54
  *
49
55
  * @type {boolean}
@@ -154,6 +160,7 @@ export function ConversationVirtualAgentCapabilitiesFromJSONTyped(json: any, ign
154
160
  'access_storefront_and_item': !exists(json, 'access_storefront_and_item') ? undefined : json['access_storefront_and_item'],
155
161
  'cancel_subscription': !exists(json, 'cancel_subscription') ? undefined : json['cancel_subscription'],
156
162
  'delay_subscription': !exists(json, 'delay_subscription') ? undefined : json['delay_subscription'],
163
+ 'generate_coupon': !exists(json, 'generate_coupon') ? undefined : json['generate_coupon'],
157
164
  'lookup_order_information': !exists(json, 'lookup_order_information') ? undefined : json['lookup_order_information'],
158
165
  'lookup_subscription_information': !exists(json, 'lookup_subscription_information') ? undefined : json['lookup_subscription_information'],
159
166
  'open_support_ticket': !exists(json, 'open_support_ticket') ? undefined : json['open_support_ticket'],
@@ -181,6 +188,7 @@ export function ConversationVirtualAgentCapabilitiesToJSON(value?: ConversationV
181
188
  'access_storefront_and_item': value.access_storefront_and_item,
182
189
  'cancel_subscription': value.cancel_subscription,
183
190
  'delay_subscription': value.delay_subscription,
191
+ 'generate_coupon': value.generate_coupon,
184
192
  'lookup_order_information': value.lookup_order_information,
185
193
  'lookup_subscription_information': value.lookup_subscription_information,
186
194
  'open_support_ticket': value.open_support_ticket,
@@ -0,0 +1,83 @@
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 OrderAssignToAffiliateRequest
20
+ */
21
+ export interface OrderAssignToAffiliateRequest {
22
+ /**
23
+ * Affiliate email to associate with the order
24
+ * @type {string}
25
+ * @memberof OrderAssignToAffiliateRequest
26
+ */
27
+ affiliate_email?: string;
28
+ /**
29
+ * Affiliate id to associate with the order
30
+ * @type {number}
31
+ * @memberof OrderAssignToAffiliateRequest
32
+ */
33
+ affiliate_id?: number;
34
+ /**
35
+ * Affiliate sub id to associate with the order
36
+ * @type {string}
37
+ * @memberof OrderAssignToAffiliateRequest
38
+ */
39
+ affiliate_sub_id?: string;
40
+ }
41
+
42
+
43
+
44
+ /**
45
+ * Check if a given object implements the OrderAssignToAffiliateRequest interface.
46
+ */
47
+ export function instanceOfOrderAssignToAffiliateRequest(value: object): boolean {
48
+ let isInstance = true;
49
+
50
+ return isInstance;
51
+ }
52
+
53
+ export function OrderAssignToAffiliateRequestFromJSON(json: any): OrderAssignToAffiliateRequest {
54
+ return OrderAssignToAffiliateRequestFromJSONTyped(json, false);
55
+ }
56
+
57
+ export function OrderAssignToAffiliateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OrderAssignToAffiliateRequest {
58
+ if ((json === undefined) || (json === null)) {
59
+ return json;
60
+ }
61
+ return {
62
+
63
+ 'affiliate_email': !exists(json, 'affiliate_email') ? undefined : json['affiliate_email'],
64
+ 'affiliate_id': !exists(json, 'affiliate_id') ? undefined : json['affiliate_id'],
65
+ 'affiliate_sub_id': !exists(json, 'affiliate_sub_id') ? undefined : json['affiliate_sub_id'],
66
+ };
67
+ }
68
+
69
+ export function OrderAssignToAffiliateRequestToJSON(value?: OrderAssignToAffiliateRequest | null): any {
70
+ if (value === undefined) {
71
+ return undefined;
72
+ }
73
+ if (value === null) {
74
+ return null;
75
+ }
76
+ return {
77
+
78
+ 'affiliate_email': value.affiliate_email,
79
+ 'affiliate_id': value.affiliate_id,
80
+ 'affiliate_sub_id': value.affiliate_sub_id,
81
+ };
82
+ }
83
+
@@ -651,6 +651,7 @@ export * from './OauthTokenResponse';
651
651
  export * from './Order';
652
652
  export * from './OrderAffiliate';
653
653
  export * from './OrderAffiliateLedger';
654
+ export * from './OrderAssignToAffiliateRequest';
654
655
  export * from './OrderAutoOrder';
655
656
  export * from './OrderBilling';
656
657
  export * from './OrderBuysafe';