paddle_rust_sdk/
enums.rs

1//! This module contains enums used in the Paddle API.
2
3#![allow(clippy::upper_case_acronyms, clippy::enum_variant_names)]
4
5use serde::{Deserialize, Serialize};
6
7#[derive(Clone, Debug, Serialize, Deserialize)]
8#[non_exhaustive]
9pub enum CountryCodeSupported {
10    /// Andorra
11    AD,
12    /// United Arab Emirates
13    AE,
14    /// Antigua and Barbuda
15    AG,
16    /// Anguilla
17    AI,
18    /// Albania
19    AL,
20    /// Armenia
21    AM,
22    /// Angola
23    AO,
24    /// Argentina
25    AR,
26    /// American Samoa
27    AS,
28    /// Austria
29    AT,
30    /// Australia
31    AU,
32    /// Aruba
33    AW,
34    /// Åland Islands
35    AX,
36    /// Azerbaijan
37    AZ,
38    /// Bosnia and Herzegovina
39    BA,
40    /// Barbados
41    BB,
42    /// Bangladesh
43    BD,
44    /// Belgium
45    BE,
46    /// Burkina Faso
47    BF,
48    /// Bulgaria
49    BG,
50    /// Bahrain
51    BH,
52    /// Burundi
53    BI,
54    /// Benin
55    BJ,
56    /// Saint Barthélemy
57    BL,
58    /// Bermuda
59    BM,
60    /// Brunei
61    BN,
62    /// Bolivia
63    BO,
64    /// Caribbean Netherlands (Bonaire, Sint Eustatius, and Saba)
65    BQ,
66    /// Brazil
67    BR,
68    /// Bahamas
69    BS,
70    /// Bhutan
71    BT,
72    /// Bouvet Island
73    BV,
74    /// Botswana
75    BW,
76    /// Belize
77    BZ,
78    /// Canada
79    CA,
80    /// Cocos Islands
81    CC,
82    /// Republic of Congo
83    CG,
84    /// Switzerland
85    CH,
86    /// Côte d'Ivoire (Ivory Coast)
87    CI,
88    /// Cook Islands
89    CK,
90    /// Chile
91    CL,
92    /// Cameroon
93    CM,
94    /// China
95    CN,
96    /// Colombia
97    CO,
98    /// Costa Rica
99    CR,
100    /// Cape Verde
101    CV,
102    /// Curaçao
103    CW,
104    /// Christmas Island
105    CX,
106    /// Cyprus
107    CY,
108    /// Czechia (Czech Republic)
109    CZ,
110    /// Germany
111    DE,
112    /// Djibouti
113    DJ,
114    /// Denmark
115    DK,
116    /// Dominica
117    DM,
118    /// Dominican Republic
119    DO,
120    /// Algeria
121    DZ,
122    /// Ecuador
123    EC,
124    /// Estonia
125    EE,
126    /// Egypt
127    EG,
128    /// Western Sahara
129    EH,
130    /// Eritrea
131    ER,
132    /// Spain
133    ES,
134    /// Ethiopia
135    ET,
136    /// Finland
137    FI,
138    /// Fiji
139    FJ,
140    /// Falkland Islands
141    FK,
142    /// Micronesia
143    FM,
144    /// Faroe Islands
145    FO,
146    /// France
147    FR,
148    /// Gabon
149    GA,
150    /// United Kingdom
151    GB,
152    /// Grenada
153    GD,
154    /// Georgia
155    GE,
156    /// French Guiana
157    GF,
158    /// Guernsey
159    GG,
160    /// Ghana
161    GH,
162    /// Gibraltar
163    GI,
164    /// Greenland
165    GL,
166    /// Gambia
167    GM,
168    /// Guinea
169    GN,
170    /// Guadeloupe
171    GP,
172    /// Equatorial Guinea
173    GQ,
174    /// Greece
175    GR,
176    /// South Georgia and the South Sandwich Islands
177    GS,
178    /// Guatemala
179    GT,
180    /// Guam
181    GU,
182    /// Guinea-Bissau
183    GW,
184    /// Guyana
185    GY,
186    /// Hong Kong
187    HK,
188    /// Heard Island and McDonald Islands
189    HM,
190    /// Honduras
191    HN,
192    /// Croatia
193    HR,
194    /// Hungary
195    HU,
196    /// Indonesia
197    ID,
198    /// Ireland
199    IE,
200    /// Israel
201    IL,
202    /// Isle of Man
203    IM,
204    /// India
205    IN,
206    /// British Indian Ocean Territory
207    IO,
208    /// Iraq
209    IQ,
210    /// Iceland
211    IS,
212    /// Italy
213    IT,
214    /// Jersey
215    JE,
216    /// Jamaica
217    JM,
218    /// Jordan
219    JO,
220    /// Japan
221    JP,
222    /// Kenya
223    KE,
224    /// Kyrgyzstan
225    KG,
226    /// Cambodia
227    KH,
228    /// Kiribati
229    KI,
230    /// Comoros
231    KM,
232    /// Saint Kitts and Nevis
233    KN,
234    /// South Korea
235    KR,
236    /// Kuwait
237    KW,
238    /// Cayman Islands
239    KY,
240    /// Kazakhstan
241    KZ,
242    /// Lao People's Democratic Republic (Laos)
243    LA,
244    /// Lebanon
245    LB,
246    /// Saint Lucia
247    LC,
248    /// Liechtenstein
249    LI,
250    /// Sri Lanka
251    LK,
252    /// Liberia
253    LR,
254    /// Lesotho
255    LS,
256    /// Lithuania
257    LT,
258    /// Luxembourg
259    LU,
260    /// Latvia
261    LV,
262    /// Morocco
263    MA,
264    /// Monaco
265    MC,
266    /// Moldova
267    MD,
268    /// Montenegro
269    ME,
270    /// Saint Martin
271    MF,
272    /// Madagascar
273    MG,
274    /// Marshall Islands
275    MH,
276    /// Macedonia
277    MK,
278    /// Mongolia
279    MN,
280    /// Macao
281    MO,
282    /// Northern Mariana Islands
283    MP,
284    /// Martinique
285    MQ,
286    /// Mauritania
287    MR,
288    /// Montserrat
289    MS,
290    /// Malta
291    MT,
292    /// Mauritius
293    MU,
294    /// Maldives
295    MV,
296    /// Malawi
297    MW,
298    /// Mexico
299    MX,
300    /// Malaysia
301    MY,
302    /// Mozambique
303    MZ,
304    /// Namibia
305    NA,
306    /// New Caledonia
307    NC,
308    /// Niger
309    NE,
310    /// Norfolk Island
311    NF,
312    /// Nigeria
313    NG,
314    /// Netherlands
315    NL,
316    /// Norway
317    NO,
318    /// Nepal
319    NP,
320    /// Nauru
321    NR,
322    /// Niue
323    NU,
324    /// New Zealand
325    NZ,
326    /// Oman
327    OM,
328    /// Panama
329    PA,
330    /// Peru
331    PE,
332    /// French Polynesia
333    PF,
334    /// Papua New Guinea
335    PG,
336    /// Philippines
337    PH,
338    /// Pakistan
339    PK,
340    /// Poland
341    PL,
342    /// Saint Pierre and Miquelon
343    PM,
344    /// Pitcairn
345    PN,
346    /// Puerto Rico
347    PR,
348    /// Palestinian territories
349    PS,
350    /// Portugal
351    PT,
352    /// Palau
353    PW,
354    /// Paraguay
355    PY,
356    /// Qatar
357    QA,
358    /// Reunion
359    RE,
360    /// Romania
361    RO,
362    /// Republic of Serbia
363    RS,
364    /// Rwanda
365    RW,
366    /// Saudi Arabia
367    SA,
368    /// Solomon Islands
369    SB,
370    /// Seychelles
371    SC,
372    /// Sweden
373    SE,
374    /// Singapore
375    SG,
376    /// Saint Helena
377    SH,
378    /// Slovenia
379    SI,
380    /// Svalbard and Jan Mayen
381    SJ,
382    /// Slovakia
383    SK,
384    /// Sierra Leone
385    SL,
386    /// San Marino
387    SM,
388    /// Senegal
389    SN,
390    /// Suriname
391    SR,
392    /// São Tomé and Príncipe
393    ST,
394    /// El Salvador
395    SV,
396    /// Sint Maarten
397    SX,
398    /// Swaziland
399    SZ,
400    /// Turks and Caicos Islands
401    TC,
402    /// Chad
403    TD,
404    /// French Southern and Antarctic Lands
405    TF,
406    /// Togo
407    TG,
408    /// Thailand
409    TH,
410    /// Tajikistan
411    TJ,
412    /// Tokelau
413    TK,
414    /// Timor-Leste
415    TL,
416    /// Turkmenistan
417    TM,
418    /// Tunisia
419    TN,
420    /// Tonga
421    TO,
422    /// Turkey
423    TR,
424    /// Trinidad and Tobago
425    TT,
426    /// Tuvalu
427    TV,
428    /// Taiwan
429    TW,
430    /// Tanzania
431    TZ,
432    /// Ukraine
433    UA,
434    /// Uganda
435    UG,
436    /// United States Minor Outlying Islands
437    UM,
438    /// United States
439    US,
440    /// Uruguay
441    UY,
442    /// Uzbekistan
443    UZ,
444    /// Holy See (Vatican City)
445    VA,
446    /// Saint Vincent and the Grenadines
447    VC,
448    /// British Virgin Islands
449    VG,
450    /// U.S. Virgin Islands
451    VI,
452    /// Vietnam
453    VN,
454    /// Vanuatu
455    VU,
456    /// Wallis and Futuna
457    WF,
458    /// Samoa
459    WS,
460    /// Kosovo
461    XK,
462    /// Mayotte
463    YT,
464    /// South Africa
465    ZA,
466    /// Zambia
467    ZM,
468}
469
470/// Whether this entity can be used in Paddle.
471#[derive(Clone, Debug, Serialize, Deserialize)]
472#[non_exhaustive]
473#[serde(rename_all = "kebab-case")]
474pub enum Status {
475    /// Entity is active and can be used.
476    Active,
477    /// Entity is archived, so can't be used.
478    Archived,
479}
480
481/// How this adjustment impacts the related transaction.
482#[derive(Clone, Debug, Serialize, Deserialize)]
483#[non_exhaustive]
484pub enum AdjustmentAction {
485    /// Credits some or all the related transaction.
486    Credit,
487    /// Refunds some or all the related transaction. Must be approved by Paddle in most cases.
488    Refund,
489    /// Chargeback for the related transaction. Automatically created by Paddle when a customer successfully disputes a charge.
490    Chargeback,
491    /// Reversal of a chargeback for the related transaction. Automatically created by Paddle when Paddle contests a chargeback successfully.
492    ChargebackReverse,
493    /// Warning of an upcoming chargeback for the related transaction. Automatically created by Paddle.
494    ChargebackWarning,
495    /// Reversal of a credit for the related transaction. Automatically created by Paddle.
496    CreditReverse,
497}
498
499/// Type of adjustment. Use `full` to adjust the grand total for the related transaction. Include an `items` array when creating a `partial` adjustment. If omitted, defaults to `partial`.
500#[derive(Clone, Debug, Serialize, Deserialize)]
501#[non_exhaustive]
502pub enum AdjustmentType {
503    /// The grand total for the related transaction is adjusted.
504    Full,
505    /// Some line items for the related transaction are adjusted. Requires `items`.
506    Partial,
507}
508
509/// Supported three-letter ISO 4217 currency code.
510#[derive(Clone, Debug, Serialize, Deserialize)]
511#[non_exhaustive]
512pub enum CurrencyCode {
513    /// United States Dollar
514    USD,
515    /// Euro
516    EUR,
517    /// Pound Sterling
518    GBP,
519    /// Japanese Yen
520    JPY,
521    /// Australian Dollar
522    AUD,
523    /// Canadian Dollar
524    CAD,
525    /// Swiss Franc
526    CHF,
527    /// Hong Kong Dollar
528    HKD,
529    /// Singapore Dollar
530    SGD,
531    /// Swedish Krona
532    SEK,
533    /// Argentine Peso
534    ARS,
535    /// Brazilian Real
536    BRL,
537    /// Chinese Yuan
538    CNY,
539    /// Colombian Peso
540    COP,
541    /// Czech Koruna
542    CZK,
543    /// Danish Krone
544    DKK,
545    /// Hungarian Forint
546    HUF,
547    /// Israeli Shekel
548    ILS,
549    /// Indian Rupee
550    INR,
551    /// South Korean Won
552    KRW,
553    /// Mexican Peso
554    MXN,
555    /// Norwegian Krone
556    NOK,
557    /// New Zealand Dollar
558    NZD,
559    /// Polish Zloty
560    PLN,
561    /// Russian Ruble
562    RUB,
563    /// Thai Baht
564    THB,
565    /// Turkish Lira
566    TRY,
567    /// New Taiwan Dollar
568    TWD,
569    /// Ukrainian Hryvnia
570    UAH,
571    /// Vietnamese Dong
572    VND,
573    /// South African Rand
574    ZAR,
575}
576
577/// Status of this adjustment. Set automatically by Paddle.
578///
579/// Most refunds for live accounts are created with the status of `pending_approval` until reviewed by Paddle, but some are automatically approved. For sandbox accounts, Paddle automatically approves refunds every ten minutes.
580///
581/// Credit adjustments don't require approval from Paddle, so they're created as `approved`.
582#[derive(Clone, Debug, Serialize, Deserialize)]
583#[non_exhaustive]
584pub enum AdjustmentStatus {
585    /// Adjustment is pending approval by Paddle. Most refunds for live accounts must be approved by Paddle.
586    PendingApproval,
587    /// Adjustment is approved. Default for credits. Set when Paddle approves a refund that was `pending_approval`.
588    Approved,
589    /// Adjustment has been rejected. Set when Paddle rejects a refund that was `pending_approval`.
590    Rejected,
591    /// Adjustment has been reversed. Set by Paddle when a `chargeback_reversal` or `credit_reversal` adjustment is created for this adjustment.
592    Reversed,
593}
594
595/// Three-letter ISO 4217 currency code for chargeback fees.
596#[derive(Clone, Debug, Serialize, Deserialize)]
597#[non_exhaustive]
598pub enum CurrencyCodeChargebacks {
599    /// Australian Dollar
600    AUD,
601    /// Canadian Dollar
602    CAD,
603    /// Euro
604    EUR,
605    /// Pound Sterling
606    GBP,
607    /// United States Dollar
608    USD,
609}
610
611/// Supported three-letter ISO 4217 currency code for payouts from Paddle.
612#[derive(Clone, Debug, Serialize, Deserialize)]
613#[non_exhaustive]
614pub enum CurrencyCodePayouts {
615    /// Australian Dollar
616    AUD,
617    /// Canadian Dollar
618    CAD,
619    /// Swiss Franc
620    CHF,
621    /// Chinese Yuan
622    CNY,
623    /// Czech Koruna
624    CZK,
625    /// Danish Krone
626    DKK,
627    /// Euro
628    EUR,
629    /// Pound Sterling
630    GBP,
631    /// Hungarian Forint
632    HUF,
633    /// Polish Zloty
634    PLN,
635    /// Swedish Krona
636    SEK,
637    /// United States Dollar
638    USD,
639    /// South African Rand
640    ZAR,
641}
642
643/// Type of adjustment for this transaction item. `tax` adjustments are automatically created by Paddle.
644/// Include `amount` when creating a `partial` adjustment.
645#[derive(Clone, Debug, Serialize, Deserialize)]
646#[non_exhaustive]
647pub enum AdjustmentItemType {
648    /// Full total for this transaction item is adjusted.
649    Full,
650    /// Part of this transaction item is adjusted. Include `amount` to specify the partial amount adjusted.
651    Partial,
652    /// Tax for this transaction item is adjusted. Created automatically by Paddle.
653    Tax,
654    /// A prorated amount for this transaction item is adjusted. Created automatically by Paddle in some cases when making changes to a subscription.
655    Proration,
656}
657
658/// Unit of time.
659#[derive(Clone, Debug, Serialize, Deserialize)]
660#[non_exhaustive]
661#[serde(rename_all = "kebab-case")]
662pub enum Interval {
663    Day,
664    Week,
665    Month,
666    Year,
667}
668
669/// Type of credit or debit card used to pay.
670#[derive(Clone, Debug, Serialize, Deserialize)]
671#[non_exhaustive]
672#[serde(rename_all = "snake_case")]
673pub enum CardType {
674    /// American Express
675    AmericanExpress,
676    /// Diners Club
677    DinersClub,
678    /// Discover Card
679    Discover,
680    /// JCB Card, popular in Japan
681    Jcb,
682    /// Mada Card, popular in Saudi Arabia
683    Mada,
684    /// Maestro (debit card)
685    Maestro,
686    /// Mastercard
687    Mastercard,
688    /// UnionPay, popular in China
689    UnionPay,
690    /// Card type unknown
691    Unknown,
692    /// Visa
693    Visa,
694}
695
696/// Type of item. Standard items are considered part of your catalog and are shown on the Paddle dashboard.
697#[derive(Clone, Debug, Serialize, Deserialize)]
698#[non_exhaustive]
699#[serde(rename_all = "kebab-case")]
700pub enum CatalogType {
701    /// Non-catalog item. Typically created for a specific transaction or subscription. Not returned when listing or shown in the Paddle dashboard.
702    Custom,
703    /// Standard item. Can be considered part of your catalog and reused across transactions and subscriptions easily.
704    Standard,
705}
706
707/// How payment is collected. `automatic` for checkout, `manual` for invoices.
708#[derive(Clone, Debug, Serialize, Deserialize)]
709#[non_exhaustive]
710#[serde(rename_all = "snake_case")]
711pub enum CollectionMode {
712    /// Payment is collected automatically using a checkout initially, then using a payment method on file.
713    Automatic,
714    /// Payment is collected manually. Customers are sent an invoice with payment terms and can make a payment offline or using a checkout. Requires `billing_details`.
715    Manual,
716}
717
718/// Type of payment method saved.
719#[derive(Clone, Debug, Serialize, Deserialize)]
720#[non_exhaustive]
721#[serde(rename_all = "snake_case")]
722pub enum SavedPaymentMethodType {
723    /// Alipay, popular in China.
724    Alipay,
725    /// Apple Pay on a supported Apple device.
726    ApplePay,
727    /// Credit or debit card.
728    Card,
729    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
730    GooglePay,
731    /// PayPal.
732    Paypal,
733}
734
735/// Describes how this payment method was saved.
736#[derive(Clone, Debug, Serialize, Deserialize)]
737#[non_exhaustive]
738#[serde(rename_all = "snake_case")]
739pub enum PaymentMethodOrigin {
740    /// The customer chose to save this payment method while purchasing a one-time item.
741    SavedDuringPurchase,
742    /// The customer purchased a subscription, so this payment method was saved for future purchases.
743    Subscription,
744}
745
746/// Whether this entity can be used in Paddle.
747#[derive(Clone, Debug, Serialize, Deserialize)]
748#[non_exhaustive]
749#[serde(rename_all = "kebab-case")]
750pub enum DiscountStatus {
751    /// Entity is active and can be used.
752    Active,
753    /// Entity is archived, so can't be used.
754    Archived,
755}
756
757/// Type of discount. Determines how this discount impacts the checkout or transaction total.
758#[derive(Clone, Debug, Serialize, Deserialize)]
759#[non_exhaustive]
760#[serde(rename_all = "snake_case")]
761pub enum DiscountType {
762    /// Discounts a checkout or transaction by a flat amount, for example -$100. Requires `currency_code`.
763    Flat,
764    /// Discounts a checkout or transaction by a flat amount per unit, for example -$100 per user. Requires `currency_code`.
765    FlatPerSeat,
766    /// Discounts a checkout or transaction by a percentage of the total, for example -10%. Maximum 100%.
767    Percentage,
768}
769
770/// When this subscription change should take effect from. Defaults to `next_billing_period`, which creates a
771/// `scheduled_change` to apply the subscription change at the end of the billing period.
772#[derive(Clone, Debug, Serialize, Deserialize)]
773#[non_exhaustive]
774pub enum EffectiveFrom {
775    /// Takes effect on the next billing period.
776    NextBillingPeriod,
777    /// Takes effect immediately.
778    Immediately,
779}
780
781/// Type of error encountered.
782#[derive(Clone, Debug, Serialize, Deserialize)]
783#[non_exhaustive]
784pub enum Type {
785    /// Typically means there's a problem with the request that you made.
786    RequestError,
787    /// Typically means there's a problem with the Paddle API.
788    ApiError,
789}
790
791/// Reason why a payment attempt failed. Returns `null` if payment captured successfully.
792#[derive(Clone, Debug, Serialize, Deserialize)]
793#[non_exhaustive]
794#[serde(rename_all = "snake_case")]
795pub enum ErrorCode {
796    /// Cancellation not possible because the amount has already been canceled. Not typically returned for payments.
797    AlreadyCanceled,
798    /// Refund is not possible because the amount has already been refunded. Not typically returned for payments.
799    AlreadyRefunded,
800    /// Payment required a 3DS2 authentication challenge. The customer completed the challenge but was not successful.
801    AuthenticationFailed,
802    /// Payment method issuer has indicated that the card cannot be used as it is frozen, lost, damaged, or stolen.
803    BlockedCard,
804    /// Customer has requested that the mandate for recurring payments be canceled.
805    Canceled,
806    /// Payment method has been declined, with no other information returned.
807    Declined,
808    /// Payment method has been declined, and the issuer has indicated that it should not be retried. This could mean the account is closed or the customer revoked authorization to charge the payment method.
809    DeclinedNotRetryable,
810    /// Payment method issuer has indicated that this card is expired. Expired cards may also return `invalid_payment_details`, depending on how a payment is routed.
811    ExpiredCard,
812    /// Payment method issuer or payment service provider flagged this payment as potentially fraudulent.
813    Fraud,
814    /// Payment method issuer or payment service provider cannot process a payment that is this high or low.
815    InvalidAmount,
816    /// Payment service provider has indicated the payment method isn't valid. This typically means that it's expired. `expired_card` is returned by the payment method issuer, rather than the payment service provider.
817    InvalidPaymentDetails,
818    /// Payment service provider couldn't reach the payment method issuer.
819    IssuerUnavailable,
820    /// Payment method declined because of insufficient funds, or fund limits being reached.
821    NotEnoughBalance,
822    /// Payment method has been declined because the network scheme that the customer selected isn't supported by the payment service provider.
823    PreferredNetworkNotSupported,
824    /// Something went wrong with the payment service provider, with no other information returned.
825    PspError,
826    /// Payment service provider didn't receive payment method information as they've been redacted.
827    RedactedPaymentMethod,
828    /// Something went wrong with the Paddle platform. Try again later, or check status.paddle.com.
829    SystemError,
830    /// Payment method issuer doesn't allow this kind of payment because of limits on the account, or legal or compliance reasons.
831    TransactionNotPermitted,
832    /// Payment attempt unsuccessful, with no other information returned.
833    Unknown,
834}
835
836/// Type of event sent by Paddle, in the format `entity.event_type`.
837#[derive(Clone, Debug, Serialize, Deserialize)]
838#[non_exhaustive]
839pub enum EventTypeName {
840    /// An [`address.created`](https://developer.paddle.com/webhooks/addresses/address-created) event.
841    AddressCreated,
842    /// An [`address.imported`](https://developer.paddle.com/webhooks/addresses/address-imported) event.
843    AddressImported,
844    /// An [`address.updated`](https://developer.paddle.com/webhooks/addresses/address-updated) event.
845    AddressUpdated,
846    /// An [`adjustment.created`](https://developer.paddle.com/webhooks/adjustments/adjustment-created) event.
847    AdjustmentCreated,
848    /// An [`adjustment.updated`](https://developer.paddle.com/webhooks/adjustments/adjustment-updated) event.
849    AdjustmentUpdated,
850    /// A [`business.created`](https://developer.paddle.com/webhooks/businesses/business-created) event.
851    BusinessCreated,
852    /// A [`business.imported`](https://developer.paddle.com/webhooks/businesses/business-imported) event.
853    BusinessImported,
854    /// A [`business.updated`](https://developer.paddle.com/webhooks/businesses/business-updated) event.
855    BusinessUpdated,
856    /// A [`customer.created`](https://developer.paddle.com/webhooks/customers/customer-created) event.
857    CustomerCreated,
858    /// A [`customer.imported`](https://developer.paddle.com/webhooks/customers/customer-imported) event.
859    CustomerImported,
860    /// A [`customer.updated`](https://developer.paddle.com/webhooks/customers/customer-updated) event.
861    CustomerUpdated,
862    /// A [`discount.created`](https://developer.paddle.com/webhooks/discounts/discount-created) event.
863    DiscountCreated,
864    /// A [`discount.imported`](https://developer.paddle.com/webhooks/discounts/discount-imported) event.
865    DiscountImported,
866    /// A [`discount.updated`](https://developer.paddle.com/webhooks/discounts/discount-updated) event.
867    DiscountUpdated,
868    /// A [`payout.created`](https://developer.paddle.com/webhooks/payouts/payout-created) event.
869    PayoutCreated,
870    /// A [`payout.paid`](https://developer.paddle.com/webhooks/payouts/payout-paid) event.
871    PayoutPaid,
872    /// A [`price.created`](https://developer.paddle.com/webhooks/prices/price-created) event.
873    PriceCreated,
874    /// A [`price.imported`](https://developer.paddle.com/webhooks/prices/price-imported) event.
875    PriceImported,
876    /// A [`price.updated`](https://developer.paddle.com/webhooks/prices/price-updated) event.
877    PriceUpdated,
878    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-created) event.
879    ProductCreated,
880    /// A [`product.imported`](https://developer.paddle.com/webhooks/products/product-imported) event.
881    ProductImported,
882    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-updated) event.
883    ProductUpdated,
884    /// A [`report.created`](https://developer.paddle.com/webhooks/reports/report-created) event.
885    ReportCreated,
886    /// A [`report.updated`](https://developer.paddle.com/webhooks/reports/report-updated) event.
887    ReportUpdated,
888    /// A [`subscription.activated`](https://developer.paddle.com/webhooks/subscriptions/subscription-activated) event.
889    SubscriptionActivated,
890    /// A [`subscription.canceled`](https://developer.paddle.com/webhooks/subscriptions/subscription-canceled) event.
891    SubscriptionCanceled,
892    /// A [`subscription.created`](https://developer.paddle.com/webhooks/subscriptions/subscription-created) event.
893    SubscriptionCreated,
894    /// A [`subscription.imported`](https://developer.paddle.com/webhooks/subscriptions/subscription-imported) event.
895    SubscriptionImported,
896    /// A [`subscription.past_due`](https://developer.paddle.com/webhooks/subscriptions/subscription-past-due) event.
897    SubscriptionPastDue,
898    /// A [`subscription.paused`](https://developer.paddle.com/webhooks/subscriptions/subscription-paused) event.
899    SubscriptionPaused,
900    /// A [`subscription.resumed`](https://developer.paddle.com/webhooks/subscriptions/subscription-resumed) event.
901    SubscriptionResumed,
902    /// A [`subscription.trialing`](https://developer.paddle.com/webhooks/subscriptions/subscription-trialing) event.
903    SubscriptionTrialing,
904    /// A [`subscription.updated`](https://developer.paddle.com/webhooks/subscriptions/subscription-updated) event.
905    SubscriptionUpdated,
906    /// A [`transaction.billed`](https://developer.paddle.com/webhooks/transactions/transaction-billed) event.
907    TransactionBilled,
908    /// A [`transaction.canceled`](https://developer.paddle.com/webhooks/transactions/transaction-canceled) event.
909    TransactionCanceled,
910    /// A [`transaction.completed`](https://developer.paddle.com/webhooks/transactions/transaction-completed) event.
911    TransactionCompleted,
912    /// A [`transaction.created`](https://developer.paddle.com/webhooks/transactions/transaction-created) event.
913    TransactionCreated,
914    /// A [`transaction.paid`](https://developer.paddle.com/webhooks/transactions/transaction-paid) event.
915    TransactionPaid,
916    /// A [`transaction.past_due`](https://developer.paddle.com/webhooks/transactions/transaction-past-due) event.
917    TransactionPastDue,
918    /// A [`transaction.payment_failed`](https://developer.paddle.com/webhooks/transactions/transaction-payment-failed) event.
919    TransactionPaymentFailed,
920    /// A [`transaction.ready`](https://developer.paddle.com/webhooks/transactions/transaction-ready) event.
921    TransactionReady,
922    /// A [`transaction.updated`](https://developer.paddle.com/webhooks/transactions/transaction-updated) event.
923    TransactionUpdated,
924}
925
926/// Status of this subscription item. Set automatically by Paddle.
927#[derive(Clone, Debug, Serialize, Deserialize)]
928#[non_exhaustive]
929#[serde(rename_all = "lowercase")]
930pub enum SubscriptionItemStatus {
931    /// This item is active. It is not in trial and Paddle bills for it.
932    Active,
933    /// This item is not active. Set when the related subscription is paused.
934    Inactive,
935    /// This item is in trial. Paddle has not billed for it.
936    Trialing,
937}
938
939/// How tax is calculated for this price.
940#[derive(Clone, Debug, Serialize, Deserialize)]
941#[non_exhaustive]
942#[serde(rename_all = "snake_case")]
943pub enum TaxMode {
944    /// Prices use the setting from your account.
945    AccountSetting,
946    /// Prices are exclusive of tax.
947    External,
948    /// Prices are inclusive of tax.
949    Internal,
950}
951
952/// Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
953#[derive(Clone, Debug, Serialize, Deserialize)]
954#[non_exhaustive]
955#[serde(rename_all = "kebab-case")]
956pub enum TaxCategory {
957    /// Non-customizable digital files or media (not software) acquired with an up front payment that can be accessed without any physical product being delivered.
958    DigitalGoods,
959    /// Digital books and educational material which is sold with permanent rights for use by the customer.
960    Ebooks,
961    /// Remote configuration, set-up, and integrating software on behalf of a customer.
962    ImplementationServices,
963    /// Services that involve the application of your expertise and specialized knowledge of a software product.
964    ProfessionalServices,
965    /// Products that allow users to connect to and use online or cloud-based applications over the Internet.
966    Saas,
967    /// Services that can be used to customize and white label software products.
968    SoftwareProgrammingServices,
969    /// Software products that are pre-written and can be downloaded and installed onto a local device.
970    Standard,
971    /// Training and education services related to software products.
972    TrainingServices,
973    /// Cloud storage service for personal or corporate information, assets, or intellectual property.
974    WebsiteHosting,
975}
976
977impl AsRef<str> for TaxCategory {
978    fn as_ref(&self) -> &str {
979        match self {
980            Self::DigitalGoods => "digital-goods",
981            Self::Ebooks => "ebooks",
982            Self::ImplementationServices => "implementation-services",
983            Self::ProfessionalServices => "professional-services",
984            Self::Saas => "saas",
985            Self::SoftwareProgrammingServices => "software-programming-services",
986            Self::Standard => "standard",
987            Self::TrainingServices => "training-services",
988            Self::WebsiteHosting => "website-hosting",
989        }
990    }
991}
992
993/// Type of payment method used for this payment attempt.
994#[derive(Clone, Debug, Serialize, Deserialize)]
995#[non_exhaustive]
996#[serde(rename_all = "snake_case")]
997pub enum PaymentMethodType {
998    /// Alipay, popular in China.
999    Alipay,
1000    /// Apple Pay on a supported Apple device.
1001    ApplePay,
1002    /// Bancontact, popular in Belgium.
1003    Bancontact,
1004    /// Credit or debit card.
1005    Card,
1006    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
1007    GooglePay,
1008    /// iDEAL, popular in the Netherlands.
1009    Ideal,
1010    /// Payment recorded offline.
1011    Offline,
1012    /// PayPal.
1013    Paypal,
1014    /// Payment method not known.
1015    Unknown,
1016    /// Wire transfer, sometimes called bank transfer.
1017    WireTransfer,
1018}
1019
1020/// Status of this notification.
1021#[derive(Clone, Debug, Serialize, Deserialize)]
1022#[non_exhaustive]
1023pub enum NotificationStatus {
1024    /// Paddle hasn't yet tried to deliver this notification.
1025    NotAttempted,
1026    /// Paddle tried to deliver this notification, but it failed. It's scheduled to be retried.
1027    NeedsRetry,
1028    /// Paddle delivered this notification successfully.
1029    Delivered,
1030    /// Paddle tried to deliver this notification, but all attempts failed. It's not scheduled to be retried.
1031    Failed,
1032}
1033
1034/// Describes how this notification was created.
1035#[derive(Clone, Debug, Serialize, Deserialize)]
1036#[non_exhaustive]
1037pub enum NotificationOrigin {
1038    /// Notification created when a subscribed event occurred.
1039    Event,
1040    /// Notification created when a notification with the origin `event` was replayed.
1041    Replay,
1042}
1043
1044/// Where notifications should be sent for this destination.
1045#[derive(Clone, Debug, Serialize, Deserialize)]
1046#[non_exhaustive]
1047pub enum NotificationSettingType {
1048    /// Deliver to an email address.
1049    Email,
1050    /// Deliver to a webhook endpoint.
1051    Url,
1052}
1053
1054/// Whether Paddle should deliver real platform events, simulation events or both to this notification destination.
1055#[derive(Clone, Debug, Serialize, Deserialize)]
1056#[non_exhaustive]
1057pub enum TrafficSource {
1058    /// Deliver real platform events to this notification destination.
1059    Platform,
1060    /// Deliver simulation events to this notification destination.
1061    Simulation,
1062    /// Deliver platform and simulation events to this notification destination.
1063    All,
1064}
1065
1066/// Operator to use when filtering.
1067#[derive(Clone, Debug, Serialize, Deserialize)]
1068#[non_exhaustive]
1069pub enum FilterOperator {
1070    /// Less than.
1071    Lt,
1072    /// Greater than or equal to.
1073    Gte,
1074}
1075
1076#[derive(Clone, Debug, Serialize, Deserialize)]
1077#[non_exhaustive]
1078#[serde(rename_all = "snake_case")]
1079pub enum TransactionOrigin {
1080    /// Transaction created via the Paddle API.
1081    Api,
1082    /// Transaction created automatically by Paddle as a result of a one-time charge for a subscription.
1083    SubscriptionCharge,
1084    /// Transaction created automatically as part of updating a payment method. May be a zero value transaction.
1085    SubscriptionPaymentMethodChange,
1086    /// Transaction created automatically by Paddle as a result of a subscription renewal.
1087    SubscriptionRecurring,
1088    /// Transaction created automatically by Paddle as a result of an update to a subscription.
1089    SubscriptionUpdate,
1090    /// Transaction created automatically by Paddle.js for a checkout.
1091    Web,
1092}
1093
1094/// Status of this report. Set automatically by Paddle.
1095///
1096/// Reports are created as `pending` initially, then move to `ready` when they're available to download.
1097#[derive(Clone, Debug, Serialize, Deserialize)]
1098#[non_exhaustive]
1099pub enum ReportStatus {
1100    /// Report created, but Paddle is processing it. It's not yet ready for download.
1101    Pending,
1102    /// Report fully processed by Paddle and ready for download.
1103    Ready,
1104    /// There was a problem processing this report.
1105    Failed,
1106    /// Report has expired and is no longer accessible.
1107    Expired,
1108}
1109
1110/// Field name to filter by.
1111#[derive(Clone, Debug, Serialize, Deserialize)]
1112#[non_exhaustive]
1113pub enum AdjustmentsReportFilterName {
1114    /// Filter by adjustment action. Pass an array of strings containing any valid value for the `action` field against an adjustment.
1115    Action,
1116    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
1117    CurrencyCode,
1118    /// Filter by transaction or adjustment status. Pass an array of strings containing any valid value for the `status` field against a transaction or an adjustment.
1119    Status,
1120    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
1121    UpdatedAt,
1122}
1123
1124/// Field name to filter by.
1125#[derive(Clone, Debug, Serialize, Deserialize)]
1126#[non_exhaustive]
1127pub enum DiscountsReportFilterName {
1128    /// Filter by discount type. Pass an array of strings containing any valid value for the `type` field against a discount.
1129    Type,
1130    /// Filter by discount status. Pass an array of strings containing any valid value for the `status` field against a discount.
1131    Status,
1132    /// Filter by discount updated date. Pass an RFC 3339 datetime string.
1133    UpdatedAt,
1134}
1135
1136/// Field name to filter by.
1137#[derive(Clone, Debug, Serialize, Deserialize)]
1138#[non_exhaustive]
1139pub enum ProductPricesReportFilterName {
1140    /// Filter by product status. Pass an array of strings containing any valid value for the `status` field against a product.
1141    ProductStatus,
1142    /// Filter by price status. Pass an array of strings containing any valid value for the `status` field against a price.
1143    PriceStatus,
1144    /// Filter by product type. Pass an array of strings containing any valid value for the `type` field against a product.
1145    ProductType,
1146    /// Filter by price type. Pass an array of strings containing any valid value for the `type` field against a price.
1147    PriceType,
1148    /// Filter by product `updated_at` date. Pass an RFC 3339 datetime string.
1149    ProductUpdatedAt,
1150    /// Filter by price `updated_at` date. Pass an RFC 3339 datetime string.
1151    PriceUpdatedAt,
1152}
1153
1154/// Field name to filter by.
1155#[derive(Clone, Debug, Serialize, Deserialize)]
1156#[non_exhaustive]
1157pub enum TransactionsReportFilterName {
1158    /// Filter by collection mode. Pass an array of strings containing any valid value for the `collection_mode` field against a transaction.
1159    CollectionMode,
1160    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
1161    CurrencyCode,
1162    /// Filter by transaction origin. Pass an array of strings containing any valid value for the origin field against a transaction.
1163    Origin,
1164    /// Filter by transaction or adjustment status. Pass an array of strings containing any valid value for the `status` field against a transaction or an adjustment.
1165    Status,
1166    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
1167    UpdatedAt,
1168}
1169
1170/// Type of report.
1171#[derive(Clone, Debug, Serialize, Deserialize)]
1172#[non_exhaustive]
1173pub enum AdjustmentsReportType {
1174    /// Adjustments reports contain information about refunds, credits, and chargebacks.
1175    Adjustments,
1176    /// Adjustments reports contain information about refunds, credits, and chargebacks. The report is broken down by line item level.
1177    AdjustmentLineItems,
1178}
1179
1180/// Type of report.
1181#[derive(Clone, Debug, Serialize, Deserialize)]
1182#[non_exhaustive]
1183pub enum TransactionsReportType {
1184    /// Transactions reports contain information about revenue received, past due invoices, draft and issued invoices, and canceled transactions.
1185    Transactions,
1186    /// Transactions reports contain information about revenue received, past due invoices, draft and issued invoices, and canceled transactions. The report is broken down by line item level.
1187    TransactionLineItems,
1188}
1189
1190/// Status of this simulation run log.
1191#[derive(Clone, Debug, Serialize, Deserialize)]
1192#[non_exhaustive]
1193pub enum SimulationEventStatus {
1194    /// Simulation run log is pending. Paddle hasn't yet tried to deliver the simulated event.
1195    Pending,
1196    /// Simulation run log was successful. Paddle delivered the simulated event successfully.
1197    Success,
1198    /// Simulation run log failed. Paddle tried to deliver the simulated event, but it failed. If `response` object is `null`, no response received from your server. Check your notification setting endpoint configuration.
1199    Failed,
1200    /// Simulation run log aborted. Paddle could not attempt delivery of the simulated event.
1201    Aborted,
1202}
1203
1204/// Status of this simulation run.
1205#[derive(Clone, Debug, Serialize, Deserialize)]
1206#[non_exhaustive]
1207pub enum SimulationRunStatus {
1208    /// Simulation run is pending. Paddle is sending events that are part of this simulation.
1209    Pending,
1210    /// Simulation run is completed. Paddle attempted to send events that are part of this simulation.
1211    Completed,
1212    /// Simulation run is canceled. Simulation run was canceled before all events were sent.
1213    Canceled,
1214}
1215
1216/// Scenario for a simulation.
1217#[derive(Clone, Debug, Serialize, Deserialize)]
1218#[non_exhaustive]
1219pub enum SimulationScenarioType {
1220    /// Simulates all events sent when a subscription is created.
1221    SubscriptionCreation,
1222    /// Simulates all events sent when a subscription is renewed.
1223    SubscriptionRenewal,
1224    /// Simulates all events sent when a subscription is paused.
1225    SubscriptionPause,
1226    /// Simulates all events sent when a subscription is resumed.
1227    SubscriptionResume,
1228    /// Simulates all events sent when a subscription is canceled.
1229    SubscriptionCancellation,
1230}
1231
1232/// Type of simulation.
1233#[derive(Clone, Debug, Serialize, Deserialize)]
1234#[non_exhaustive]
1235pub enum SimulationKind {
1236    /// Paddle simulates a single event.
1237    SingleEvent,
1238    /// Paddle simulates a predefined series of events for a scenario, like all events created when a subscription renews.
1239    Scenario,
1240}
1241
1242/// Status of this payment attempt.
1243#[derive(Clone, Debug, Serialize, Deserialize)]
1244#[non_exhaustive]
1245#[serde(rename_all = "snake_case")]
1246pub enum PaymentAttemptStatus {
1247    /// Authorized but not captured. Payment attempt is incomplete.
1248    Authorized,
1249    /// Authorized but not captured because it has been flagged as potentially fraudulent. Payment attempt is incomplete.
1250    AuthorizedFlagged,
1251    /// Previously authorized payment attempt has been canceled. Typically when `authorized_flagged` payment attempts are rejected.
1252    Canceled,
1253    /// Payment captured successfully. Payment attempt is complete.
1254    Captured,
1255    /// Something went wrong and the payment attempt was unsuccessful. Check the `error_code` for more information.
1256    Error,
1257    /// Customer must complete an action for this payment attempt to proceed. Typically means that the payment attempt requires 3DS.
1258    ActionRequired,
1259    /// Response required from the bank or payment provider. Transaction is pending.
1260    PendingNoActionRequired,
1261    /// New payment attempt created.
1262    Created,
1263    /// Payment attempt status not known.
1264    Unknown,
1265    /// Payment attempt dropped by Paddle.
1266    Dropped,
1267}
1268
1269/// Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change.
1270#[derive(Clone, Debug, Serialize, Deserialize)]
1271#[non_exhaustive]
1272#[serde(rename_all = "snake_case")]
1273pub enum SubscriptionStatus {
1274    /// Subscription is active. Paddle is billing for this subscription and related transactions aren't past due.
1275    Active,
1276    /// Subscription is canceled. Automatically set by Paddle when a subscription is canceled. When a subscription is set to cancel on the next billing period, a scheduled change for the cancellation is created. The subscription status moves to canceled when the scheduled change takes effect.
1277    Canceled,
1278    /// Subscription has an overdue payment. Automatically set by Paddle when payment fails for an automatically-collected transaction, or when payment terms have elapsed for a manually-collected transaction (an invoice).
1279    PastDue,
1280    /// Subscription is paused. Automatically set by Paddle when a subscription is paused. When a subscription is set to pause on the next billing period, a scheduled change for the pause is created. The subscription status moves to `paused` when the scheduled change takes effect.
1281    Paused,
1282    /// Subscription is in trial.
1283    Trialing,
1284}
1285
1286/// Status of this transaction. You may set a transaction to `billed` or `canceled`, other statuses are set automatically by Paddle. Automatically-collected transactions may return `completed` if payment is captured successfully, or `past_due` if payment failed.
1287#[derive(Clone, Debug, Serialize, Deserialize)]
1288#[non_exhaustive]
1289#[serde(rename_all = "snake_case")]
1290pub enum TransactionStatus {
1291    /// Transaction is missing required fields. Typically the first stage of a checkout before customer details are captured.
1292    Draft,
1293    /// Transaction has all of the required fields to be marked as `billed` or `completed`.
1294    Ready,
1295    /// Transaction has been updated to `billed`. Billed transactions get an invoice number and are considered a legal record. They cannot be changed. Typically used as part of an invoice workflow.
1296    Billed,
1297    /// Transaction is fully paid, but has not yet been processed internally.
1298    Paid,
1299    /// Transaction is fully paid and processed.
1300    Completed,
1301    /// Transaction has been updated to `canceled`. If an invoice, it's no longer due.
1302    Canceled,
1303    /// Transaction is past due. Occurs for automatically-collected transactions when the related subscription is in dunning, and for manually-collected transactions when payment terms have elapsed.
1304    PastDue,
1305}
1306
1307/// Kind of change that's scheduled to be applied to this subscription.
1308#[derive(Clone, Debug, Serialize, Deserialize)]
1309#[non_exhaustive]
1310#[serde(rename_all = "lowercase")]
1311pub enum ScheduledChangeAction {
1312    /// Subscription is scheduled to cancel. Its status changes to `canceled` on the `effective_at` date.
1313    Cancel,
1314    /// Subscription is scheduled to pause. Its status changes to `pause` on the `effective_at` date.
1315    Pause,
1316    /// Subscription is scheduled to resume. Its status changes to `active` on the `resume_at` date.
1317    Resume,
1318}
1319
1320/// How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
1321#[derive(Clone, Debug, Serialize, Deserialize)]
1322#[non_exhaustive]
1323pub enum SubscriptionOnPaymentFailure {
1324    /// In case of payment failure, prevent the change to the subscription from applying.
1325    PreventChange,
1326    /// In case of payment failure, apply the change and update the subscription.
1327    ApplyChange,
1328}
1329
1330/// Whether the subscription change results in a prorated credit or a charge.
1331#[derive(Clone, Debug, Serialize, Deserialize)]
1332#[non_exhaustive]
1333pub enum UpdateSummaryResultAction {
1334    /// Changes to the subscription results in a prorated credit.
1335    Credit,
1336    /// Changes to the subscription results in a prorated charge.
1337    Charge,
1338}
1339
1340/// How Paddle should handle proration calculation for changes made to a subscription or its items. Required when making
1341/// changes that impact billing.
1342///
1343/// For automatically-collected subscriptions, responses may take longer than usual if a proration billing mode that
1344/// collects for payment immediately is used.
1345#[derive(Clone, Debug, Serialize, Deserialize)]
1346#[non_exhaustive]
1347pub enum ProrationBillingMode {
1348    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
1349    /// creates a transaction to collect immediately.
1350    ProratedImmediately,
1351    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
1352    /// schedules them to be billed on the next renewal.
1353    ProratedNextBillingPeriod,
1354    /// Paddle does not calculate proration for the subscription changes, creating a transaction to collect for the full
1355    /// amount immediately.
1356    FullImmediately,
1357    /// Paddle does not calculate proration for the subscription changes, scheduling for the full amount for the changes
1358    /// to be billed on the next renewal.
1359    FullNextBillingPeriod,
1360    /// Paddle does not bill for the subscription changes.
1361    DoNotBill,
1362}
1363
1364/// How Paddle should set the billing period for the subscription when resuming. If omitted, defaults to `start_new_billing_period`.
1365#[derive(Clone, Debug, Serialize, Deserialize)]
1366#[non_exhaustive]
1367pub enum SubscriptionOnResume {
1368    /// When resuming, continue the existing billing period. If the customer resumes before the end date of the existing billing period, there's no immediate charge. If after, an error is returned.
1369    ContinueExistingBillingPeriod,
1370    /// When resuming, start a new billing period. The `current_billing_period.starts_at` date is set to the resume date, and Paddle immediately charges the full amount for the new billing period.
1371    StartNewBillingPeriod,
1372}
1373
1374/// Determine whether the generated URL should download the PDF as an attachment saved locally, or open it inline in the browser.
1375#[derive(Clone, Debug, Serialize, Deserialize)]
1376#[non_exhaustive]
1377#[serde(rename_all = "lowercase")]
1378pub enum Disposition {
1379    /// Generated URL downloads the PDF as an attachment. Browsers typically automatically save the PDF.
1380    Attachment,
1381    /// Generated URL displays the PDF inline in the browser. Browsers typically open the PDF in the current tab.
1382    Inline,
1383}