@paid-ai/paid-node 1.0.1 → 1.2.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.
- package/README.md +6 -2
- package/dist/cjs/Client.d.ts +9 -0
- package/dist/cjs/Client.js +29 -14
- package/dist/cjs/api/resources/checkouts/client/Client.d.ts +84 -0
- package/dist/cjs/api/resources/checkouts/client/Client.js +350 -0
- package/dist/cjs/api/resources/checkouts/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/checkouts/client/index.js +17 -0
- package/dist/cjs/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.d.ts +9 -0
- package/dist/cjs/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.js +3 -0
- package/dist/cjs/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.ts +23 -0
- package/dist/cjs/api/resources/checkouts/client/requests/CreateCheckoutRequest.js +3 -0
- package/dist/cjs/api/resources/checkouts/client/requests/GetCheckoutRequest.d.ts +9 -0
- package/dist/cjs/api/resources/checkouts/client/requests/GetCheckoutRequest.js +3 -0
- package/dist/cjs/api/resources/checkouts/client/requests/ListCheckoutsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/checkouts/client/requests/ListCheckoutsRequest.js +3 -0
- package/dist/cjs/api/resources/checkouts/client/requests/index.d.ts +4 -0
- package/dist/cjs/api/resources/checkouts/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/checkouts/index.d.ts +2 -0
- package/dist/cjs/api/resources/checkouts/index.js +18 -0
- package/dist/cjs/api/resources/checkouts/types/ListCheckoutsRequestStatus.d.ts +6 -0
- package/dist/cjs/api/resources/checkouts/types/ListCheckoutsRequestStatus.js +9 -0
- package/dist/cjs/api/resources/checkouts/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/checkouts/types/index.js +17 -0
- package/dist/cjs/api/resources/contacts/client/Client.d.ts +0 -2
- package/dist/cjs/api/resources/contacts/client/Client.js +0 -2
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.d.ts +13 -4
- package/dist/cjs/api/resources/contacts/client/requests/CreateContactRequest.js +11 -0
- package/dist/cjs/api/resources/credits/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/credits/client/Client.js +123 -0
- package/dist/cjs/api/resources/credits/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/credits/client/index.js +2 -0
- package/dist/cjs/api/resources/credits/index.d.ts +1 -0
- package/dist/cjs/api/resources/credits/index.js +17 -0
- package/dist/cjs/api/resources/customerPortals/client/Client.d.ts +30 -0
- package/dist/cjs/api/resources/customerPortals/client/Client.js +133 -0
- package/dist/cjs/api/resources/customerPortals/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/customerPortals/client/index.js +17 -0
- package/dist/cjs/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.d.ts +12 -0
- package/dist/cjs/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.js +3 -0
- package/dist/cjs/api/resources/customerPortals/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/customerPortals/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/customerPortals/index.d.ts +1 -0
- package/dist/cjs/api/resources/customerPortals/index.js +17 -0
- package/dist/cjs/api/resources/customers/client/Client.d.ts +34 -0
- package/dist/cjs/api/resources/customers/client/Client.js +136 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.ts +9 -0
- package/dist/cjs/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.js +3 -0
- package/dist/cjs/api/resources/customers/client/requests/index.d.ts +2 -0
- package/dist/cjs/api/resources/index.d.ts +6 -0
- package/dist/cjs/api/resources/index.js +7 -1
- package/dist/cjs/api/resources/orders/client/requests/CreateOrderRequest.d.ts +12 -7
- package/dist/cjs/api/resources/orders/client/requests/UpdateOrderRequest.d.ts +10 -7
- package/dist/cjs/api/types/Checkout.d.ts +18 -0
- package/dist/cjs/api/types/Checkout.js +3 -0
- package/dist/cjs/api/types/CheckoutListResponse.d.ts +5 -0
- package/dist/cjs/api/types/CheckoutListResponse.js +3 -0
- package/dist/cjs/api/types/CheckoutProduct.d.ts +3 -0
- package/dist/cjs/api/types/CheckoutProduct.js +3 -0
- package/dist/cjs/api/types/CheckoutProductInput.d.ts +3 -0
- package/dist/cjs/api/types/CheckoutProductInput.js +3 -0
- package/dist/cjs/api/types/CheckoutStatus.d.ts +7 -0
- package/dist/cjs/api/types/CheckoutStatus.js +10 -0
- package/dist/cjs/api/types/Contact.d.ts +11 -0
- package/dist/cjs/api/types/Contact.js +11 -0
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.d.ts +120 -0
- package/dist/cjs/api/types/CreateOrderLineAttributeRequest.js +73 -0
- package/dist/cjs/api/types/CreateOrderLineRequest.d.ts +9 -0
- package/dist/cjs/api/types/CreateOrderLineRequest.js +3 -0
- package/dist/cjs/api/types/CreditBalance.d.ts +19 -0
- package/dist/cjs/api/types/CreditBalance.js +11 -0
- package/dist/cjs/api/types/CreditBalanceListResponse.d.ts +4 -0
- package/dist/cjs/api/types/CreditBalanceListResponse.js +3 -0
- package/dist/cjs/api/types/CreditCurrency.d.ts +9 -0
- package/dist/cjs/api/types/CreditCurrency.js +3 -0
- package/dist/cjs/api/types/CreditCurrencyListResponse.d.ts +4 -0
- package/dist/cjs/api/types/CreditCurrencyListResponse.js +3 -0
- package/dist/cjs/api/types/CustomerPortal.d.ts +10 -0
- package/dist/cjs/api/types/CustomerPortal.js +3 -0
- package/dist/cjs/api/types/CustomerPortalStatus.d.ts +5 -0
- package/dist/cjs/api/types/CustomerPortalStatus.js +8 -0
- package/dist/cjs/api/types/Order.d.ts +3 -0
- package/dist/cjs/api/types/Signal.d.ts +2 -0
- package/dist/cjs/api/types/UpdateContactRequest.d.ts +11 -0
- package/dist/cjs/api/types/UpdateContactRequest.js +11 -0
- package/dist/cjs/api/types/index.d.ts +13 -0
- package/dist/cjs/api/types/index.js +13 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +9 -0
- package/dist/esm/Client.mjs +17 -2
- package/dist/esm/api/resources/checkouts/client/Client.d.mts +84 -0
- package/dist/esm/api/resources/checkouts/client/Client.mjs +313 -0
- package/dist/esm/api/resources/checkouts/client/index.d.mts +1 -0
- package/dist/esm/api/resources/checkouts/client/index.mjs +1 -0
- package/dist/esm/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.d.mts +9 -0
- package/dist/esm/api/resources/checkouts/client/requests/ArchiveCheckoutRequest.mjs +2 -0
- package/dist/esm/api/resources/checkouts/client/requests/CreateCheckoutRequest.d.mts +23 -0
- package/dist/esm/api/resources/checkouts/client/requests/CreateCheckoutRequest.mjs +2 -0
- package/dist/esm/api/resources/checkouts/client/requests/GetCheckoutRequest.d.mts +9 -0
- package/dist/esm/api/resources/checkouts/client/requests/GetCheckoutRequest.mjs +2 -0
- package/dist/esm/api/resources/checkouts/client/requests/ListCheckoutsRequest.d.mts +10 -0
- package/dist/esm/api/resources/checkouts/client/requests/ListCheckoutsRequest.mjs +2 -0
- package/dist/esm/api/resources/checkouts/client/requests/index.d.mts +4 -0
- package/dist/esm/api/resources/checkouts/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/checkouts/index.d.mts +2 -0
- package/dist/esm/api/resources/checkouts/index.mjs +2 -0
- package/dist/esm/api/resources/checkouts/types/ListCheckoutsRequestStatus.d.mts +6 -0
- package/dist/esm/api/resources/checkouts/types/ListCheckoutsRequestStatus.mjs +6 -0
- package/dist/esm/api/resources/checkouts/types/index.d.mts +1 -0
- package/dist/esm/api/resources/checkouts/types/index.mjs +1 -0
- package/dist/esm/api/resources/contacts/client/Client.d.mts +0 -2
- package/dist/esm/api/resources/contacts/client/Client.mjs +0 -2
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.d.mts +13 -4
- package/dist/esm/api/resources/contacts/client/requests/CreateContactRequest.mjs +10 -1
- package/dist/esm/api/resources/credits/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/credits/client/Client.mjs +86 -0
- package/dist/esm/api/resources/credits/client/index.d.mts +1 -0
- package/dist/esm/api/resources/credits/client/index.mjs +1 -0
- package/dist/esm/api/resources/credits/index.d.mts +1 -0
- package/dist/esm/api/resources/credits/index.mjs +1 -0
- package/dist/esm/api/resources/customerPortals/client/Client.d.mts +30 -0
- package/dist/esm/api/resources/customerPortals/client/Client.mjs +96 -0
- package/dist/esm/api/resources/customerPortals/client/index.d.mts +1 -0
- package/dist/esm/api/resources/customerPortals/client/index.mjs +1 -0
- package/dist/esm/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.d.mts +12 -0
- package/dist/esm/api/resources/customerPortals/client/requests/CreateCustomerPortalRequest.mjs +2 -0
- package/dist/esm/api/resources/customerPortals/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/customerPortals/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/customerPortals/index.d.mts +1 -0
- package/dist/esm/api/resources/customerPortals/index.mjs +1 -0
- package/dist/esm/api/resources/customers/client/Client.d.mts +34 -0
- package/dist/esm/api/resources/customers/client/Client.mjs +136 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.d.mts +9 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesByExternalIdRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.d.mts +9 -0
- package/dist/esm/api/resources/customers/client/requests/GetCustomerCreditBalancesRequest.mjs +2 -0
- package/dist/esm/api/resources/customers/client/requests/index.d.mts +2 -0
- package/dist/esm/api/resources/index.d.mts +6 -0
- package/dist/esm/api/resources/index.mjs +6 -0
- package/dist/esm/api/resources/orders/client/requests/CreateOrderRequest.d.mts +12 -7
- package/dist/esm/api/resources/orders/client/requests/UpdateOrderRequest.d.mts +10 -7
- package/dist/esm/api/types/Checkout.d.mts +18 -0
- package/dist/esm/api/types/Checkout.mjs +2 -0
- package/dist/esm/api/types/CheckoutListResponse.d.mts +5 -0
- package/dist/esm/api/types/CheckoutListResponse.mjs +2 -0
- package/dist/esm/api/types/CheckoutProduct.d.mts +3 -0
- package/dist/esm/api/types/CheckoutProduct.mjs +2 -0
- package/dist/esm/api/types/CheckoutProductInput.d.mts +3 -0
- package/dist/esm/api/types/CheckoutProductInput.mjs +2 -0
- package/dist/esm/api/types/CheckoutStatus.d.mts +7 -0
- package/dist/esm/api/types/CheckoutStatus.mjs +7 -0
- package/dist/esm/api/types/Contact.d.mts +11 -0
- package/dist/esm/api/types/Contact.mjs +10 -1
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.d.mts +120 -0
- package/dist/esm/api/types/CreateOrderLineAttributeRequest.mjs +70 -0
- package/dist/esm/api/types/CreateOrderLineRequest.d.mts +9 -0
- package/dist/esm/api/types/CreateOrderLineRequest.mjs +2 -0
- package/dist/esm/api/types/CreditBalance.d.mts +19 -0
- package/dist/esm/api/types/CreditBalance.mjs +8 -0
- package/dist/esm/api/types/CreditBalanceListResponse.d.mts +4 -0
- package/dist/esm/api/types/CreditBalanceListResponse.mjs +2 -0
- package/dist/esm/api/types/CreditCurrency.d.mts +9 -0
- package/dist/esm/api/types/CreditCurrency.mjs +2 -0
- package/dist/esm/api/types/CreditCurrencyListResponse.d.mts +4 -0
- package/dist/esm/api/types/CreditCurrencyListResponse.mjs +2 -0
- package/dist/esm/api/types/CustomerPortal.d.mts +10 -0
- package/dist/esm/api/types/CustomerPortal.mjs +2 -0
- package/dist/esm/api/types/CustomerPortalStatus.d.mts +5 -0
- package/dist/esm/api/types/CustomerPortalStatus.mjs +5 -0
- package/dist/esm/api/types/Order.d.mts +3 -0
- package/dist/esm/api/types/Signal.d.mts +2 -0
- package/dist/esm/api/types/UpdateContactRequest.d.mts +11 -0
- package/dist/esm/api/types/UpdateContactRequest.mjs +10 -1
- package/dist/esm/api/types/index.d.mts +13 -0
- package/dist/esm/api/types/index.mjs +13 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +215 -215
- package/reference.md +512 -2
|
@@ -618,6 +618,142 @@ class Customers {
|
|
|
618
618
|
}
|
|
619
619
|
});
|
|
620
620
|
}
|
|
621
|
+
/**
|
|
622
|
+
* Get current customer credit balances grouped by currency
|
|
623
|
+
*
|
|
624
|
+
* @param {Paid.GetCustomerCreditBalancesRequest} request
|
|
625
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
626
|
+
*
|
|
627
|
+
* @throws {@link Paid.ForbiddenError}
|
|
628
|
+
* @throws {@link Paid.NotFoundError}
|
|
629
|
+
* @throws {@link Paid.InternalServerError}
|
|
630
|
+
*
|
|
631
|
+
* @example
|
|
632
|
+
* await client.customers.getCustomerCreditBalances({
|
|
633
|
+
* id: "id"
|
|
634
|
+
* })
|
|
635
|
+
*/
|
|
636
|
+
getCustomerCreditBalances(request, requestOptions) {
|
|
637
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalances(request, requestOptions));
|
|
638
|
+
}
|
|
639
|
+
__getCustomerCreditBalances(request, requestOptions) {
|
|
640
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
641
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
642
|
+
const { id } = request;
|
|
643
|
+
const _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);
|
|
644
|
+
const _response = yield core.fetcher({
|
|
645
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/${core.url.encodePathParam(id)}/credits/balances`),
|
|
646
|
+
method: "GET",
|
|
647
|
+
headers: _headers,
|
|
648
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
649
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
650
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
651
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
652
|
+
});
|
|
653
|
+
if (_response.ok) {
|
|
654
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
655
|
+
}
|
|
656
|
+
if (_response.error.reason === "status-code") {
|
|
657
|
+
switch (_response.error.statusCode) {
|
|
658
|
+
case 403:
|
|
659
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
660
|
+
case 404:
|
|
661
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
662
|
+
case 500:
|
|
663
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
664
|
+
default:
|
|
665
|
+
throw new errors.PaidError({
|
|
666
|
+
statusCode: _response.error.statusCode,
|
|
667
|
+
body: _response.error.body,
|
|
668
|
+
rawResponse: _response.rawResponse,
|
|
669
|
+
});
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
switch (_response.error.reason) {
|
|
673
|
+
case "non-json":
|
|
674
|
+
throw new errors.PaidError({
|
|
675
|
+
statusCode: _response.error.statusCode,
|
|
676
|
+
body: _response.error.rawBody,
|
|
677
|
+
rawResponse: _response.rawResponse,
|
|
678
|
+
});
|
|
679
|
+
case "timeout":
|
|
680
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/{id}/credits/balances.");
|
|
681
|
+
case "unknown":
|
|
682
|
+
throw new errors.PaidError({
|
|
683
|
+
message: _response.error.errorMessage,
|
|
684
|
+
rawResponse: _response.rawResponse,
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
/**
|
|
690
|
+
* Get current customer credit balances grouped by currency, looked up by external ID
|
|
691
|
+
*
|
|
692
|
+
* @param {Paid.GetCustomerCreditBalancesByExternalIdRequest} request
|
|
693
|
+
* @param {Customers.RequestOptions} requestOptions - Request-specific configuration.
|
|
694
|
+
*
|
|
695
|
+
* @throws {@link Paid.ForbiddenError}
|
|
696
|
+
* @throws {@link Paid.NotFoundError}
|
|
697
|
+
* @throws {@link Paid.InternalServerError}
|
|
698
|
+
*
|
|
699
|
+
* @example
|
|
700
|
+
* await client.customers.getCustomerCreditBalancesByExternalId({
|
|
701
|
+
* externalId: "externalId"
|
|
702
|
+
* })
|
|
703
|
+
*/
|
|
704
|
+
getCustomerCreditBalancesByExternalId(request, requestOptions) {
|
|
705
|
+
return core.HttpResponsePromise.fromPromise(this.__getCustomerCreditBalancesByExternalId(request, requestOptions));
|
|
706
|
+
}
|
|
707
|
+
__getCustomerCreditBalancesByExternalId(request, requestOptions) {
|
|
708
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
709
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
710
|
+
const { externalId } = request;
|
|
711
|
+
const _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);
|
|
712
|
+
const _response = yield core.fetcher({
|
|
713
|
+
url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.PaidEnvironment.Default, `customers/external/${core.url.encodePathParam(externalId)}/credits/balances`),
|
|
714
|
+
method: "GET",
|
|
715
|
+
headers: _headers,
|
|
716
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
717
|
+
timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
|
|
718
|
+
maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
|
|
719
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
720
|
+
});
|
|
721
|
+
if (_response.ok) {
|
|
722
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
723
|
+
}
|
|
724
|
+
if (_response.error.reason === "status-code") {
|
|
725
|
+
switch (_response.error.statusCode) {
|
|
726
|
+
case 403:
|
|
727
|
+
throw new Paid.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
728
|
+
case 404:
|
|
729
|
+
throw new Paid.NotFoundError(_response.error.body, _response.rawResponse);
|
|
730
|
+
case 500:
|
|
731
|
+
throw new Paid.InternalServerError(_response.error.body, _response.rawResponse);
|
|
732
|
+
default:
|
|
733
|
+
throw new errors.PaidError({
|
|
734
|
+
statusCode: _response.error.statusCode,
|
|
735
|
+
body: _response.error.body,
|
|
736
|
+
rawResponse: _response.rawResponse,
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
switch (_response.error.reason) {
|
|
741
|
+
case "non-json":
|
|
742
|
+
throw new errors.PaidError({
|
|
743
|
+
statusCode: _response.error.statusCode,
|
|
744
|
+
body: _response.error.rawBody,
|
|
745
|
+
rawResponse: _response.rawResponse,
|
|
746
|
+
});
|
|
747
|
+
case "timeout":
|
|
748
|
+
throw new errors.PaidTimeoutError("Timeout exceeded when calling GET /customers/external/{externalId}/credits/balances.");
|
|
749
|
+
case "unknown":
|
|
750
|
+
throw new errors.PaidError({
|
|
751
|
+
message: _response.error.errorMessage,
|
|
752
|
+
rawResponse: _response.rawResponse,
|
|
753
|
+
});
|
|
754
|
+
}
|
|
755
|
+
});
|
|
756
|
+
}
|
|
621
757
|
_getAuthorizationHeader() {
|
|
622
758
|
return __awaiter(this, void 0, void 0, function* () {
|
|
623
759
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
@@ -3,6 +3,8 @@ export type { DeleteCustomerByExternalIdRequest } from "./DeleteCustomerByExtern
|
|
|
3
3
|
export type { DeleteCustomerByIdRequest } from "./DeleteCustomerByIdRequest.js";
|
|
4
4
|
export type { GetCustomerByExternalIdRequest } from "./GetCustomerByExternalIdRequest.js";
|
|
5
5
|
export type { GetCustomerByIdRequest } from "./GetCustomerByIdRequest.js";
|
|
6
|
+
export type { GetCustomerCreditBalancesByExternalIdRequest } from "./GetCustomerCreditBalancesByExternalIdRequest.js";
|
|
7
|
+
export type { GetCustomerCreditBalancesRequest } from "./GetCustomerCreditBalancesRequest.js";
|
|
6
8
|
export type { ListCustomersRequest } from "./ListCustomersRequest.js";
|
|
7
9
|
export type { UpdateCustomerByExternalIdRequest } from "./UpdateCustomerByExternalIdRequest.js";
|
|
8
10
|
export type { UpdateCustomerByIdRequest } from "./UpdateCustomerByIdRequest.js";
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
export * from "./checkouts/client/requests/index.js";
|
|
2
|
+
export * as checkouts from "./checkouts/index.js";
|
|
3
|
+
export * from "./checkouts/types/index.js";
|
|
1
4
|
export * from "./contacts/client/requests/index.js";
|
|
2
5
|
export * as contacts from "./contacts/index.js";
|
|
6
|
+
export * as credits from "./credits/index.js";
|
|
7
|
+
export * from "./customerPortals/client/requests/index.js";
|
|
8
|
+
export * as customerPortals from "./customerPortals/index.js";
|
|
3
9
|
export * from "./customers/client/requests/index.js";
|
|
4
10
|
export * as customers from "./customers/index.js";
|
|
5
11
|
export * from "./invoices/client/requests/index.js";
|
|
@@ -36,9 +36,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.signals = exports.products = exports.orders = exports.invoices = exports.customers = exports.contacts = void 0;
|
|
39
|
+
exports.signals = exports.products = exports.orders = exports.invoices = exports.customers = exports.customerPortals = exports.credits = exports.contacts = exports.checkouts = void 0;
|
|
40
|
+
__exportStar(require("./checkouts/client/requests/index.js"), exports);
|
|
41
|
+
exports.checkouts = __importStar(require("./checkouts/index.js"));
|
|
42
|
+
__exportStar(require("./checkouts/types/index.js"), exports);
|
|
40
43
|
__exportStar(require("./contacts/client/requests/index.js"), exports);
|
|
41
44
|
exports.contacts = __importStar(require("./contacts/index.js"));
|
|
45
|
+
exports.credits = __importStar(require("./credits/index.js"));
|
|
46
|
+
__exportStar(require("./customerPortals/client/requests/index.js"), exports);
|
|
47
|
+
exports.customerPortals = __importStar(require("./customerPortals/index.js"));
|
|
42
48
|
__exportStar(require("./customers/client/requests/index.js"), exports);
|
|
43
49
|
exports.customers = __importStar(require("./customers/index.js"));
|
|
44
50
|
__exportStar(require("./invoices/client/requests/index.js"), exports);
|
|
@@ -7,16 +7,21 @@ import type * as Paid from "../../../../index.js";
|
|
|
7
7
|
*/
|
|
8
8
|
export interface CreateOrderRequest {
|
|
9
9
|
customerId: string;
|
|
10
|
-
billingCustomerId?: string
|
|
10
|
+
billingCustomerId?: string;
|
|
11
11
|
billingContactIds?: string[];
|
|
12
12
|
name?: string;
|
|
13
13
|
startDate?: string;
|
|
14
|
-
endDate?: string
|
|
15
|
-
subscriptionTerms?: number
|
|
14
|
+
endDate?: string;
|
|
15
|
+
subscriptionTerms?: number;
|
|
16
16
|
creationState?: Paid.OrderCreationState;
|
|
17
17
|
/** Day of month for billing anchor (1-31). Defaults to start date day if not provided. */
|
|
18
|
-
billingAnchor?: number
|
|
19
|
-
paymentTerms?: string
|
|
20
|
-
externalId?: string
|
|
21
|
-
metadata?: Record<string, unknown
|
|
18
|
+
billingAnchor?: number;
|
|
19
|
+
paymentTerms?: string;
|
|
20
|
+
externalId?: string;
|
|
21
|
+
metadata?: Record<string, unknown>;
|
|
22
|
+
currency?: string;
|
|
23
|
+
autoPostInvoices?: boolean;
|
|
24
|
+
autoSendBillingEmails?: boolean;
|
|
25
|
+
autoSendPaymentEmails?: boolean;
|
|
26
|
+
lines?: Paid.CreateOrderLineRequest[];
|
|
22
27
|
}
|
|
@@ -9,14 +9,17 @@ export interface UpdateOrderRequest {
|
|
|
9
9
|
id: string;
|
|
10
10
|
name?: string;
|
|
11
11
|
startDate?: string;
|
|
12
|
-
endDate?: string
|
|
13
|
-
subscriptionTerms?: number
|
|
12
|
+
endDate?: string;
|
|
13
|
+
subscriptionTerms?: number;
|
|
14
14
|
creationState?: Paid.OrderCreationState;
|
|
15
15
|
/** Day of month for billing anchor (1-31). Defaults to start date day if not provided. */
|
|
16
|
-
billingAnchor?: number
|
|
17
|
-
paymentTerms?: string
|
|
18
|
-
externalId?: string
|
|
19
|
-
metadata?: Record<string, unknown
|
|
20
|
-
billingCustomerId?: string
|
|
16
|
+
billingAnchor?: number;
|
|
17
|
+
paymentTerms?: string;
|
|
18
|
+
externalId?: string;
|
|
19
|
+
metadata?: Record<string, unknown>;
|
|
20
|
+
billingCustomerId?: string;
|
|
21
21
|
billingContactIds?: string[];
|
|
22
|
+
autoPostInvoices?: boolean;
|
|
23
|
+
autoSendBillingEmails?: boolean;
|
|
24
|
+
autoSendPaymentEmails?: boolean;
|
|
22
25
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type * as Paid from "../index.js";
|
|
2
|
+
export interface Checkout {
|
|
3
|
+
id: string;
|
|
4
|
+
url: string;
|
|
5
|
+
status: Paid.CheckoutStatus;
|
|
6
|
+
products: Paid.CheckoutProduct[];
|
|
7
|
+
customerId: string | null;
|
|
8
|
+
externalCustomerId: string | null;
|
|
9
|
+
successUrl: string;
|
|
10
|
+
cancelUrl: string | null;
|
|
11
|
+
expiresAt: string | null;
|
|
12
|
+
metadata: Record<string, unknown> | null;
|
|
13
|
+
collectAddress: boolean;
|
|
14
|
+
collectPhone: boolean;
|
|
15
|
+
singleUse: boolean;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CheckoutStatus = void 0;
|
|
5
|
+
exports.CheckoutStatus = {
|
|
6
|
+
Active: "active",
|
|
7
|
+
Completed: "completed",
|
|
8
|
+
Expired: "expired",
|
|
9
|
+
Archived: "archived",
|
|
10
|
+
};
|
|
@@ -8,6 +8,17 @@ export interface Contact {
|
|
|
8
8
|
phone: string | null;
|
|
9
9
|
billingAddress?: Paid.ContactBillingAddress | null;
|
|
10
10
|
externalId: string | null;
|
|
11
|
+
roles: Contact.Roles.Item[];
|
|
11
12
|
createdAt: string;
|
|
12
13
|
updatedAt: string;
|
|
13
14
|
}
|
|
15
|
+
export declare namespace Contact {
|
|
16
|
+
type Roles = Roles.Item[];
|
|
17
|
+
namespace Roles {
|
|
18
|
+
const Item: {
|
|
19
|
+
readonly Billing: "BILLING";
|
|
20
|
+
readonly AccountsPayable: "ACCOUNTS_PAYABLE";
|
|
21
|
+
};
|
|
22
|
+
type Item = (typeof Item)[keyof typeof Item];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Contact = void 0;
|
|
5
|
+
var Contact;
|
|
6
|
+
(function (Contact) {
|
|
7
|
+
let Roles;
|
|
8
|
+
(function (Roles) {
|
|
9
|
+
Roles.Item = {
|
|
10
|
+
Billing: "BILLING",
|
|
11
|
+
AccountsPayable: "ACCOUNTS_PAYABLE",
|
|
12
|
+
};
|
|
13
|
+
})(Roles = Contact.Roles || (Contact.Roles = {}));
|
|
14
|
+
})(Contact || (exports.Contact = Contact = {}));
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export interface CreateOrderLineAttributeRequest {
|
|
2
|
+
name: string;
|
|
3
|
+
quantity?: number;
|
|
4
|
+
pricing: CreateOrderLineAttributeRequest.Pricing;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace CreateOrderLineAttributeRequest {
|
|
7
|
+
interface Pricing {
|
|
8
|
+
eventName?: string;
|
|
9
|
+
chargeType: Pricing.ChargeType;
|
|
10
|
+
pricePoints: Pricing.PricePoints;
|
|
11
|
+
pricingModel?: Pricing.PricingModel;
|
|
12
|
+
billingFrequency?: Pricing.BillingFrequency;
|
|
13
|
+
billingFrequencyCustomMonths?: number;
|
|
14
|
+
billingType?: Pricing.BillingType;
|
|
15
|
+
signalType?: Pricing.SignalType;
|
|
16
|
+
creditsCurrencyId?: string;
|
|
17
|
+
creditCost?: number;
|
|
18
|
+
overageUnitPrice?: number;
|
|
19
|
+
creditBenefits?: Pricing.CreditBenefits.Item[];
|
|
20
|
+
}
|
|
21
|
+
namespace Pricing {
|
|
22
|
+
const ChargeType: {
|
|
23
|
+
readonly Usage: "usage";
|
|
24
|
+
readonly Recurring: "recurring";
|
|
25
|
+
readonly OneTime: "oneTime";
|
|
26
|
+
readonly SeatBased: "seatBased";
|
|
27
|
+
};
|
|
28
|
+
type ChargeType = (typeof ChargeType)[keyof typeof ChargeType];
|
|
29
|
+
interface PricePoints {
|
|
30
|
+
currency?: string;
|
|
31
|
+
unitPrice: number;
|
|
32
|
+
minQuantity?: number;
|
|
33
|
+
includedQuantity?: number;
|
|
34
|
+
tiers?: PricePoints.Tiers.Item[];
|
|
35
|
+
}
|
|
36
|
+
namespace PricePoints {
|
|
37
|
+
type Tiers = Tiers.Item[];
|
|
38
|
+
namespace Tiers {
|
|
39
|
+
interface Item {
|
|
40
|
+
flatAmount?: number;
|
|
41
|
+
index?: number;
|
|
42
|
+
lowerBound?: number;
|
|
43
|
+
number?: number;
|
|
44
|
+
tierBillingType?: Item.TierBillingType;
|
|
45
|
+
unitAmount?: number;
|
|
46
|
+
upperBound?: number;
|
|
47
|
+
}
|
|
48
|
+
namespace Item {
|
|
49
|
+
const TierBillingType: {
|
|
50
|
+
readonly Flat: "flat";
|
|
51
|
+
readonly PerUnit: "perUnit";
|
|
52
|
+
};
|
|
53
|
+
type TierBillingType = (typeof TierBillingType)[keyof typeof TierBillingType];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
const PricingModel: {
|
|
58
|
+
readonly PerUnit: "perUnit";
|
|
59
|
+
readonly VolumePricing: "volumePricing";
|
|
60
|
+
readonly GraduatedPricing: "graduatedPricing";
|
|
61
|
+
readonly PrepaidCredits: "prepaidCredits";
|
|
62
|
+
readonly Flat: "flat";
|
|
63
|
+
};
|
|
64
|
+
type PricingModel = (typeof PricingModel)[keyof typeof PricingModel];
|
|
65
|
+
const BillingFrequency: {
|
|
66
|
+
readonly Monthly: "monthly";
|
|
67
|
+
readonly Quarterly: "quarterly";
|
|
68
|
+
readonly SemiAnnually: "semiAnnually";
|
|
69
|
+
readonly Annual: "annual";
|
|
70
|
+
readonly Custom: "custom";
|
|
71
|
+
};
|
|
72
|
+
type BillingFrequency = (typeof BillingFrequency)[keyof typeof BillingFrequency];
|
|
73
|
+
const BillingType: {
|
|
74
|
+
readonly Advance: "advance";
|
|
75
|
+
readonly Arrears: "arrears";
|
|
76
|
+
};
|
|
77
|
+
type BillingType = (typeof BillingType)[keyof typeof BillingType];
|
|
78
|
+
const SignalType: {
|
|
79
|
+
readonly Activity: "activity";
|
|
80
|
+
readonly Outcome: "outcome";
|
|
81
|
+
};
|
|
82
|
+
type SignalType = (typeof SignalType)[keyof typeof SignalType];
|
|
83
|
+
type CreditBenefits = CreditBenefits.Item[];
|
|
84
|
+
namespace CreditBenefits {
|
|
85
|
+
interface Item {
|
|
86
|
+
id: string;
|
|
87
|
+
creditsCurrencyId?: string;
|
|
88
|
+
recipient?: Item.Recipient;
|
|
89
|
+
amount: number;
|
|
90
|
+
rolloverAmount?: number;
|
|
91
|
+
rolloverDuration?: number;
|
|
92
|
+
rolloverDurationUnit?: Item.RolloverDurationUnit;
|
|
93
|
+
allocationCadence?: Item.AllocationCadence;
|
|
94
|
+
creditGrantTiming?: Item.CreditGrantTiming;
|
|
95
|
+
}
|
|
96
|
+
namespace Item {
|
|
97
|
+
const Recipient: {
|
|
98
|
+
readonly Organization: "organization";
|
|
99
|
+
readonly Seat: "seat";
|
|
100
|
+
};
|
|
101
|
+
type Recipient = (typeof Recipient)[keyof typeof Recipient];
|
|
102
|
+
const RolloverDurationUnit: {
|
|
103
|
+
readonly Days: "days";
|
|
104
|
+
readonly Months: "months";
|
|
105
|
+
};
|
|
106
|
+
type RolloverDurationUnit = (typeof RolloverDurationUnit)[keyof typeof RolloverDurationUnit];
|
|
107
|
+
const AllocationCadence: {
|
|
108
|
+
readonly Upfront: "upfront";
|
|
109
|
+
readonly Monthly: "monthly";
|
|
110
|
+
};
|
|
111
|
+
type AllocationCadence = (typeof AllocationCadence)[keyof typeof AllocationCadence];
|
|
112
|
+
const CreditGrantTiming: {
|
|
113
|
+
readonly OnPayment: "on_payment";
|
|
114
|
+
readonly OnOrderActivation: "on_order_activation";
|
|
115
|
+
};
|
|
116
|
+
type CreditGrantTiming = (typeof CreditGrantTiming)[keyof typeof CreditGrantTiming];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CreateOrderLineAttributeRequest = void 0;
|
|
5
|
+
var CreateOrderLineAttributeRequest;
|
|
6
|
+
(function (CreateOrderLineAttributeRequest) {
|
|
7
|
+
let Pricing;
|
|
8
|
+
(function (Pricing) {
|
|
9
|
+
Pricing.ChargeType = {
|
|
10
|
+
Usage: "usage",
|
|
11
|
+
Recurring: "recurring",
|
|
12
|
+
OneTime: "oneTime",
|
|
13
|
+
SeatBased: "seatBased",
|
|
14
|
+
};
|
|
15
|
+
let PricePoints;
|
|
16
|
+
(function (PricePoints) {
|
|
17
|
+
let Tiers;
|
|
18
|
+
(function (Tiers) {
|
|
19
|
+
let Item;
|
|
20
|
+
(function (Item) {
|
|
21
|
+
Item.TierBillingType = {
|
|
22
|
+
Flat: "flat",
|
|
23
|
+
PerUnit: "perUnit",
|
|
24
|
+
};
|
|
25
|
+
})(Item = Tiers.Item || (Tiers.Item = {}));
|
|
26
|
+
})(Tiers = PricePoints.Tiers || (PricePoints.Tiers = {}));
|
|
27
|
+
})(PricePoints = Pricing.PricePoints || (Pricing.PricePoints = {}));
|
|
28
|
+
Pricing.PricingModel = {
|
|
29
|
+
PerUnit: "perUnit",
|
|
30
|
+
VolumePricing: "volumePricing",
|
|
31
|
+
GraduatedPricing: "graduatedPricing",
|
|
32
|
+
PrepaidCredits: "prepaidCredits",
|
|
33
|
+
Flat: "flat",
|
|
34
|
+
};
|
|
35
|
+
Pricing.BillingFrequency = {
|
|
36
|
+
Monthly: "monthly",
|
|
37
|
+
Quarterly: "quarterly",
|
|
38
|
+
SemiAnnually: "semiAnnually",
|
|
39
|
+
Annual: "annual",
|
|
40
|
+
Custom: "custom",
|
|
41
|
+
};
|
|
42
|
+
Pricing.BillingType = {
|
|
43
|
+
Advance: "advance",
|
|
44
|
+
Arrears: "arrears",
|
|
45
|
+
};
|
|
46
|
+
Pricing.SignalType = {
|
|
47
|
+
Activity: "activity",
|
|
48
|
+
Outcome: "outcome",
|
|
49
|
+
};
|
|
50
|
+
let CreditBenefits;
|
|
51
|
+
(function (CreditBenefits) {
|
|
52
|
+
let Item;
|
|
53
|
+
(function (Item) {
|
|
54
|
+
Item.Recipient = {
|
|
55
|
+
Organization: "organization",
|
|
56
|
+
Seat: "seat",
|
|
57
|
+
};
|
|
58
|
+
Item.RolloverDurationUnit = {
|
|
59
|
+
Days: "days",
|
|
60
|
+
Months: "months",
|
|
61
|
+
};
|
|
62
|
+
Item.AllocationCadence = {
|
|
63
|
+
Upfront: "upfront",
|
|
64
|
+
Monthly: "monthly",
|
|
65
|
+
};
|
|
66
|
+
Item.CreditGrantTiming = {
|
|
67
|
+
OnPayment: "on_payment",
|
|
68
|
+
OnOrderActivation: "on_order_activation",
|
|
69
|
+
};
|
|
70
|
+
})(Item = CreditBenefits.Item || (CreditBenefits.Item = {}));
|
|
71
|
+
})(CreditBenefits = Pricing.CreditBenefits || (Pricing.CreditBenefits = {}));
|
|
72
|
+
})(Pricing = CreateOrderLineAttributeRequest.Pricing || (CreateOrderLineAttributeRequest.Pricing = {}));
|
|
73
|
+
})(CreateOrderLineAttributeRequest || (exports.CreateOrderLineAttributeRequest = CreateOrderLineAttributeRequest = {}));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface CreditBalance {
|
|
2
|
+
creditsCurrencyId: string;
|
|
3
|
+
currencyName: string;
|
|
4
|
+
currencyKey: string;
|
|
5
|
+
available: number;
|
|
6
|
+
used: number;
|
|
7
|
+
total: number;
|
|
8
|
+
periodStart: string | null;
|
|
9
|
+
periodEnd: string | null;
|
|
10
|
+
rolloverEndDate: string | null;
|
|
11
|
+
recipient: CreditBalance.Recipient;
|
|
12
|
+
}
|
|
13
|
+
export declare namespace CreditBalance {
|
|
14
|
+
const Recipient: {
|
|
15
|
+
readonly Organization: "organization";
|
|
16
|
+
readonly Seat: "seat";
|
|
17
|
+
};
|
|
18
|
+
type Recipient = (typeof Recipient)[keyof typeof Recipient];
|
|
19
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CreditBalance = void 0;
|
|
5
|
+
var CreditBalance;
|
|
6
|
+
(function (CreditBalance) {
|
|
7
|
+
CreditBalance.Recipient = {
|
|
8
|
+
Organization: "organization",
|
|
9
|
+
Seat: "seat",
|
|
10
|
+
};
|
|
11
|
+
})(CreditBalance || (exports.CreditBalance = CreditBalance = {}));
|