recurly-api-client
1.17.13
See the version list below for details.
dotnet add package recurly-api-client --version 1.17.13
NuGet\Install-Package recurly-api-client -Version 1.17.13
<PackageReference Include="recurly-api-client" Version="1.17.13" />
paket add recurly-api-client --version 1.17.13
#r "nuget: recurly-api-client, 1.17.13"
// Install recurly-api-client as a Cake Addin #addin nuget:?package=recurly-api-client&version=1.17.13 // Install recurly-api-client as a Cake Tool #tool nuget:?package=recurly-api-client&version=1.17.13
Recurly .NET Client
The Official .NET Recurly API client library.
Compatible with Recurly API v2.
Versions >= 1.13.0 of this library are targeted against .NET v4.7. Versions < 1.13.0 are targeted against .NET v3.5.
Installation
If you use NuGet, simply run the following:
PM> Install-Package recurly-api-client
You may also visit our Releases page to
download the latest version. Then add the Recurly.dll
as a
reference to your solution.
Alternatively, you can use use git to work with the latest changes in development.
git clone git://github.com/recurly/recurly-client-net.git C:\path\to\recurly
For more information about getting started with git, please check out the Github Guide for Windows.
Configuration
To configure the library, you will need your API Key and site subdomain. The recommended way to configure the library is to statically initialize it:
// pageSize is optional and defaults to 200
Recurly.Configuration.SettingsManager.Initialize(apiKey, subdomain, privateKey, pageSize);
// requestTimeoutMilliseconds is optional and defaults to null
Recurly.Configuration.SettingsManager.Initialize(apiKey, subdomain, privateKey, pageSize, requestTimeoutMilliseconds);
We recommend doing this for compatibility with newer .NET frameworks as well as security. We also recommend you encrypt your api key at rest or use a secrets service. You should not store your api key in plain text on your system.
Configuration Security Note
If you are using the legacy method of configuring with app.config
or web.config
, we strongly recommend updating your
updating your application to use the above method.
Client Documentation
The API documentation is available on our developer docs site. Examples can be found there for each API endpoint.
.NET core and standard support
Although we do not officially support .NET core or standard at this moment, it is possible to use this library from those applications. One method is to vendor the source code, build the dll, and link directly to it from your project.
To build the library you can now use msbuild:
msbuild /p:Configuration=Release Recurly.sln
To use the dll, you can reference it in your .csproj
file:
<ItemGroup>
<Reference Include="Recurly">
<HintPath>{pathToRecurlyLibrary}/Library/bin/Release/Recurly.dll</HintPath>
</Reference>
</ItemGroup>
Overview Usage
Creating Resources
To create a resource, initialize it, set the desired parameters, then call Create()
.
The instance will be auto-updated with the new details from the server. Here is an
example of creating an Account:
var account = new Account("123")
{
FirstName = "John",
LastName = "Smith"
};
account.Create();
Console.WriteLine(account.CreatedAt);
Fetching Resources
All resources have some kind of identifier. The API docs site should help you understand how to reference
the resource you want. In the case of the Account
, we can reference it by AccountCode
. Call Get
on a
resource class to fetch the resource with the given identifier.
var account = Accounts.Get("123");
Pagination
Sometimes, if you wish to enumerate many resources on the server, you will need to make multiple HTTP calls to the server.
This is called pagination. Pagination in this library is handled by the RecurlyList
class. An instance of this class can be
created by calling List()
on the plural-named resource class (e.g. Account
→ Accounts
). For example, suppose we wish to
iterate over every account on our site:
// returns a RecurlyList instance
var accounts = Accounts.List();
// while the server still has accounts to give
while (accounts.Any())
{
// iterate through each account in this "page"
foreach (var account in accounts)
Console.WriteLine(account);
// fetch the next "page" of accounts
accounts = accounts.Next;
}
It's also possible to sort and/or filter this stream of resources by passing in parameters to the List()
method and
using the FilterCriteria
class. Here is an example of sorting and filtering accounts:
var filter = FilterCriteria.Instance // create the instance
.WithOrder(FilterCriteria.Order.Desc) // order the results in "descending" order
.WithSort(FilterCriteria.Sort.UpdatedAt) // sort by the `UpdatedAt` property
.WithBeginTime(new DateTime(2017, 1, 1)) // filter out any accounts updated before January 1st, 2017
.WithEndTime(DateTime.UtcNow); // filter accounts updated to this moment (could be any date after `BeginTime`)
// The first parameter of Accounts.List allows you to filter by the `State` of the account.
// In this case, let's only look at `Active` accounts.
var accounts = Accounts.List(Account.AccountState.Active, filter);
foreach (var account in accounts)
{
Console.Write(account.AccountCode + ": ");
Console.WriteLine(account.UpdatedAt);
}
Every List()
method takes a FilterCriteria
as the final parameter, but differs in the endpoint specific filters.
The best way to learn about this is by looking at the source code or the code docs.
Testing
The test suite can be run using the scripts/test
script. This script provides some optional configuration that can be viewed by passing the -h
flag:
$ ./scripts/test -h
Supported Options:
-R Use the Release build configuration (Debug is used by default).
-r Output test results to test-report.html file.
-c Test class to run. Cannot be used with -m option.
-m Test method to run. Cannot be used with -c option.
-h Print this help.
Example:
./scripts/test -m SettingsTest.ValidDomainTest
./scripts/test -c SettingsTest -r
Support
Looking for help? Please contact support@recurly.com or visit support.recurly.com.
It's also acceptable to post a question, problem, or request as a GitHub issue on this repository and the developers will try to get back to you in a timely manner.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net47 is compatible. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated | |
---|---|---|---|
1.18.4 | 171 | 11/13/2024 | |
1.18.3 | 251 | 8/28/2024 | |
1.18.2 | 198 | 8/21/2024 | |
1.18.1 | 201 | 7/3/2024 | |
1.18.0 | 9,997 | 5/8/2024 | |
1.17.38 | 2,921 | 4/4/2024 | |
1.17.37 | 232 | 3/19/2024 | |
1.17.36 | 227 | 3/13/2024 | |
1.17.34 | 446 | 12/6/2023 | |
1.17.33 | 967 | 8/1/2023 | |
1.17.31 | 398 | 6/13/2023 | |
1.17.30 | 371 | 5/30/2023 | |
1.17.28 | 387 | 4/26/2023 | |
1.17.27 | 418 | 4/13/2023 | |
1.17.26 | 453 | 4/5/2023 | |
1.17.25 | 11,752 | 2/22/2023 | |
1.17.24 | 528 | 2/6/2023 | |
1.17.23 | 19,263 | 1/11/2023 | |
1.17.22 | 678 | 11/30/2022 | |
1.17.21 | 689 | 11/15/2022 | |
1.17.20 | 678 | 11/10/2022 | |
1.17.19 | 736 | 10/27/2022 | |
1.17.18 | 734 | 10/20/2022 | |
1.17.17 | 8,716 | 8/31/2022 | |
1.17.16 | 750 | 8/24/2022 | |
1.17.15 | 2,405 | 6/17/2022 | |
1.17.14 | 1,915 | 3/9/2022 | |
1.17.13 | 22,565 | 10/27/2021 | |
1.17.12 | 6,265 | 6/16/2021 | |
1.17.11 | 5,946 | 4/22/2021 | |
1.17.10 | 1,731 | 2/22/2021 | |
1.17.9 | 8,888 | 11/5/2020 | |
1.17.8 | 1,061 | 9/17/2020 | |
1.17.7 | 2,351 | 8/20/2020 | |
1.17.6 | 1,541 | 7/22/2020 | |
1.17.5 | 1,179 | 6/30/2020 | |
1.17.4 | 2,308 | 4/15/2020 | |
1.17.3 | 2,108 | 3/27/2020 | |
1.17.2 | 11,894 | 2/20/2020 | |
1.17.1 | 1,050 | 2/18/2020 | |
1.17.0 | 4,845 | 11/21/2019 | |
1.16.3 | 4,684 | 10/22/2019 | |
1.16.2 | 4,419 | 9/13/2019 | |
1.16.1 | 18,195 | 8/21/2019 | |
1.16.0 | 43,357 | 7/16/2019 | |
1.15.8 | 1,511 | 6/27/2019 | |
1.15.7 | 1,138 | 6/18/2019 | |
1.15.6 | 1,320 | 5/21/2019 | |
1.15.5 | 8,767 | 4/30/2019 | |
1.15.4 | 2,472 | 3/19/2019 | |
1.15.3 | 1,079 | 3/12/2019 | |
1.15.2 | 1,407 | 2/19/2019 | |
1.15.1 | 1,212 | 2/7/2019 | |
1.15.0 | 1,289 | 2/5/2019 | |
1.14.1 | 32,276 | 12/11/2018 | |
1.14.0 | 1,529 | 10/30/2018 | |
1.13.1 | 1,396 | 9/25/2018 | |
1.13.0 | 1,430 | 9/12/2018 | |
1.13.0-alpha | 994 | 9/12/2018 | |
1.12.5 | 49,384 | 7/30/2018 | |
1.12.4 | 90,728 | 7/6/2018 | |
1.12.3 | 3,007 | 6/27/2018 | |
1.12.2 | 1,444 | 6/26/2018 | |
1.12.1 | 1,526 | 6/22/2018 | |
1.12.0 | 29,288 | 5/29/2018 | |
1.11.4 | 5,030 | 5/16/2018 | |
1.11.3 | 2,878 | 5/9/2018 | |
1.11.2 | 10,246 | 4/3/2018 | |
1.11.1 | 1,483 | 4/2/2018 | |
1.11.0 | 1,652 | 3/13/2018 | |
1.10.1 | 1,756 | 5/9/2018 | |
1.10.0 | 1,532 | 3/6/2018 | |
1.9.2 | 5,028 | 5/9/2018 | |
1.9.1 | 2,379 | 1/23/2018 | |
1.9.0 | 8,756 | 12/1/2017 | |
1.8.2 | 21,138 | 5/9/2018 | |
1.8.1 | 12,288 | 11/9/2017 | |
1.8.0 | 10,746 | 10/27/2017 | |
1.7.2 | 1,486 | 5/9/2018 | |
1.7.1 | 1,519 | 11/9/2017 | |
1.7.0 | 1,840 | 10/18/2017 | |
1.6.3 | 1,460 | 5/9/2018 | |
1.6.2 | 1,509 | 11/9/2017 | |
1.6.1 | 1,802 | 10/4/2017 | |
1.6.0 | 5,007 | 9/6/2017 | |
1.5.4 | 1,918 | 5/9/2018 | |
1.5.3 | 1,851 | 11/9/2017 | |
1.5.2 | 1,796 | 11/9/2017 | |
1.5.1 | 20,234 | 6/27/2017 | |
1.5.0 | 1,937 | 6/7/2017 | |
1.4.15 | 2,903 | 5/9/2018 | |
1.4.14 | 1,721 | 11/9/2017 | |
1.4.13 | 2,040 | 5/4/2017 | |
1.4.12 | 2,104 | 4/6/2017 | |
1.4.11 | 6,750 | 2/17/2017 | |
1.4.10 | 1,893 | 2/6/2017 | |
1.4.9 | 1,945 | 1/20/2017 | |
1.4.8 | 1,901 | 1/20/2017 | |
1.4.7 | 3,833 | 1/11/2017 | |
1.4.6 | 1,855 | 1/9/2017 | |
1.4.5 | 2,410 | 12/6/2016 | |
1.4.4 | 1,988 | 11/17/2016 | |
1.4.3 | 3,797 | 10/24/2016 | |
1.4.2 | 2,140 | 10/3/2016 | |
1.4.1 | 2,458 | 9/21/2016 | |
1.4.0 | 2,233 | 9/19/2016 | |
1.3.3 | 12,629 | 5/9/2018 | |
1.3.2 | 1,682 | 11/9/2017 | |
1.3.1 | 9,608 | 11/19/2015 | |
1.3.0 | 2,145 | 11/19/2015 | |
1.2.9 | 2,674 | 5/9/2018 | |
1.2.8 | 1,524 | 11/9/2017 | |
1.2.7 | 2,018 | 11/17/2015 | |
1.2.6 | 1,925 | 11/4/2015 | |
1.2.5 | 1,854 | 11/3/2015 | |
1.2.4 | 2,207 | 9/15/2015 | |
1.2.3 | 2,282 | 8/14/2015 | |
1.2.2 | 5,296 | 7/6/2015 | |
1.2.1 | 2,156 | 5/26/2015 | |
1.2.0 | 2,211 | 4/28/2015 | |
1.1.11 | 1,445 | 5/9/2018 | |
1.1.10 | 1,553 | 11/9/2017 | |
1.1.9 | 2,541 | 4/1/2015 | |
1.1.8 | 2,232 | 1/27/2015 | |
1.1.7 | 2,396 | 12/19/2014 | |
1.1.6 | 2,277 | 9/19/2014 | |
1.1.5 | 2,110 | 7/31/2014 | |
1.1.4 | 1,950 | 7/23/2014 | |
1.1.3 | 1,925 | 7/22/2014 | |
1.1.2 | 23,930 | 6/27/2014 | |
1.1.1 | 2,006 | 5/1/2014 | |
1.1.0 | 2,006 | 5/1/2014 | |
1.0.2 | 1,460 | 5/9/2018 | |
1.0.1 | 4,905 | 11/9/2017 | |
1.0.0 | 2,296 | 4/21/2014 |