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 88 4/4/2024
1.17.37 109 3/19/2024
1.17.36 120 3/13/2024
1.17.34 301 12/6/2023
1.17.33 615 8/1/2023
1.17.31 287 6/13/2023
1.17.30 248 5/30/2023
1.17.28 273 4/26/2023
1.17.27 296 4/13/2023
1.17.26 342 4/5/2023
1.17.25 7,528 2/22/2023
1.17.24 416 2/6/2023
1.17.23 17,700 1/11/2023
1.17.22 564 11/30/2022
1.17.21 567 11/15/2022
1.17.20 567 11/10/2022
1.17.19 622 10/27/2022
1.17.18 620 10/20/2022
1.17.17 8,049 8/31/2022
1.17.16 634 8/24/2022
1.17.15 2,258 6/17/2022
1.17.14 1,613 3/9/2022
1.17.13 22,126 10/27/2021
1.17.12 6,136 6/16/2021
1.17.11 5,821 4/22/2021
1.17.10 1,608 2/22/2021
1.17.9 8,761 11/5/2020
1.17.8 941 9/17/2020
1.17.7 2,123 8/20/2020
1.17.6 1,415 7/22/2020
1.17.5 1,032 6/30/2020
1.17.4 1,991 4/15/2020
1.17.3 1,919 3/27/2020
1.17.2 10,247 2/20/2020
1.17.1 928 2/18/2020
1.17.0 4,367 11/21/2019
1.16.3 3,805 10/22/2019
1.16.2 3,986 9/13/2019
1.16.1 18,079 8/21/2019
1.16.0 35,121 7/16/2019
1.15.8 1,392 6/27/2019
1.15.7 1,017 6/18/2019
1.15.6 1,205 5/21/2019
1.15.5 5,568 4/30/2019
1.15.4 2,352 3/19/2019
1.15.3 980 3/12/2019
1.15.2 1,289 2/19/2019
1.15.1 1,093 2/7/2019
1.15.0 1,172 2/5/2019
1.14.1 30,649 12/11/2018
1.14.0 1,408 10/30/2018
1.13.1 1,265 9/25/2018
1.13.0 1,304 9/12/2018
1.13.0-alpha 873 9/12/2018
1.12.5 45,685 7/30/2018
1.12.4 87,367 7/6/2018
1.12.3 2,879 6/27/2018
1.12.2 1,314 6/26/2018
1.12.1 1,405 6/22/2018
1.12.0 28,443 5/29/2018
1.11.4 4,675 5/16/2018
1.11.3 2,751 5/9/2018
1.11.2 10,090 4/3/2018
1.11.1 1,355 4/2/2018
1.11.0 1,524 3/13/2018
1.10.1 1,645 5/9/2018
1.10.0 1,412 3/6/2018
1.9.2 4,899 5/9/2018
1.9.1 2,252 1/23/2018
1.9.0 8,605 12/1/2017
1.8.2 20,972 5/9/2018
1.8.1 12,086 11/9/2017
1.8.0 10,350 10/27/2017
1.7.2 1,366 5/9/2018
1.7.1 1,387 11/9/2017
1.7.0 1,713 10/18/2017
1.6.3 1,327 5/9/2018
1.6.2 1,380 11/9/2017
1.6.1 1,692 10/4/2017
1.6.0 4,880 9/6/2017
1.5.4 1,786 5/9/2018
1.5.3 1,728 11/9/2017
1.5.2 1,663 11/9/2017
1.5.1 20,092 6/27/2017
1.5.0 1,810 6/7/2017
1.4.15 2,479 5/9/2018
1.4.14 1,593 11/9/2017
1.4.13 1,913 5/4/2017
1.4.12 1,978 4/6/2017
1.4.11 6,621 2/17/2017
1.4.10 1,773 2/6/2017
1.4.9 1,819 1/20/2017
1.4.8 1,773 1/20/2017
1.4.7 3,713 1/11/2017
1.4.6 1,733 1/9/2017
1.4.5 2,279 12/6/2016
1.4.4 1,864 11/17/2016
1.4.3 3,684 10/24/2016
1.4.2 2,006 10/3/2016
1.4.1 2,328 9/21/2016
1.4.0 2,106 9/19/2016
1.3.3 12,483 5/9/2018
1.3.2 1,557 11/9/2017
1.3.1 8,995 11/19/2015
1.3.0 2,022 11/19/2015
1.2.9 2,258 5/9/2018
1.2.8 1,401 11/9/2017
1.2.7 1,898 11/17/2015
1.2.6 1,801 11/4/2015
1.2.5 1,727 11/3/2015
1.2.4 2,080 9/15/2015
1.2.3 2,153 8/14/2015
1.2.2 5,171 7/6/2015
1.2.1 2,031 5/26/2015
1.2.0 2,088 4/28/2015
1.1.11 1,320 5/9/2018
1.1.10 1,431 11/9/2017
1.1.9 2,412 4/1/2015
1.1.8 2,103 1/27/2015
1.1.7 2,287 12/19/2014
1.1.6 2,144 9/19/2014
1.1.5 1,984 7/31/2014
1.1.4 1,820 7/23/2014
1.1.3 1,795 7/22/2014
1.1.2 23,515 6/27/2014
1.1.1 1,880 5/1/2014
1.1.0 1,884 5/1/2014
1.0.2 1,338 5/9/2018
1.0.1 4,571 11/9/2017
1.0.0 2,143 4/21/2014