perspectapi-ts-sdk 7.2.0 → 7.2.2
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/dist/{chunk-OG4UB2MD.mjs → chunk-Z2LA2IWQ.mjs} +9 -0
- package/dist/{index-fBvdMvWa.d.mts → index-uyP4WdHB.d.mts} +39 -0
- package/dist/{index-fBvdMvWa.d.ts → index-uyP4WdHB.d.ts} +39 -0
- package/dist/index.d.mts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +9 -0
- package/dist/index.mjs +1 -1
- package/dist/v2/index.d.mts +1 -1
- package/dist/v2/index.d.ts +1 -1
- package/dist/v2/index.js +9 -0
- package/dist/v2/index.mjs +1 -1
- package/package.json +1 -1
- package/src/client/site-users-client.ts +12 -0
- package/src/v2/client/orders-client.ts +9 -0
- package/src/v2/types.ts +30 -0
|
@@ -945,6 +945,12 @@ var OrdersV2Client = class extends BaseV2Client {
|
|
|
945
945
|
*
|
|
946
946
|
* Set `notify_customer: true` when moving the order into a terminal
|
|
947
947
|
* fulfillment state to send the customer fulfillment email.
|
|
948
|
+
*
|
|
949
|
+
* When cancelling (`fulfillment_status: 'cancelled'`/`'canceled'`) with
|
|
950
|
+
* `notify_customer: true`, `cancellation_reason` is **required**: the API
|
|
951
|
+
* responds `400` if it is missing or blank, and the order is not mutated.
|
|
952
|
+
* `cancellation_details_*` are no longer derived from `fulfillment_details_*`
|
|
953
|
+
* — pass them explicitly if you need them.
|
|
948
954
|
*/
|
|
949
955
|
async updateFulfillment(siteName, id, data) {
|
|
950
956
|
const result = await this.patchOne(
|
|
@@ -960,6 +966,9 @@ var OrdersV2Client = class extends BaseV2Client {
|
|
|
960
966
|
/**
|
|
961
967
|
* Send the customer fulfillment template for an external delivery/packing
|
|
962
968
|
* record without mutating a checkout session.
|
|
969
|
+
*
|
|
970
|
+
* When `fulfillment_status` is `cancelled`/`canceled`, `cancellation_reason`
|
|
971
|
+
* is **required**: the API responds `400` if it is missing or blank.
|
|
963
972
|
*/
|
|
964
973
|
async sendFulfillmentNotification(siteName, data) {
|
|
965
974
|
return this.post(
|
|
@@ -1457,13 +1457,32 @@ interface V2OrderCreateParams {
|
|
|
1457
1457
|
currency?: string;
|
|
1458
1458
|
referral_code?: string;
|
|
1459
1459
|
referrer_site_user_id?: string;
|
|
1460
|
+
/**
|
|
1461
|
+
* Subscription billing-cycle anchor as a Unix timestamp (seconds). When set
|
|
1462
|
+
* on a `subscription` checkout, no charge is taken at checkout; the first
|
|
1463
|
+
* invoice and the recurring cycle are aligned to this instant via Stripe
|
|
1464
|
+
* `subscription_data.billing_cycle_anchor` with `proration_behavior: none`.
|
|
1465
|
+
*/
|
|
1466
|
+
billing_cycle_anchor?: number;
|
|
1460
1467
|
}
|
|
1461
1468
|
interface V2OrderFulfillmentUpdate {
|
|
1462
1469
|
fulfillment_status: string;
|
|
1463
1470
|
tracking_number?: string;
|
|
1471
|
+
/** Internal operator notes. Never shown to the customer. */
|
|
1464
1472
|
notes?: string;
|
|
1465
1473
|
fulfillment_details_text?: string;
|
|
1466
1474
|
fulfillment_details_html?: string;
|
|
1475
|
+
/**
|
|
1476
|
+
* Customer-visible cancellation reason. **Required** when
|
|
1477
|
+
* `fulfillment_status` is `cancelled`/`canceled` and `notify_customer` is
|
|
1478
|
+
* `true` — the request is rejected with `400` if it is missing or blank.
|
|
1479
|
+
* Not derived from `notes` or `fulfillment_details_*`.
|
|
1480
|
+
*/
|
|
1481
|
+
cancellation_reason?: string;
|
|
1482
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
1483
|
+
cancellation_details_text?: string;
|
|
1484
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
1485
|
+
cancellation_details_html?: string;
|
|
1467
1486
|
/** When true, a terminal fulfillment status triggers a customer email. */
|
|
1468
1487
|
notify_customer?: boolean;
|
|
1469
1488
|
}
|
|
@@ -1481,6 +1500,17 @@ interface V2OrderFulfillmentNotificationParams {
|
|
|
1481
1500
|
fulfillment_status?: string;
|
|
1482
1501
|
fulfillment_details_text?: string;
|
|
1483
1502
|
fulfillment_details_html?: string;
|
|
1503
|
+
/**
|
|
1504
|
+
* Customer-visible cancellation reason. **Required** when
|
|
1505
|
+
* `fulfillment_status` is `cancelled`/`canceled` — the request is rejected
|
|
1506
|
+
* with `400` if it is missing or blank. Not derived from
|
|
1507
|
+
* `fulfillment_details_*`.
|
|
1508
|
+
*/
|
|
1509
|
+
cancellation_reason?: string;
|
|
1510
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
1511
|
+
cancellation_details_text?: string;
|
|
1512
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
1513
|
+
cancellation_details_html?: string;
|
|
1484
1514
|
line_items?: V2OrderFulfillmentNotificationLineItem[];
|
|
1485
1515
|
amount_total?: number;
|
|
1486
1516
|
currency?: string;
|
|
@@ -2003,11 +2033,20 @@ declare class OrdersV2Client extends BaseV2Client {
|
|
|
2003
2033
|
*
|
|
2004
2034
|
* Set `notify_customer: true` when moving the order into a terminal
|
|
2005
2035
|
* fulfillment state to send the customer fulfillment email.
|
|
2036
|
+
*
|
|
2037
|
+
* When cancelling (`fulfillment_status: 'cancelled'`/`'canceled'`) with
|
|
2038
|
+
* `notify_customer: true`, `cancellation_reason` is **required**: the API
|
|
2039
|
+
* responds `400` if it is missing or blank, and the order is not mutated.
|
|
2040
|
+
* `cancellation_details_*` are no longer derived from `fulfillment_details_*`
|
|
2041
|
+
* — pass them explicitly if you need them.
|
|
2006
2042
|
*/
|
|
2007
2043
|
updateFulfillment(siteName: string, id: string, data: V2OrderFulfillmentUpdate): Promise<V2Order>;
|
|
2008
2044
|
/**
|
|
2009
2045
|
* Send the customer fulfillment template for an external delivery/packing
|
|
2010
2046
|
* record without mutating a checkout session.
|
|
2047
|
+
*
|
|
2048
|
+
* When `fulfillment_status` is `cancelled`/`canceled`, `cancellation_reason`
|
|
2049
|
+
* is **required**: the API responds `400` if it is missing or blank.
|
|
2011
2050
|
*/
|
|
2012
2051
|
sendFulfillmentNotification(siteName: string, data: V2OrderFulfillmentNotificationParams): Promise<V2OrderFulfillmentNotificationResult>;
|
|
2013
2052
|
private withOrderTags;
|
|
@@ -1457,13 +1457,32 @@ interface V2OrderCreateParams {
|
|
|
1457
1457
|
currency?: string;
|
|
1458
1458
|
referral_code?: string;
|
|
1459
1459
|
referrer_site_user_id?: string;
|
|
1460
|
+
/**
|
|
1461
|
+
* Subscription billing-cycle anchor as a Unix timestamp (seconds). When set
|
|
1462
|
+
* on a `subscription` checkout, no charge is taken at checkout; the first
|
|
1463
|
+
* invoice and the recurring cycle are aligned to this instant via Stripe
|
|
1464
|
+
* `subscription_data.billing_cycle_anchor` with `proration_behavior: none`.
|
|
1465
|
+
*/
|
|
1466
|
+
billing_cycle_anchor?: number;
|
|
1460
1467
|
}
|
|
1461
1468
|
interface V2OrderFulfillmentUpdate {
|
|
1462
1469
|
fulfillment_status: string;
|
|
1463
1470
|
tracking_number?: string;
|
|
1471
|
+
/** Internal operator notes. Never shown to the customer. */
|
|
1464
1472
|
notes?: string;
|
|
1465
1473
|
fulfillment_details_text?: string;
|
|
1466
1474
|
fulfillment_details_html?: string;
|
|
1475
|
+
/**
|
|
1476
|
+
* Customer-visible cancellation reason. **Required** when
|
|
1477
|
+
* `fulfillment_status` is `cancelled`/`canceled` and `notify_customer` is
|
|
1478
|
+
* `true` — the request is rejected with `400` if it is missing or blank.
|
|
1479
|
+
* Not derived from `notes` or `fulfillment_details_*`.
|
|
1480
|
+
*/
|
|
1481
|
+
cancellation_reason?: string;
|
|
1482
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
1483
|
+
cancellation_details_text?: string;
|
|
1484
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
1485
|
+
cancellation_details_html?: string;
|
|
1467
1486
|
/** When true, a terminal fulfillment status triggers a customer email. */
|
|
1468
1487
|
notify_customer?: boolean;
|
|
1469
1488
|
}
|
|
@@ -1481,6 +1500,17 @@ interface V2OrderFulfillmentNotificationParams {
|
|
|
1481
1500
|
fulfillment_status?: string;
|
|
1482
1501
|
fulfillment_details_text?: string;
|
|
1483
1502
|
fulfillment_details_html?: string;
|
|
1503
|
+
/**
|
|
1504
|
+
* Customer-visible cancellation reason. **Required** when
|
|
1505
|
+
* `fulfillment_status` is `cancelled`/`canceled` — the request is rejected
|
|
1506
|
+
* with `400` if it is missing or blank. Not derived from
|
|
1507
|
+
* `fulfillment_details_*`.
|
|
1508
|
+
*/
|
|
1509
|
+
cancellation_reason?: string;
|
|
1510
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
1511
|
+
cancellation_details_text?: string;
|
|
1512
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
1513
|
+
cancellation_details_html?: string;
|
|
1484
1514
|
line_items?: V2OrderFulfillmentNotificationLineItem[];
|
|
1485
1515
|
amount_total?: number;
|
|
1486
1516
|
currency?: string;
|
|
@@ -2003,11 +2033,20 @@ declare class OrdersV2Client extends BaseV2Client {
|
|
|
2003
2033
|
*
|
|
2004
2034
|
* Set `notify_customer: true` when moving the order into a terminal
|
|
2005
2035
|
* fulfillment state to send the customer fulfillment email.
|
|
2036
|
+
*
|
|
2037
|
+
* When cancelling (`fulfillment_status: 'cancelled'`/`'canceled'`) with
|
|
2038
|
+
* `notify_customer: true`, `cancellation_reason` is **required**: the API
|
|
2039
|
+
* responds `400` if it is missing or blank, and the order is not mutated.
|
|
2040
|
+
* `cancellation_details_*` are no longer derived from `fulfillment_details_*`
|
|
2041
|
+
* — pass them explicitly if you need them.
|
|
2006
2042
|
*/
|
|
2007
2043
|
updateFulfillment(siteName: string, id: string, data: V2OrderFulfillmentUpdate): Promise<V2Order>;
|
|
2008
2044
|
/**
|
|
2009
2045
|
* Send the customer fulfillment template for an external delivery/packing
|
|
2010
2046
|
* record without mutating a checkout session.
|
|
2047
|
+
*
|
|
2048
|
+
* When `fulfillment_status` is `cancelled`/`canceled`, `cancellation_reason`
|
|
2049
|
+
* is **required**: the API responds `400` if it is missing or blank.
|
|
2011
2050
|
*/
|
|
2012
2051
|
sendFulfillmentNotification(siteName: string, data: V2OrderFulfillmentNotificationParams): Promise<V2OrderFulfillmentNotificationResult>;
|
|
2013
2052
|
private withOrderTags;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-
|
|
2
|
-
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary, c4 as CheckoutMetadataValue, c9 as CheckoutSessionTax, c8 as CheckoutTaxBreakdownItem, c7 as CheckoutTaxCustomerExemptionRequest, c6 as CheckoutTaxExemptionStatus, c5 as CheckoutTaxStrategy, b_ as ContentStatus, b$ as ContentType, c2 as CreatePaymentGatewayRequest, cb as CreditTransaction, cc as HttpMethod, aF as MediaItem, aJ as NewsletterCampaignSummary, aK as NewsletterManagementListMembership, aP as NewsletterManagementPagination, aI as NewsletterSubscription, aN as NewsletterSubscriptionImportRowRequest, aL as NewsletterSubscriptionsBulkAction, aM as NewsletterSubscriptionsBulkOutcome, aO as NewsletterSubscriptionsImportRowResult, bZ as PaginationParams, aH as PaymentGateway, aC as PerspectApiError, ay as PerspectApiV2Client, aA as PerspectV2Error, c0 as ProductSkuMediaItem, c1 as ProductSkuOption, cd as RequestOptions, aQ as SetProfileValueRequest, ca as SubscriptionCancellationMode, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, c3 as WebhookEventType, aB as createApiError, az as createPerspectApiV2Client } from './index-
|
|
1
|
+
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-uyP4WdHB.mjs';
|
|
2
|
+
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary, c4 as CheckoutMetadataValue, c9 as CheckoutSessionTax, c8 as CheckoutTaxBreakdownItem, c7 as CheckoutTaxCustomerExemptionRequest, c6 as CheckoutTaxExemptionStatus, c5 as CheckoutTaxStrategy, b_ as ContentStatus, b$ as ContentType, c2 as CreatePaymentGatewayRequest, cb as CreditTransaction, cc as HttpMethod, aF as MediaItem, aJ as NewsletterCampaignSummary, aK as NewsletterManagementListMembership, aP as NewsletterManagementPagination, aI as NewsletterSubscription, aN as NewsletterSubscriptionImportRowRequest, aL as NewsletterSubscriptionsBulkAction, aM as NewsletterSubscriptionsBulkOutcome, aO as NewsletterSubscriptionsImportRowResult, bZ as PaginationParams, aH as PaymentGateway, aC as PerspectApiError, ay as PerspectApiV2Client, aA as PerspectV2Error, c0 as ProductSkuMediaItem, c1 as ProductSkuOption, cd as RequestOptions, aQ as SetProfileValueRequest, ca as SubscriptionCancellationMode, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, c3 as WebhookEventType, aB as createApiError, az as createPerspectApiV2Client } from './index-uyP4WdHB.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* v1 deprecation constants — kept in sync with the backend's
|
|
@@ -1774,9 +1774,21 @@ declare class SiteUsersClient extends BaseClient {
|
|
|
1774
1774
|
updateOrderFulfillment(siteName: string, sessionId: string, data: {
|
|
1775
1775
|
fulfillment_status: string;
|
|
1776
1776
|
tracking_number?: string;
|
|
1777
|
+
/** Internal operator notes. Never shown to the customer. */
|
|
1777
1778
|
notes?: string;
|
|
1778
1779
|
fulfillment_details_text?: string;
|
|
1779
1780
|
fulfillment_details_html?: string;
|
|
1781
|
+
/**
|
|
1782
|
+
* Customer-visible cancellation reason. Required when
|
|
1783
|
+
* `fulfillment_status` is `cancelled`/`canceled` and `notify_customer`
|
|
1784
|
+
* is `true` — the request is rejected with `400` if missing or blank.
|
|
1785
|
+
* Not derived from `notes` or `fulfillment_details_*`.
|
|
1786
|
+
*/
|
|
1787
|
+
cancellation_reason?: string;
|
|
1788
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
1789
|
+
cancellation_details_text?: string;
|
|
1790
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
1791
|
+
cancellation_details_html?: string;
|
|
1780
1792
|
notify_customer?: boolean;
|
|
1781
1793
|
}): Promise<ApiResponse<{
|
|
1782
1794
|
success: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-
|
|
2
|
-
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary, c4 as CheckoutMetadataValue, c9 as CheckoutSessionTax, c8 as CheckoutTaxBreakdownItem, c7 as CheckoutTaxCustomerExemptionRequest, c6 as CheckoutTaxExemptionStatus, c5 as CheckoutTaxStrategy, b_ as ContentStatus, b$ as ContentType, c2 as CreatePaymentGatewayRequest, cb as CreditTransaction, cc as HttpMethod, aF as MediaItem, aJ as NewsletterCampaignSummary, aK as NewsletterManagementListMembership, aP as NewsletterManagementPagination, aI as NewsletterSubscription, aN as NewsletterSubscriptionImportRowRequest, aL as NewsletterSubscriptionsBulkAction, aM as NewsletterSubscriptionsBulkOutcome, aO as NewsletterSubscriptionsImportRowResult, bZ as PaginationParams, aH as PaymentGateway, aC as PerspectApiError, ay as PerspectApiV2Client, aA as PerspectV2Error, c0 as ProductSkuMediaItem, c1 as ProductSkuOption, cd as RequestOptions, aQ as SetProfileValueRequest, ca as SubscriptionCancellationMode, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, c3 as WebhookEventType, aB as createApiError, az as createPerspectApiV2Client } from './index-
|
|
1
|
+
import { H as HttpClient, C as CacheManager, A as ApiResponse, a as CachePolicy, b as CacheInvalidateOptions, U as User, c as ContentQueryParams, P as PaginatedResponse, d as Content, e as ContentCategoryResponse, f as CreateContentRequest, g as UpdateContentRequest, h as ApiKey, i as CreateApiKeyRequest, j as UpdateApiKeyRequest, O as Organization, k as CreateOrganizationRequest, S as Site, l as CreateSiteRequest, m as ProductQueryParams, n as Product, o as CreateProductRequest, p as ProductSku, q as CreateProductSkuRequest, r as Category, s as CreateCategoryRequest, W as Webhook, t as CreateWebhookRequest, u as CreateCheckoutSessionRequest, v as CheckoutSession, w as CreateContactRequest, x as ContactSubmitResponse, y as ContactStatusResponse, z as ContactSubmission, B as CreateNewsletterSubscriptionRequest, N as NewsletterSubscribeResponse, D as NewsletterConfirmResponse, E as NewsletterUnsubscribeRequest, F as NewsletterUnsubscribeResponse, G as NewsletterPreferences, I as NewsletterList, J as NewsletterCampaignListResponse, K as NewsletterCampaignDetail, L as NewsletterStatusResponse, M as NewsletterManagementSubscriptionsListResponse, Q as NewsletterManagementSubscription, R as NewsletterSubscriptionSyncRequest, T as NewsletterSubscriptionSyncResponse, V as NewsletterSubscriptionsBulkUpdateRequest, X as NewsletterSubscriptionsBulkUpdateResponse, Y as NewsletterSubscriptionMembershipUpdateRequest, Z as NewsletterSubscriptionsImportRequest, _ as NewsletterSubscriptionsImportResponse, $ as NewsletterManagementList, a0 as NewsletterManagementSeries, a1 as NewsletterManagementCampaignListResponse, a2 as NewsletterManagementCampaign, a3 as NewsletterCampaignTestSendRequest, a4 as NewsletterCampaignTestSendResponse, a5 as NewsletterManagementStatsResponse, a6 as NewsletterExportCreateRequest, a7 as NewsletterExportCreateResponse, a8 as RequestOtpRequest, a9 as VerifyOtpRequest, aa as VerifyOtpResponse, ab as SiteUser, ac as SiteUserProfile, ad as UpdateSiteUserRequest, ae as SiteUserOrder, af as SiteUserSubscription, ag as CancelSubscriptionRequest, ah as CancelSubscriptionResponse, ai as CreditBalance, aj as CreditBalanceWithTransactions, ak as GrantCreditRequest, al as ProductBundleGroup, am as CreateBundleGroupRequest, an as BundleCollection, ao as BundleCollectionItemWithProduct, ap as CreateBundleCollectionRequest, aq as AddCollectionItemRequest, ar as BundleCollectionItem, as as PerspectApiConfig, at as CacheAdapter, au as BlogPost, av as CheckoutMetadata, aw as CheckoutAddress, ax as CheckoutTaxRequest } from './index-uyP4WdHB.js';
|
|
2
|
+
export { aE as ApiError, aD as CacheConfig, aG as CategorySummary, c4 as CheckoutMetadataValue, c9 as CheckoutSessionTax, c8 as CheckoutTaxBreakdownItem, c7 as CheckoutTaxCustomerExemptionRequest, c6 as CheckoutTaxExemptionStatus, c5 as CheckoutTaxStrategy, b_ as ContentStatus, b$ as ContentType, c2 as CreatePaymentGatewayRequest, cb as CreditTransaction, cc as HttpMethod, aF as MediaItem, aJ as NewsletterCampaignSummary, aK as NewsletterManagementListMembership, aP as NewsletterManagementPagination, aI as NewsletterSubscription, aN as NewsletterSubscriptionImportRowRequest, aL as NewsletterSubscriptionsBulkAction, aM as NewsletterSubscriptionsBulkOutcome, aO as NewsletterSubscriptionsImportRowResult, bZ as PaginationParams, aH as PaymentGateway, aC as PerspectApiError, ay as PerspectApiV2Client, aA as PerspectV2Error, c0 as ProductSkuMediaItem, c1 as ProductSkuOption, cd as RequestOptions, aQ as SetProfileValueRequest, ca as SubscriptionCancellationMode, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, c3 as WebhookEventType, aB as createApiError, az as createPerspectApiV2Client } from './index-uyP4WdHB.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* v1 deprecation constants — kept in sync with the backend's
|
|
@@ -1774,9 +1774,21 @@ declare class SiteUsersClient extends BaseClient {
|
|
|
1774
1774
|
updateOrderFulfillment(siteName: string, sessionId: string, data: {
|
|
1775
1775
|
fulfillment_status: string;
|
|
1776
1776
|
tracking_number?: string;
|
|
1777
|
+
/** Internal operator notes. Never shown to the customer. */
|
|
1777
1778
|
notes?: string;
|
|
1778
1779
|
fulfillment_details_text?: string;
|
|
1779
1780
|
fulfillment_details_html?: string;
|
|
1781
|
+
/**
|
|
1782
|
+
* Customer-visible cancellation reason. Required when
|
|
1783
|
+
* `fulfillment_status` is `cancelled`/`canceled` and `notify_customer`
|
|
1784
|
+
* is `true` — the request is rejected with `400` if missing or blank.
|
|
1785
|
+
* Not derived from `notes` or `fulfillment_details_*`.
|
|
1786
|
+
*/
|
|
1787
|
+
cancellation_reason?: string;
|
|
1788
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
1789
|
+
cancellation_details_text?: string;
|
|
1790
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
1791
|
+
cancellation_details_html?: string;
|
|
1780
1792
|
notify_customer?: boolean;
|
|
1781
1793
|
}): Promise<ApiResponse<{
|
|
1782
1794
|
success: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1031,6 +1031,12 @@ var OrdersV2Client = class extends BaseV2Client {
|
|
|
1031
1031
|
*
|
|
1032
1032
|
* Set `notify_customer: true` when moving the order into a terminal
|
|
1033
1033
|
* fulfillment state to send the customer fulfillment email.
|
|
1034
|
+
*
|
|
1035
|
+
* When cancelling (`fulfillment_status: 'cancelled'`/`'canceled'`) with
|
|
1036
|
+
* `notify_customer: true`, `cancellation_reason` is **required**: the API
|
|
1037
|
+
* responds `400` if it is missing or blank, and the order is not mutated.
|
|
1038
|
+
* `cancellation_details_*` are no longer derived from `fulfillment_details_*`
|
|
1039
|
+
* — pass them explicitly if you need them.
|
|
1034
1040
|
*/
|
|
1035
1041
|
async updateFulfillment(siteName, id, data) {
|
|
1036
1042
|
const result = await this.patchOne(
|
|
@@ -1046,6 +1052,9 @@ var OrdersV2Client = class extends BaseV2Client {
|
|
|
1046
1052
|
/**
|
|
1047
1053
|
* Send the customer fulfillment template for an external delivery/packing
|
|
1048
1054
|
* record without mutating a checkout session.
|
|
1055
|
+
*
|
|
1056
|
+
* When `fulfillment_status` is `cancelled`/`canceled`, `cancellation_reason`
|
|
1057
|
+
* is **required**: the API responds `400` if it is missing or blank.
|
|
1049
1058
|
*/
|
|
1050
1059
|
async sendFulfillmentNotification(siteName, data) {
|
|
1051
1060
|
return this.post(
|
package/dist/index.mjs
CHANGED
package/dist/v2/index.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cq as ApiKeysV2Client, cf as BaseV2Client, ci as CategoriesV2Client, cj as CollectionsV2Client, cn as ContactsV2Client, cg as ContentV2Client, ct as CreditsV2Client, cu as EmailV2Client, cm as NewsletterV2Client, ck as OrdersV2Client, co as OrganizationsV2Client, ay as PerspectApiV2Client, ce as PerspectApiV2Config, aA as PerspectV2Error, ch as ProductsV2Client, cl as SiteUsersV2Client, cp as SitesV2Client, cs as SubscriptionsV2Client, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, cr as WebhooksV2Client, az as createPerspectApiV2Client } from '../index-
|
|
1
|
+
export { cq as ApiKeysV2Client, cf as BaseV2Client, ci as CategoriesV2Client, cj as CollectionsV2Client, cn as ContactsV2Client, cg as ContentV2Client, ct as CreditsV2Client, cu as EmailV2Client, cm as NewsletterV2Client, ck as OrdersV2Client, co as OrganizationsV2Client, ay as PerspectApiV2Client, ce as PerspectApiV2Config, aA as PerspectV2Error, ch as ProductsV2Client, cl as SiteUsersV2Client, cp as SitesV2Client, cs as SubscriptionsV2Client, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, cr as WebhooksV2Client, az as createPerspectApiV2Client } from '../index-uyP4WdHB.mjs';
|
package/dist/v2/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { cq as ApiKeysV2Client, cf as BaseV2Client, ci as CategoriesV2Client, cj as CollectionsV2Client, cn as ContactsV2Client, cg as ContentV2Client, ct as CreditsV2Client, cu as EmailV2Client, cm as NewsletterV2Client, ck as OrdersV2Client, co as OrganizationsV2Client, ay as PerspectApiV2Client, ce as PerspectApiV2Config, aA as PerspectV2Error, ch as ProductsV2Client, cl as SiteUsersV2Client, cp as SitesV2Client, cs as SubscriptionsV2Client, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, cr as WebhooksV2Client, az as createPerspectApiV2Client } from '../index-
|
|
1
|
+
export { cq as ApiKeysV2Client, cf as BaseV2Client, ci as CategoriesV2Client, cj as CollectionsV2Client, cn as ContactsV2Client, cg as ContentV2Client, ct as CreditsV2Client, cu as EmailV2Client, cm as NewsletterV2Client, ck as OrdersV2Client, co as OrganizationsV2Client, ay as PerspectApiV2Client, ce as PerspectApiV2Config, aA as PerspectV2Error, ch as ProductsV2Client, cl as SiteUsersV2Client, cp as SitesV2Client, cs as SubscriptionsV2Client, bH as V2ApiKey, bS as V2CancelSubscriptionResult, b4 as V2Category, b5 as V2CategoryCreateParams, b6 as V2CategoryUpdateParams, b7 as V2Collection, b9 as V2CollectionCreateParams, b8 as V2CollectionItem, ba as V2CollectionUpdateParams, bE as V2ContactSubmission, aY as V2Content, aZ as V2ContentCreateParams, a$ as V2ContentListParams, a_ as V2ContentUpdateParams, bU as V2CreditBalance, bT as V2CreditTransaction, aT as V2Deleted, bX as V2EmailSendParams, bY as V2EmailSendResult, aU as V2Error, aV as V2ErrorType, bV as V2GrantCreditParams, bW as V2GrantCreditResult, aS as V2List, aX as V2Media, bv as V2NewsletterCampaign, bC as V2NewsletterImportRequest, bD as V2NewsletterImportResult, bu as V2NewsletterList, bx as V2NewsletterListCreateParams, by as V2NewsletterListUpdateParams, bt as V2NewsletterSubscription, bB as V2NewsletterSubscriptionListMembershipUpdate, bz as V2NewsletterSyncInput, bA as V2NewsletterSyncResult, bw as V2NewsletterTrackingResponse, aR as V2Object, bb as V2Order, bf as V2OrderAddress, bh as V2OrderCreateParams, bm as V2OrderCreateResult, bj as V2OrderFulfillmentNotificationLineItem, bk as V2OrderFulfillmentNotificationParams, bl as V2OrderFulfillmentNotificationResult, bi as V2OrderFulfillmentUpdate, be as V2OrderLineItem, bd as V2OrderLineItemPriceData, bc as V2OrderListParams, bg as V2OrderTaxRequest, bF as V2Organization, aW as V2PaginationParams, b0 as V2Product, b1 as V2ProductCreateParams, b3 as V2ProductListParams, b2 as V2ProductUpdateParams, bG as V2Site, bn as V2SiteUser, bq as V2SiteUserListParams, bp as V2SiteUserMeUpdateParams, bs as V2SiteUserProfile, bM as V2SiteUserSubscription, bo as V2SiteUserUpdateParams, br as V2SiteUserWithProfile, bO as V2SubscriptionCancelParams, bP as V2SubscriptionChangePlanParams, bQ as V2SubscriptionChargeParams, bR as V2SubscriptionChargeResult, bN as V2SubscriptionPauseParams, bJ as V2Webhook, bK as V2WebhookCreateParams, bI as V2WebhookEventType, bL as V2WebhookUpdateParams, cr as WebhooksV2Client, az as createPerspectApiV2Client } from '../index-uyP4WdHB.js';
|
package/dist/v2/index.js
CHANGED
|
@@ -977,6 +977,12 @@ var OrdersV2Client = class extends BaseV2Client {
|
|
|
977
977
|
*
|
|
978
978
|
* Set `notify_customer: true` when moving the order into a terminal
|
|
979
979
|
* fulfillment state to send the customer fulfillment email.
|
|
980
|
+
*
|
|
981
|
+
* When cancelling (`fulfillment_status: 'cancelled'`/`'canceled'`) with
|
|
982
|
+
* `notify_customer: true`, `cancellation_reason` is **required**: the API
|
|
983
|
+
* responds `400` if it is missing or blank, and the order is not mutated.
|
|
984
|
+
* `cancellation_details_*` are no longer derived from `fulfillment_details_*`
|
|
985
|
+
* — pass them explicitly if you need them.
|
|
980
986
|
*/
|
|
981
987
|
async updateFulfillment(siteName, id, data) {
|
|
982
988
|
const result = await this.patchOne(
|
|
@@ -992,6 +998,9 @@ var OrdersV2Client = class extends BaseV2Client {
|
|
|
992
998
|
/**
|
|
993
999
|
* Send the customer fulfillment template for an external delivery/packing
|
|
994
1000
|
* record without mutating a checkout session.
|
|
1001
|
+
*
|
|
1002
|
+
* When `fulfillment_status` is `cancelled`/`canceled`, `cancellation_reason`
|
|
1003
|
+
* is **required**: the API responds `400` if it is missing or blank.
|
|
995
1004
|
*/
|
|
996
1005
|
async sendFulfillmentNotification(siteName, data) {
|
|
997
1006
|
return this.post(
|
package/dist/v2/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -518,9 +518,21 @@ export class SiteUsersClient extends BaseClient {
|
|
|
518
518
|
data: {
|
|
519
519
|
fulfillment_status: string;
|
|
520
520
|
tracking_number?: string;
|
|
521
|
+
/** Internal operator notes. Never shown to the customer. */
|
|
521
522
|
notes?: string;
|
|
522
523
|
fulfillment_details_text?: string;
|
|
523
524
|
fulfillment_details_html?: string;
|
|
525
|
+
/**
|
|
526
|
+
* Customer-visible cancellation reason. Required when
|
|
527
|
+
* `fulfillment_status` is `cancelled`/`canceled` and `notify_customer`
|
|
528
|
+
* is `true` — the request is rejected with `400` if missing or blank.
|
|
529
|
+
* Not derived from `notes` or `fulfillment_details_*`.
|
|
530
|
+
*/
|
|
531
|
+
cancellation_reason?: string;
|
|
532
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
533
|
+
cancellation_details_text?: string;
|
|
534
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
535
|
+
cancellation_details_html?: string;
|
|
524
536
|
notify_customer?: boolean;
|
|
525
537
|
}
|
|
526
538
|
): Promise<ApiResponse<{ success: boolean }>> {
|
|
@@ -88,6 +88,12 @@ export class OrdersV2Client extends BaseV2Client {
|
|
|
88
88
|
*
|
|
89
89
|
* Set `notify_customer: true` when moving the order into a terminal
|
|
90
90
|
* fulfillment state to send the customer fulfillment email.
|
|
91
|
+
*
|
|
92
|
+
* When cancelling (`fulfillment_status: 'cancelled'`/`'canceled'`) with
|
|
93
|
+
* `notify_customer: true`, `cancellation_reason` is **required**: the API
|
|
94
|
+
* responds `400` if it is missing or blank, and the order is not mutated.
|
|
95
|
+
* `cancellation_details_*` are no longer derived from `fulfillment_details_*`
|
|
96
|
+
* — pass them explicitly if you need them.
|
|
91
97
|
*/
|
|
92
98
|
async updateFulfillment(
|
|
93
99
|
siteName: string,
|
|
@@ -108,6 +114,9 @@ export class OrdersV2Client extends BaseV2Client {
|
|
|
108
114
|
/**
|
|
109
115
|
* Send the customer fulfillment template for an external delivery/packing
|
|
110
116
|
* record without mutating a checkout session.
|
|
117
|
+
*
|
|
118
|
+
* When `fulfillment_status` is `cancelled`/`canceled`, `cancellation_reason`
|
|
119
|
+
* is **required**: the API responds `400` if it is missing or blank.
|
|
111
120
|
*/
|
|
112
121
|
async sendFulfillmentNotification(
|
|
113
122
|
siteName: string,
|
package/src/v2/types.ts
CHANGED
|
@@ -322,14 +322,33 @@ export interface V2OrderCreateParams {
|
|
|
322
322
|
currency?: string;
|
|
323
323
|
referral_code?: string;
|
|
324
324
|
referrer_site_user_id?: string;
|
|
325
|
+
/**
|
|
326
|
+
* Subscription billing-cycle anchor as a Unix timestamp (seconds). When set
|
|
327
|
+
* on a `subscription` checkout, no charge is taken at checkout; the first
|
|
328
|
+
* invoice and the recurring cycle are aligned to this instant via Stripe
|
|
329
|
+
* `subscription_data.billing_cycle_anchor` with `proration_behavior: none`.
|
|
330
|
+
*/
|
|
331
|
+
billing_cycle_anchor?: number;
|
|
325
332
|
}
|
|
326
333
|
|
|
327
334
|
export interface V2OrderFulfillmentUpdate {
|
|
328
335
|
fulfillment_status: string;
|
|
329
336
|
tracking_number?: string;
|
|
337
|
+
/** Internal operator notes. Never shown to the customer. */
|
|
330
338
|
notes?: string;
|
|
331
339
|
fulfillment_details_text?: string;
|
|
332
340
|
fulfillment_details_html?: string;
|
|
341
|
+
/**
|
|
342
|
+
* Customer-visible cancellation reason. **Required** when
|
|
343
|
+
* `fulfillment_status` is `cancelled`/`canceled` and `notify_customer` is
|
|
344
|
+
* `true` — the request is rejected with `400` if it is missing or blank.
|
|
345
|
+
* Not derived from `notes` or `fulfillment_details_*`.
|
|
346
|
+
*/
|
|
347
|
+
cancellation_reason?: string;
|
|
348
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
349
|
+
cancellation_details_text?: string;
|
|
350
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
351
|
+
cancellation_details_html?: string;
|
|
333
352
|
/** When true, a terminal fulfillment status triggers a customer email. */
|
|
334
353
|
notify_customer?: boolean;
|
|
335
354
|
}
|
|
@@ -349,6 +368,17 @@ export interface V2OrderFulfillmentNotificationParams {
|
|
|
349
368
|
fulfillment_status?: string;
|
|
350
369
|
fulfillment_details_text?: string;
|
|
351
370
|
fulfillment_details_html?: string;
|
|
371
|
+
/**
|
|
372
|
+
* Customer-visible cancellation reason. **Required** when
|
|
373
|
+
* `fulfillment_status` is `cancelled`/`canceled` — the request is rejected
|
|
374
|
+
* with `400` if it is missing or blank. Not derived from
|
|
375
|
+
* `fulfillment_details_*`.
|
|
376
|
+
*/
|
|
377
|
+
cancellation_reason?: string;
|
|
378
|
+
/** Customer-visible cancellation detail (plain text). Only used if provided. */
|
|
379
|
+
cancellation_details_text?: string;
|
|
380
|
+
/** Customer-visible cancellation detail (HTML). Only used if provided. */
|
|
381
|
+
cancellation_details_html?: string;
|
|
352
382
|
line_items?: V2OrderFulfillmentNotificationLineItem[];
|
|
353
383
|
amount_total?: number;
|
|
354
384
|
currency?: string;
|