payload-api 0.2.5

Install-Package payload-api -Version 0.2.5
dotnet add package payload-api --version 0.2.5
<PackageReference Include="payload-api" Version="0.2.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add payload-api --version 0.2.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: payload-api, 0.2.5"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install payload-api as a Cake Addin
#addin nuget:?package=payload-api&version=0.2.5

// Install payload-api as a Cake Tool
#tool nuget:?package=payload-api&version=0.2.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Payload C# Library

A C# library for integrating Payload.


1) Download

Download the latest version from GitHub.

2) Include in Project

Include the Payload folder in your Visual Studio project.


nuget install payload-api

Get Started

Once you've included the Payload C# library in your project, include the Payload namespace to get started.

All Payload objects and methods are accessible using the pl static class.

API Authentication

To authenticate with the Payload API, you'll need a live or test API key. API keys are accessible from within the Payload dashboard.

using Payload;
pl.api_key = "secret_key_3bW9JMZtPVDOfFNzwRdfE";

Creating an Object

Interfacing with the Payload API is done primarily through Payload Objects. Below is an example of creating a customer using the pl.Customer object.

// Create a Customer
var customer = pl.Customer.create(new {
    name="Matt Perez"
// Create a Payment
var payment = pl.Payment.create(new {
    payment_method=new pl.Card(new{
        card_number="4242 4242 4242 4242"

Accessing Object Attributes

Object attributes are accessible through both dot and bracket notation.


Updating an Object

Updating an object is a simple call to the update object method.

// Updating a customer's email
customer.update(new { email="" });

Selecting Objects

Objects can be selected using any of their attributes.

// Select a customer by email
var customers = pl.Customer.filter_by(new {

Use the pl.attr attribute helper interface to write powerful queries with a little extra syntax sugar.

var payments = pl.Payment.filter_by(,,
    pl.attr.description.contains("Test"), DateTime(2019,2,1))

Testing the Payload C# Library

Tests are contained within the PayloadTests/ directory. To run tests enter the command in terminal

API_KEY=your_test_secret_key dotnet test


To get further information on Payload's C# library and API capabilities, visit the unabridged Payload Documentation.

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
0.2.5 157 6/3/2021
0.2.4 135 3/18/2021
0.2.3 105 3/17/2021
0.2.2 233 12/3/2020
0.2.1 194 9/7/2020
0.2.0 171 8/26/2020
0.1.12 397 2/27/2020
0.1.10 285 1/13/2020
0.1.9 518 12/17/2019
0.1.8 279 12/4/2019
0.1.7 231 12/4/2019
0.1.6 300 6/19/2019
0.1.5 268 6/19/2019
0.1.4 268 6/16/2019
0.1.3 270 6/16/2019