{"id":15626576,"url":"https://github.com/arlyon/async-stripe","last_synced_at":"2026-04-13T09:01:21.362Z","repository":{"id":37050947,"uuid":"316836799","full_name":"arlyon/async-stripe","owner":"arlyon","description":"Async (and blocking!) Rust bindings for the Stripe API","archived":false,"fork":false,"pushed_at":"2026-04-07T10:53:17.000Z","size":24245,"stargazers_count":697,"open_issues_count":6,"forks_count":178,"subscribers_count":8,"default_branch":"master","last_synced_at":"2026-04-07T12:25:44.088Z","etag":null,"topics":["rust","stripe"],"latest_commit_sha":null,"homepage":"https://payments.arlyon.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arlyon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"arlyon"}},"created_at":"2020-11-28T22:57:18.000Z","updated_at":"2026-04-07T10:50:21.000Z","dependencies_parsed_at":"2026-02-12T05:05:52.369Z","dependency_job_id":null,"html_url":"https://github.com/arlyon/async-stripe","commit_stats":{"total_commits":1062,"total_committers":90,"mean_commits":11.8,"dds":0.7448210922787194,"last_synced_commit":"c71a7eb6d7115089193f7dd602a0ce356848ab73"},"previous_names":["arlyon/stripe-rs"],"tags_count":312,"template":false,"template_full_name":null,"purl":"pkg:github/arlyon/async-stripe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlyon%2Fasync-stripe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlyon%2Fasync-stripe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlyon%2Fasync-stripe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlyon%2Fasync-stripe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arlyon","download_url":"https://codeload.github.com/arlyon/async-stripe/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arlyon%2Fasync-stripe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31746113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","stripe"],"created_at":"2024-10-03T10:13:03.405Z","updated_at":"2026-04-13T09:01:21.356Z","avatar_url":"https://github.com/arlyon.png","language":"Rust","funding_links":["https://github.com/sponsors/arlyon"],"categories":["Rust"],"sub_categories":[],"readme":"# async-stripe\n\n![CI](https://github.com/arlyon/async-stripe/workflows/CI/badge.svg)\n[![async-stripe on crates.io](https://img.shields.io/crates/v/async-stripe.svg)](https://crates.io/crates/async-stripe)\n[![async-stripe  on docs.rs](https://docs.rs/async-stripe/badge.svg)](https://docs.rs/async-stripe)\n\nA convenient, performant, and strongly-typed Rust library for the Stripe\nHTTP API.\n\nThis library provides asynchronous bindings for the entire Stripe API\nsurface. It's generated directly from Stripe's official OpenAPI\nspecification and is **updated weekly via CI** to ensure it's always\nup-to-date with the latest API changes.\n\n## 📚 Documentation\n\nFor comprehensive guides, tutorials, and API documentation, visit:\n\n- **[async-stripe Documentation Site](https://payments.rs/docs)** - Complete guides on working with expandable fields, error handling, webhooks, testing, and more\n- **[API Reference on docs.rs](https://docs.rs/async-stripe)** - Full API documentation for all types and methods\n- **[Examples](https://github.com/arlyon/async-stripe/tree/master/examples)** - Real-world examples for common Stripe operations\n\n## ✨ Key Features\n\n- **Complete \u0026 Current API Coverage**: Generated from the official\n  Stripe OpenAPI spec for maximum coverage and correctness. Our CI runs\n  weekly to pull in the latest API definitions.\n\n- **Asynchronous \u0026 Performant**: Built with async Rust for high\n  performance. Uses `miniserde` for blazing-fast deserialization,\n  keeping your binary sizes small and compile times fast.\n\n- **Modular by Design**: The API is split into multiple crates\n  (`stripe-core`, `stripe-billing`, etc.), so you only compile what you\n  need, further reducing bloat.\n\n- **Ergonomic API**: A fluent, builder-style API for constructing\n  requests that is easy to use and discover.\n\n- **Flexible HTTP Clients**: Supports `tokio` and `async-std` runtimes\n  with `native-tls` and `rustls` backends.\n\n\u003e ⏰ **1.0 Alpha Notice**: We are still expecting a few breaking changes before RC. We recommend using the [Migration Guide](MIGRATION.md) when upgrading from 0.x versions.\n\n## 🚀 Quick Start\n\nHere's a quick example of how to create a new Stripe Customer.\n\n**1. Add dependencies to your `Cargo.toml`:**\n\nYou'll need the main `async-stripe` crate for the client and a resource\ncrate for the APIs you want to use (e.g., `stripe-core` for customers).\n\n```toml\n[dependencies]\nasync-stripe = \"=1.0.0-alpha.8\"\nasync-stripe-core = { version = \"=1.0.0-alpha.8\", features = [\"customer\"] }\ntokio = { version = \"1\", features = [\"full\"] }\n```\n\n**2. Create a Customer:**\n\nThe new API uses a builder pattern that flows naturally from request\ncreation to sending.\n\n```rust\nuse stripe::Client;\nuse stripe_core::customer::CreateCustomer;\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), Box\u003cdyn std::error::Error\u003e\u003e {\n    // 1. Initialize the client\n    let secret_key = std::env::var(\"STRIPE_SECRET_KEY\").expect(\"Missing STRIPE_SECRET_KEY in env\");\n    let client = Client::new(secret_key);\n\n    // 2. Create a customer using the builder pattern\n    let customer = CreateCustomer::new()\n        .name(\"Alexander Lyon\")\n        .email(\"test@async-stripe.com\")\n        .description(\"A fake customer that is used to illustrate the examples in async-stripe.\")\n        .metadata([(String::from(\"async-stripe\"), String::from(\"true\"))])\n        .send(\u0026client)\n        .await?;\n\n    println!(\"Successfully created customer: {} ({})\", customer.name.unwrap_or_default(), customer.id);\n\n    Ok(())\n}\n```\n\n## How It Works\n\n### Code Generation\n\n`async-stripe` achieves its vast API coverage and stays current by\ngenerating Rust code directly from the [official Stripe OpenAPI\nspecification](https://github.com/stripe/openapi \"null\"). A CI job runs\nweekly to fetch the latest spec, regenerate the code, and open a pull\nrequest. This ensures that new Stripe features and updates are available\nin the library almost immediately.\n\n### Performance: `serde` and `miniserde`\n\nThe Stripe API has a massive surface area, and the code generation\nprocess creates a very large number of types. Using `serde` for both\nserialization and deserialization in previous versions resulted in\nexcessive codegen size and long compile times. To solve this,\n`async-stripe` now uses a hybrid approach:\n\n- **`serde`** is used for **serializing** request parameters you send to\n  Stripe. Its flexibility and rich feature set make it ideal for\n  building complex requests.\n\n- **`miniserde`** is used for **deserializing** API responses from\n  Stripe. It's a minimal, high-performance JSON library that\n  significantly reduces compile times and final binary size compared to\n  a full `serde` dependency.\n\nIf you need to use `serde::Deserialize` on the Stripe response types\nwithin your own application, you can enable the `deserialize` feature on\nany of the `stripe-*` crates.\n\n### Modular Crate Structure\n\nThe Stripe API is extensive. To avoid long compile times and large\ndependencies, `async-stripe` is split into several crates. You only need\nto include the ones corresponding to the API sections you use.\n\n| API Area | Crate Name | Description |\n|----|----|----|\n| **Client** | `async-stripe` | The core client for making requests. **Always required.** |\n| **Core Resources** | `stripe-core` | Customers, Charges, Payment Intents, Refunds, etc. |\n| **Payments** | `stripe-payment` | Payment Methods, Payment Links, Sources. |\n| **Billing \u0026 Subscriptions** | `stripe-billing` | Invoices, Subscriptions, Plans, Quotes. |\n| **Stripe Connect** | `stripe-connect` | Accounts, Account Links, Transfers. |\n| **Fraud Detection** | `stripe-fraud` | Radar, Reviews. |\n| **Checkout** | `stripe-checkout` | Checkout Sessions. |\n| **Webhooks** | `stripe-webhook` | Securely receive and deserialize webhook events. |\n| **Products \u0026 Pricing** | `stripe-product` | Products, Prices, Coupons, Tax Rates. |\n| **Issuing** | `stripe-issuing` | Card creation and management for Stripe Issuing. |\n| **Terminal** | `stripe-terminal` | In-person payments with Stripe Terminal. |\n| **Treasury** | `stripe-treasury` | Financial accounts and money movement. |\n| **Miscellaneous** | `stripe-misc` | Tax, Identity, Reporting, Sigma, etc. |\n\n\u003e [!NOTE]\n\u003e For a complete, up-to-date mapping of every API object to its crate\n\u003e and feature flag, see the\n\u003e [`crate_info.md`](https://www.google.com/search?q=crate_info.md \"null\")\n\u003e file in the repository. We are actively working on improving API\n\u003e surface exploration. For now, you can explore the `generated/`\n\u003e directory in the repository to see all available API crates and their\n\u003e respective modules.\n\n## Usage Guide\n\n### 1. Choose Your HTTP Client\n\nThe core `async-stripe` crate provides the client. You must enable a\nfeature flag to select your desired async runtime and TLS backend.\n\n| Feature Flag | Async Runtime | HTTP Client | TLS Backend |\n|----|----|----|----|\n| `default-tls` (Default) | `tokio` | `hyper` | `native-tls` |\n| `rustls-tls-webpki-roots` | `tokio` | `hyper` | `rustls` (from `webpki-roots`) |\n| `rustls-tls-native` | `tokio` | `hyper` | `rustls` (from native cert store) |\n| `async-std-surf` | `async-std` | `surf` | `native-tls` |\n| `blocking` | Sync (uses `tokio` internally) | `hyper` | Depends on active TLS feature |\n\n### 2. Add Resource Crates and Features\n\nFor each Stripe resource you want to interact with, add its crate and\nenable the corresponding feature flag. For example, to use `Customer`\nand `Charge` objects:\n\n```toml\n[dependencies]\nstripe-core = { version = \"...\", features = [\"customer\", \"charge\"] }\n```\n\n### 3. Pagination\n\nListing resources is now more ergonomic. You can call `.paginate()`\ndirectly on a `List*` request struct to get a stream of results.\n\n```rust\nuse stripe_core::customer::ListCustomer;\nuse futures_util::TryStreamExt;\n\nasync fn run(client: \u0026stripe::Client) -\u003e Result\u003c(), stripe::StripeError\u003e {\n    let mut stream = ListCustomer::new().paginate().stream(client);\n    while let Some(customer) = stream.try_next().await? {\n        println!(\"Got customer: {}\", customer.id);\n    }\n    Ok(())\n}\n```\n\n### 4. Handling Webhooks\n\nWebhook handling is now isolated in the `stripe-webhook` crate and the\nAPI is much simpler. You can now match directly on the event object\ntype.\n\n```rust\nuse stripe_webhook::{Event, EventObject, Webhook};\n\nfn handle_webhook(payload: \u0026str, sig: \u0026str, secret: \u0026str) {\n    let event = Webhook::construct_event(payload, sig, secret).unwrap();\n    match event.data.object {\n        EventObject::CheckoutSessionCompleted(session) =\u003e {\n            println!(\"Received checkout session completed webhook with id: {:?}\", session.id);\n        }\n        EventObject::AccountUpdated(account) =\u003e {\n            println!(\"Received account updated webhook for account: {:?}\", account.id);\n        }\n        _ =\u003e println!(\"Unknown event encountered in webhook: {:?}\", event.type_),\n    }\n}\n```\n\n## Project Status\n\nThis library is actively maintained. The code is regenerated weekly to\nensure it never falls behind the official Stripe API.\n\nWe are working on setting up fully automated releases to `crates.io` to\ncoincide with the weekly updates. This will ensure you can depend on the\nlatest Stripe features as soon as they are available.\n\n## Contributing\n\nContributions are welcome! Please see\n[CONTRIBUTING.md](CONTRIBUTING.md)\nfor details on how to get started, run tests, and contribute to the code\ngeneration process.\n\n## License\n\nThis project is licensed under either of:\n\n- Apache License, Version 2.0\n  ([LICENSE-APACHE](LICENSE-APACHE)\n  or http://www.apache.org/licenses/LICENSE-2.0)\n\n- MIT license\n  ([LICENSE-MIT](LICENSE-MIT) or\n  http://opensource.org/licenses/MIT)\n\nThis project began as a fork of\n[stripe-rs](https://github.com/wyyerd/stripe-rs), and we are\nincredibly grateful for their foundational work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlyon%2Fasync-stripe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farlyon%2Fasync-stripe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farlyon%2Fasync-stripe/lists"}