{"id":34188466,"url":"https://github.com/blacklightcms/recurly","last_synced_at":"2026-03-12T19:35:28.035Z","repository":{"id":35583651,"uuid":"39856256","full_name":"blacklightcms/recurly","owner":"blacklightcms","description":"A Recurly API client written in golang. Actively maintained and unit tested. No external dependencies.","archived":false,"fork":false,"pushed_at":"2022-08-11T23:20:56.000Z","size":609,"stargazers_count":41,"open_issues_count":9,"forks_count":42,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-18T15:17:10.542Z","etag":null,"topics":["api-client","billing","golang","payment","recurly","recurring-payments","saas","subscription"],"latest_commit_sha":null,"homepage":"","language":"Go","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/blacklightcms.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-28T20:30:38.000Z","updated_at":"2024-04-03T17:48:49.000Z","dependencies_parsed_at":"2022-08-29T20:31:32.689Z","dependency_job_id":null,"html_url":"https://github.com/blacklightcms/recurly","commit_stats":null,"previous_names":["blacklightcms/go-recurly"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/blacklightcms/recurly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklightcms%2Frecurly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklightcms%2Frecurly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklightcms%2Frecurly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklightcms%2Frecurly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blacklightcms","download_url":"https://codeload.github.com/blacklightcms/recurly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blacklightcms%2Frecurly/sbom","scorecard":{"id":242201,"data":{"date":"2025-08-11","repo":{"name":"github.com/blacklightcms/recurly","commit":"0c0179ff07f4a54b8c535bbd1e8fc59d1737d595"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.2,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":9,"reason":"Found 27/30 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T06:52:35.759Z","repository_id":35583651,"created_at":"2025-08-17T06:52:35.759Z","updated_at":"2025-08-17T06:52:35.759Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30440011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-12T14:34:45.044Z","status":"ssl_error","status_checked_at":"2026-03-12T14:09:33.793Z","response_time":114,"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":["api-client","billing","golang","payment","recurly","recurring-payments","saas","subscription"],"created_at":"2025-12-15T15:35:13.080Z","updated_at":"2026-03-12T19:35:28.026Z","avatar_url":"https://github.com/blacklightcms.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Recurly Client for Go\n\n [![Build Status](https://travis-ci.org/blacklightcms/recurly.svg?branch=master)](https://travis-ci.org/blacklightcms/recurly)  [![GoDoc](https://godoc.org/github.com/blacklightcms/recurly?status.svg)](https://godoc.org/github.com/blacklightcms/recurly/)\n\n Recurly is a Go (golang) API Client for the [Recurly](https://recurly.com/) API. It is actively maintained, unit tested, and uses no external dependencies. The vast majority of the API is implemented.\n\n Supports:\n  - Recurly API `v2.27`\n  - Accounts\n  - Add Ons\n  - Adjustments\n  - Billing\n  - Coupons\n  - Credit Payments\n  - Invoices\n  - Plans\n  - Purchases\n  - Redemptions\n  - Shipping Addresses\n  - Shipping Methods\n  - Subscriptions\n  - Transactions\n\n## Installation\nInstall:\n\n```shell\ngo get github.com/blacklightcms/recurly\n```\n\nImport:\n```go\nimport \"github.com/blacklightcms/recurly\"\n```\n\nResources:\n - [API Docs](https://godoc.org/github.com/blacklightcms/recurly/)\n - [Examples](https://godoc.org/github.com/blacklightcms/recurly/#pkg-examples)\n\n## Note on v1 and breaking changes\nIf migrating from a previous version of the library, there was a large refactor with breaking changes released to address some design issues with the library. See the [migration guide](https://github.com/blacklightcms/recurly/wiki/v1-Migration-Guide) for steps on how to migrate to the latest version.\n\nThis is recommended for all users.\n\n## Quickstart\n\nConstruct a new Recurly client, then use the various services on the client to access different parts of the Recurly API. For example:\n\n```go\nclient := recurly.NewClient(\"your-subdomain\", \"APIKEY\")\n\n// Retrieve an account\na, err := client.Accounts.Get(context.Background(), \"1\")\n```\n\n## Examples and How To\nPlease go through [examples](https://godoc.org/github.com/blacklightcms/recurly/#pkg-examples) for detailed examples of using this package.\n\nThe examples explain important cases like:\n\n- Null Types\n- Error Handling\n- Get Methods\n- Pagination\n\nHere are a few snippets to demonstrate library usage.\n\n### Create Account\n```go\naccount, err := client.Accounts.Create(ctx, recurly.Account{\n    Code: \"1\",\n    FirstName: \"Verena\",\n    LastName: \"Example\",\n    Email: \"verena@example.com\",\n})\n```\n\n\u003e **NOTE**: An account can also be created along a subscription by embedding the \n\u003e account in the subscription during creation. The purchases API also supports \n\u003e this, and likely other endpoints. See Recurly's documentation for details.\n\n### Get Account\n```go\naccount, err := client.Accounts.Get(ctx, \"1\")\nif err != nil {\n    return err\n} else if account == nil {\n    // account not found\n    // Note: this nil, nil response on 404s is unique to Get() methods\n    // See GoDoc for details.\n}\n```\n\n### Create Billing Info\n```go\n// Using token obtained with recurly.js\n// If you want to set billing info directly, omit the token and set the\n// corresponding fields on the recurly.Billing struct.\nbilling, err := client.Billing.Create(\"1\", recurly.Billing{\n    Token: token,\n})\n```\n\u003e **NOTE**: See the error handling section in GoDoc for how to handle transaction errors\n\n### Creating Purchases\n\n```go\npurchase, err := c.Client.Purchases.Create(ctx, recurly.Purchase{\n    Account: recurly.Account{\n\t    Code: \"1\",\n    },\n    Adjustments: []recurly.Adjustment{{\n\t    UnitAmountInCents: recurly.NewInt(100),\n\t    Description:       \"Purchase Description\",\n\t    ProductCode:       \"product_code\",\n    }},\n    CollectionMethod: recurly.CollectionMethodAutomatic,\n    Currency:         \"USD\",\n})\nif err != nil {\n    // NOTE: See GoDoc for how to handle failed transaction errors\n}\n```\n\n\u003e **NOTE**: The purchases API supports subscriptions, adjustments, shipping addresses,\n\u003e shipping fees, and more. This is one of many possible examples. See the underlying\n\u003e structs and [Recurly's documentation](https://dev.recurly.com/docs/create-purchase) for more info.\n\n### Creating Subscriptions\n```go\nsubscription, err := client.Subscriptions.Create(ctx, recurly.NewSubscription{\n    PlanCode: \"gold\",\n    Currency: \"USD\",\n    Account: recurly.Account{\n        // Note: Set the Code for an existing account\n        // To create a new account, omit Code but provide other fields\n    },\n})\nif err != nil {\n    // NOTE: See GoDoc for how to handle failed transaction errors\n    return err\n}\n```\n\u003e **NOTE**: Recurly offers several other ways to create subscriptions, often embedded \n\u003e within other requests (such as the `Purchases.Create()` call). See Recurly's \n\u003e documentation for more details.\n\n## Webhooks\nThis library supports webhooks via the `webhooks` sub package. \n\nThe usage is to parse the webhook from a reader, then use a switch statement \nto determine the type of webhook received.\n\n```go\n// import \"github.com/blacklightcms/recurly/webhooks\"\n\nhook, err := webhooks.Parse(r)\nif e, ok := err.(*webhooks.ErrUnknownNotification); ok {\n    // e.Name() holds the name of the notification\n} else if err != nil {\n    // all other errors\n}\n\n// Use a switch statement to determine the type of webhook received.\nswitch h := hook.(type) {\ncase *webhooks.AccountNotification:\n    // h.Account\ncase *webhooks.PaymentNotification:\n    // h.Account\n    // h.Transaction\ncase *webhooks.SubscriptionNotification:\n    // h.Account\n    // h.Subscription\ndefault:\n    // webhook not listed above\n}\n```\n\n## Testing\nOnce you've imported this library into your application, you will want to add tests.\n\nInternally this library sets up a test HTTPs server and validates methods, paths, \nquery strings, request body, and returns XML. You will not need to worry about those internals\nwhen testing your own code that uses this library.\n\nInstead we recommend using the `mock` package. The `mock` package provides mocks \nfor all of the different services in this library.\n\nFor examples of how to test your code using mocks, visit the [GoDoc examples](https://godoc.org/github.com/blacklightcms/recurly/mock/).\n\n\u003e **NOTE**: If you need to go beyond mocks and test requests/responses, `testing.go` exports `TestServer`. This is how the library tests itself. See the GoDoc or the `*_test.go` files for usage examples.\n\n## Contributing\n\nWe use [`dep`](https://github.com/golang/dep) for dependency management. If you \ndo not have it installed, see the [installation instructions](https://github.com/golang/dep#installation).\n\nTo contribute: fork and clone the repository, `cd` into the directory, and run:\n\n```shell\ndep ensure\n```\n\nThat will ensure you have [`google/go-cmp`](https://github.com/google/go-cmp) which is used to run tests.\n\nIf you plan on submitting a patch, please write tests for it.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacklightcms%2Frecurly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblacklightcms%2Frecurly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblacklightcms%2Frecurly/lists"}