{"id":30698403,"url":"https://github.com/answerdotai/faststripe","last_synced_at":"2026-02-10T06:03:49.495Z","repository":{"id":307160534,"uuid":"989334085","full_name":"AnswerDotAI/faststripe","owner":"AnswerDotAI","description":"Fastest way to use the Stripe API in python","archived":false,"fork":false,"pushed_at":"2025-08-11T14:53:25.000Z","size":735,"stargazers_count":32,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-29T12:44:47.492Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://stripe.fast.ai/","language":"Python","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/AnswerDotAI.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-05-23T22:33:41.000Z","updated_at":"2025-08-28T16:00:45.000Z","dependencies_parsed_at":"2025-07-29T20:51:48.462Z","dependency_job_id":null,"html_url":"https://github.com/AnswerDotAI/faststripe","commit_stats":null,"previous_names":["answerdotai/faststripe"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/AnswerDotAI/faststripe","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Ffaststripe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Ffaststripe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Ffaststripe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Ffaststripe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnswerDotAI","download_url":"https://codeload.github.com/AnswerDotAI/faststripe/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnswerDotAI%2Ffaststripe/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273272579,"owners_count":25075982,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-02T02:00:09.530Z","response_time":77,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-09-02T10:47:47.591Z","updated_at":"2026-02-10T06:03:49.488Z","avatar_url":"https://github.com/AnswerDotAI.png","language":"Python","readme":"# Tutorial: Get Started with FastStripe\n\n\n\u003c!-- WARNING: THIS FILE WAS AUTOGENERATED! DO NOT EDIT! --\u003e\n\n## Prerequisites\n\nBefore starting this tutorial, you’ll need:\n\n- Python 3.9 or higher installed\n- A Stripe account (sign up at [stripe.com](https://stripe.com))\n- Your Stripe test API keys from the [Stripe\n  Dashboard](https://dashboard.stripe.com/test/apikeys)\n\n## Why FastStripe?\n\nFastStripe offers several advantages over the official Stripe Python\nSDK:\n\n- **Self-documenting**: See all available parameters with descriptions\n  in your IDE\n- **Simplified workflows**: High-level methods for common payment\n  patterns\n- **Lightweight**: Minimal dependencies (just `fastcore`)\n- **Consistent API**: HTTP verb-based methods (`post`, `get`) with full\n  parameter visibility\n\n## Step 1: Installation\n\nFirst, install FastStripe using pip:\n\n``` bash\npip install faststripe\n```\n\nOr install the latest development version:\n\n``` bash\npip install git+https://github.com/AnswerDotAI/faststripe.git\n```\n\n## Versioning\n\nFastStripe versions follow Stripe’s API versioning scheme (e.g.,\n`2025.05.28.x`). Each FastStripe release is pinned to a specific Stripe\nAPI version, ensuring:\n\n- **Stability**: Your code won’t break when Stripe updates their API\n- **Predictability**: Same behavior across all environments  \n- **Compatibility**: Choose the Stripe API version that works for your\n  application\n\nWhen you install FastStripe, you get a specific snapshot of the Stripe\nAPI that’s been tested and validated. The minor version represents\nnon-breaking changes we add such as better higher-level APIs.\n\n## Step 2: Set up your API key\n\nFor this tutorial, you’ll use your Stripe test API key. Create a `.env`\nfile in your project directory:\n\n``` bash\necho \"STRIPE_SECRET_KEY=sk_test_your_test_key_here\" \u003e .env\n```\n\nThen load it in your Python environment:\n\n## Step 3: Initialize FastStripe\n\nNow let’s import FastStripe and initialize it with your API key:\n\n``` python\nfrom faststripe.core import StripeApi\n\nimport os\n\n# Initialize with your API key from environment\nsapi = StripeApi('your-api-key')\n```\n\n``` python\nsapi.customers.post(\n```\n\n``` python\n# Create a customer\ncustomer = sapi.customers.post(email='user@example.com', name='John Doe')\nprint(customer.id, customer.email)\n```\n\n    cus_ScUPG9yb5cPV6G user@example.com\n\n### Self-Documenting API\n\nOne of FastStripe’s key advantages is that all methods include parameter\ndocumentation directly in your IDE. You can see what parameters are\navailable without checking external docs:\n\n``` python\n# Explore available methods and their parameters\nsapi.customers.post?\n```\n\n    Signature:     \n    sapi.customers.post(\n        address: object = None,\n        balance: int = None,\n        cash_balance: dict = None,\n        description: str = None,\n        email: str = None,\n        ...\n\nIt also supports tab completion when filling in parameters!\n\n### High-Level Convenience Methods\n\nFastStripe includes simplified methods for common payment workflows:\n\n``` python\n# Create a one-time payment checkout session\ncheckout = sapi.one_time_payment(\n    product_name='My Product',\n    amount_cents=2000,  # $20.00\n    success_url='https://localhost:8000/success',\n    cancel_url='https://localhost:8000/cancel'\n)\nprint(f\"Payment URL: {checkout.url[:64]}...\")\n```\n\n    Payment URL: https://billing.answer.ai/c/pay/cs_test_a107uQXcqI6W9iD09wOmVinc...\n\n``` python\n# Create a subscription checkout session\nsubscription = sapi.subscription(\n    product_name='Monthly Plan',\n    amount_cents=999,  # $9.99/month\n    success_url='https://localhost:8000/success',\n    cancel_url='https://localhost:8000/cancel',\n    customer_email=customer.email\n)\nprint(f\"Subscription URL: {subscription.url[:64]}...\")\n```\n\n    Subscription URL: https://billing.answer.ai/c/pay/cs_test_a1O4fjw1mgs11zkLGgHZTp6T...\n\n### Complete API Coverage\n\nFastStripe provides access to the entire Stripe API through organized\nresource groups:\n\n``` python\n# Access any Stripe resource with consistent patterns\nproduct = sapi.products.post(name='New Product')\nprint(f\"Created product: {product.name} with ID: {product.id}\")\n```\n\n    Created product: New Product with ID: prod_ScUPzNzla8KDC6\n\n``` python\n# Fetch existing resources\ncustomers = sapi.customers.get(limit=3)\nprint(f\"Found {len(customers.data)} customers\")\n```\n\n    Found 3 customers\n\n``` python\n# All responses are AttrDict objects for easy dot notation access\npayment_intent = sapi.payment.intents_post(amount=1000, currency='usd')\nprint(f\"Payment intent status: {payment_intent.status}, amount: ${payment_intent.amount/100}\")\n```\n\n    Payment intent status: requires_payment_method, amount: $10.0\n\n### Pagination Support\n\nFastStripe includes built-in utilities for handling paginated API\nresponses, making it easy to work with large requests.\n\n``` python\nfrom faststripe.page import paged, pages\n\nfor p in paged(sapi.customers.get, limit=5): break\nprint(f\"Got {len(p.data)} customers\")\nprint(f\"Has more pages: {p.has_more}\")\n```\n\n    Got 5 customers\n    Has more pages: True\n\n``` python\nsapi.products\n```\n\n\u003cpre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"\u003e\u003c/pre\u003e\n\n- [products.get](https://docs.stripe.com/api/products/list)(active:\n  ‘str’, created: ‘str’, ending_before: ‘str’, expand: ‘str’, ids:\n  ‘str’, limit: ‘str’, shippable: ‘str’, starting_after: ‘str’, url:\n  ‘str’): *List all products*\n- [products.post](https://docs.stripe.com/api/products/create)(active:\n  bool = None, default_price_data: dict = None, description: str = None,\n  expand: list = None, id: str = None, images: list = None,\n  marketing_features: list = None, metadata: dict = None, name: str =\n  None, package_dimensions: dict = None, shippable: bool = None,\n  statement_descriptor: str = None, tax_code: str = None, unit_label:\n  str = None, url: str = None): *Create a product*\n- [products.search_get](https://docs.stripe.com/api/searchs/retrieve)(expand:\n  ‘str’, limit: ‘str’, page: ‘str’, query: ‘str’): *Search products*\n- [products.id_delete](https://docs.stripe.com/api/products/delete)(id):\n  *Delete a product*\n- [products.id_get](https://docs.stripe.com/api/products/delete)(id,\n  expand: ‘str’): *Retrieve a product*\n- [products.id_post](https://docs.stripe.com/api/products/update)(id,\n  active: bool = None, default_price: str = None, description: object =\n  None, expand: list = None, images: object = None, marketing_features:\n  object = None, metadata: object = None, name: str = None,\n  package_dimensions: object = None, shippable: bool = None,\n  statement_descriptor: str = None, tax_code: object = None, unit_label:\n  object = None, url: object = None): *Update a product*\n- [products.product_features_get](https://docs.stripe.com/api/features/delete)(product,\n  ending_before: ‘str’, expand: ‘str’, limit: ‘str’, starting_after:\n  ‘str’): *List all features attached to a product*\n- [products.product_features_post](https://docs.stripe.com/api/features/update)(product,\n  entitlement_feature: str = None, expand: list = None): *Attach a\n  feature to a product*\n- [products.product_features_id_delete](https://docs.stripe.com/api/features/delete)(product,\n  id): *Remove a feature from a product*\n- [products.product_features_id_get](https://docs.stripe.com/api/features/delete)(product,\n  id, expand: ‘str’): *Retrieve a product_feature*\n\n``` python\nproducts = pages(sapi.products.get, limit=10)\nlen(products), products[0]\n```\n\n\u003cpre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\"\u003e\u003c/pre\u003e\n\n\n    (\n        650,\n        {\n            'id': 'prod_ScUPzNzla8KDC6',\n            'object': 'product',\n            'active': True,\n            'attributes': [],\n            'created': 1751657895,\n            'default_price': None,\n            'description': None,\n            'images': [],\n            'livemode': False,\n            'marketing_features': [],\n            'metadata': {},\n            'name': 'New Product',\n            'package_dimensions': None,\n            'shippable': None,\n            'statement_descriptor': None,\n            'tax_code': None,\n            'type': 'service',\n            'unit_label': None,\n            'updated': 1751657895,\n            'url': None\n        }\n    )\n\nThe pagination utilities work with any Stripe resource that supports\npagination:\n\n- **[`paged()`](https://AnswerDotAI.github.io/faststripe/page.html#paged)**:\n  Creates a paged generator for a resource’s API\n- **[`pages()`](https://AnswerDotAI.github.io/faststripe/page.html#pages)**:\n  Iterator that automatically fetches all pages and returns all items\n  returned in those pages\n\nThis makes it easy to process large datasets without manually handling\npagination tokens.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanswerdotai%2Ffaststripe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanswerdotai%2Ffaststripe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanswerdotai%2Ffaststripe/lists"}