@zernio/node 0.2.1502 → 0.2.1503

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.
@@ -16316,7 +16316,7 @@ export type TreasuryTopup = {
16316
16316
  */
16317
16317
  feeCoveredByZernio?: boolean;
16318
16318
  /**
16319
- * The amount you asked for. A top-up charges exactly this and credits it whole. Top-ups from 2026-11-02 to 2026-11-05 charged a card fee on top and credited what Stripe delivered; older ones charged this amount and credited it minus the fee.
16319
+ * The amount you asked for. A top-up credits exactly this and charges it plus tax (taxCents). Top-ups from 2026-11-02 to 2026-11-05 charged a card fee on top and credited what Stripe delivered; older ones charged this amount and credited it minus the fee.
16320
16320
  */
16321
16321
  amountCents?: number;
16322
16322
  /**
@@ -16324,7 +16324,11 @@ export type TreasuryTopup = {
16324
16324
  */
16325
16325
  feeCents?: (number) | null;
16326
16326
  /**
16327
- * What your card was charged: amountCents, or amountCents plus the card fee on a top-up from 2026-11-02 to 2026-11-05.
16327
+ * Tax charged on top of amountCents once paid (VAT where it applies, since 2026-11-05); 0 before payment, when reverse charged, outside the EU, and on older top-ups.
16328
+ */
16329
+ taxCents?: number;
16330
+ /**
16331
+ * What your card was charged: amountCents plus taxCents, or amountCents plus the card fee on a top-up from 2026-11-02 to 2026-11-05.
16328
16332
  */
16329
16333
  chargedCents?: number;
16330
16334
  /**
@@ -16342,7 +16346,7 @@ export type TreasuryTopup = {
16342
16346
  createdAt?: string;
16343
16347
  succeededAt?: (string) | null;
16344
16348
  /**
16345
- * A Checkout invoice exists for this payment (Checkout payments before 2026-10-29). Every paid payment has a card receipt (getTopupReceipt); a paid top-up has a statement (getTopupStatement).
16349
+ * The paid payment has an invoice (getTopupInvoice): every balance top-up paid since 2026-11-05 (unless charged without one for a Stripe credit balance), and Checkout payments before 2026-10-29. Every paid payment has a card receipt (getTopupReceipt).
16346
16350
  */
16347
16351
  hasInvoice?: boolean;
16348
16352
  };
@@ -24728,7 +24732,7 @@ export type GetBalanceError = ({
24728
24732
  export type CreateTopupData = {
24729
24733
  body: {
24730
24734
  /**
24731
- * Amount to charge and credit to your balance, in cents: $5 to $100,000. No card fee.
24735
+ * Amount to credit to your balance, in cents: $5 to $100,000. Tax is charged on top; no card fee.
24732
24736
  */
24733
24737
  amountCents: number;
24734
24738
  /**
@@ -24758,15 +24762,31 @@ export type CreateTopupData = {
24758
24762
  export type CreateTopupResponse = ({
24759
24763
  topupId: string;
24760
24764
  /**
24761
- * Charged and credited to your balance once paid.
24765
+ * Credited to your balance once paid.
24762
24766
  */
24763
24767
  amountCents: number;
24768
+ /**
24769
+ * Tax added on top of amountCents (VAT where it applies). 0 when reverse charged or outside the EU.
24770
+ */
24771
+ taxCents: number;
24772
+ /**
24773
+ * What the card is charged: amountCents + taxCents.
24774
+ */
24775
+ totalCents: number;
24776
+ /**
24777
+ * The tax and its rate, for example "VAT 21%". Null when no tax is charged.
24778
+ */
24779
+ taxLabel: (string) | null;
24780
+ /**
24781
+ * True for an EU business with a valid VAT id: no VAT is charged and the invoice says reverse charge.
24782
+ */
24783
+ reverseCharge: boolean;
24764
24784
  /**
24765
24785
  * Always 0: there is no card fee. Kept for older clients.
24766
24786
  */
24767
24787
  feeCents: number;
24768
24788
  /**
24769
- * What the card is charged: amountCents. Kept for older clients.
24789
+ * Same as totalCents. Kept for older clients.
24770
24790
  */
24771
24791
  chargedCents: number;
24772
24792
  /**
@@ -24859,6 +24879,102 @@ export type ListTopupsError = (ErrorResponse | {
24859
24879
  required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
24860
24880
  });
24861
24881
 
24882
+ export type PreviewTopupData = {
24883
+ body: {
24884
+ /**
24885
+ * Amount to credit to your balance, in cents.
24886
+ */
24887
+ amountCents: number;
24888
+ };
24889
+ };
24890
+
24891
+ export type PreviewTopupResponse = ({
24892
+ /**
24893
+ * Credited to your balance.
24894
+ */
24895
+ amountCents: number;
24896
+ /**
24897
+ * Tax added on top (VAT where it applies).
24898
+ */
24899
+ taxCents: number;
24900
+ /**
24901
+ * What the card would be charged: amountCents + taxCents.
24902
+ */
24903
+ totalCents: number;
24904
+ /**
24905
+ * The tax and its rate, for example "VAT 21%". Null when no tax is charged.
24906
+ */
24907
+ taxLabel: (string) | null;
24908
+ /**
24909
+ * True for an EU business with a valid VAT id: no VAT, reverse charge.
24910
+ */
24911
+ reverseCharge: boolean;
24912
+ });
24913
+
24914
+ export type PreviewTopupError = (ErrorResponse | {
24915
+ /**
24916
+ * Human-readable error message suitable for end-user display.
24917
+ */
24918
+ error: string;
24919
+ /**
24920
+ * Machine-readable error code. Stable across versions.
24921
+ */
24922
+ code: 'PAYMENT_REQUIRED';
24923
+ /**
24924
+ * Discriminator for which gate fired.
24925
+ */
24926
+ reason: 'free_tier_exceeded' | 'twitter_passthrough' | 'enterprise_required' | 'card_verification_required';
24927
+ /**
24928
+ * Link to the relevant documentation page.
24929
+ */
24930
+ documentation_url?: string;
24931
+ /**
24932
+ * Deep-link to send the end-user to. For
24933
+ * `free_tier_exceeded` and `twitter_passthrough` this opens
24934
+ * the add-payment-method drawer on the Zernio billing page.
24935
+ * For `enterprise_required` this is the Zernio enterprise
24936
+ * contact page.
24937
+ *
24938
+ */
24939
+ dashboard_url?: string;
24940
+ /**
24941
+ * Structured context for SDK clients that want to render their own UX. Keys vary by `reason`.
24942
+ */
24943
+ details?: {
24944
+ /**
24945
+ * How many accounts the free tier allows. Only set when reason=free_tier_exceeded.
24946
+ */
24947
+ free_tier_account_limit?: number;
24948
+ /**
24949
+ * How many accounts the team currently has connected. Set when reason=free_tier_exceeded or reason=enterprise_required.
24950
+ */
24951
+ current_account_count?: number;
24952
+ /**
24953
+ * Whether the team currently has a card on file in Stripe. Set when reason=free_tier_exceeded or reason=twitter_passthrough.
24954
+ */
24955
+ has_payment_method?: boolean;
24956
+ /**
24957
+ * One-time card verification charge in USD cents, credited to usage. Only set when reason=card_verification_required.
24958
+ */
24959
+ verification_amount_cents?: number;
24960
+ /**
24961
+ * The negotiated connected-account cap from the
24962
+ * team's enterprise contract. Self-service teams
24963
+ * have no cap and never receive this reason. Only
24964
+ * set when reason=enterprise_required.
24965
+ *
24966
+ */
24967
+ effective_account_limit?: number;
24968
+ };
24969
+ } | {
24970
+ error?: string;
24971
+ code?: 'insufficient_permissions' | 'unclassified_resource';
24972
+ /**
24973
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
24974
+ */
24975
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
24976
+ });
24977
+
24862
24978
  export type GetTopupReceiptData = {
24863
24979
  path: {
24864
24980
  topupId: string;
@@ -24885,7 +25001,11 @@ export type GetTopupReceiptResponse = ({
24885
25001
  */
24886
25002
  feeCents: (number) | null;
24887
25003
  /**
24888
- * What the card was charged, the total on the receipt.
25004
+ * Tax charged on top of amountCents, as in the top-up list.
25005
+ */
25006
+ taxCents?: number;
25007
+ /**
25008
+ * What the card was charged, tax included: the total on the receipt.
24889
25009
  */
24890
25010
  chargedCents: number;
24891
25011
  });
@@ -24956,6 +25076,103 @@ export type GetTopupReceiptError = (ErrorResponse | {
24956
25076
  error?: string;
24957
25077
  });
24958
25078
 
25079
+ export type GetTopupInvoiceData = {
25080
+ path: {
25081
+ topupId: string;
25082
+ };
25083
+ };
25084
+
25085
+ export type GetTopupInvoiceResponse = ({
25086
+ url: string;
25087
+ format: 'pdf' | 'page';
25088
+ /**
25089
+ * The invoice PDF.
25090
+ */
25091
+ pdfUrl: (string) | null;
25092
+ /**
25093
+ * The invoice's Stripe-hosted page.
25094
+ */
25095
+ pageUrl: (string) | null;
25096
+ /**
25097
+ * Amount added to your balance, as in the top-up list.
25098
+ */
25099
+ amountCents: number;
25100
+ /**
25101
+ * Tax charged on top of amountCents.
25102
+ */
25103
+ taxCents: number;
25104
+ /**
25105
+ * What the card was charged, tax included.
25106
+ */
25107
+ chargedCents: number;
25108
+ });
25109
+
25110
+ export type GetTopupInvoiceError = (ErrorResponse | {
25111
+ /**
25112
+ * Human-readable error message suitable for end-user display.
25113
+ */
25114
+ error: string;
25115
+ /**
25116
+ * Machine-readable error code. Stable across versions.
25117
+ */
25118
+ code: 'PAYMENT_REQUIRED';
25119
+ /**
25120
+ * Discriminator for which gate fired.
25121
+ */
25122
+ reason: 'free_tier_exceeded' | 'twitter_passthrough' | 'enterprise_required' | 'card_verification_required';
25123
+ /**
25124
+ * Link to the relevant documentation page.
25125
+ */
25126
+ documentation_url?: string;
25127
+ /**
25128
+ * Deep-link to send the end-user to. For
25129
+ * `free_tier_exceeded` and `twitter_passthrough` this opens
25130
+ * the add-payment-method drawer on the Zernio billing page.
25131
+ * For `enterprise_required` this is the Zernio enterprise
25132
+ * contact page.
25133
+ *
25134
+ */
25135
+ dashboard_url?: string;
25136
+ /**
25137
+ * Structured context for SDK clients that want to render their own UX. Keys vary by `reason`.
25138
+ */
25139
+ details?: {
25140
+ /**
25141
+ * How many accounts the free tier allows. Only set when reason=free_tier_exceeded.
25142
+ */
25143
+ free_tier_account_limit?: number;
25144
+ /**
25145
+ * How many accounts the team currently has connected. Set when reason=free_tier_exceeded or reason=enterprise_required.
25146
+ */
25147
+ current_account_count?: number;
25148
+ /**
25149
+ * Whether the team currently has a card on file in Stripe. Set when reason=free_tier_exceeded or reason=twitter_passthrough.
25150
+ */
25151
+ has_payment_method?: boolean;
25152
+ /**
25153
+ * One-time card verification charge in USD cents, credited to usage. Only set when reason=card_verification_required.
25154
+ */
25155
+ verification_amount_cents?: number;
25156
+ /**
25157
+ * The negotiated connected-account cap from the
25158
+ * team's enterprise contract. Self-service teams
25159
+ * have no cap and never receive this reason. Only
25160
+ * set when reason=enterprise_required.
25161
+ *
25162
+ */
25163
+ effective_account_limit?: number;
25164
+ };
25165
+ } | {
25166
+ error?: string;
25167
+ code?: 'insufficient_permissions' | 'unclassified_resource';
25168
+ /**
25169
+ * The resource group the key needs for this operation. Absent on admin-plane and unclassified-path denials.
25170
+ */
25171
+ required_group?: 'publishing' | 'engagement' | 'messages' | 'contacts' | 'analytics' | 'ads' | 'telephony' | 'accounts' | 'billing' | 'webhooks' | 'commerce' | 'creator_campaigns' | 'money' | 'calendar' | 'files';
25172
+ } | {
25173
+ error?: string;
25174
+ });
25175
+
24959
25176
  export type GetTopupStatementData = {
24960
25177
  path: {
24961
25178
  topupId: string;
@@ -24966,17 +25183,25 @@ export type GetTopupStatementResponse = ({
24966
25183
  url: string;
24967
25184
  format: 'pdf' | 'page';
24968
25185
  /**
24969
- * The statement PDF.
25186
+ * The invoice PDF.
24970
25187
  */
24971
25188
  pdfUrl: (string) | null;
24972
25189
  /**
24973
- * The statement's Stripe-hosted page.
25190
+ * The invoice's Stripe-hosted page.
24974
25191
  */
24975
25192
  pageUrl: (string) | null;
24976
25193
  /**
24977
25194
  * Amount added to your balance, as in the top-up list.
24978
25195
  */
24979
25196
  amountCents: number;
25197
+ /**
25198
+ * Tax charged on top of amountCents.
25199
+ */
25200
+ taxCents: number;
25201
+ /**
25202
+ * What the card was charged, tax included.
25203
+ */
25204
+ chargedCents: number;
24980
25205
  });
24981
25206
 
24982
25207
  export type GetTopupStatementError = (ErrorResponse | {