recurly-api-client 1.17.13

There is a newer version of this package available.
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
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="recurly-api-client" Version="1.17.13" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add recurly-api-client --version 1.17.13
#r "nuget: recurly-api-client, 1.17.13"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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. AccountAccounts). 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 Compatible and additional computed target framework versions.
.NET Framework net47 is compatible.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.17.38 97 4/4/2024
1.17.37 112 3/19/2024
1.17.36 123 3/13/2024
1.17.34 305 12/6/2023
1.17.33 619 8/1/2023
1.17.31 291 6/13/2023
1.17.30 252 5/30/2023
1.17.28 277 4/26/2023
1.17.27 300 4/13/2023
1.17.26 346 4/5/2023
1.17.25 7,649 2/22/2023
1.17.24 420 2/6/2023
1.17.23 17,981 1/11/2023
1.17.22 568 11/30/2022
1.17.21 569 11/15/2022
1.17.20 569 11/10/2022
1.17.19 624 10/27/2022
1.17.18 622 10/20/2022
1.17.17 8,143 8/31/2022
1.17.16 636 8/24/2022
1.17.15 2,260 6/17/2022
1.17.14 1,621 3/9/2022
1.17.13 22,128 10/27/2021
1.17.12 6,138 6/16/2021
1.17.11 5,823 4/22/2021
1.17.10 1,610 2/22/2021
1.17.9 8,763 11/5/2020
1.17.8 943 9/17/2020
1.17.7 2,127 8/20/2020
1.17.6 1,417 7/22/2020
1.17.5 1,034 6/30/2020
1.17.4 1,994 4/15/2020
1.17.3 1,923 3/27/2020
1.17.2 10,341 2/20/2020
1.17.1 930 2/18/2020
1.17.0 4,390 11/21/2019
1.16.3 3,810 10/22/2019
1.16.2 3,988 9/13/2019
1.16.1 18,081 8/21/2019
1.16.0 35,292 7/16/2019
1.15.8 1,394 6/27/2019
1.15.7 1,019 6/18/2019
1.15.6 1,207 5/21/2019
1.15.5 5,588 4/30/2019
1.15.4 2,354 3/19/2019
1.15.3 982 3/12/2019
1.15.2 1,293 2/19/2019
1.15.1 1,097 2/7/2019
1.15.0 1,176 2/5/2019
1.14.1 30,667 12/11/2018
1.14.0 1,412 10/30/2018
1.13.1 1,269 9/25/2018
1.13.0 1,308 9/12/2018
1.13.0-alpha 875 9/12/2018
1.12.5 45,798 7/30/2018
1.12.4 87,410 7/6/2018
1.12.3 2,885 6/27/2018
1.12.2 1,318 6/26/2018
1.12.1 1,409 6/22/2018
1.12.0 28,456 5/29/2018
1.11.4 4,698 5/16/2018
1.11.3 2,755 5/9/2018
1.11.2 10,111 4/3/2018
1.11.1 1,359 4/2/2018
1.11.0 1,528 3/13/2018
1.10.1 1,649 5/9/2018
1.10.0 1,416 3/6/2018
1.9.2 4,903 5/9/2018
1.9.1 2,256 1/23/2018
1.9.0 8,609 12/1/2017
1.8.2 20,978 5/9/2018
1.8.1 12,091 11/9/2017
1.8.0 10,357 10/27/2017
1.7.2 1,370 5/9/2018
1.7.1 1,391 11/9/2017
1.7.0 1,717 10/18/2017
1.6.3 1,331 5/9/2018
1.6.2 1,384 11/9/2017
1.6.1 1,696 10/4/2017
1.6.0 4,884 9/6/2017
1.5.4 1,790 5/9/2018
1.5.3 1,732 11/9/2017
1.5.2 1,667 11/9/2017
1.5.1 20,096 6/27/2017
1.5.0 1,814 6/7/2017
1.4.15 2,485 5/9/2018
1.4.14 1,597 11/9/2017
1.4.13 1,917 5/4/2017
1.4.12 1,982 4/6/2017
1.4.11 6,625 2/17/2017
1.4.10 1,777 2/6/2017
1.4.9 1,823 1/20/2017
1.4.8 1,777 1/20/2017
1.4.7 3,717 1/11/2017
1.4.6 1,737 1/9/2017
1.4.5 2,283 12/6/2016
1.4.4 1,868 11/17/2016
1.4.3 3,688 10/24/2016
1.4.2 2,010 10/3/2016
1.4.1 2,332 9/21/2016
1.4.0 2,110 9/19/2016
1.3.3 12,487 5/9/2018
1.3.2 1,561 11/9/2017
1.3.1 9,007 11/19/2015
1.3.0 2,024 11/19/2015
1.2.9 2,264 5/9/2018
1.2.8 1,405 11/9/2017
1.2.7 1,900 11/17/2015
1.2.6 1,805 11/4/2015
1.2.5 1,731 11/3/2015
1.2.4 2,084 9/15/2015
1.2.3 2,157 8/14/2015
1.2.2 5,175 7/6/2015
1.2.1 2,035 5/26/2015
1.2.0 2,092 4/28/2015
1.1.11 1,324 5/9/2018
1.1.10 1,435 11/9/2017
1.1.9 2,416 4/1/2015
1.1.8 2,107 1/27/2015
1.1.7 2,291 12/19/2014
1.1.6 2,148 9/19/2014
1.1.5 1,988 7/31/2014
1.1.4 1,826 7/23/2014
1.1.3 1,801 7/22/2014
1.1.2 23,555 6/27/2014
1.1.1 1,886 5/1/2014
1.1.0 1,889 5/1/2014
1.0.2 1,342 5/9/2018
1.0.1 4,577 11/9/2017
1.0.0 2,149 4/21/2014