MCPcopy Index your code
hub / github.com/arlyon/async-stripe

github.com/arlyon/async-stripe @v0.41.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.41.0 ↗ · + Follow
4,831 symbols 5,920 edges 473 files 245 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

async-stripe

CI async-stripe on crates.io async-stripe  on docs.rs

Convenient rust bindings and types for the Stripe HTTP API aiming to support the entire API surface. Not the case? Please open an issue. We update our definitions every week to ensure that we are up to date. Want to see a changelog of the Stripe API? Look no further.

Note

We are currently working on a major rewrite of the library in the next branch. This rewrite aims to make the library more efficient and easier to use. Some lovely numbers from the rewrite:

  • A clean release build of examples/endpoints goes from ~4m to 50s with min-ser enabled.
  • The actual time to build just the binary goes from 75s to 7s, making incremental builds for code depending on async-stripe much faster.
  • Stripped binary size of the examples/endpoints binary went from ~70MB to ~20MB, with further reduction to ~13MB using a fat LTO build.

We are actively seeking testers to help us ensure the new version is stable and performant. If you are interested in trying out the new version, you can add the following to your Cargo.toml:

toml [dependencies] async-stripe = { git = "https://github.com/arlyon/async-stripe", branch = "next" }

Your feedback is invaluable to us, so please report any issues or suggestions you may have. We are still expecting a few breaking changes before RC. We recommend using the in-progress Migration Guide when upgrading.

Documentation

See the Rust API docs, the examples, or payments.rs.

Installation

async-stripe is compatible with the async-std and tokio runtimes and the native-tls and rustls backends. When adding the dependency, you must select a runtime feature.

[dependencies]
async-stripe = { version = "0.31", features = ["runtime-tokio-hyper"] }

Feature Flags

Runtimes

  • runtime-tokio-hyper
  • runtime-tokio-hyper-rustls
  • runtime-blocking
  • runtime-blocking-rustls
  • runtime-async-std-surf

API Features

Additionally, since this is a large library, it is possible to conditionally enable features as required to reduce compile times and final binary size. Refer to the Stripe API docs to determine which APIs are included as part of each feature flag.

# Example: Core-only (enough to create a `Charge` or `Card` or `Customer`)
async-stripe = { version = "*", default-features = false, features = ["runtime-async-std-surf"] }

# Example: Support for "Subscriptions" and "Invoices"
async-stripe = { version = "*", default-features = false, features = ["runtime-async-std-surf", "billing"] }

API Versions

This library always tracks the latest version of the stripe API.

https://github.com/arlyon/async-stripe/blob/f0fd7115aa3b7500134da10f848c8e93ba8eca2e/src/resources/generated/version.rs#L1-L3

If you want to find a version that matches the API you are on, you can easily navigate back through the git blame in that file. Set the corresponding crate version depending on which version of the Stripe API you are pinned to. If you don't see the specific version you are on, prefer the next available version.

MSRV

We currently have 1.82.0 pinned in CI, so any version of rustc newer than that should work. If this is not the case, please open an issue. As a policy, we permit MSRV increases in non-breaking releases. If you have a compelling usecase for bumping it, we are usually open to do so, as long as the rust version is not too new (generally 3 releases).

Contributing

See CONTRIBUTING.md for information on contributing to async-stripe.

License

This project started as a fork of stripe-rs. We would not be here without them! :)

Licensed under either of

at your option.

Extension points exported contracts — how you extend this code

Object (Interface)
Implemented by types which represent stripe objects. [159 implementers]
src/params.rs
Paginable (Interface)
(no doc) [47 implementers]
src/params.rs
Paginate (Interface)
Implemented by types which support cursor-based pagination, typically with an id, allowing them to be fetched using a `L [1 …
src/params.rs
AsCursor (Interface)
(no doc) [2 implementers]
src/params.rs
PaginableList (Interface)
(no doc) [2 implementers]
src/params.rs

Core symbols most depended-on inside this repo

get_query
called by 102
src/client/stripe.rs
post_form
called by 87
src/client/stripe.rs
get
called by 38
src/client/stripe.rs
create
called by 31
src/client/base/tokio.rs
as_str
called by 28
src/resources/types.rs
as_ref
called by 23
src/resources/types.rs
schema_to_rust_type
called by 22
openapi/src/metadata.rs
url
called by 19
src/client/stripe.rs

Shape

Class 2,367
Method 1,157
Enum 1,152
Function 150
Interface 5

Languages

Rust100%
C1%

Modules by API surface

src/resources/generated/payment_intent.rs516 symbols
src/resources/generated/checkout_session.rs285 symbols
src/resources/generated/payment_method_configuration.rs226 symbols
src/resources/generated/setup_intent.rs217 symbols
src/resources/generated/account.rs200 symbols
src/resources/generated/payment_link.rs152 symbols
src/resources/generated/payment_method.rs134 symbols
src/resources/generated/subscription.rs126 symbols
src/resources/generated/charge.rs118 symbols
src/resources/generated/invoice.rs97 symbols
src/resources/generated/subscription_schedule.rs67 symbols
src/resources/generated/source.rs64 symbols

For agents

$ claude mcp add async-stripe \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact