This release overhauls the code generation process to achieve near-complete coverage of the Stripe API (#32). To avoid further bloating compile times, it also includes crates splitting. Consequently, there are many breaking changes in this release. If you have any trouble updating to this release or want help with it, please file an issue! There will likely be multiple release candidates, so suggestions are welcome for ways to improve ergonomics along the release candidate trail. This release should not regress compile times, but will not improve them. However, it paves the way for upcoming improvements!
We are still expecting a few breaking changes before RC. We recommend using the in-progress Migration Guide when upgrading.
0.41.0 (2025-04-08)
- include refund events in EventType enum (1a164c8)
0.40.2 (2025-03-21)
- Remove quotes from EventType display (4b0deeb)
0.40.1 (2025-03-18)
- Make customer session module public (f149d15)
0.40.0 (2024-09-26)
0.39.2 (2024-09-24)
- erroneous deref clippy lint (1fcbb29)
0.39.1 (2024-09-03)
- correct docs host and path for API references (539836d)
0.39.0 (2024-08-31)
post->post_form(bc39260)- Move
promotion_code_exttoproductsfeature (32435f3) - Re-export (24f1782)
- Create promotion code (0fde9eb)
0.38.1 (2024-08-06)
0.38.0 (2024-07-31)
0.37.3 (2024-07-29)
- linting issue for Rust 1.80 (9232213)
0.37.2 (2024-07-23)
- rtx id prefix (67ea232)
0.37.1 (2024-05-24)
0.37.0 (2024-04-30)
- customer-ext,PM query: type field is optional (362659e)
- setup_intent: add mandate_data for confirm (51e34d6)
- setup_intent: verify microdeposits flow (15b3663)
0.36.0 (2024-04-30)
- Add
retrieve_line_itemsfunction forCheckoutSession(5c74b3b)
0.35.3 (2024-04-26)
- Clippy append instead of extend (1a85b9b)
- Clippy explicit ToString implementation (15250a9)
- Clippy panic warnings (552aff2)
- Clippys from generated code (89cce5b)
- More clippy warnings (6de23bb)
- Remove useless reference that causes clippy warnings (2fca98b)
0.35.2 (2024-04-26)
- Clippy warnings (842bce6)
- Implement workaround for ace in the verify-codegen action (79c1f6f)
- Semantic release needs minimal rust version (642ea31)
0.35.1 (2024-04-26)
0.35.0 (2024-04-04)
- add products to features list in cargo.toml and export from resourses (d26860f)
- export SearchList (a427943)
- Remove "Some()" from RequestError's display (e609cad)
- rename redirect_url to return_url on ConfirmSetupIntent (9da5a28), closes #504
- webhook_events: support construct_event with timestamp (88fe501)
0.34.2 (2024-02-21)
- correctly generate types for optional lists (63732cc)
0.34.1 (2024-02-15)
- fixes an issue with missing renames of Self_ (9c58038)
0.34.0 (2024-02-15)
- generate latest changes from OpenApi spec (a3b0e4d)
0.33.1 (2024-02-08)
- expose the
auto_advancefield from theFinalizeInvoiceParamsstruct (ae1a807)
0.33.0 (2024-02-02)
- support pdp_ as an id prefix for dispute objects (be506d6)
- generate latest changes from OpenApi spec (29a457d)
0.32.0 (2024-01-27)
- generate latest changes from OpenApi spec (19ac377)
0.31.2 (2024-01-24)
- currency: add BYN and MMK to currency list (03cddce)
0.31.1 (2024-01-24)
- pagination: prevent infinite loop caused by clone (bc20bd4)
0.31.0 (2024-01-24)
- generate latest changes from OpenApi spec (9b3a844)
0.30.1 (2024-01-24)
- codegen: generate terminal resource objects (bf7e117)
0.30.0 (2024-01-24)
- generate latest changes from OpenApi spec (d0cbc71)
0.29.0 (2024-01-10)
- generate latest changes from OpenApi spec (32e802e)
0.28.1 (2024-01-10)
- add plan prefix to PriceId (6655058)
0.28.0 (2023-12-08)
- generate latest changes from OpenApi spec (4c25649)
0.27.0 (2023-12-01)
- add support for atxi id prefix (414d534)
0.26.0 (2023-10-31)
- fixed bool value (c752f52)
- fixed bool value (153d63d)
- fixed mutability (86aabdd)
- fixed mutability (5ad76c5)
- fixed warnings (30f0a1e)
- fixed warnings (e0d0bd8)
- updated ListPaginator to be generic over type T where T impl PaginableList instead of having separate SearchListPaginator and ListPaginator implementations for types SearchList and List. (9d49602)
- updated ListPaginator to be generic over type T where T impl PaginableList instead of having separate SearchListPaginator and ListPaginator implementations for types SearchList and List. (411f82c)
0.25.2 (2023-10-05)
- prevent panic on StatusCode conversion (9b94228)
0.25.1 (2023-09-27)
- respect the required and optional fields for EventType and Metadata (cdabd2e)
0.25.0 (2023-09-25)
- generate latest changes from OpenApi spec (652a360)
0.24.0 (2023-09-21)
- Generate latest changes from OpenApi spec (7421960)
- Generate latest changes from OpenApi spec (2fedb71)
0.23.0 (2023-09-06)
- add support for connect tokens (b7c5489)
- add tax calculation api behind a feature (2266ed1)
- handle currency_options (1bb8165)
0.22.2 (2023-05-11)
- Add sis_ id prefix for usage record summaries (1042493)
0.22.1 (2023-05-09)
- Move feature check to
build.rs(8d06be0)
0.22.0 (2023-04-18)
- generate latest changes from OpenApi spec (a76703c)
0.21.0 (2023-04-06)
- use codegen version of WebhookEvent rather than overriding manually (8347a6d)
0.20.2 (2023-04-05)
- generate api version from the codegen (3006688)
0.20.1 (2023-03-23)
- Use
HashMap::from(0c8dc9d)
0.20.0 (2023-03-09)
- Implement Balance retrieve (7509c98)
0.19.0 (2023-03-05)
- add CreditNote and CustomerBalanceTransaction (dc82e59)
0.18.4 (2023-03-05)
- add missing prefix for CheckoutSessionItemId (c6bdb57)
0.18.3 (2023-02-20)
- reexport duplicate SubscriptionPaymentBehaviour (dbcff41)
0.18.2 (2023-02-04)
- prevent publishing the benchmark crate (e4be54d)
0.18.1 (2023-02-04)
- prevent publishing the openapi crate (6de846e)
0.18.0 (2023-02-04)
- fn to expire checkout sessions (0368c79)
0.17.0 (2023-02-01)
- improve api doc code to fix / add more coverage (fecaa2e)
0.16.0 (2023-01-17)
- prevent freeze when hitting network errors in a retry strategy (d423be2)
- add support for webpki (alt. to native-certs) (c994b1c)
0.15.2 (2023-01-17)
- add automated release config (ac5a87a)
This is a half-release before we overhaul the codegen in 0.16. I want to give a special shoutout to @mzeitlin11 who has been doing some excellent work behind the scenes cleaning up the codegen.
- add a number of missing ids to
ids.rs - add a number of missing prefixes to
ids.rs - restore
serde_path_to_errorto give better error messages when parsing responses from the API - add api to retrieve checkout session
- add api to cancel a setup intent
- export the
generatedmodules so that overlapping apis can be reached by their path - handle the
idempotency_errorerror variant - allow blocking client to be used in a multithreaded scenario
- disable connection pooling to prevent API errors
This release comes with some improvements to list traversal as well as dramatic expansion of the api surface when dealing with webhooks!
- BREAKING: list methods now only borrow their parameters
- Add a streaming api for lazily and ergonomically traversing lists
- Exported the stripe terminal APIs
- Significantly more webhook types now available
- List traversals now properly include parameters when fetching later list items
This release is a minor patch release to fix an oversight in the API.
- Expose the request strategy API
This release has been focused on refining the ergonomics supporting additional stripe APIs, and adding retries / idempotency.
- BREAKING: fluent client config api.
- Add the
cardparam to the codegen. (@erichCompSci) - Derive
Defaultacross the codebase. - Opt-in idempotency functionality. (@erichCompSci)
- Opt-in retry logic.
In addition we have expanded the test coverage, and will continue to do so with more examples.
First release of async-stripe with swappable runtimes.
- You will now need to select a runtime to use the library.
- There may be small breaks in other places in the api.
- Fix failing
Invoice::upcomingby adding ais_nonerepresentation to InvoiceId (@bryanburgers)
- Enable RustTLS behind a feature flag (@kiljacken)
- Add missing values to
PaymentMethodTypeandPaymentIntentMethodType(@ThouCheese)
- Fixed deserialization of
ChargeIds withpy_prefix inPaymentIntentevent(s).
-
Updated to a newer version of the Stripe API.
-
The
PaymentIntent<___>Paramsstructs have been renamed to be consistent with the autogenerated APIe.g.
PaymentIntentCreateParamshas becomeCreatePaymentIntent
- The
app-infoheader can now be set/customized with theClient::set_app_infomethod.
-
New feature flags have been introduced to disable unused parts of the stripe APIs. This helps reduce binary bloat and compile time.
-
The async client has been updated to use
std::future::Future. Theasyncfeature flag is deprecated. Prefer{ default-features = false, features = ["full"] }instead. -
Set default stripe api version to the latest version supported by the library. This is intended to avoid bugs where a later version of stripe is enabled by a customer.
By default the full stripe api is enabled.
To reduce code size, disable default features and enable just the APIs you use:
# Example: Core-only (enough to create a `Charge` or `Card` or `Customer`)
stripe-rust = { version = "*", default-features = false, features = ["blocking"] }
# Example: Support for "Subscriptions" and "Invoices"
stripe-rust = { version = "*", default-features = false, features = ["blocking", "billing"] }Refer to the Stripe API docs to determine which APIs are included as part of each feature flag.
- The
stripe-versionheader can now be set/customized with theClient::with_headersmethod.
- The
Defaulttrait is now derived for all structs that have only defaultable parameters. Webhook::construct_eventtakes payload, signature, and secret args by ref (&str) instead of value.- The
payment_methodandconfirmation_methodfields were added toPaymentIntentCreateParams. - The
payment_method_detailsstructure now supports thecarddata field.
- Boolean fields that may be
null, are nowOptioninstead ofserde(default). - The
Customervariant was added to theEventObjectenum. - The
PaymentIntentCaptureParamsare now correctlypub. - Fixed parsing a negative customer
account_balance.
- The
PaymentSourceParamsstruct was edit to only include aTokenIdandSourceIdas per improvements to the API. - The
charge.sourcefield to create aChargewas fixed to accept the new structChargeSourceParams.
- Added
idfield toEvent
- Fixes a regression deriving
EqandPartialEqforPaymentIntentenums.
- Fixed deserialization of
CheckoutSessionCompletedevents. - Added missing
Invoiceevents.
- Fixed the
InvoiceLineItemIdtype to correctly handle subscription items.
This version uses code generation to generate the stripe API according to the openapi spec.
This contains major breaking changes from previous versions, both because many structures were out of date and because some changes were made to make things easier to generate.
-
Many new APIs have now been implemented (mostly CRUD); some requests are still missing because not all requests are automatically implemented. All previously implemented requests are still implemented (even if they couldn't be code-generated).
-
Many requests now take the
expandparameter which controls whether more data should be returned forExpandable<T>fields. Previously these fields were just id types.
- Fields and requests have descriptive documentation rather than just referring to the stripe API docs.
- Ids and fields are more strictly typed (newtypes vs raw strings).
- Ids no longer need to be allocated and are cheaply clonable (in almost all cases).
- Enum types now implement
DisplayandAsRef<str>.
- Add missing
producttoPlan. - Add missing
receipt_urltoCharge. - The deprecated
closedfield inInvoiceis now optional. - Fix allowing the
descriptionfield inPayoutto be optional. - Fix allowing a
SubscriptionItemquantity to beNone(e.g. when using metered pricing API). - Fix signature checking for received Webhooks.
- Allow the timestamp to be manually specified when verifying webhook signature.
- Detach source data structure is a new
DetachedSourceenum - The
objectfield was removed fromPaymentIntent,RefundandPayout. - Fields in
PaymentIntentwere updated to correctly be optional
- Added an
asyncfeature flag which removesstripe::Clientand addsstripe::async::Client.
- The
stripe::Paramstyped was renamed toHeadersto avoid confusion with otherFooParamstypes and theparamsmodule.
- Added
verify_bank_accounttoCustomerresource. - Added BankAccount as a variant of
PaymentSource. - Add the PaymentIntents resources, apis and events.
- Minimum Rust version required is 1.31.1.
- Moved
retrieve_sourceanddetach_sourcetoCustomerresource fromSource. - The
Error::Conversionenum variant has been replaced byError::SerializeandError::Deserialize. - See also Fixes / Improvements.
- TokenId has become an enum to account for different Token options
- Updated fields on
BankAccountresource so all are correct. - The
PayoutandRefundtypes now use enums instead of Strings. - The
WebhookErrortype is now externally public.
- Fix sending
metadata(and other nested params) as part of a POST request; e.g.Customer::create,Customer::update, etc.
- The type of
Customer.default_sourcehas changed fromSourceIdtoPaymentSourceId. - The type of
Customer.sourceshas changed fromList<Source>toList<PaymentSource>.
- The
List<T>type has newnextandget_allmethods for pagination. - Struct types more consistently implement
Clone. - Enum types more consistently implement
Copy,Eq, andHash. - More source details (e.g.
ach_credit_transfer, etc) were added toSource. - The blocking api is now backed by
reqwestinstead ofhyper:0.10so that the library is no longer pinned to outdated dependencies. - Added the "webhooks" feature flag for processing events (enabled by default)
to convert
hmacandsha2to optional dependencies.
- (Mostly from 0.5.x series)
Charge,Card, andSourcehave been updated to use new enum values rather thanString. - The
SourceTypeenum used by ChargeListParams has been renamed toSourceFilterTypeto remove a conflict with theSourceTypeenum used by the type field of Source.
- All
Addressfields have been updated to be optional. - The
Client-Idparam has been added to params to make support for impersonating Connect Accounts compatible with newer stripe api versions.
- Updated
Chargeto use enum types rather than&strwhere possible.
- Fixed many issues with the
Sourceobject. - Updated
Cardto use enum types rather than&strwhere possible. - Added many new fields to
Card.
- Bumped dependency versions
- Implemented the sources resource and
added the
Sourcetype .
- The
CustomerSourceParamsstruct was renamed toPaymentSourceParams. - The
Sourceenum was renamed toPaymentSource(there is a newSourcestruct). - Source and token fields (like
token: &str) now usesource: SourceIdortoken: TokenIdinstead.
- Added missing
default_sourcefield toCustomer. - The
DeserializeandSerializetraits have now been implemented for all param and resource structs. - The
Copy,Clone,Eq,PartialEq, andHashtraits have been derived for flat enum types.
- Fix, adds all missing error code variants to
stripe::error::ErrorCode.
- Fixed field
nicknameofPlancan be null.
- Fixed field
nicknameofPlanshould bename
- The
balance_transactionfield ofChargeis nowOption<_>.
- Added basic crate documentation
- Added the
invoice.upcomingevent
- Add RangeQuery struct for created/date filters in list requests
- Implement
Customer::listrequest (ie. "GET /customers"); Thanks @pocket7878 - Add missing params to
InvoiceListParamsforInvoice::list
- Upgrade Serde to v1.0
- Add support for authentication using the Stripe-Account header
- Implement
Eventstruct for implementing a Stripe Webhook (only some events) - Implement
Invoice::updaterequest (ie. POST "/invoices/{invoice_id}") - Implement
InvoiceItem::createrequest (ie. POST "/invoiceitems") - Fix
Subscription::cancelrequest (previously used wrong method/path)
- Implemented the
Invoice::listAPI (ie. "/invoices") - Fixed a request encoding error for
Invoice::pay(ie. "/invoices/{invoice_id}/pay") - Fixed fields on
Subscriptionthat could be null but were missingOptional<..> - Added missing
last4field toCardresource - Changed the repository URL
- Made rust docs slightly easier to read
- Fixed incorrect method name for
Planresource - Use
native-tlsby default and add feature-flag supportingopenssl
- Implemented the charges resource and
added the
Chargetype.
- The
Resource::getrequests have been renamed toResource::retrieve. - The
Subscription::cancelrequest now expectsCancelParamsinstead of expecting a one-off function argument. - Removed the
blamemethod andBlametype from errors. - The
Error::DecodeandError::Encodevariants have been combined into a singleError::Conversionvariant.
- The
Errortype now has easier to read error messages and will parses JSON errors returned by Stripe into a structured error type (RequestError). - Added Travis CI for automated testing on GitHub.
- Added reference documentation to implemented resources (but still no docs at crate/module level nor a "Getting started" guide)
- Added
Clientwhich is created once with a stripe private key and is intended to be re-used for multiple requests. It implementsSyncso you can share it among multiple threads. - Added new strongly-typed
Currencytype following the example of https://github.com/stripe/stripe-go. Customer::create/CustomerParamsnow support usingCardParamsas a source instead of just tokens.- Implemented the sources API in the
Sourcetype.
- All
Paramstypes now use&strfields instead ofStrings. - Requests used to require a
stripe_key: &stras their final argument but now use a&Clientas the first argument instead. - Stripe tokens used to be directly used as a source in
CustomerParamsbut now must be used withCustomerSourceParams::Token("tok_xyzABC123").
- Added remaining fields to
Paramstypes after switching fromserde_urlencodedtoserde_qsto support nested params. - Added the
create_customerexample - Types that implement
Deserializenow also implementDebug. - Types that implement
Serializenow also implementDefault.