{"id":28254956,"url":"https://github.com/chargebee/chargebee-dotnet","last_synced_at":"2026-06-08T08:01:35.630Z","repository":{"id":7613336,"uuid":"8971756","full_name":"chargebee/chargebee-dotnet","owner":"chargebee","description":".NET library for the Chargebee API.","archived":false,"fork":false,"pushed_at":"2026-03-27T05:59:56.000Z","size":9171,"stargazers_count":26,"open_issues_count":12,"forks_count":25,"subscribers_count":40,"default_branch":"master","last_synced_at":"2026-03-27T17:48:23.152Z","etag":null,"topics":["chargebee","dotnet"],"latest_commit_sha":null,"homepage":"https://apidocs.chargebee.com/docs/api?lang=dotnet","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chargebee.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":"SECURITY.md","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}},"created_at":"2013-03-23T14:49:54.000Z","updated_at":"2026-03-27T05:59:25.000Z","dependencies_parsed_at":"2024-06-19T01:25:13.766Z","dependency_job_id":"4ddfc481-f1c6-4262-99af-9476b339616a","html_url":"https://github.com/chargebee/chargebee-dotnet","commit_stats":{"total_commits":244,"total_committers":15,"mean_commits":"16.266666666666666","dds":0.6680327868852459,"last_synced_commit":"90c5c3f74b795dedfc66169ef146140bdfb2e5ab"},"previous_names":[],"tags_count":234,"template":false,"template_full_name":null,"purl":"pkg:github/chargebee/chargebee-dotnet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-dotnet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-dotnet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-dotnet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-dotnet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chargebee","download_url":"https://codeload.github.com/chargebee/chargebee-dotnet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chargebee%2Fchargebee-dotnet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31308446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["chargebee","dotnet"],"created_at":"2025-05-19T20:16:31.639Z","updated_at":"2026-04-02T14:51:18.285Z","avatar_url":"https://github.com/chargebee.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# .NET Client Library for Chargebee API\n\n\u003e [!NOTE]\n\u003e [![Join Discord](https://img.shields.io/badge/Discord-Early%20Access-blue?logo=discord\u0026logoColor=white)](https://discord.gg/S3SXDzXHAg)\n\u003e\n\u003e We are trialing a Discord server for developers building with Chargebee. Limited spots are open on a first-come basis. Join [here](https://discord.gg/gpsNqnhDm2) if interested.\n\n\n***\n\n[![NuGet](https://img.shields.io/nuget/v/chargebee.svg?maxAge=3592000)](https://www.nuget.org/packages/ChargeBee/)\nand\n[![NuGet](https://img.shields.io/nuget/v/chargebee.svg?maxAge=2592000)](https://www.nuget.org/packages/ChargeBee/)\n\nThis is the official .NET library for integrating with Chargebee.\n\n- 📘 For a complete reference of available APIs, check out our [API Documentation](https://apidocs.chargebee.com/docs/api/?lang=dotnet).  \n- 🧪 To explore and test API capabilities interactively, head over to our [API Explorer](https://api-explorer.chargebee.com).\n\nThe latest version (v3) of the library supports the following:\n\n- .NET Standard 1.2+\n- .NET Core 1.0+\n- .NET Framework 4.5+\n\n## Library versions\n***\n\nThe versioning scheme of this library is inspired by [SemVer](https://semver.org/) and the format is `v{MAJOR}.{MINOR}.{PATCH}`. For example, `v3.0.0` and `v2.5.1` are valid library versions.\n\nThe following table provides some details for each major version:\n\n| Library major version | Status   | Compatible API versions                                                                                         | **Branch**        |\n|----------------------------|----------|-----------------------------------------------------------------------------------------------------------------|---------------|\n| v3                         | Active   | [v2](https://apidocs.chargebee.com/docs/api/v2?lang=dotnet) and [v1](https://apidocs.chargebee.com/docs/api/v1?lang=dotnet) | `master`      |\n| v2                         | Inactive | [v2](https://apidocs.chargebee.com/docs/api/v2?lang=dotnet) and [v1](https://apidocs.chargebee.com/docs/api/v1?lang=dotnet)             | `chargebee-v2`|\n| v1                         | Inactive | [v1](https://apidocs.chargebee.com/docs/api/v1?lang=dotnet)                                                                 | `chargebee-v1`|\n\nA couple of terms used in the above table are explained below:\n- **Status**: The current development status for the library version. An **Active** major version is currently being maintained and continues to get backward-compatible changes. **Inactive** versions no longer receive any updates.\n- **Branch**: The branch in this repository containing the source code for the latest release of the library version. Every version of the library has been [tagged](https://github.com/chargebee/chargebee-dotnet/tags). You can check out the source code for any version using its tag.\n\n🔴 **Attention**: The support for v2 will eventually be discontinued on **December 31st 2023** and will no longer receive any further updates. We strongly recommend [upgrading to v3](https://github.com/chargebee/chargebee-dotnet/wiki/Migration-guide-for-v3) as soon as possible.\n**Note:** See the [changelog](CHANGELOG.md) for a history of changes.\n\n## Install the library\n***\n\nYou can install any release of an **active** library version using [NuGet](https://nuget.org)—a package manager for Visual Studio—by running the following command in the NuGet Package Manager Console:\n\n```shell\n$ Install-Package ChargeBee -Version {MAJOR}.{MINOR}.{PATCH}\n```\nFor example, the following commands are valid:\n\n- Install the latest version:\n```shell\n$ Install-Package ChargeBee -Version 3.0.0\n```\n\n- Install an earlier version, say v2.5.1:\n```shell\n$ Install-Package ChargeBee -Version 2.5.1\n```\n\n## Use the library\n***\nSome examples for using the library are listed below.\n\n### [Create a new subscription](https://apidocs.chargebee.com/docs/api/subscriptions?prod_cat_ver=2\u0026lang=dotnet#create_subscription_for_items)\n\n```cs\nusing ChargeBee.Api;\nusing ChargeBee.Models;\nApiConfig.Configure(\"site\",\"api_key\");\nEntityResult result = Subscription.Create()\n              .PlanId(\"basic\")\n              .Request();\nSubscription subscription = result.Subscription;\nCustomer customer = result.Customer;\n```\n\n### Create an idempotent request\n[Idempotency keys](https://apidocs.chargebee.com/docs/api/idempotency?prod_cat_ver=2) are passed along with request headers to allow a safe retry of POST requests. \n\n```cs\nusing ChargeBee.Api;\nusing ChargeBee.Models;\nApiConfig.Configure(\"site\",\"api_key\");\nEntityResult result = Customer.Create()\n    .FirstName(\"John\")\n    .LastName(\"Doe\")\n    .Email(\"john@test.com\")\n    .SetIdempotencyKey(\"\u003c\u003cUUID\u003e\u003e\") // Replace \u003c\u003cUUID\u003e\u003e with a unique string\n    .Request();\nCustomer customer = result.Customer;\nConsole.WriteLine(ApiConfig.SerializeObject(customer));\nHttpResponseHeaders httpResponseHeaders = result.ResponseHeaders; // Retrieves response headers\nConsole.WriteLine(httpResponseHeaders);\nstring idempotencyReplayedValue = result.IsIdempotencyReplayed(); // Retrieves idempotency replayed header value \nConsole.WriteLine(idempotencyReplayedValue);\n\n```\n`isIdempotencyReplayed()` method can be accessed to differentiate between original and replayed requests.\n\n### Serialize an object\n\n```cs\nApiConfig.SerializeObject(obj);\n```\n\n\n### Deserialize an object\n\n```cs\nApiConfig.DeserializeObject\u003cT\u003e(jsonString);\n```\n\n### Retry Handling\n\nChargebee's SDK includes built-in retry logic to handle temporary network issues and server-side errors. This feature is **disabled by default** but can be **enabled when needed**.\n\n#### Key features include:\n\n- **Automatic retries for specific HTTP status codes**: Retries are automatically triggered for status codes `500`, `502`, `503`, and `504`.\n- **Exponential backoff**: Retry delays increase exponentially to prevent overwhelming the server.\n- **Rate limit management**: If a `429 Too Many Requests` response is received with a `Retry-After` header, the SDK waits for the specified duration before retrying.  \n  \u003e *Note: Exponential backoff and max retries do not apply in this case.*\n- **Customizable retry behavior**: Retry logic can be configured using the `retryConfig` parameter in the environment configuration.\n\n#### Example: Customizing Retry Logic\n\nYou can enable and configure the retry logic by passing a `retryConfig` object when initializing the Chargebee environment:\n\n```cs\nusing ChargeBee.Api;\nusing ChargeBee.Models;\nApiConfig.Configure(\"site\",\"api_key\");\n\nChargeBee.Api.RetryConfig retryConfig = new ChargeBee.Api.RetryConfig\n    {\n        Enabled = true, // Enable retry logic\n        MaxRetries = 5, // Maximum number of retries\n        DelayMs = 300, // Initial delay between retries in milliseconds\n        RetryOnStatus = [500] // HTTP status codes to retry on\n    };\nApiConfig.UpdateRetryConfig(retryConfig);\nEntityResult result = Customer.Create()\n    .FirstName(\"John\")\n    .LastName(\"Doe\")\n    .Email(\"john@test.com\")\n    .Reqeust();\n\n```\n\n#### Example: Rate Limit retry logic\n\nYou can enable and configure the retry logic for rate-limit by passing a `retryConfig` object when initializing the Chargebee environment:\n\n\n```cs\nusing ChargeBee.Api;\nusing ChargeBee.Models;\nApiConfig.Configure(\"site\",\"api_key\");\n\nChargeBee.Api.RetryConfig retryConfig = new ChargeBee.Api.RetryConfig\n    {\n        Enabled = true, // Enable retry logic\n        MaxRetries = 5, // Maximum number of retries\n        DelayMs = 300, // Initial delay between retries in milliseconds\n        RetryOnStatus = [429] // HTTP status codes to retry on\n    };\nApiConfig.UpdateRetryConfig(retryConfig);\nEntityResult result = Customer.Create()\n    .FirstName(\"John\")\n    .LastName(\"Doe\")\n    .Email(\"john@test.com\")\n    .Reqeust();\n    \n```\n\n## Contribution\n***\nYou may contribute patches to any of the **Active** versions of this library. To do so, raise a PR against the [respective branch](#library-versions).\n\nIf you find something amiss, you are welcome to create an [issue](https://github.com/chargebee/chargebee-dotnet/issues).\n\n## API documentation\n***\n\nThe API documentation for the .NET library can be found in our [API reference](https://apidocs.chargebee.com/docs/api?lang=dotnet).\n\n## License\n***\nSee the [LICENSE](LICENSE).\n***\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchargebee%2Fchargebee-dotnet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchargebee%2Fchargebee-dotnet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchargebee%2Fchargebee-dotnet/lists"}