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]
672pub enum CardType {
673    /// American Express
674    AmericanExpress,
675    /// Diners Club
676    DinersClub,
677    /// Discover Card
678    Discover,
679    /// JCB Card, popular in Japan
680    Jcb,
681    /// Mada Card, popular in Saudi Arabia
682    Mada,
683    /// Maestro (debit card)
684    Maestro,
685    /// Mastercard
686    Mastercard,
687    /// UnionPay, popular in China
688    UnionPay,
689    /// Card type unknown
690    Unknown,
691    /// Visa
692    Visa,
693}
694
695/// Type of item. Standard items are considered part of your catalog and are shown on the Paddle dashboard.
696#[derive(Clone, Debug, Serialize, Deserialize)]
697#[non_exhaustive]
698#[serde(rename_all = "kebab-case")]
699pub enum CatalogType {
700    /// Non-catalog item. Typically created for a specific transaction or subscription. Not returned when listing or shown in the Paddle dashboard.
701    Custom,
702    /// Standard item. Can be considered part of your catalog and reused across transactions and subscriptions easily.
703    Standard,
704}
705
706/// How payment is collected. `automatic` for checkout, `manual` for invoices.
707#[derive(Clone, Debug, Serialize, Deserialize)]
708#[non_exhaustive]
709#[serde(rename_all = "snake_case")]
710pub enum CollectionMode {
711    /// Payment is collected automatically using a checkout initially, then using a payment method on file.
712    Automatic,
713    /// 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`.
714    Manual,
715}
716
717/// Type of payment method saved.
718#[derive(Clone, Debug, Serialize, Deserialize)]
719#[non_exhaustive]
720pub enum SavedPaymentMethodType {
721    /// Alipay, popular in China.
722    Alipay,
723    /// Apple Pay on a supported Apple device.
724    ApplePay,
725    /// Credit or debit card.
726    Card,
727    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
728    GooglePay,
729    /// PayPal.
730    Paypal,
731}
732
733/// Describes how this payment method was saved.
734#[derive(Clone, Debug, Serialize, Deserialize)]
735#[non_exhaustive]
736pub enum PaymentMethodOrigin {
737    /// The customer chose to save this payment method while purchasing a one-time item.
738    SavedDuringPurchase,
739    /// The customer purchased a subscription, so this payment method was saved for future purchases.
740    Subscription,
741}
742
743/// Whether this entity can be used in Paddle.
744#[derive(Clone, Debug, Serialize, Deserialize)]
745#[non_exhaustive]
746#[serde(rename_all = "kebab-case")]
747pub enum DiscountStatus {
748    /// Entity is active and can be used.
749    Active,
750    /// Entity is archived, so can't be used.
751    Archived,
752}
753
754/// Type of discount. Determines how this discount impacts the checkout or transaction total.
755#[derive(Clone, Debug, Serialize, Deserialize)]
756#[non_exhaustive]
757#[serde(rename_all = "snake_case")]
758pub enum DiscountType {
759    /// Discounts a checkout or transaction by a flat amount, for example -$100. Requires `currency_code`.
760    Flat,
761    /// Discounts a checkout or transaction by a flat amount per unit, for example -$100 per user. Requires `currency_code`.
762    FlatPerSeat,
763    /// Discounts a checkout or transaction by a percentage of the total, for example -10%. Maximum 100%.
764    Percentage,
765}
766
767/// When this subscription change should take effect from. Defaults to `next_billing_period`, which creates a
768/// `scheduled_change` to apply the subscription change at the end of the billing period.
769#[derive(Clone, Debug, Serialize, Deserialize)]
770#[non_exhaustive]
771pub enum EffectiveFrom {
772    /// Takes effect on the next billing period.
773    NextBillingPeriod,
774    /// Takes effect immediately.
775    Immediately,
776}
777
778/// Type of error encountered.
779#[derive(Clone, Debug, Serialize, Deserialize)]
780#[non_exhaustive]
781pub enum Type {
782    /// Typically means there's a problem with the request that you made.
783    RequestError,
784    /// Typically means there's a problem with the Paddle API.
785    ApiError,
786}
787
788/// Reason why a payment attempt failed. Returns `null` if payment captured successfully.
789#[derive(Clone, Debug, Serialize, Deserialize)]
790#[non_exhaustive]
791pub enum ErrorCode {
792    /// Cancellation not possible because the amount has already been canceled. Not typically returned for payments.
793    AlreadyCanceled,
794    /// Refund is not possible because the amount has already been refunded. Not typically returned for payments.
795    AlreadyRefunded,
796    /// Payment required a 3DS2 authentication challenge. The customer completed the challenge but was not successful.
797    AuthenticationFailed,
798    /// Payment method issuer has indicated that the card cannot be used as it is frozen, lost, damaged, or stolen.
799    BlockedCard,
800    /// Customer has requested that the mandate for recurring payments be canceled.
801    Canceled,
802    /// Payment method has been declined, with no other information returned.
803    Declined,
804    /// 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.
805    DeclinedNotRetryable,
806    /// 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.
807    ExpiredCard,
808    /// Payment method issuer or payment service provider flagged this payment as potentially fraudulent.
809    Fraud,
810    /// Payment method issuer or payment service provider cannot process a payment that is this high or low.
811    InvalidAmount,
812    /// 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.
813    InvalidPaymentDetails,
814    /// Payment service provider couldn't reach the payment method issuer.
815    IssuerUnavailable,
816    /// Payment method declined because of insufficient funds, or fund limits being reached.
817    NotEnoughBalance,
818    /// Payment method has been declined because the network scheme that the customer selected isn't supported by the payment service provider.
819    PreferredNetworkNotSupported,
820    /// Something went wrong with the payment service provider, with no other information returned.
821    PspError,
822    /// Payment service provider didn't receive payment method information as they've been redacted.
823    RedactedPaymentMethod,
824    /// Something went wrong with the Paddle platform. Try again later, or check status.paddle.com.
825    SystemError,
826    /// Payment method issuer doesn't allow this kind of payment because of limits on the account, or legal or compliance reasons.
827    TransactionNotPermitted,
828    /// Payment attempt unsuccessful, with no other information returned.
829    Unknown,
830}
831
832/// Type of event sent by Paddle, in the format `entity.event_type`.
833#[derive(Clone, Debug, Serialize, Deserialize)]
834#[non_exhaustive]
835pub enum EventTypeName {
836    /// An [`address.created`](https://developer.paddle.com/webhooks/addresses/address-created) event.
837    AddressCreated,
838    /// An [`address.imported`](https://developer.paddle.com/webhooks/addresses/address-imported) event.
839    AddressImported,
840    /// An [`address.updated`](https://developer.paddle.com/webhooks/addresses/address-updated) event.
841    AddressUpdated,
842    /// An [`adjustment.created`](https://developer.paddle.com/webhooks/adjustments/adjustment-created) event.
843    AdjustmentCreated,
844    /// An [`adjustment.updated`](https://developer.paddle.com/webhooks/adjustments/adjustment-updated) event.
845    AdjustmentUpdated,
846    /// A [`business.created`](https://developer.paddle.com/webhooks/businesses/business-created) event.
847    BusinessCreated,
848    /// A [`business.imported`](https://developer.paddle.com/webhooks/businesses/business-imported) event.
849    BusinessImported,
850    /// A [`business.updated`](https://developer.paddle.com/webhooks/businesses/business-updated) event.
851    BusinessUpdated,
852    /// A [`customer.created`](https://developer.paddle.com/webhooks/customers/customer-created) event.
853    CustomerCreated,
854    /// A [`customer.imported`](https://developer.paddle.com/webhooks/customers/customer-imported) event.
855    CustomerImported,
856    /// A [`customer.updated`](https://developer.paddle.com/webhooks/customers/customer-updated) event.
857    CustomerUpdated,
858    /// A [`discount.created`](https://developer.paddle.com/webhooks/discounts/discount-created) event.
859    DiscountCreated,
860    /// A [`discount.imported`](https://developer.paddle.com/webhooks/discounts/discount-imported) event.
861    DiscountImported,
862    /// A [`discount.updated`](https://developer.paddle.com/webhooks/discounts/discount-updated) event.
863    DiscountUpdated,
864    /// A [`payout.created`](https://developer.paddle.com/webhooks/payouts/payout-created) event.
865    PayoutCreated,
866    /// A [`payout.paid`](https://developer.paddle.com/webhooks/payouts/payout-paid) event.
867    PayoutPaid,
868    /// A [`price.created`](https://developer.paddle.com/webhooks/prices/price-created) event.
869    PriceCreated,
870    /// A [`price.imported`](https://developer.paddle.com/webhooks/prices/price-imported) event.
871    PriceImported,
872    /// A [`price.updated`](https://developer.paddle.com/webhooks/prices/price-updated) event.
873    PriceUpdated,
874    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-created) event.
875    ProductCreated,
876    /// A [`product.imported`](https://developer.paddle.com/webhooks/products/product-imported) event.
877    ProductImported,
878    /// A [`product.created`](https://developer.paddle.com/webhooks/products/product-updated) event.
879    ProductUpdated,
880    /// A [`report.created`](https://developer.paddle.com/webhooks/reports/report-created) event.
881    ReportCreated,
882    /// A [`report.updated`](https://developer.paddle.com/webhooks/reports/report-updated) event.
883    ReportUpdated,
884    /// A [`subscription.activated`](https://developer.paddle.com/webhooks/subscriptions/subscription-activated) event.
885    SubscriptionActivated,
886    /// A [`subscription.canceled`](https://developer.paddle.com/webhooks/subscriptions/subscription-canceled) event.
887    SubscriptionCanceled,
888    /// A [`subscription.created`](https://developer.paddle.com/webhooks/subscriptions/subscription-created) event.
889    SubscriptionCreated,
890    /// A [`subscription.imported`](https://developer.paddle.com/webhooks/subscriptions/subscription-imported) event.
891    SubscriptionImported,
892    /// A [`subscription.past_due`](https://developer.paddle.com/webhooks/subscriptions/subscription-past-due) event.
893    SubscriptionPastDue,
894    /// A [`subscription.paused`](https://developer.paddle.com/webhooks/subscriptions/subscription-paused) event.
895    SubscriptionPaused,
896    /// A [`subscription.resumed`](https://developer.paddle.com/webhooks/subscriptions/subscription-resumed) event.
897    SubscriptionResumed,
898    /// A [`subscription.trialing`](https://developer.paddle.com/webhooks/subscriptions/subscription-trialing) event.
899    SubscriptionTrialing,
900    /// A [`subscription.updated`](https://developer.paddle.com/webhooks/subscriptions/subscription-updated) event.
901    SubscriptionUpdated,
902    /// A [`transaction.billed`](https://developer.paddle.com/webhooks/transactions/transaction-billed) event.
903    TransactionBilled,
904    /// A [`transaction.canceled`](https://developer.paddle.com/webhooks/transactions/transaction-canceled) event.
905    TransactionCanceled,
906    /// A [`transaction.completed`](https://developer.paddle.com/webhooks/transactions/transaction-completed) event.
907    TransactionCompleted,
908    /// A [`transaction.created`](https://developer.paddle.com/webhooks/transactions/transaction-created) event.
909    TransactionCreated,
910    /// A [`transaction.paid`](https://developer.paddle.com/webhooks/transactions/transaction-paid) event.
911    TransactionPaid,
912    /// A [`transaction.past_due`](https://developer.paddle.com/webhooks/transactions/transaction-past-due) event.
913    TransactionPastDue,
914    /// A [`transaction.payment_failed`](https://developer.paddle.com/webhooks/transactions/transaction-payment-failed) event.
915    TransactionPaymentFailed,
916    /// A [`transaction.ready`](https://developer.paddle.com/webhooks/transactions/transaction-ready) event.
917    TransactionReady,
918    /// A [`transaction.updated`](https://developer.paddle.com/webhooks/transactions/transaction-updated) event.
919    TransactionUpdated,
920}
921
922/// Status of this subscription item. Set automatically by Paddle.
923#[derive(Clone, Debug, Serialize, Deserialize)]
924#[non_exhaustive]
925pub enum SubscriptionItemStatus {
926    /// This item is active. It is not in trial and Paddle bills for it.
927    Active,
928    /// This item is not active. Set when the related subscription is paused.
929    Inactive,
930    /// This item is in trial. Paddle has not billed for it.
931    Trialing,
932}
933
934/// How tax is calculated for this price.
935#[derive(Clone, Debug, Serialize, Deserialize)]
936#[non_exhaustive]
937#[serde(rename_all = "snake_case")]
938pub enum TaxMode {
939    /// Prices use the setting from your account.
940    AccountSetting,
941    /// Prices are exclusive of tax.
942    External,
943    /// Prices are inclusive of tax.
944    Internal,
945}
946
947/// Tax category for this product. Used for charging the correct rate of tax. Selected tax category must be enabled on your Paddle account.
948#[derive(Clone, Debug, Serialize, Deserialize)]
949#[non_exhaustive]
950#[serde(rename_all = "kebab-case")]
951pub enum TaxCategory {
952    /// Non-customizable digital files or media (not software) acquired with an up front payment that can be accessed without any physical product being delivered.
953    DigitalGoods,
954    /// Digital books and educational material which is sold with permanent rights for use by the customer.
955    Ebooks,
956    /// Remote configuration, set-up, and integrating software on behalf of a customer.
957    ImplementationServices,
958    /// Services that involve the application of your expertise and specialized knowledge of a software product.
959    ProfessionalServices,
960    /// Products that allow users to connect to and use online or cloud-based applications over the Internet.
961    Saas,
962    /// Services that can be used to customize and white label software products.
963    SoftwareProgrammingServices,
964    /// Software products that are pre-written and can be downloaded and installed onto a local device.
965    Standard,
966    /// Training and education services related to software products.
967    TrainingServices,
968    /// Cloud storage service for personal or corporate information, assets, or intellectual property.
969    WebsiteHosting,
970}
971
972impl AsRef<str> for TaxCategory {
973    fn as_ref(&self) -> &str {
974        match self {
975            Self::DigitalGoods => "digital-goods",
976            Self::Ebooks => "ebooks",
977            Self::ImplementationServices => "implementation-services",
978            Self::ProfessionalServices => "professional-services",
979            Self::Saas => "saas",
980            Self::SoftwareProgrammingServices => "software-programming-services",
981            Self::Standard => "standard",
982            Self::TrainingServices => "training-services",
983            Self::WebsiteHosting => "website-hosting",
984        }
985    }
986}
987
988/// Type of payment method used for this payment attempt.
989#[derive(Clone, Debug, Serialize, Deserialize)]
990#[non_exhaustive]
991pub enum PaymentMethodType {
992    /// Alipay, popular in China.
993    Alipay,
994    /// Apple Pay on a supported Apple device.
995    ApplePay,
996    /// Bancontact, popular in Belgium.
997    Bancontact,
998    /// Credit or debit card.
999    Card,
1000    /// Google Pay on a supported Android device, Chromebook, or Google Chrome browser.
1001    GooglePay,
1002    /// iDEAL, popular in the Netherlands.
1003    Ideal,
1004    /// Payment recorded offline.
1005    Offline,
1006    /// PayPal.
1007    Paypal,
1008    /// Payment method not known.
1009    Unknown,
1010    /// Wire transfer, sometimes called bank transfer.
1011    WireTransfer,
1012}
1013
1014/// Status of this notification.
1015#[derive(Clone, Debug, Serialize, Deserialize)]
1016#[non_exhaustive]
1017pub enum NotificationStatus {
1018    /// Paddle hasn't yet tried to deliver this notification.
1019    NotAttempted,
1020    /// Paddle tried to deliver this notification, but it failed. It's scheduled to be retried.
1021    NeedsRetry,
1022    /// Paddle delivered this notification successfully.
1023    Delivered,
1024    /// Paddle tried to deliver this notification, but all attempts failed. It's not scheduled to be retried.
1025    Failed,
1026}
1027
1028/// Describes how this notification was created.
1029#[derive(Clone, Debug, Serialize, Deserialize)]
1030#[non_exhaustive]
1031pub enum NotificationOrigin {
1032    /// Notification created when a subscribed event occurred.
1033    Event,
1034    /// Notification created when a notification with the origin `event` was replayed.
1035    Replay,
1036}
1037
1038/// Where notifications should be sent for this destination.
1039#[derive(Clone, Debug, Serialize, Deserialize)]
1040#[non_exhaustive]
1041pub enum NotificationSettingType {
1042    /// Deliver to an email address.
1043    Email,
1044    /// Deliver to a webhook endpoint.
1045    Url,
1046}
1047
1048/// Whether Paddle should deliver real platform events, simulation events or both to this notification destination.
1049#[derive(Clone, Debug, Serialize, Deserialize)]
1050#[non_exhaustive]
1051pub enum TrafficSource {
1052    /// Deliver real platform events to this notification destination.
1053    Platform,
1054    /// Deliver simulation events to this notification destination.
1055    Simulation,
1056    /// Deliver platform and simulation events to this notification destination.
1057    All,
1058}
1059
1060/// Operator to use when filtering.
1061#[derive(Clone, Debug, Serialize, Deserialize)]
1062#[non_exhaustive]
1063pub enum FilterOperator {
1064    /// Less than.
1065    Lt,
1066    /// Greater than or equal to.
1067    Gte,
1068}
1069
1070#[derive(Clone, Debug, Serialize, Deserialize)]
1071#[non_exhaustive]
1072pub enum TransactionOrigin {
1073    /// Transaction created via the Paddle API.
1074    Api,
1075    /// Transaction created automatically by Paddle as a result of a one-time charge for a subscription.
1076    SubscriptionCharge,
1077    /// Transaction created automatically as part of updating a payment method. May be a zero value transaction.
1078    SubscriptionPaymentMethodChange,
1079    /// Transaction created automatically by Paddle as a result of a subscription renewal.
1080    SubscriptionRecurring,
1081    /// Transaction created automatically by Paddle as a result of an update to a subscription.
1082    SubscriptionUpdate,
1083    /// Transaction created automatically by Paddle.js for a checkout.
1084    Web,
1085}
1086
1087/// Status of this report. Set automatically by Paddle.
1088///
1089/// Reports are created as `pending` initially, then move to `ready` when they're available to download.
1090#[derive(Clone, Debug, Serialize, Deserialize)]
1091#[non_exhaustive]
1092pub enum ReportStatus {
1093    /// Report created, but Paddle is processing it. It's not yet ready for download.
1094    Pending,
1095    /// Report fully processed by Paddle and ready for download.
1096    Ready,
1097    /// There was a problem processing this report.
1098    Failed,
1099    /// Report has expired and is no longer accessible.
1100    Expired,
1101}
1102
1103/// Field name to filter by.
1104#[derive(Clone, Debug, Serialize, Deserialize)]
1105#[non_exhaustive]
1106pub enum AdjustmentsReportFilterName {
1107    /// Filter by adjustment action. Pass an array of strings containing any valid value for the `action` field against an adjustment.
1108    Action,
1109    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
1110    CurrencyCode,
1111    /// 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.
1112    Status,
1113    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
1114    UpdatedAt,
1115}
1116
1117/// Field name to filter by.
1118#[derive(Clone, Debug, Serialize, Deserialize)]
1119#[non_exhaustive]
1120pub enum DiscountsReportFilterName {
1121    /// Filter by discount type. Pass an array of strings containing any valid value for the `type` field against a discount.
1122    Type,
1123    /// Filter by discount status. Pass an array of strings containing any valid value for the `status` field against a discount.
1124    Status,
1125    /// Filter by discount updated date. Pass an RFC 3339 datetime string.
1126    UpdatedAt,
1127}
1128
1129/// Field name to filter by.
1130#[derive(Clone, Debug, Serialize, Deserialize)]
1131#[non_exhaustive]
1132pub enum ProductPricesReportFilterName {
1133    /// Filter by product status. Pass an array of strings containing any valid value for the `status` field against a product.
1134    ProductStatus,
1135    /// Filter by price status. Pass an array of strings containing any valid value for the `status` field against a price.
1136    PriceStatus,
1137    /// Filter by product type. Pass an array of strings containing any valid value for the `type` field against a product.
1138    ProductType,
1139    /// Filter by price type. Pass an array of strings containing any valid value for the `type` field against a price.
1140    PriceType,
1141    /// Filter by product `updated_at` date. Pass an RFC 3339 datetime string.
1142    ProductUpdatedAt,
1143    /// Filter by price `updated_at` date. Pass an RFC 3339 datetime string.
1144    PriceUpdatedAt,
1145}
1146
1147/// Field name to filter by.
1148#[derive(Clone, Debug, Serialize, Deserialize)]
1149#[non_exhaustive]
1150pub enum TransactionsReportFilterName {
1151    /// Filter by collection mode. Pass an array of strings containing any valid value for the `collection_mode` field against a transaction.
1152    CollectionMode,
1153    /// Filter by transaction or adjustment currency. Pass an array of strings containing any valid supported three-letter ISO 4217 currency code.
1154    CurrencyCode,
1155    /// Filter by transaction origin. Pass an array of strings containing any valid value for the origin field against a transaction.
1156    Origin,
1157    /// 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.
1158    Status,
1159    /// Filter by transaction or adjustment updated date. Pass an RFC 3339 datetime string.
1160    UpdatedAt,
1161}
1162
1163/// Type of report.
1164#[derive(Clone, Debug, Serialize, Deserialize)]
1165#[non_exhaustive]
1166pub enum AdjustmentsReportType {
1167    /// Adjustments reports contain information about refunds, credits, and chargebacks.
1168    Adjustments,
1169    /// Adjustments reports contain information about refunds, credits, and chargebacks. The report is broken down by line item level.
1170    AdjustmentLineItems,
1171}
1172
1173/// Type of report.
1174#[derive(Clone, Debug, Serialize, Deserialize)]
1175#[non_exhaustive]
1176pub enum TransactionsReportType {
1177    /// Transactions reports contain information about revenue received, past due invoices, draft and issued invoices, and canceled transactions.
1178    Transactions,
1179    /// 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.
1180    TransactionLineItems,
1181}
1182
1183/// Status of this simulation run log.
1184#[derive(Clone, Debug, Serialize, Deserialize)]
1185#[non_exhaustive]
1186pub enum SimulationEventStatus {
1187    /// Simulation run log is pending. Paddle hasn't yet tried to deliver the simulated event.
1188    Pending,
1189    /// Simulation run log was successful. Paddle delivered the simulated event successfully.
1190    Success,
1191    /// 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.
1192    Failed,
1193    /// Simulation run log aborted. Paddle could not attempt delivery of the simulated event.
1194    Aborted,
1195}
1196
1197/// Status of this simulation run.
1198#[derive(Clone, Debug, Serialize, Deserialize)]
1199#[non_exhaustive]
1200pub enum SimulationRunStatus {
1201    /// Simulation run is pending. Paddle is sending events that are part of this simulation.
1202    Pending,
1203    /// Simulation run is completed. Paddle attempted to send events that are part of this simulation.
1204    Completed,
1205    /// Simulation run is canceled. Simulation run was canceled before all events were sent.
1206    Canceled,
1207}
1208
1209/// Scenario for a simulation.
1210#[derive(Clone, Debug, Serialize, Deserialize)]
1211#[non_exhaustive]
1212pub enum SimulationScenarioType {
1213    /// Simulates all events sent when a subscription is created.
1214    SubscriptionCreation,
1215    /// Simulates all events sent when a subscription is renewed.
1216    SubscriptionRenewal,
1217    /// Simulates all events sent when a subscription is paused.
1218    SubscriptionPause,
1219    /// Simulates all events sent when a subscription is resumed.
1220    SubscriptionResume,
1221    /// Simulates all events sent when a subscription is canceled.
1222    SubscriptionCancellation,
1223}
1224
1225/// Type of simulation.
1226#[derive(Clone, Debug, Serialize, Deserialize)]
1227#[non_exhaustive]
1228pub enum SimulationKind {
1229    /// Paddle simulates a single event.
1230    SingleEvent,
1231    /// Paddle simulates a predefined series of events for a scenario, like all events created when a subscription renews.
1232    Scenario,
1233}
1234
1235/// Status of this payment attempt.
1236#[derive(Clone, Debug, Serialize, Deserialize)]
1237#[non_exhaustive]
1238pub enum PaymentAttemptStatus {
1239    /// Authorized but not captured. Payment attempt is incomplete.
1240    Authorized,
1241    /// Authorized but not captured because it has been flagged as potentially fraudulent. Payment attempt is incomplete.
1242    AuthorizedFlagged,
1243    /// Previously authorized payment attempt has been canceled. Typically when `authorized_flagged` payment attempts are rejected.
1244    Canceled,
1245    /// Payment captured successfully. Payment attempt is complete.
1246    Captured,
1247    /// Something went wrong and the payment attempt was unsuccessful. Check the `error_code` for more information.
1248    Error,
1249    /// Customer must complete an action for this payment attempt to proceed. Typically means that the payment attempt requires 3DS.
1250    ActionRequired,
1251    /// Response required from the bank or payment provider. Transaction is pending.
1252    PendingNoActionRequired,
1253    /// New payment attempt created.
1254    Created,
1255    /// Payment attempt status not known.
1256    Unknown,
1257    /// Payment attempt dropped by Paddle.
1258    Dropped,
1259}
1260
1261/// Status of this subscription. Set automatically by Paddle. Use the pause subscription or cancel subscription operations to change.
1262#[derive(Clone, Debug, Serialize, Deserialize)]
1263#[non_exhaustive]
1264pub enum SubscriptionStatus {
1265    /// Subscription is active. Paddle is billing for this subscription and related transactions aren't past due.
1266    Active,
1267    /// 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.
1268    Canceled,
1269    /// 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).
1270    PastDue,
1271    /// 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.
1272    Paused,
1273    /// Subscription is in trial.
1274    Trialing,
1275}
1276
1277/// 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.
1278#[derive(Clone, Debug, Serialize, Deserialize)]
1279#[non_exhaustive]
1280pub enum TransactionStatus {
1281    /// Transaction is missing required fields. Typically the first stage of a checkout before customer details are captured.
1282    Draft,
1283    /// Transaction has all of the required fields to be marked as `billed` or `completed`.
1284    Ready,
1285    /// 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.
1286    Billed,
1287    /// Transaction is fully paid, but has not yet been processed internally.
1288    Paid,
1289    /// Transaction is fully paid and processed.
1290    Completed,
1291    /// Transaction has been updated to `canceled`. If an invoice, it's no longer due.
1292    Canceled,
1293    /// 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.
1294    PastDue,
1295}
1296
1297/// Kind of change that's scheduled to be applied to this subscription.
1298#[derive(Clone, Debug, Serialize, Deserialize)]
1299#[non_exhaustive]
1300pub enum ScheduledChangeAction {
1301    /// Subscription is scheduled to cancel. Its status changes to `canceled` on the `effective_at` date.
1302    Cancel,
1303    /// Subscription is scheduled to pause. Its status changes to `pause` on the `effective_at` date.
1304    Pause,
1305    /// Subscription is scheduled to resume. Its status changes to `active` on the `resume_at` date.
1306    Resume,
1307}
1308
1309/// How Paddle should handle changes made to a subscription or its items if the payment fails during update. If omitted, defaults to `prevent_change`.
1310#[derive(Clone, Debug, Serialize, Deserialize)]
1311#[non_exhaustive]
1312pub enum SubscriptionOnPaymentFailure {
1313    /// In case of payment failure, prevent the change to the subscription from applying.
1314    PreventChange,
1315    /// In case of payment failure, apply the change and update the subscription.
1316    ApplyChange,
1317}
1318
1319/// Whether the subscription change results in a prorated credit or a charge.
1320#[derive(Clone, Debug, Serialize, Deserialize)]
1321#[non_exhaustive]
1322pub enum UpdateSummaryResultAction {
1323    /// Changes to the subscription results in a prorated credit.
1324    Credit,
1325    /// Changes to the subscription results in a prorated charge.
1326    Charge,
1327}
1328
1329/// How Paddle should handle proration calculation for changes made to a subscription or its items. Required when making
1330/// changes that impact billing.
1331///
1332/// For automatically-collected subscriptions, responses may take longer than usual if a proration billing mode that
1333/// collects for payment immediately is used.
1334#[derive(Clone, Debug, Serialize, Deserialize)]
1335#[non_exhaustive]
1336pub enum ProrationBillingMode {
1337    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
1338    /// creates a transaction to collect immediately.
1339    ProratedImmediately,
1340    /// Paddle calculates the prorated amount for the subscription changes based on the current billing cycle, then
1341    /// schedules them to be billed on the next renewal.
1342    ProratedNextBillingPeriod,
1343    /// Paddle does not calculate proration for the subscription changes, creating a transaction to collect for the full
1344    /// amount immediately.
1345    FullImmediately,
1346    /// Paddle does not calculate proration for the subscription changes, scheduling for the full amount for the changes
1347    /// to be billed on the next renewal.
1348    FullNextBillingPeriod,
1349    /// Paddle does not bill for the subscription changes.
1350    DoNotBill,
1351}
1352
1353/// How Paddle should set the billing period for the subscription when resuming. If omitted, defaults to `start_new_billing_period`.
1354#[derive(Clone, Debug, Serialize, Deserialize)]
1355#[non_exhaustive]
1356pub enum SubscriptionOnResume {
1357    /// 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.
1358    ContinueExistingBillingPeriod,
1359    /// 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.
1360    StartNewBillingPeriod,
1361}