ultracart_rest_api_v2_typescript 4.1.121 → 4.1.122

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.
@@ -74,10 +74,12 @@ src/models/AutoOrderItemOption.ts
74
74
  src/models/AutoOrderItemSimpleSchedule.ts
75
75
  src/models/AutoOrderLog.ts
76
76
  src/models/AutoOrderManagement.ts
77
+ src/models/AutoOrderPaymentUpdateRequest.ts
77
78
  src/models/AutoOrderPropertiesUpdateRequest.ts
78
79
  src/models/AutoOrderProperty.ts
79
80
  src/models/AutoOrderQuery.ts
80
81
  src/models/AutoOrderQueryBatch.ts
82
+ src/models/AutoOrderRebillResponse.ts
81
83
  src/models/AutoOrderResponse.ts
82
84
  src/models/AutoOrdersRequest.ts
83
85
  src/models/AutoOrdersResponse.ts
package/README.md CHANGED
@@ -1,12 +1,12 @@
1
1
  # UltraCart Typescript SDK
2
- ## ultracart_rest_api_v2_typescript@4.1.121
2
+ ## ultracart_rest_api_v2_typescript@4.1.122
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.121 --save
9
+ npm install ultracart_rest_api_v2_typescript@4.1.122 --save
10
10
  ```
11
11
 
12
12
  ```typescript
@@ -85,6 +85,7 @@ Not every change is committed to every SDK.
85
85
 
86
86
  | Version | Date | Comments |
87
87
  | --: | :-: | --- |
88
+ | 4.1.122 | 07/29/2026 | auto order api - new methods for payment information and rebill |
88
89
  | 4.1.121 | 07/15/2026 | storefront - parameter to include details on dispatch log methods |
89
90
  | 4.1.120 | 07/15/2026 | storefront - parameter to include details on dispatch log methods |
90
91
  | 4.1.119 | 07/15/2026 | order api - query transaction details for cache target |
@@ -10,7 +10,11 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import { AutoOrder, AutoOrderAddonItemsUpdateRequest, AutoOrderCancelReasonsResponse, AutoOrderConsolidate, AutoOrderEmailsResponse, AutoOrderItemCancelRequest, AutoOrderPropertiesUpdateRequest, AutoOrderQuery, AutoOrderQueryBatch, AutoOrderResponse, AutoOrdersRequest, AutoOrdersResponse } from '../models';
13
+ import { AutoOrder, AutoOrderAddonItemsUpdateRequest, AutoOrderCancelReasonsResponse, AutoOrderConsolidate, AutoOrderEmailsResponse, AutoOrderItemCancelRequest, AutoOrderPaymentUpdateRequest, AutoOrderPropertiesUpdateRequest, AutoOrderQuery, AutoOrderQueryBatch, AutoOrderRebillResponse, AutoOrderResponse, AutoOrdersRequest, AutoOrdersResponse } from '../models';
14
+ export interface AttemptAutoOrderRebillRequest {
15
+ autoOrderOid: number;
16
+ expand?: string;
17
+ }
14
18
  export interface CancelAutoOrderItemByReferenceOrderIdRequest {
15
19
  referenceOrderId: string;
16
20
  originalItemId: string;
@@ -100,6 +104,11 @@ export interface UpdateAutoOrderItemPropertiesRequest {
100
104
  autoOrderPropertiesUpdateRequest: AutoOrderPropertiesUpdateRequest;
101
105
  expand?: string;
102
106
  }
107
+ export interface UpdateAutoOrderPaymentRequest {
108
+ autoOrderOid: number;
109
+ autoOrderPaymentUpdateRequest: AutoOrderPaymentUpdateRequest;
110
+ expand?: string;
111
+ }
103
112
  export interface UpdateAutoOrderPropertiesRequest {
104
113
  autoOrderOid: number;
105
114
  autoOrderPropertiesUpdateRequest: AutoOrderPropertiesUpdateRequest;
@@ -118,6 +127,21 @@ export interface UpdateAutoOrdersBatchRequest {
118
127
  * @interface AutoOrderApiInterface
119
128
  */
120
129
  export interface AutoOrderApiInterface {
130
+ /**
131
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
132
+ * @summary Attempt a failed rebill on an auto order
133
+ * @param {number} autoOrderOid The auto order oid to rebill.
134
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
135
+ * @param {*} [options] Override http request option.
136
+ * @throws {RequiredError}
137
+ * @memberof AutoOrderApiInterface
138
+ */
139
+ attemptAutoOrderRebillRaw(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>>;
140
+ /**
141
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
142
+ * Attempt a failed rebill on an auto order
143
+ */
144
+ attemptAutoOrderRebill(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse>;
121
145
  /**
122
146
  * Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
123
147
  * @summary Cancel a single item on an auto order
@@ -374,6 +398,22 @@ export interface AutoOrderApiInterface {
374
398
  * Update an auto order item properties
375
399
  */
376
400
  updateAutoOrderItemProperties(requestParameters: UpdateAutoOrderItemPropertiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
401
+ /**
402
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
403
+ * @summary Update the payment information on an auto order
404
+ * @param {number} autoOrderOid The auto order oid to update payment information on.
405
+ * @param {AutoOrderPaymentUpdateRequest} autoOrderPaymentUpdateRequest Payment information to place on the auto order
406
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
407
+ * @param {*} [options] Override http request option.
408
+ * @throws {RequiredError}
409
+ * @memberof AutoOrderApiInterface
410
+ */
411
+ updateAutoOrderPaymentRaw(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>>;
412
+ /**
413
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
414
+ * Update the payment information on an auto order
415
+ */
416
+ updateAutoOrderPayment(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse>;
377
417
  /**
378
418
  * Update an auto order properties. Returns the auto order based upon expansion
379
419
  * @summary Update an auto order properties
@@ -412,6 +452,16 @@ export interface AutoOrderApiInterface {
412
452
  *
413
453
  */
414
454
  export declare class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterface {
455
+ /**
456
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
457
+ * Attempt a failed rebill on an auto order
458
+ */
459
+ attemptAutoOrderRebillRaw(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>>;
460
+ /**
461
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
462
+ * Attempt a failed rebill on an auto order
463
+ */
464
+ attemptAutoOrderRebill(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse>;
415
465
  /**
416
466
  * Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
417
467
  * Cancel a single item on an auto order
@@ -562,6 +612,16 @@ export declare class AutoOrderApi extends runtime.BaseAPI implements AutoOrderAp
562
612
  * Update an auto order item properties
563
613
  */
564
614
  updateAutoOrderItemProperties(requestParameters: UpdateAutoOrderItemPropertiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
615
+ /**
616
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
617
+ * Update the payment information on an auto order
618
+ */
619
+ updateAutoOrderPaymentRaw(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>>;
620
+ /**
621
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
622
+ * Update the payment information on an auto order
623
+ */
624
+ updateAutoOrderPayment(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse>;
565
625
  /**
566
626
  * Update an auto order properties. Returns the auto order based upon expansion
567
627
  * Update an auto order properties
@@ -75,6 +75,68 @@ var AutoOrderApi = /** @class */ (function (_super) {
75
75
  function AutoOrderApi() {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
+ /**
79
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
80
+ * Attempt a failed rebill on an auto order
81
+ */
82
+ AutoOrderApi.prototype.attemptAutoOrderRebillRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, response;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (requestParameters.autoOrderOid === null || requestParameters.autoOrderOid === undefined) {
89
+ throw new runtime.RequiredError('autoOrderOid', 'Required parameter requestParameters.autoOrderOid was null or undefined when calling attemptAutoOrderRebill.');
90
+ }
91
+ queryParameters = {};
92
+ if (requestParameters.expand !== undefined) {
93
+ queryParameters['_expand'] = requestParameters.expand;
94
+ }
95
+ headerParameters = {};
96
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
97
+ // oauth required
98
+ _a = headerParameters;
99
+ _b = "Authorization";
100
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["auto_order_write"])];
101
+ case 1:
102
+ // oauth required
103
+ _a[_b] = _c.sent();
104
+ _c.label = 2;
105
+ case 2:
106
+ if (this.configuration && this.configuration.apiKey) {
107
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
108
+ }
109
+ return [4 /*yield*/, this.request({
110
+ path: "/auto_order/auto_orders/{auto_order_oid}/rebill".replace("{".concat("auto_order_oid", "}"), encodeURIComponent(String(requestParameters.autoOrderOid))),
111
+ method: 'POST',
112
+ headers: headerParameters,
113
+ query: queryParameters,
114
+ }, initOverrides)];
115
+ case 3:
116
+ response = _c.sent();
117
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.AutoOrderRebillResponseFromJSON)(jsonValue); })];
118
+ }
119
+ });
120
+ });
121
+ };
122
+ /**
123
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
124
+ * Attempt a failed rebill on an auto order
125
+ */
126
+ AutoOrderApi.prototype.attemptAutoOrderRebill = function (requestParameters, initOverrides) {
127
+ return __awaiter(this, void 0, void 0, function () {
128
+ var response;
129
+ return __generator(this, function (_a) {
130
+ switch (_a.label) {
131
+ case 0: return [4 /*yield*/, this.attemptAutoOrderRebillRaw(requestParameters, initOverrides)];
132
+ case 1:
133
+ response = _a.sent();
134
+ return [4 /*yield*/, response.value()];
135
+ case 2: return [2 /*return*/, _a.sent()];
136
+ }
137
+ });
138
+ });
139
+ };
78
140
  /**
79
141
  * Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
80
142
  * Cancel a single item on an auto order
@@ -1112,6 +1174,73 @@ var AutoOrderApi = /** @class */ (function (_super) {
1112
1174
  });
1113
1175
  });
1114
1176
  };
1177
+ /**
1178
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
1179
+ * Update the payment information on an auto order
1180
+ */
1181
+ AutoOrderApi.prototype.updateAutoOrderPaymentRaw = function (requestParameters, initOverrides) {
1182
+ return __awaiter(this, void 0, void 0, function () {
1183
+ var queryParameters, headerParameters, _a, _b, response;
1184
+ return __generator(this, function (_c) {
1185
+ switch (_c.label) {
1186
+ case 0:
1187
+ if (requestParameters.autoOrderOid === null || requestParameters.autoOrderOid === undefined) {
1188
+ throw new runtime.RequiredError('autoOrderOid', 'Required parameter requestParameters.autoOrderOid was null or undefined when calling updateAutoOrderPayment.');
1189
+ }
1190
+ if (requestParameters.autoOrderPaymentUpdateRequest === null || requestParameters.autoOrderPaymentUpdateRequest === undefined) {
1191
+ throw new runtime.RequiredError('autoOrderPaymentUpdateRequest', 'Required parameter requestParameters.autoOrderPaymentUpdateRequest was null or undefined when calling updateAutoOrderPayment.');
1192
+ }
1193
+ queryParameters = {};
1194
+ if (requestParameters.expand !== undefined) {
1195
+ queryParameters['_expand'] = requestParameters.expand;
1196
+ }
1197
+ headerParameters = {};
1198
+ headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
1199
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
1200
+ // oauth required
1201
+ _a = headerParameters;
1202
+ _b = "Authorization";
1203
+ return [4 /*yield*/, this.configuration.accessToken("ultraCartOauth", ["auto_order_write"])];
1204
+ case 1:
1205
+ // oauth required
1206
+ _a[_b] = _c.sent();
1207
+ _c.label = 2;
1208
+ case 2:
1209
+ if (this.configuration && this.configuration.apiKey) {
1210
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
1211
+ }
1212
+ return [4 /*yield*/, this.request({
1213
+ path: "/auto_order/auto_orders/{auto_order_oid}/payment".replace("{".concat("auto_order_oid", "}"), encodeURIComponent(String(requestParameters.autoOrderOid))),
1214
+ method: 'PUT',
1215
+ headers: headerParameters,
1216
+ query: queryParameters,
1217
+ body: (0, models_1.AutoOrderPaymentUpdateRequestToJSON)(requestParameters.autoOrderPaymentUpdateRequest),
1218
+ }, initOverrides)];
1219
+ case 3:
1220
+ response = _c.sent();
1221
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, models_1.AutoOrderRebillResponseFromJSON)(jsonValue); })];
1222
+ }
1223
+ });
1224
+ });
1225
+ };
1226
+ /**
1227
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
1228
+ * Update the payment information on an auto order
1229
+ */
1230
+ AutoOrderApi.prototype.updateAutoOrderPayment = function (requestParameters, initOverrides) {
1231
+ return __awaiter(this, void 0, void 0, function () {
1232
+ var response;
1233
+ return __generator(this, function (_a) {
1234
+ switch (_a.label) {
1235
+ case 0: return [4 /*yield*/, this.updateAutoOrderPaymentRaw(requestParameters, initOverrides)];
1236
+ case 1:
1237
+ response = _a.sent();
1238
+ return [4 /*yield*/, response.value()];
1239
+ case 2: return [2 /*return*/, _a.sent()];
1240
+ }
1241
+ });
1242
+ });
1243
+ };
1115
1244
  /**
1116
1245
  * Update an auto order properties. Returns the auto order based upon expansion
1117
1246
  * Update an auto order properties
@@ -0,0 +1,73 @@
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 AutoOrderPaymentUpdateRequest
16
+ */
17
+ export interface AutoOrderPaymentUpdateRequest {
18
+ /**
19
+ * Attempt to rebill the auto order immediately after the payment information is updated. Defaults to false.
20
+ * @type {boolean}
21
+ * @memberof AutoOrderPaymentUpdateRequest
22
+ */
23
+ attempt_rebill?: boolean;
24
+ /**
25
+ * Card expiration month (1-12)
26
+ * @type {number}
27
+ * @memberof AutoOrderPaymentUpdateRequest
28
+ */
29
+ card_expiration_month?: number;
30
+ /**
31
+ * Card expiration year (four digit)
32
+ * @type {number}
33
+ * @memberof AutoOrderPaymentUpdateRequest
34
+ */
35
+ card_expiration_year?: number;
36
+ /**
37
+ * Hosted field token for the credit card number. Tokens are valid for two hours.
38
+ * @type {string}
39
+ * @memberof AutoOrderPaymentUpdateRequest
40
+ */
41
+ card_number_token?: string;
42
+ /**
43
+ * Credit card type. Optional. When the hosted field token carries the card type, the token wins.
44
+ * @type {string}
45
+ * @memberof AutoOrderPaymentUpdateRequest
46
+ */
47
+ card_type?: AutoOrderPaymentUpdateRequestCardTypeEnum;
48
+ /**
49
+ * Hosted field token for the card verification number (CVV). Required when the order has a vaulted card that must be re-vaulted.
50
+ * @type {string}
51
+ * @memberof AutoOrderPaymentUpdateRequest
52
+ */
53
+ card_verification_number_token?: string;
54
+ }
55
+ /**
56
+ * @export
57
+ */
58
+ export declare const AutoOrderPaymentUpdateRequestCardTypeEnum: {
59
+ readonly Amex: "AMEX";
60
+ readonly DinersClub: "Diners Club";
61
+ readonly Discover: "Discover";
62
+ readonly Jcb: "JCB";
63
+ readonly MasterCard: "MasterCard";
64
+ readonly Visa: "VISA";
65
+ };
66
+ export type AutoOrderPaymentUpdateRequestCardTypeEnum = typeof AutoOrderPaymentUpdateRequestCardTypeEnum[keyof typeof AutoOrderPaymentUpdateRequestCardTypeEnum];
67
+ /**
68
+ * Check if a given object implements the AutoOrderPaymentUpdateRequest interface.
69
+ */
70
+ export declare function instanceOfAutoOrderPaymentUpdateRequest(value: object): boolean;
71
+ export declare function AutoOrderPaymentUpdateRequestFromJSON(json: any): AutoOrderPaymentUpdateRequest;
72
+ export declare function AutoOrderPaymentUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoOrderPaymentUpdateRequest;
73
+ export declare function AutoOrderPaymentUpdateRequestToJSON(value?: AutoOrderPaymentUpdateRequest | null): any;
@@ -0,0 +1,71 @@
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.AutoOrderPaymentUpdateRequestToJSON = exports.AutoOrderPaymentUpdateRequestFromJSONTyped = exports.AutoOrderPaymentUpdateRequestFromJSON = exports.instanceOfAutoOrderPaymentUpdateRequest = exports.AutoOrderPaymentUpdateRequestCardTypeEnum = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ /**
19
+ * @export
20
+ */
21
+ exports.AutoOrderPaymentUpdateRequestCardTypeEnum = {
22
+ Amex: 'AMEX',
23
+ DinersClub: 'Diners Club',
24
+ Discover: 'Discover',
25
+ Jcb: 'JCB',
26
+ MasterCard: 'MasterCard',
27
+ Visa: 'VISA'
28
+ };
29
+ /**
30
+ * Check if a given object implements the AutoOrderPaymentUpdateRequest interface.
31
+ */
32
+ function instanceOfAutoOrderPaymentUpdateRequest(value) {
33
+ var isInstance = true;
34
+ return isInstance;
35
+ }
36
+ exports.instanceOfAutoOrderPaymentUpdateRequest = instanceOfAutoOrderPaymentUpdateRequest;
37
+ function AutoOrderPaymentUpdateRequestFromJSON(json) {
38
+ return AutoOrderPaymentUpdateRequestFromJSONTyped(json, false);
39
+ }
40
+ exports.AutoOrderPaymentUpdateRequestFromJSON = AutoOrderPaymentUpdateRequestFromJSON;
41
+ function AutoOrderPaymentUpdateRequestFromJSONTyped(json, ignoreDiscriminator) {
42
+ if ((json === undefined) || (json === null)) {
43
+ return json;
44
+ }
45
+ return {
46
+ 'attempt_rebill': !(0, runtime_1.exists)(json, 'attempt_rebill') ? undefined : json['attempt_rebill'],
47
+ 'card_expiration_month': !(0, runtime_1.exists)(json, 'card_expiration_month') ? undefined : json['card_expiration_month'],
48
+ 'card_expiration_year': !(0, runtime_1.exists)(json, 'card_expiration_year') ? undefined : json['card_expiration_year'],
49
+ 'card_number_token': !(0, runtime_1.exists)(json, 'card_number_token') ? undefined : json['card_number_token'],
50
+ 'card_type': !(0, runtime_1.exists)(json, 'card_type') ? undefined : json['card_type'],
51
+ 'card_verification_number_token': !(0, runtime_1.exists)(json, 'card_verification_number_token') ? undefined : json['card_verification_number_token'],
52
+ };
53
+ }
54
+ exports.AutoOrderPaymentUpdateRequestFromJSONTyped = AutoOrderPaymentUpdateRequestFromJSONTyped;
55
+ function AutoOrderPaymentUpdateRequestToJSON(value) {
56
+ if (value === undefined) {
57
+ return undefined;
58
+ }
59
+ if (value === null) {
60
+ return null;
61
+ }
62
+ return {
63
+ 'attempt_rebill': value.attempt_rebill,
64
+ 'card_expiration_month': value.card_expiration_month,
65
+ 'card_expiration_year': value.card_expiration_year,
66
+ 'card_number_token': value.card_number_token,
67
+ 'card_type': value.card_type,
68
+ 'card_verification_number_token': value.card_verification_number_token,
69
+ };
70
+ }
71
+ exports.AutoOrderPaymentUpdateRequestToJSON = AutoOrderPaymentUpdateRequestToJSON;
@@ -0,0 +1,83 @@
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
+ import { AutoOrder } from './AutoOrder';
13
+ import { ModelError } from './ModelError';
14
+ import { ResponseMetadata } from './ResponseMetadata';
15
+ import { Warning } from './Warning';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface AutoOrderRebillResponse
20
+ */
21
+ export interface AutoOrderRebillResponse {
22
+ /**
23
+ *
24
+ * @type {AutoOrder}
25
+ * @memberof AutoOrderRebillResponse
26
+ */
27
+ auto_order?: AutoOrder;
28
+ /**
29
+ *
30
+ * @type {ModelError}
31
+ * @memberof AutoOrderRebillResponse
32
+ */
33
+ error?: ModelError;
34
+ /**
35
+ * Why the rebill attempt did not succeed
36
+ * @type {string}
37
+ * @memberof AutoOrderRebillResponse
38
+ */
39
+ failure_reason?: string;
40
+ /**
41
+ *
42
+ * @type {ResponseMetadata}
43
+ * @memberof AutoOrderRebillResponse
44
+ */
45
+ metadata?: ResponseMetadata;
46
+ /**
47
+ * True if a rebill was attempted during this call
48
+ * @type {boolean}
49
+ * @memberof AutoOrderRebillResponse
50
+ */
51
+ rebill_attempted?: boolean;
52
+ /**
53
+ * The order id created by a successful rebill
54
+ * @type {string}
55
+ * @memberof AutoOrderRebillResponse
56
+ */
57
+ rebill_order_id?: string;
58
+ /**
59
+ * True if the rebill attempt produced an order
60
+ * @type {boolean}
61
+ * @memberof AutoOrderRebillResponse
62
+ */
63
+ rebill_success?: boolean;
64
+ /**
65
+ * Indicates if API call was successful
66
+ * @type {boolean}
67
+ * @memberof AutoOrderRebillResponse
68
+ */
69
+ success?: boolean;
70
+ /**
71
+ *
72
+ * @type {Warning}
73
+ * @memberof AutoOrderRebillResponse
74
+ */
75
+ warning?: Warning;
76
+ }
77
+ /**
78
+ * Check if a given object implements the AutoOrderRebillResponse interface.
79
+ */
80
+ export declare function instanceOfAutoOrderRebillResponse(value: object): boolean;
81
+ export declare function AutoOrderRebillResponseFromJSON(json: any): AutoOrderRebillResponse;
82
+ export declare function AutoOrderRebillResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoOrderRebillResponse;
83
+ export declare function AutoOrderRebillResponseToJSON(value?: AutoOrderRebillResponse | null): any;
@@ -0,0 +1,70 @@
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.AutoOrderRebillResponseToJSON = exports.AutoOrderRebillResponseFromJSONTyped = exports.AutoOrderRebillResponseFromJSON = exports.instanceOfAutoOrderRebillResponse = void 0;
17
+ var runtime_1 = require("../runtime");
18
+ var AutoOrder_1 = require("./AutoOrder");
19
+ var ModelError_1 = require("./ModelError");
20
+ var ResponseMetadata_1 = require("./ResponseMetadata");
21
+ var Warning_1 = require("./Warning");
22
+ /**
23
+ * Check if a given object implements the AutoOrderRebillResponse interface.
24
+ */
25
+ function instanceOfAutoOrderRebillResponse(value) {
26
+ var isInstance = true;
27
+ return isInstance;
28
+ }
29
+ exports.instanceOfAutoOrderRebillResponse = instanceOfAutoOrderRebillResponse;
30
+ function AutoOrderRebillResponseFromJSON(json) {
31
+ return AutoOrderRebillResponseFromJSONTyped(json, false);
32
+ }
33
+ exports.AutoOrderRebillResponseFromJSON = AutoOrderRebillResponseFromJSON;
34
+ function AutoOrderRebillResponseFromJSONTyped(json, ignoreDiscriminator) {
35
+ if ((json === undefined) || (json === null)) {
36
+ return json;
37
+ }
38
+ return {
39
+ 'auto_order': !(0, runtime_1.exists)(json, 'auto_order') ? undefined : (0, AutoOrder_1.AutoOrderFromJSON)(json['auto_order']),
40
+ 'error': !(0, runtime_1.exists)(json, 'error') ? undefined : (0, ModelError_1.ModelErrorFromJSON)(json['error']),
41
+ 'failure_reason': !(0, runtime_1.exists)(json, 'failure_reason') ? undefined : json['failure_reason'],
42
+ 'metadata': !(0, runtime_1.exists)(json, 'metadata') ? undefined : (0, ResponseMetadata_1.ResponseMetadataFromJSON)(json['metadata']),
43
+ 'rebill_attempted': !(0, runtime_1.exists)(json, 'rebill_attempted') ? undefined : json['rebill_attempted'],
44
+ 'rebill_order_id': !(0, runtime_1.exists)(json, 'rebill_order_id') ? undefined : json['rebill_order_id'],
45
+ 'rebill_success': !(0, runtime_1.exists)(json, 'rebill_success') ? undefined : json['rebill_success'],
46
+ 'success': !(0, runtime_1.exists)(json, 'success') ? undefined : json['success'],
47
+ 'warning': !(0, runtime_1.exists)(json, 'warning') ? undefined : (0, Warning_1.WarningFromJSON)(json['warning']),
48
+ };
49
+ }
50
+ exports.AutoOrderRebillResponseFromJSONTyped = AutoOrderRebillResponseFromJSONTyped;
51
+ function AutoOrderRebillResponseToJSON(value) {
52
+ if (value === undefined) {
53
+ return undefined;
54
+ }
55
+ if (value === null) {
56
+ return null;
57
+ }
58
+ return {
59
+ 'auto_order': (0, AutoOrder_1.AutoOrderToJSON)(value.auto_order),
60
+ 'error': (0, ModelError_1.ModelErrorToJSON)(value.error),
61
+ 'failure_reason': value.failure_reason,
62
+ 'metadata': (0, ResponseMetadata_1.ResponseMetadataToJSON)(value.metadata),
63
+ 'rebill_attempted': value.rebill_attempted,
64
+ 'rebill_order_id': value.rebill_order_id,
65
+ 'rebill_success': value.rebill_success,
66
+ 'success': value.success,
67
+ 'warning': (0, Warning_1.WarningToJSON)(value.warning),
68
+ };
69
+ }
70
+ exports.AutoOrderRebillResponseToJSON = AutoOrderRebillResponseToJSON;
@@ -33,6 +33,12 @@ export interface EmailSettings {
33
33
  * @memberof EmailSettings
34
34
  */
35
35
  emails_per_month?: number;
36
+ /**
37
+ * If machine open should be ignored
38
+ * @type {boolean}
39
+ * @memberof EmailSettings
40
+ */
41
+ machine_open_ignore?: boolean;
36
42
  /**
37
43
  *
38
44
  * @type {string}
@@ -35,6 +35,7 @@ function EmailSettingsFromJSONTyped(json, ignoreDiscriminator) {
35
35
  'emails_per_day': !(0, runtime_1.exists)(json, 'emails_per_day') ? undefined : json['emails_per_day'],
36
36
  'emails_per_hour': !(0, runtime_1.exists)(json, 'emails_per_hour') ? undefined : json['emails_per_hour'],
37
37
  'emails_per_month': !(0, runtime_1.exists)(json, 'emails_per_month') ? undefined : json['emails_per_month'],
38
+ 'machine_open_ignore': !(0, runtime_1.exists)(json, 'machine_open_ignore') ? undefined : json['machine_open_ignore'],
38
39
  'marketing_esp_domain_user': !(0, runtime_1.exists)(json, 'marketing_esp_domain_user') ? undefined : json['marketing_esp_domain_user'],
39
40
  'marketing_esp_domain_uuid': !(0, runtime_1.exists)(json, 'marketing_esp_domain_uuid') ? undefined : json['marketing_esp_domain_uuid'],
40
41
  'marketing_esp_friendly_name': !(0, runtime_1.exists)(json, 'marketing_esp_friendly_name') ? undefined : json['marketing_esp_friendly_name'],
@@ -65,6 +66,7 @@ function EmailSettingsToJSON(value) {
65
66
  'emails_per_day': value.emails_per_day,
66
67
  'emails_per_hour': value.emails_per_hour,
67
68
  'emails_per_month': value.emails_per_month,
69
+ 'machine_open_ignore': value.machine_open_ignore,
68
70
  'marketing_esp_domain_user': value.marketing_esp_domain_user,
69
71
  'marketing_esp_domain_uuid': value.marketing_esp_domain_uuid,
70
72
  'marketing_esp_friendly_name': value.marketing_esp_friendly_name,
@@ -45,10 +45,12 @@ export * from './AutoOrderItemOption';
45
45
  export * from './AutoOrderItemSimpleSchedule';
46
46
  export * from './AutoOrderLog';
47
47
  export * from './AutoOrderManagement';
48
+ export * from './AutoOrderPaymentUpdateRequest';
48
49
  export * from './AutoOrderPropertiesUpdateRequest';
49
50
  export * from './AutoOrderProperty';
50
51
  export * from './AutoOrderQuery';
51
52
  export * from './AutoOrderQueryBatch';
53
+ export * from './AutoOrderRebillResponse';
52
54
  export * from './AutoOrderResponse';
53
55
  export * from './AutoOrdersRequest';
54
56
  export * from './AutoOrdersResponse';
@@ -63,10 +63,12 @@ __exportStar(require("./AutoOrderItemOption"), exports);
63
63
  __exportStar(require("./AutoOrderItemSimpleSchedule"), exports);
64
64
  __exportStar(require("./AutoOrderLog"), exports);
65
65
  __exportStar(require("./AutoOrderManagement"), exports);
66
+ __exportStar(require("./AutoOrderPaymentUpdateRequest"), exports);
66
67
  __exportStar(require("./AutoOrderPropertiesUpdateRequest"), exports);
67
68
  __exportStar(require("./AutoOrderProperty"), exports);
68
69
  __exportStar(require("./AutoOrderQuery"), exports);
69
70
  __exportStar(require("./AutoOrderQueryBatch"), exports);
71
+ __exportStar(require("./AutoOrderRebillResponse"), exports);
70
72
  __exportStar(require("./AutoOrderResponse"), exports);
71
73
  __exportStar(require("./AutoOrdersRequest"), exports);
72
74
  __exportStar(require("./AutoOrdersResponse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ultracart_rest_api_v2_typescript",
3
- "version": "4.1.121",
3
+ "version": "4.1.122",
4
4
  "description": "UltraCart Rest TypeScript SDK",
5
5
  "author": "UltraCart",
6
6
  "repository": {
@@ -33,6 +33,9 @@ import {
33
33
  AutoOrderItemCancelRequest,
34
34
  AutoOrderItemCancelRequestFromJSON,
35
35
  AutoOrderItemCancelRequestToJSON,
36
+ AutoOrderPaymentUpdateRequest,
37
+ AutoOrderPaymentUpdateRequestFromJSON,
38
+ AutoOrderPaymentUpdateRequestToJSON,
36
39
  AutoOrderPropertiesUpdateRequest,
37
40
  AutoOrderPropertiesUpdateRequestFromJSON,
38
41
  AutoOrderPropertiesUpdateRequestToJSON,
@@ -42,6 +45,9 @@ import {
42
45
  AutoOrderQueryBatch,
43
46
  AutoOrderQueryBatchFromJSON,
44
47
  AutoOrderQueryBatchToJSON,
48
+ AutoOrderRebillResponse,
49
+ AutoOrderRebillResponseFromJSON,
50
+ AutoOrderRebillResponseToJSON,
45
51
  AutoOrderResponse,
46
52
  AutoOrderResponseFromJSON,
47
53
  AutoOrderResponseToJSON,
@@ -56,6 +62,11 @@ import {
56
62
  ErrorResponseToJSON,
57
63
  } from '../models';
58
64
 
65
+ export interface AttemptAutoOrderRebillRequest {
66
+ autoOrderOid: number;
67
+ expand?: string;
68
+ }
69
+
59
70
  export interface CancelAutoOrderItemByReferenceOrderIdRequest {
60
71
  referenceOrderId: string;
61
72
  originalItemId: string;
@@ -159,6 +170,12 @@ export interface UpdateAutoOrderItemPropertiesRequest {
159
170
  expand?: string;
160
171
  }
161
172
 
173
+ export interface UpdateAutoOrderPaymentRequest {
174
+ autoOrderOid: number;
175
+ autoOrderPaymentUpdateRequest: AutoOrderPaymentUpdateRequest;
176
+ expand?: string;
177
+ }
178
+
162
179
  export interface UpdateAutoOrderPropertiesRequest {
163
180
  autoOrderOid: number;
164
181
  autoOrderPropertiesUpdateRequest: AutoOrderPropertiesUpdateRequest;
@@ -179,6 +196,23 @@ export interface UpdateAutoOrdersBatchRequest {
179
196
  * @interface AutoOrderApiInterface
180
197
  */
181
198
  export interface AutoOrderApiInterface {
199
+ /**
200
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
201
+ * @summary Attempt a failed rebill on an auto order
202
+ * @param {number} autoOrderOid The auto order oid to rebill.
203
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
204
+ * @param {*} [options] Override http request option.
205
+ * @throws {RequiredError}
206
+ * @memberof AutoOrderApiInterface
207
+ */
208
+ attemptAutoOrderRebillRaw(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>>;
209
+
210
+ /**
211
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
212
+ * Attempt a failed rebill on an auto order
213
+ */
214
+ attemptAutoOrderRebill(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse>;
215
+
182
216
  /**
183
217
  * Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
184
218
  * @summary Cancel a single item on an auto order
@@ -465,6 +499,24 @@ export interface AutoOrderApiInterface {
465
499
  */
466
500
  updateAutoOrderItemProperties(requestParameters: UpdateAutoOrderItemPropertiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderResponse>;
467
501
 
502
+ /**
503
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
504
+ * @summary Update the payment information on an auto order
505
+ * @param {number} autoOrderOid The auto order oid to update payment information on.
506
+ * @param {AutoOrderPaymentUpdateRequest} autoOrderPaymentUpdateRequest Payment information to place on the auto order
507
+ * @param {string} [expand] The object expansion to perform on the result. See documentation for examples
508
+ * @param {*} [options] Override http request option.
509
+ * @throws {RequiredError}
510
+ * @memberof AutoOrderApiInterface
511
+ */
512
+ updateAutoOrderPaymentRaw(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>>;
513
+
514
+ /**
515
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
516
+ * Update the payment information on an auto order
517
+ */
518
+ updateAutoOrderPayment(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse>;
519
+
468
520
  /**
469
521
  * Update an auto order properties. Returns the auto order based upon expansion
470
522
  * @summary Update an auto order properties
@@ -509,6 +561,51 @@ export interface AutoOrderApiInterface {
509
561
  */
510
562
  export class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterface {
511
563
 
564
+ /**
565
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
566
+ * Attempt a failed rebill on an auto order
567
+ */
568
+ async attemptAutoOrderRebillRaw(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>> {
569
+ if (requestParameters.autoOrderOid === null || requestParameters.autoOrderOid === undefined) {
570
+ throw new runtime.RequiredError('autoOrderOid','Required parameter requestParameters.autoOrderOid was null or undefined when calling attemptAutoOrderRebill.');
571
+ }
572
+
573
+ const queryParameters: any = {};
574
+
575
+ if (requestParameters.expand !== undefined) {
576
+ queryParameters['_expand'] = requestParameters.expand;
577
+ }
578
+
579
+ const headerParameters: runtime.HTTPHeaders = {};
580
+
581
+ if (this.configuration && this.configuration.accessToken) {
582
+ // oauth required
583
+ headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["auto_order_write"]);
584
+ }
585
+
586
+ if (this.configuration && this.configuration.apiKey) {
587
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
588
+ }
589
+
590
+ const response = await this.request({
591
+ path: `/auto_order/auto_orders/{auto_order_oid}/rebill`.replace(`{${"auto_order_oid"}}`, encodeURIComponent(String(requestParameters.autoOrderOid))),
592
+ method: 'POST',
593
+ headers: headerParameters,
594
+ query: queryParameters,
595
+ }, initOverrides);
596
+
597
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutoOrderRebillResponseFromJSON(jsonValue));
598
+ }
599
+
600
+ /**
601
+ * Attempts to rebill an auto order using the payment information already on the original order. The attempt is refused if the auto order is scheduled to charge within the next five minutes, or if it was already billed within the last 24 hours, both of which guard against double charging. Runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
602
+ * Attempt a failed rebill on an auto order
603
+ */
604
+ async attemptAutoOrderRebill(requestParameters: AttemptAutoOrderRebillRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse> {
605
+ const response = await this.attemptAutoOrderRebillRaw(requestParameters, initOverrides);
606
+ return await response.value();
607
+ }
608
+
512
609
  /**
513
610
  * Cancels a single item on an auto order identified by the original order id and the item\'s original_item_id. The request body may specify mode=end (soft cancel by setting no_order_after_dts to the current time, preserving the row for reporting; this is the default when the body is omitted) or mode=remove (hard delete). Returns the updated auto order based upon expansion.
514
611
  * Cancel a single item on an auto order
@@ -1328,6 +1425,58 @@ export class AutoOrderApi extends runtime.BaseAPI implements AutoOrderApiInterfa
1328
1425
  return await response.value();
1329
1426
  }
1330
1427
 
1428
+ /**
1429
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
1430
+ * Update the payment information on an auto order
1431
+ */
1432
+ async updateAutoOrderPaymentRaw(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutoOrderRebillResponse>> {
1433
+ if (requestParameters.autoOrderOid === null || requestParameters.autoOrderOid === undefined) {
1434
+ throw new runtime.RequiredError('autoOrderOid','Required parameter requestParameters.autoOrderOid was null or undefined when calling updateAutoOrderPayment.');
1435
+ }
1436
+
1437
+ if (requestParameters.autoOrderPaymentUpdateRequest === null || requestParameters.autoOrderPaymentUpdateRequest === undefined) {
1438
+ throw new runtime.RequiredError('autoOrderPaymentUpdateRequest','Required parameter requestParameters.autoOrderPaymentUpdateRequest was null or undefined when calling updateAutoOrderPayment.');
1439
+ }
1440
+
1441
+ const queryParameters: any = {};
1442
+
1443
+ if (requestParameters.expand !== undefined) {
1444
+ queryParameters['_expand'] = requestParameters.expand;
1445
+ }
1446
+
1447
+ const headerParameters: runtime.HTTPHeaders = {};
1448
+
1449
+ headerParameters['Content-Type'] = 'application/json; charset=UTF-8';
1450
+
1451
+ if (this.configuration && this.configuration.accessToken) {
1452
+ // oauth required
1453
+ headerParameters["Authorization"] = await this.configuration.accessToken("ultraCartOauth", ["auto_order_write"]);
1454
+ }
1455
+
1456
+ if (this.configuration && this.configuration.apiKey) {
1457
+ headerParameters["x-ultracart-simple-key"] = this.configuration.apiKey("x-ultracart-simple-key"); // ultraCartSimpleApiKey authentication
1458
+ }
1459
+
1460
+ const response = await this.request({
1461
+ path: `/auto_order/auto_orders/{auto_order_oid}/payment`.replace(`{${"auto_order_oid"}}`, encodeURIComponent(String(requestParameters.autoOrderOid))),
1462
+ method: 'PUT',
1463
+ headers: headerParameters,
1464
+ query: queryParameters,
1465
+ body: AutoOrderPaymentUpdateRequestToJSON(requestParameters.autoOrderPaymentUpdateRequest),
1466
+ }, initOverrides);
1467
+
1468
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutoOrderRebillResponseFromJSON(jsonValue));
1469
+ }
1470
+
1471
+ /**
1472
+ * Updates the credit card on the original order behind an auto order, along with any rebills sitting in accounts receivable, and reactivates the auto order. Card data is accepted as hosted field tokens only. raw card numbers and card verification numbers are rejected. Set attempt_rebill to true to also attempt the rebill immediately, which runs synchronously and may take some time while the gateway is contacted. A declined card is reported in the response body rather than as an API error.
1473
+ * Update the payment information on an auto order
1474
+ */
1475
+ async updateAutoOrderPayment(requestParameters: UpdateAutoOrderPaymentRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutoOrderRebillResponse> {
1476
+ const response = await this.updateAutoOrderPaymentRaw(requestParameters, initOverrides);
1477
+ return await response.value();
1478
+ }
1479
+
1331
1480
  /**
1332
1481
  * Update an auto order properties. Returns the auto order based upon expansion
1333
1482
  * Update an auto order properties
@@ -0,0 +1,121 @@
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 AutoOrderPaymentUpdateRequest
20
+ */
21
+ export interface AutoOrderPaymentUpdateRequest {
22
+ /**
23
+ * Attempt to rebill the auto order immediately after the payment information is updated. Defaults to false.
24
+ * @type {boolean}
25
+ * @memberof AutoOrderPaymentUpdateRequest
26
+ */
27
+ attempt_rebill?: boolean;
28
+ /**
29
+ * Card expiration month (1-12)
30
+ * @type {number}
31
+ * @memberof AutoOrderPaymentUpdateRequest
32
+ */
33
+ card_expiration_month?: number;
34
+ /**
35
+ * Card expiration year (four digit)
36
+ * @type {number}
37
+ * @memberof AutoOrderPaymentUpdateRequest
38
+ */
39
+ card_expiration_year?: number;
40
+ /**
41
+ * Hosted field token for the credit card number. Tokens are valid for two hours.
42
+ * @type {string}
43
+ * @memberof AutoOrderPaymentUpdateRequest
44
+ */
45
+ card_number_token?: string;
46
+ /**
47
+ * Credit card type. Optional. When the hosted field token carries the card type, the token wins.
48
+ * @type {string}
49
+ * @memberof AutoOrderPaymentUpdateRequest
50
+ */
51
+ card_type?: AutoOrderPaymentUpdateRequestCardTypeEnum;
52
+ /**
53
+ * Hosted field token for the card verification number (CVV). Required when the order has a vaulted card that must be re-vaulted.
54
+ * @type {string}
55
+ * @memberof AutoOrderPaymentUpdateRequest
56
+ */
57
+ card_verification_number_token?: string;
58
+ }
59
+
60
+
61
+
62
+ /**
63
+ * @export
64
+ */
65
+ export const AutoOrderPaymentUpdateRequestCardTypeEnum = {
66
+ Amex: 'AMEX',
67
+ DinersClub: 'Diners Club',
68
+ Discover: 'Discover',
69
+ Jcb: 'JCB',
70
+ MasterCard: 'MasterCard',
71
+ Visa: 'VISA'
72
+ } as const;
73
+ export type AutoOrderPaymentUpdateRequestCardTypeEnum = typeof AutoOrderPaymentUpdateRequestCardTypeEnum[keyof typeof AutoOrderPaymentUpdateRequestCardTypeEnum];
74
+
75
+
76
+ /**
77
+ * Check if a given object implements the AutoOrderPaymentUpdateRequest interface.
78
+ */
79
+ export function instanceOfAutoOrderPaymentUpdateRequest(value: object): boolean {
80
+ let isInstance = true;
81
+
82
+ return isInstance;
83
+ }
84
+
85
+ export function AutoOrderPaymentUpdateRequestFromJSON(json: any): AutoOrderPaymentUpdateRequest {
86
+ return AutoOrderPaymentUpdateRequestFromJSONTyped(json, false);
87
+ }
88
+
89
+ export function AutoOrderPaymentUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoOrderPaymentUpdateRequest {
90
+ if ((json === undefined) || (json === null)) {
91
+ return json;
92
+ }
93
+ return {
94
+
95
+ 'attempt_rebill': !exists(json, 'attempt_rebill') ? undefined : json['attempt_rebill'],
96
+ 'card_expiration_month': !exists(json, 'card_expiration_month') ? undefined : json['card_expiration_month'],
97
+ 'card_expiration_year': !exists(json, 'card_expiration_year') ? undefined : json['card_expiration_year'],
98
+ 'card_number_token': !exists(json, 'card_number_token') ? undefined : json['card_number_token'],
99
+ 'card_type': !exists(json, 'card_type') ? undefined : json['card_type'],
100
+ 'card_verification_number_token': !exists(json, 'card_verification_number_token') ? undefined : json['card_verification_number_token'],
101
+ };
102
+ }
103
+
104
+ export function AutoOrderPaymentUpdateRequestToJSON(value?: AutoOrderPaymentUpdateRequest | null): any {
105
+ if (value === undefined) {
106
+ return undefined;
107
+ }
108
+ if (value === null) {
109
+ return null;
110
+ }
111
+ return {
112
+
113
+ 'attempt_rebill': value.attempt_rebill,
114
+ 'card_expiration_month': value.card_expiration_month,
115
+ 'card_expiration_year': value.card_expiration_year,
116
+ 'card_number_token': value.card_number_token,
117
+ 'card_type': value.card_type,
118
+ 'card_verification_number_token': value.card_verification_number_token,
119
+ };
120
+ }
121
+
@@ -0,0 +1,156 @@
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
+ import {
17
+ AutoOrder,
18
+ AutoOrderFromJSON,
19
+ AutoOrderFromJSONTyped,
20
+ AutoOrderToJSON,
21
+ } from './AutoOrder';
22
+ import {
23
+ ModelError,
24
+ ModelErrorFromJSON,
25
+ ModelErrorFromJSONTyped,
26
+ ModelErrorToJSON,
27
+ } from './ModelError';
28
+ import {
29
+ ResponseMetadata,
30
+ ResponseMetadataFromJSON,
31
+ ResponseMetadataFromJSONTyped,
32
+ ResponseMetadataToJSON,
33
+ } from './ResponseMetadata';
34
+ import {
35
+ Warning,
36
+ WarningFromJSON,
37
+ WarningFromJSONTyped,
38
+ WarningToJSON,
39
+ } from './Warning';
40
+
41
+ /**
42
+ *
43
+ * @export
44
+ * @interface AutoOrderRebillResponse
45
+ */
46
+ export interface AutoOrderRebillResponse {
47
+ /**
48
+ *
49
+ * @type {AutoOrder}
50
+ * @memberof AutoOrderRebillResponse
51
+ */
52
+ auto_order?: AutoOrder;
53
+ /**
54
+ *
55
+ * @type {ModelError}
56
+ * @memberof AutoOrderRebillResponse
57
+ */
58
+ error?: ModelError;
59
+ /**
60
+ * Why the rebill attempt did not succeed
61
+ * @type {string}
62
+ * @memberof AutoOrderRebillResponse
63
+ */
64
+ failure_reason?: string;
65
+ /**
66
+ *
67
+ * @type {ResponseMetadata}
68
+ * @memberof AutoOrderRebillResponse
69
+ */
70
+ metadata?: ResponseMetadata;
71
+ /**
72
+ * True if a rebill was attempted during this call
73
+ * @type {boolean}
74
+ * @memberof AutoOrderRebillResponse
75
+ */
76
+ rebill_attempted?: boolean;
77
+ /**
78
+ * The order id created by a successful rebill
79
+ * @type {string}
80
+ * @memberof AutoOrderRebillResponse
81
+ */
82
+ rebill_order_id?: string;
83
+ /**
84
+ * True if the rebill attempt produced an order
85
+ * @type {boolean}
86
+ * @memberof AutoOrderRebillResponse
87
+ */
88
+ rebill_success?: boolean;
89
+ /**
90
+ * Indicates if API call was successful
91
+ * @type {boolean}
92
+ * @memberof AutoOrderRebillResponse
93
+ */
94
+ success?: boolean;
95
+ /**
96
+ *
97
+ * @type {Warning}
98
+ * @memberof AutoOrderRebillResponse
99
+ */
100
+ warning?: Warning;
101
+ }
102
+
103
+
104
+
105
+ /**
106
+ * Check if a given object implements the AutoOrderRebillResponse interface.
107
+ */
108
+ export function instanceOfAutoOrderRebillResponse(value: object): boolean {
109
+ let isInstance = true;
110
+
111
+ return isInstance;
112
+ }
113
+
114
+ export function AutoOrderRebillResponseFromJSON(json: any): AutoOrderRebillResponse {
115
+ return AutoOrderRebillResponseFromJSONTyped(json, false);
116
+ }
117
+
118
+ export function AutoOrderRebillResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutoOrderRebillResponse {
119
+ if ((json === undefined) || (json === null)) {
120
+ return json;
121
+ }
122
+ return {
123
+
124
+ 'auto_order': !exists(json, 'auto_order') ? undefined : AutoOrderFromJSON(json['auto_order']),
125
+ 'error': !exists(json, 'error') ? undefined : ModelErrorFromJSON(json['error']),
126
+ 'failure_reason': !exists(json, 'failure_reason') ? undefined : json['failure_reason'],
127
+ 'metadata': !exists(json, 'metadata') ? undefined : ResponseMetadataFromJSON(json['metadata']),
128
+ 'rebill_attempted': !exists(json, 'rebill_attempted') ? undefined : json['rebill_attempted'],
129
+ 'rebill_order_id': !exists(json, 'rebill_order_id') ? undefined : json['rebill_order_id'],
130
+ 'rebill_success': !exists(json, 'rebill_success') ? undefined : json['rebill_success'],
131
+ 'success': !exists(json, 'success') ? undefined : json['success'],
132
+ 'warning': !exists(json, 'warning') ? undefined : WarningFromJSON(json['warning']),
133
+ };
134
+ }
135
+
136
+ export function AutoOrderRebillResponseToJSON(value?: AutoOrderRebillResponse | null): any {
137
+ if (value === undefined) {
138
+ return undefined;
139
+ }
140
+ if (value === null) {
141
+ return null;
142
+ }
143
+ return {
144
+
145
+ 'auto_order': AutoOrderToJSON(value.auto_order),
146
+ 'error': ModelErrorToJSON(value.error),
147
+ 'failure_reason': value.failure_reason,
148
+ 'metadata': ResponseMetadataToJSON(value.metadata),
149
+ 'rebill_attempted': value.rebill_attempted,
150
+ 'rebill_order_id': value.rebill_order_id,
151
+ 'rebill_success': value.rebill_success,
152
+ 'success': value.success,
153
+ 'warning': WarningToJSON(value.warning),
154
+ };
155
+ }
156
+
@@ -37,6 +37,12 @@ export interface EmailSettings {
37
37
  * @memberof EmailSettings
38
38
  */
39
39
  emails_per_month?: number;
40
+ /**
41
+ * If machine open should be ignored
42
+ * @type {boolean}
43
+ * @memberof EmailSettings
44
+ */
45
+ machine_open_ignore?: boolean;
40
46
  /**
41
47
  *
42
48
  * @type {string}
@@ -159,6 +165,7 @@ export function EmailSettingsFromJSONTyped(json: any, ignoreDiscriminator: boole
159
165
  'emails_per_day': !exists(json, 'emails_per_day') ? undefined : json['emails_per_day'],
160
166
  'emails_per_hour': !exists(json, 'emails_per_hour') ? undefined : json['emails_per_hour'],
161
167
  'emails_per_month': !exists(json, 'emails_per_month') ? undefined : json['emails_per_month'],
168
+ 'machine_open_ignore': !exists(json, 'machine_open_ignore') ? undefined : json['machine_open_ignore'],
162
169
  'marketing_esp_domain_user': !exists(json, 'marketing_esp_domain_user') ? undefined : json['marketing_esp_domain_user'],
163
170
  'marketing_esp_domain_uuid': !exists(json, 'marketing_esp_domain_uuid') ? undefined : json['marketing_esp_domain_uuid'],
164
171
  'marketing_esp_friendly_name': !exists(json, 'marketing_esp_friendly_name') ? undefined : json['marketing_esp_friendly_name'],
@@ -190,6 +197,7 @@ export function EmailSettingsToJSON(value?: EmailSettings | null): any {
190
197
  'emails_per_day': value.emails_per_day,
191
198
  'emails_per_hour': value.emails_per_hour,
192
199
  'emails_per_month': value.emails_per_month,
200
+ 'machine_open_ignore': value.machine_open_ignore,
193
201
  'marketing_esp_domain_user': value.marketing_esp_domain_user,
194
202
  'marketing_esp_domain_uuid': value.marketing_esp_domain_uuid,
195
203
  'marketing_esp_friendly_name': value.marketing_esp_friendly_name,
@@ -47,10 +47,12 @@ export * from './AutoOrderItemOption';
47
47
  export * from './AutoOrderItemSimpleSchedule';
48
48
  export * from './AutoOrderLog';
49
49
  export * from './AutoOrderManagement';
50
+ export * from './AutoOrderPaymentUpdateRequest';
50
51
  export * from './AutoOrderPropertiesUpdateRequest';
51
52
  export * from './AutoOrderProperty';
52
53
  export * from './AutoOrderQuery';
53
54
  export * from './AutoOrderQueryBatch';
55
+ export * from './AutoOrderRebillResponse';
54
56
  export * from './AutoOrderResponse';
55
57
  export * from './AutoOrdersRequest';
56
58
  export * from './AutoOrdersResponse';