@waffo/pancake-ts 0.18.0 → 0.19.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/dist/index.d.cts CHANGED
@@ -505,12 +505,18 @@ interface UpdateRoleResult {
505
505
  * @example
506
506
  * // JPY ¥1000
507
507
  * { amount: "1000", taxCategory: "software" }
508
+ *
509
+ * @example
510
+ * // USD $9.99 with a $1.00 trial period (subscription products only)
511
+ * { amount: "9.99", taxCategory: "saas", trialAmount: "1.00" }
508
512
  */
509
513
  interface PriceInfo {
510
514
  /** Price amount as display string (e.g., "9.99" for USD, "1000" for JPY) */
511
515
  amount: string;
512
516
  /** Tax category */
513
517
  taxCategory: TaxCategory;
518
+ /** Trial period price as display string; requires `metadata.trialDays` and must be lower than `amount` */
519
+ trialAmount?: string;
514
520
  }
515
521
  /**
516
522
  * Multi-currency prices (keyed by ISO 4217 currency code).
@@ -757,6 +763,17 @@ type CashierLanguage = "en" | "pt-BR" | "es-MX" | "id-ID" | "vi-VN" | "ru-RU" |
757
763
  * Currencies outside this matrix cannot be charged at all — checkout session creation is rejected with a 400.
758
764
  */
759
765
  type PaymentMethod = "card" | "applepay" | "googlepay" | "wechat";
766
+ /**
767
+ * Session-level price override, accepted with API Key authentication only.
768
+ * For subscription products it replaces the regular period price; the trial price comes from the locked product version.
769
+ * @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
770
+ */
771
+ interface PriceSnapshot {
772
+ /** Price amount as display string (e.g., "9.99" for USD, "1000" for JPY) */
773
+ amount: string;
774
+ /** Tax category */
775
+ taxCategory: TaxCategory;
776
+ }
760
777
  /**
761
778
  * Parameters for creating a checkout session.
762
779
  * @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
@@ -767,7 +784,7 @@ interface CreateCheckoutSessionParams {
767
784
  /** Currency code (ISO 4217) */
768
785
  currency: string;
769
786
  /** Optional price snapshot override (reads from DB if omitted) */
770
- priceSnapshot?: PriceInfo;
787
+ priceSnapshot?: PriceSnapshot;
771
788
  /** Trial toggle override (subscription only) */
772
789
  withTrial?: boolean;
773
790
  /** Pre-filled customer email */
@@ -2339,4 +2356,4 @@ declare class WaffoPancakeError extends Error {
2339
2356
  */
2340
2357
  declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
2341
2358
 
2342
- export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type CustomerSessionOptions, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, type PaymentMethod, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
2359
+ export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type CustomerSessionOptions, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, type PaymentMethod, PaymentStatus, type PostResult, type PriceInfo, type PriceSnapshot, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
package/dist/index.d.ts CHANGED
@@ -505,12 +505,18 @@ interface UpdateRoleResult {
505
505
  * @example
506
506
  * // JPY ¥1000
507
507
  * { amount: "1000", taxCategory: "software" }
508
+ *
509
+ * @example
510
+ * // USD $9.99 with a $1.00 trial period (subscription products only)
511
+ * { amount: "9.99", taxCategory: "saas", trialAmount: "1.00" }
508
512
  */
509
513
  interface PriceInfo {
510
514
  /** Price amount as display string (e.g., "9.99" for USD, "1000" for JPY) */
511
515
  amount: string;
512
516
  /** Tax category */
513
517
  taxCategory: TaxCategory;
518
+ /** Trial period price as display string; requires `metadata.trialDays` and must be lower than `amount` */
519
+ trialAmount?: string;
514
520
  }
515
521
  /**
516
522
  * Multi-currency prices (keyed by ISO 4217 currency code).
@@ -757,6 +763,17 @@ type CashierLanguage = "en" | "pt-BR" | "es-MX" | "id-ID" | "vi-VN" | "ru-RU" |
757
763
  * Currencies outside this matrix cannot be charged at all — checkout session creation is rejected with a 400.
758
764
  */
759
765
  type PaymentMethod = "card" | "applepay" | "googlepay" | "wechat";
766
+ /**
767
+ * Session-level price override, accepted with API Key authentication only.
768
+ * For subscription products it replaces the regular period price; the trial price comes from the locked product version.
769
+ * @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
770
+ */
771
+ interface PriceSnapshot {
772
+ /** Price amount as display string (e.g., "9.99" for USD, "1000" for JPY) */
773
+ amount: string;
774
+ /** Tax category */
775
+ taxCategory: TaxCategory;
776
+ }
760
777
  /**
761
778
  * Parameters for creating a checkout session.
762
779
  * @see docs/api-reference/endpoints/orders/create-checkout-session.mdx
@@ -767,7 +784,7 @@ interface CreateCheckoutSessionParams {
767
784
  /** Currency code (ISO 4217) */
768
785
  currency: string;
769
786
  /** Optional price snapshot override (reads from DB if omitted) */
770
- priceSnapshot?: PriceInfo;
787
+ priceSnapshot?: PriceSnapshot;
771
788
  /** Trial toggle override (subscription only) */
772
789
  withTrial?: boolean;
773
790
  /** Pre-filled customer email */
@@ -2339,4 +2356,4 @@ declare class WaffoPancakeError extends Error {
2339
2356
  */
2340
2357
  declare function verifyWebhook<T = Record<string, unknown>>(payload: string, signatureHeader: string | undefined | null, options?: VerifyWebhookOptions): WebhookEvent<T>;
2341
2358
 
2342
- export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type CustomerSessionOptions, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, type PaymentMethod, PaymentStatus, type PostResult, type PriceInfo, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };
2359
+ export { type AddMerchantParams, type AddMerchantResult, type AddWebhookParams, type AnonymousCheckoutParams, type ApiError, type AuthenticatedCheckoutParams, type AuthenticatedCheckoutResult, type BillingDetail, BillingPeriod, type CancelOnetimeOrderParams, type CancelOnetimeOrderResult, type CancelSubscriptionParams, type CancelSubscriptionResult, type CashierLanguage, type CheckoutSessionResult, type CheckoutSettings, type CheckoutThemeSettings, type CreateCheckoutSessionParams, type CreateOnetimeProductParams, type CreateRefundTicketParams, type CreateStoreParams, type CreateSubscriptionProductGroupParams, type CreateSubscriptionProductParams, type CustomerSessionOptions, type DeleteStoreParams, type DeleteSubscriptionProductGroupParams, EntityStatus, type Envelope, Environment, ErrorLayer, type GraphQLParams, type GraphQLResponse, type GroupRules, type IssueSessionTokenParams, type MediaItem, MediaType, type MerchantWritableNotificationSettings, type Notice, type NotificationSettings, OnetimeOrderStatus, type OnetimeProductDetail, type PaymentMethod, PaymentStatus, type PostResult, type PriceInfo, type PriceSnapshot, type Prices, ProductVersionStatus, type PublishOnetimeProductParams, type PublishSubscriptionProductGroupParams, type PublishSubscriptionProductParams, type ReactivateSubscriptionParams, type ReactivateSubscriptionResult, RefundStatus, type RefundTicket, RefundTicketStatus, type RefundTicketVersionData, type RemoveMerchantParams, type RemoveMerchantResult, type RemoveWebhookParams, type RequestedAmount, type ResubmitRefundTicketParams, ScanAction, ScanPolicyCategory, type ScanPromptParams, ScanReasonCode, type ScanResult, ScanSemanticMode, ScanSemanticStatus, type SessionToken, type Store, StoreRole, type StoreWebhook, SubscriptionOrderStatus, type SubscriptionProductDetail, type SubscriptionProductGroup, TaxCategory, type UpdateOnetimeProductParams, type UpdateOnetimeStatusParams, type UpdateRoleParams, type UpdateRoleResult, type UpdateStoreParams, type UpdateSubscriptionProductGroupParams, type UpdateSubscriptionProductParams, type UpdateSubscriptionStatusParams, type UpdateWebhookParams, type VerifyWebhookOptions, WaffoPancake, type WaffoPancakeConfig, WaffoPancakeError, type WebhookChannel, type WebhookEvent, type WebhookEventData, WebhookEventType, type WebhookPublicKeys, verifyWebhook };