@chrt-inc/typescript-sdk 1.976.0 → 1.982.0

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.
Files changed (28) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.ts +17 -1
  3. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/Client.js +69 -1
  4. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsCurrencyConversionUpdateManyReq.d.ts +1 -1
  5. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.d.ts +18 -0
  6. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.js +5 -0
  7. package/dist/cjs/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.ts +1 -0
  8. package/dist/cjs/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.d.ts +18 -0
  9. package/dist/cjs/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.js +14 -0
  10. package/dist/cjs/api/types/index.d.ts +1 -0
  11. package/dist/cjs/api/types/index.js +1 -0
  12. package/dist/cjs/version.d.ts +1 -1
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/esm/Client.mjs +2 -2
  15. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.d.mts +17 -1
  16. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/Client.mjs +69 -1
  17. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/InvoiceLineItemsCurrencyConversionUpdateManyReq.d.mts +1 -1
  18. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.d.mts +18 -0
  19. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/ReceivablesAcrossOrdersCurrencyConversionUpdateReq.mjs +4 -0
  20. package/dist/esm/api/resources/billingNew/resources/invoiceLineItems/client/requests/index.d.mts +1 -0
  21. package/dist/esm/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.d.mts +18 -0
  22. package/dist/esm/api/types/ReceivablesAcrossOrdersCurrencyConversionOrderRes.mjs +11 -0
  23. package/dist/esm/api/types/index.d.mts +1 -0
  24. package/dist/esm/api/types/index.mjs +1 -0
  25. package/dist/esm/version.d.mts +1 -1
  26. package/dist/esm/version.mjs +1 -1
  27. package/package.json +1 -1
  28. package/reference.md +67 -1
@@ -60,8 +60,8 @@ class ChrtClient {
60
60
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
61
61
  "X-Fern-Language": "JavaScript",
62
62
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
63
- "X-Fern-SDK-Version": "1.976.0",
64
- "User-Agent": "@chrt-inc/typescript-sdk/1.976.0",
63
+ "X-Fern-SDK-Version": "1.982.0",
64
+ "User-Agent": "@chrt-inc/typescript-sdk/1.982.0",
65
65
  "X-Fern-Runtime": core.RUNTIME.type,
66
66
  "X-Fern-Runtime-Version": core.RUNTIME.version,
67
67
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -285,7 +285,23 @@ export declare class InvoiceLineItems {
285
285
  recalculateTaxesV1(request: Chrt.billingNew.RecalculateOrderTaxInvoiceLineItemsReq, requestOptions?: InvoiceLineItems.RequestOptions): core.HttpResponsePromise<Chrt.InvoiceLineItem1[]>;
286
286
  private __recalculateTaxesV1;
287
287
  /**
288
- * Applies or reverts one currency conversion on line items from their original source values and moves attached items to the matching target-currency draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
288
+ * Applies one currency conversion independently to each selected order and reports each outcome. | authz: allowed_org_types=[provider], min_org_role=operator | (ReceivablesAcrossOrdersCurrencyConversionUpdateReq) -> (list[ReceivablesAcrossOrdersCurrencyConversionOrderRes])
289
+ *
290
+ * @param {Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq} request
291
+ * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
292
+ *
293
+ * @throws {@link Chrt.UnprocessableEntityError}
294
+ *
295
+ * @example
296
+ * await client.billingNew.invoiceLineItems.updateCurrencyConversionForReceivablesAcrossOrdersV1({
297
+ * order_ids: ["order_ids"],
298
+ * target_currency_code: "USD"
299
+ * })
300
+ */
301
+ updateCurrencyConversionForReceivablesAcrossOrdersV1(request: Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq, requestOptions?: InvoiceLineItems.RequestOptions): core.HttpResponsePromise<Chrt.ReceivablesAcrossOrdersCurrencyConversionOrderRes[]>;
302
+ private __updateCurrencyConversionForReceivablesAcrossOrdersV1;
303
+ /**
304
+ * Applies, reverts, or skips one currency conversion from original source values and moves attached items to the matching draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
289
305
  *
290
306
  * @param {Chrt.billingNew.InvoiceLineItemsCurrencyConversionUpdateManyReq} request
291
307
  * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
@@ -989,7 +989,75 @@ class InvoiceLineItems {
989
989
  });
990
990
  }
991
991
  /**
992
- * Applies or reverts one currency conversion on line items from their original source values and moves attached items to the matching target-currency draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
992
+ * Applies one currency conversion independently to each selected order and reports each outcome. | authz: allowed_org_types=[provider], min_org_role=operator | (ReceivablesAcrossOrdersCurrencyConversionUpdateReq) -> (list[ReceivablesAcrossOrdersCurrencyConversionOrderRes])
993
+ *
994
+ * @param {Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq} request
995
+ * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
996
+ *
997
+ * @throws {@link Chrt.UnprocessableEntityError}
998
+ *
999
+ * @example
1000
+ * await client.billingNew.invoiceLineItems.updateCurrencyConversionForReceivablesAcrossOrdersV1({
1001
+ * order_ids: ["order_ids"],
1002
+ * target_currency_code: "USD"
1003
+ * })
1004
+ */
1005
+ updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions) {
1006
+ return core.HttpResponsePromise.fromPromise(this.__updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions));
1007
+ }
1008
+ __updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions) {
1009
+ return __awaiter(this, void 0, void 0, function* () {
1010
+ var _a, _b, _c, _d;
1011
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1012
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1013
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing_new/invoice_line_items/update_currency_conversion_for_receivables_across_orders/v1"),
1014
+ method: "PATCH",
1015
+ headers: _headers,
1016
+ contentType: "application/json",
1017
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1018
+ requestType: "json",
1019
+ body: request,
1020
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
1021
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
1022
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1023
+ });
1024
+ if (_response.ok) {
1025
+ return {
1026
+ data: _response.body,
1027
+ rawResponse: _response.rawResponse,
1028
+ };
1029
+ }
1030
+ if (_response.error.reason === "status-code") {
1031
+ switch (_response.error.statusCode) {
1032
+ case 422:
1033
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1034
+ default:
1035
+ throw new errors.ChrtError({
1036
+ statusCode: _response.error.statusCode,
1037
+ body: _response.error.body,
1038
+ rawResponse: _response.rawResponse,
1039
+ });
1040
+ }
1041
+ }
1042
+ switch (_response.error.reason) {
1043
+ case "non-json":
1044
+ throw new errors.ChrtError({
1045
+ statusCode: _response.error.statusCode,
1046
+ body: _response.error.rawBody,
1047
+ rawResponse: _response.rawResponse,
1048
+ });
1049
+ case "timeout":
1050
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /billing_new/invoice_line_items/update_currency_conversion_for_receivables_across_orders/v1.");
1051
+ case "unknown":
1052
+ throw new errors.ChrtError({
1053
+ message: _response.error.errorMessage,
1054
+ rawResponse: _response.rawResponse,
1055
+ });
1056
+ }
1057
+ });
1058
+ }
1059
+ /**
1060
+ * Applies, reverts, or skips one currency conversion from original source values and moves attached items to the matching draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
993
1061
  *
994
1062
  * @param {Chrt.billingNew.InvoiceLineItemsCurrencyConversionUpdateManyReq} request
995
1063
  * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
@@ -10,7 +10,7 @@ import * as Chrt from "../../../../../../index.js";
10
10
  * }
11
11
  */
12
12
  export interface InvoiceLineItemsCurrencyConversionUpdateManyReq {
13
- /** Units of target_currency_code per one unit of the line items' original source currency -- their currency_conversion.source_currency_code if already converted, otherwise their current currency_code. Always relative to that original source, never to an intermediate converted currency, so conversions never compound. Omitted when target_currency_code is the original source currency, which reverts the conversion. */
13
+ /** Units of target_currency_code per one unit of the line items' original source currency -- their currency_conversion.source_currency_code if already converted, otherwise their current currency_code. Always relative to that original source, never to an intermediate converted currency, so conversions never compound. Omitted when target_currency_code is the original source currency, which reverts converted items and leaves unconverted items unchanged. */
14
14
  conversion_rate?: number | null;
15
15
  description?: string | null;
16
16
  invoice_line_item_ids: string[];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * order_ids: ["order_ids"],
9
+ * target_currency_code: "USD"
10
+ * }
11
+ */
12
+ export interface ReceivablesAcrossOrdersCurrencyConversionUpdateReq {
13
+ /** Units of target_currency_code per one unit of the order's sole original source currency different from the target. Target-currency items are reverted or left unchanged without applying this rate. */
14
+ conversion_rate?: number | null;
15
+ description?: string | null;
16
+ order_ids: string[];
17
+ target_currency_code: Chrt.BillingCurrencyCodeEnum1;
18
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,5 +5,6 @@ export { type CreateInvoiceLineItemsFromLineItemsReq } from "./CreateInvoiceLine
5
5
  export { type InvoiceLineItemsDeleteManyReq } from "./InvoiceLineItemsDeleteManyReq.js";
6
6
  export { type InvoiceLineItemsListV1Request } from "./InvoiceLineItemsListV1Request.js";
7
7
  export { type RecalculateOrderTaxInvoiceLineItemsReq } from "./RecalculateOrderTaxInvoiceLineItemsReq.js";
8
+ export { type ReceivablesAcrossOrdersCurrencyConversionUpdateReq } from "./ReceivablesAcrossOrdersCurrencyConversionUpdateReq.js";
8
9
  export { type InvoiceLineItemsCurrencyConversionUpdateManyReq } from "./InvoiceLineItemsCurrencyConversionUpdateManyReq.js";
9
10
  export { type InvoiceLineItemClientUpdate1 } from "./InvoiceLineItemClientUpdate1.js";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
5
+ export interface ReceivablesAcrossOrdersCurrencyConversionOrderRes {
6
+ converted_invoice_line_items?: Chrt.InvoiceLineItem1[];
7
+ failure_reason?: string | null;
8
+ order_id: string;
9
+ status: ReceivablesAcrossOrdersCurrencyConversionOrderRes.Status;
10
+ }
11
+ export declare namespace ReceivablesAcrossOrdersCurrencyConversionOrderRes {
12
+ type Status = "succeeded" | "failed" | "no_receivables";
13
+ const Status: {
14
+ readonly Succeeded: "succeeded";
15
+ readonly Failed: "failed";
16
+ readonly NoReceivables: "no_receivables";
17
+ };
18
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ReceivablesAcrossOrdersCurrencyConversionOrderRes = void 0;
7
+ var ReceivablesAcrossOrdersCurrencyConversionOrderRes;
8
+ (function (ReceivablesAcrossOrdersCurrencyConversionOrderRes) {
9
+ ReceivablesAcrossOrdersCurrencyConversionOrderRes.Status = {
10
+ Succeeded: "succeeded",
11
+ Failed: "failed",
12
+ NoReceivables: "no_receivables",
13
+ };
14
+ })(ReceivablesAcrossOrdersCurrencyConversionOrderRes || (exports.ReceivablesAcrossOrdersCurrencyConversionOrderRes = ReceivablesAcrossOrdersCurrencyConversionOrderRes = {}));
@@ -443,6 +443,7 @@ export * from "./Position2D.js";
443
443
  export * from "./Position3D.js";
444
444
  export * from "./ProFormaLineItem1.js";
445
445
  export * from "./ProFormaLineItemProvenanceEnum1.js";
446
+ export * from "./ReceivablesAcrossOrdersCurrencyConversionOrderRes.js";
446
447
  export * from "./ReelablesAsset1.js";
447
448
  export * from "./ReelablesAssetListRes.js";
448
449
  export * from "./ReelablesAssetPausedTimeWindow1.js";
@@ -459,6 +459,7 @@ __exportStar(require("./Position2D.js"), exports);
459
459
  __exportStar(require("./Position3D.js"), exports);
460
460
  __exportStar(require("./ProFormaLineItem1.js"), exports);
461
461
  __exportStar(require("./ProFormaLineItemProvenanceEnum1.js"), exports);
462
+ __exportStar(require("./ReceivablesAcrossOrdersCurrencyConversionOrderRes.js"), exports);
462
463
  __exportStar(require("./ReelablesAsset1.js"), exports);
463
464
  __exportStar(require("./ReelablesAssetListRes.js"), exports);
464
465
  __exportStar(require("./ReelablesAssetPausedTimeWindow1.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.976.0";
1
+ export declare const SDK_VERSION = "1.982.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.976.0";
4
+ exports.SDK_VERSION = "1.982.0";
@@ -24,8 +24,8 @@ export class ChrtClient {
24
24
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
25
25
  "X-Fern-Language": "JavaScript",
26
26
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
27
- "X-Fern-SDK-Version": "1.976.0",
28
- "User-Agent": "@chrt-inc/typescript-sdk/1.976.0",
27
+ "X-Fern-SDK-Version": "1.982.0",
28
+ "User-Agent": "@chrt-inc/typescript-sdk/1.982.0",
29
29
  "X-Fern-Runtime": core.RUNTIME.type,
30
30
  "X-Fern-Runtime-Version": core.RUNTIME.version,
31
31
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -285,7 +285,23 @@ export declare class InvoiceLineItems {
285
285
  recalculateTaxesV1(request: Chrt.billingNew.RecalculateOrderTaxInvoiceLineItemsReq, requestOptions?: InvoiceLineItems.RequestOptions): core.HttpResponsePromise<Chrt.InvoiceLineItem1[]>;
286
286
  private __recalculateTaxesV1;
287
287
  /**
288
- * Applies or reverts one currency conversion on line items from their original source values and moves attached items to the matching target-currency draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
288
+ * Applies one currency conversion independently to each selected order and reports each outcome. | authz: allowed_org_types=[provider], min_org_role=operator | (ReceivablesAcrossOrdersCurrencyConversionUpdateReq) -> (list[ReceivablesAcrossOrdersCurrencyConversionOrderRes])
289
+ *
290
+ * @param {Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq} request
291
+ * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
292
+ *
293
+ * @throws {@link Chrt.UnprocessableEntityError}
294
+ *
295
+ * @example
296
+ * await client.billingNew.invoiceLineItems.updateCurrencyConversionForReceivablesAcrossOrdersV1({
297
+ * order_ids: ["order_ids"],
298
+ * target_currency_code: "USD"
299
+ * })
300
+ */
301
+ updateCurrencyConversionForReceivablesAcrossOrdersV1(request: Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq, requestOptions?: InvoiceLineItems.RequestOptions): core.HttpResponsePromise<Chrt.ReceivablesAcrossOrdersCurrencyConversionOrderRes[]>;
302
+ private __updateCurrencyConversionForReceivablesAcrossOrdersV1;
303
+ /**
304
+ * Applies, reverts, or skips one currency conversion from original source values and moves attached items to the matching draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
289
305
  *
290
306
  * @param {Chrt.billingNew.InvoiceLineItemsCurrencyConversionUpdateManyReq} request
291
307
  * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
@@ -953,7 +953,75 @@ export class InvoiceLineItems {
953
953
  });
954
954
  }
955
955
  /**
956
- * Applies or reverts one currency conversion on line items from their original source values and moves attached items to the matching target-currency draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
956
+ * Applies one currency conversion independently to each selected order and reports each outcome. | authz: allowed_org_types=[provider], min_org_role=operator | (ReceivablesAcrossOrdersCurrencyConversionUpdateReq) -> (list[ReceivablesAcrossOrdersCurrencyConversionOrderRes])
957
+ *
958
+ * @param {Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq} request
959
+ * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
960
+ *
961
+ * @throws {@link Chrt.UnprocessableEntityError}
962
+ *
963
+ * @example
964
+ * await client.billingNew.invoiceLineItems.updateCurrencyConversionForReceivablesAcrossOrdersV1({
965
+ * order_ids: ["order_ids"],
966
+ * target_currency_code: "USD"
967
+ * })
968
+ */
969
+ updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions) {
970
+ return core.HttpResponsePromise.fromPromise(this.__updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions));
971
+ }
972
+ __updateCurrencyConversionForReceivablesAcrossOrdersV1(request, requestOptions) {
973
+ return __awaiter(this, void 0, void 0, function* () {
974
+ var _a, _b, _c, _d;
975
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
976
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
977
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "billing_new/invoice_line_items/update_currency_conversion_for_receivables_across_orders/v1"),
978
+ method: "PATCH",
979
+ headers: _headers,
980
+ contentType: "application/json",
981
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
982
+ requestType: "json",
983
+ body: request,
984
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
985
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
986
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
987
+ });
988
+ if (_response.ok) {
989
+ return {
990
+ data: _response.body,
991
+ rawResponse: _response.rawResponse,
992
+ };
993
+ }
994
+ if (_response.error.reason === "status-code") {
995
+ switch (_response.error.statusCode) {
996
+ case 422:
997
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
998
+ default:
999
+ throw new errors.ChrtError({
1000
+ statusCode: _response.error.statusCode,
1001
+ body: _response.error.body,
1002
+ rawResponse: _response.rawResponse,
1003
+ });
1004
+ }
1005
+ }
1006
+ switch (_response.error.reason) {
1007
+ case "non-json":
1008
+ throw new errors.ChrtError({
1009
+ statusCode: _response.error.statusCode,
1010
+ body: _response.error.rawBody,
1011
+ rawResponse: _response.rawResponse,
1012
+ });
1013
+ case "timeout":
1014
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling PATCH /billing_new/invoice_line_items/update_currency_conversion_for_receivables_across_orders/v1.");
1015
+ case "unknown":
1016
+ throw new errors.ChrtError({
1017
+ message: _response.error.errorMessage,
1018
+ rawResponse: _response.rawResponse,
1019
+ });
1020
+ }
1021
+ });
1022
+ }
1023
+ /**
1024
+ * Applies, reverts, or skips one currency conversion from original source values and moves attached items to the matching draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
957
1025
  *
958
1026
  * @param {Chrt.billingNew.InvoiceLineItemsCurrencyConversionUpdateManyReq} request
959
1027
  * @param {InvoiceLineItems.RequestOptions} requestOptions - Request-specific configuration.
@@ -10,7 +10,7 @@ import * as Chrt from "../../../../../../index.mjs";
10
10
  * }
11
11
  */
12
12
  export interface InvoiceLineItemsCurrencyConversionUpdateManyReq {
13
- /** Units of target_currency_code per one unit of the line items' original source currency -- their currency_conversion.source_currency_code if already converted, otherwise their current currency_code. Always relative to that original source, never to an intermediate converted currency, so conversions never compound. Omitted when target_currency_code is the original source currency, which reverts the conversion. */
13
+ /** Units of target_currency_code per one unit of the line items' original source currency -- their currency_conversion.source_currency_code if already converted, otherwise their current currency_code. Always relative to that original source, never to an intermediate converted currency, so conversions never compound. Omitted when target_currency_code is the original source currency, which reverts converted items and leaves unconverted items unchanged. */
14
14
  conversion_rate?: number | null;
15
15
  description?: string | null;
16
16
  invoice_line_item_ids: string[];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.mjs";
5
+ /**
6
+ * @example
7
+ * {
8
+ * order_ids: ["order_ids"],
9
+ * target_currency_code: "USD"
10
+ * }
11
+ */
12
+ export interface ReceivablesAcrossOrdersCurrencyConversionUpdateReq {
13
+ /** Units of target_currency_code per one unit of the order's sole original source currency different from the target. Target-currency items are reverted or left unchanged without applying this rate. */
14
+ conversion_rate?: number | null;
15
+ description?: string | null;
16
+ order_ids: string[];
17
+ target_currency_code: Chrt.BillingCurrencyCodeEnum1;
18
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -5,5 +5,6 @@ export { type CreateInvoiceLineItemsFromLineItemsReq } from "./CreateInvoiceLine
5
5
  export { type InvoiceLineItemsDeleteManyReq } from "./InvoiceLineItemsDeleteManyReq.mjs";
6
6
  export { type InvoiceLineItemsListV1Request } from "./InvoiceLineItemsListV1Request.mjs";
7
7
  export { type RecalculateOrderTaxInvoiceLineItemsReq } from "./RecalculateOrderTaxInvoiceLineItemsReq.mjs";
8
+ export { type ReceivablesAcrossOrdersCurrencyConversionUpdateReq } from "./ReceivablesAcrossOrdersCurrencyConversionUpdateReq.mjs";
8
9
  export { type InvoiceLineItemsCurrencyConversionUpdateManyReq } from "./InvoiceLineItemsCurrencyConversionUpdateManyReq.mjs";
9
10
  export { type InvoiceLineItemClientUpdate1 } from "./InvoiceLineItemClientUpdate1.mjs";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.mjs";
5
+ export interface ReceivablesAcrossOrdersCurrencyConversionOrderRes {
6
+ converted_invoice_line_items?: Chrt.InvoiceLineItem1[];
7
+ failure_reason?: string | null;
8
+ order_id: string;
9
+ status: ReceivablesAcrossOrdersCurrencyConversionOrderRes.Status;
10
+ }
11
+ export declare namespace ReceivablesAcrossOrdersCurrencyConversionOrderRes {
12
+ type Status = "succeeded" | "failed" | "no_receivables";
13
+ const Status: {
14
+ readonly Succeeded: "succeeded";
15
+ readonly Failed: "failed";
16
+ readonly NoReceivables: "no_receivables";
17
+ };
18
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export var ReceivablesAcrossOrdersCurrencyConversionOrderRes;
5
+ (function (ReceivablesAcrossOrdersCurrencyConversionOrderRes) {
6
+ ReceivablesAcrossOrdersCurrencyConversionOrderRes.Status = {
7
+ Succeeded: "succeeded",
8
+ Failed: "failed",
9
+ NoReceivables: "no_receivables",
10
+ };
11
+ })(ReceivablesAcrossOrdersCurrencyConversionOrderRes || (ReceivablesAcrossOrdersCurrencyConversionOrderRes = {}));
@@ -443,6 +443,7 @@ export * from "./Position2D.mjs";
443
443
  export * from "./Position3D.mjs";
444
444
  export * from "./ProFormaLineItem1.mjs";
445
445
  export * from "./ProFormaLineItemProvenanceEnum1.mjs";
446
+ export * from "./ReceivablesAcrossOrdersCurrencyConversionOrderRes.mjs";
446
447
  export * from "./ReelablesAsset1.mjs";
447
448
  export * from "./ReelablesAssetListRes.mjs";
448
449
  export * from "./ReelablesAssetPausedTimeWindow1.mjs";
@@ -443,6 +443,7 @@ export * from "./Position2D.mjs";
443
443
  export * from "./Position3D.mjs";
444
444
  export * from "./ProFormaLineItem1.mjs";
445
445
  export * from "./ProFormaLineItemProvenanceEnum1.mjs";
446
+ export * from "./ReceivablesAcrossOrdersCurrencyConversionOrderRes.mjs";
446
447
  export * from "./ReelablesAsset1.mjs";
447
448
  export * from "./ReelablesAssetListRes.mjs";
448
449
  export * from "./ReelablesAssetPausedTimeWindow1.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.976.0";
1
+ export declare const SDK_VERSION = "1.982.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.976.0";
1
+ export const SDK_VERSION = "1.982.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrt-inc/typescript-sdk",
3
- "version": "1.976.0",
3
+ "version": "1.982.0",
4
4
  "private": false,
5
5
  "repository": "github:chrt-inc/typescript-sdk",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -2741,6 +2741,72 @@ await client.billingNew.invoiceLineItems.recalculateTaxesV1({
2741
2741
  </dl>
2742
2742
  </details>
2743
2743
 
2744
+ <details><summary><code>client.billingNew.invoiceLineItems.<a href="/src/api/resources/billingNew/resources/invoiceLineItems/client/Client.ts">updateCurrencyConversionForReceivablesAcrossOrdersV1</a>({ ...params }) -> Chrt.ReceivablesAcrossOrdersCurrencyConversionOrderRes[]</code></summary>
2745
+ <dl>
2746
+ <dd>
2747
+
2748
+ #### 📝 Description
2749
+
2750
+ <dl>
2751
+ <dd>
2752
+
2753
+ <dl>
2754
+ <dd>
2755
+
2756
+ Applies one currency conversion independently to each selected order and reports each outcome. | authz: allowed_org_types=[provider], min_org_role=operator | (ReceivablesAcrossOrdersCurrencyConversionUpdateReq) -> (list[ReceivablesAcrossOrdersCurrencyConversionOrderRes])
2757
+
2758
+ </dd>
2759
+ </dl>
2760
+ </dd>
2761
+ </dl>
2762
+
2763
+ #### 🔌 Usage
2764
+
2765
+ <dl>
2766
+ <dd>
2767
+
2768
+ <dl>
2769
+ <dd>
2770
+
2771
+ ```typescript
2772
+ await client.billingNew.invoiceLineItems.updateCurrencyConversionForReceivablesAcrossOrdersV1({
2773
+ order_ids: ["order_ids"],
2774
+ target_currency_code: "USD",
2775
+ });
2776
+ ```
2777
+
2778
+ </dd>
2779
+ </dl>
2780
+ </dd>
2781
+ </dl>
2782
+
2783
+ #### ⚙️ Parameters
2784
+
2785
+ <dl>
2786
+ <dd>
2787
+
2788
+ <dl>
2789
+ <dd>
2790
+
2791
+ **request:** `Chrt.billingNew.ReceivablesAcrossOrdersCurrencyConversionUpdateReq`
2792
+
2793
+ </dd>
2794
+ </dl>
2795
+
2796
+ <dl>
2797
+ <dd>
2798
+
2799
+ **requestOptions:** `InvoiceLineItems.RequestOptions`
2800
+
2801
+ </dd>
2802
+ </dl>
2803
+ </dd>
2804
+ </dl>
2805
+
2806
+ </dd>
2807
+ </dl>
2808
+ </details>
2809
+
2744
2810
  <details><summary><code>client.billingNew.invoiceLineItems.<a href="/src/api/resources/billingNew/resources/invoiceLineItems/client/Client.ts">updateCurrencyConversionManyV1</a>({ ...params }) -> Chrt.InvoiceLineItem1[]</code></summary>
2745
2811
  <dl>
2746
2812
  <dd>
@@ -2753,7 +2819,7 @@ await client.billingNew.invoiceLineItems.recalculateTaxesV1({
2753
2819
  <dl>
2754
2820
  <dd>
2755
2821
 
2756
- Applies or reverts one currency conversion on line items from their original source values and moves attached items to the matching target-currency draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
2822
+ Applies, reverts, or skips one currency conversion from original source values and moves attached items to the matching draft invoice. | authz: allowed_org_types=[provider], min_org_role=operator | (InvoiceLineItemsCurrencyConversionUpdateManyReq) -> (list[InvoiceLineItem1])
2757
2823
 
2758
2824
  </dd>
2759
2825
  </dl>