Aeroverra.PayPalSharp 0.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Aeroverra.PayPalSharp --version 0.0.2
                    
NuGet\Install-Package Aeroverra.PayPalSharp -Version 0.0.2
                    
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="Aeroverra.PayPalSharp" Version="0.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aeroverra.PayPalSharp" Version="0.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Aeroverra.PayPalSharp" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aeroverra.PayPalSharp --version 0.0.2
                    
#r "nuget: Aeroverra.PayPalSharp, 0.0.2"
                    
#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.
#:package Aeroverra.PayPalSharp@0.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aeroverra.PayPalSharp&version=0.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Aeroverra.PayPalSharp&version=0.0.2
                    
Install as a Cake Tool

AeroPayPalSharp

A strict-typed PayPal REST client for modern .NET, with first-class partner / platform (multiparty) support.

Why

The existing .NET options for PayPal are dated and loosely typed, and none cleanly support the partner APIs (acting on behalf of sellers). AeroPayPalSharp is generated from PayPal's official OpenAPI specs and then tightened so responses are actually typed instead of everything-nullable. It wraps all of PayPal's REST APIs behind one injectable client, handles OAuth for you, and makes partner flows (auth assertion, attribution) first-class.

  • All of PayPal's REST APIs, one injectable IPayPalApiClient
  • Strongly-typed models, plus typed value constants (PayPalIntent.Capture, PayPalCurrency.Usd, ...) with an IsKnown validator instead of magic strings
  • PayPal's enum fields stay strings under the hood, so a value PayPal adds later never crashes deserialization
  • OAuth2 fetched, cached, and refreshed automatically
  • Partner attribution and auth assertion built in, including a clean ActingAsMerchant scope
  • .NET 10, Newtonsoft.Json

Install

dotnet add package AeroPayPalSharp

Getting started

Configure and inject (keep the client id / secret in user-secrets or env vars):

services.AddPayPalSharp(options =>
{
    options.Environment  = PayPalEnvironment.Sandbox;   // or Live
    options.ClientId     = config["PayPal:ClientId"];
    options.ClientSecret = config["PayPal:ClientSecret"];
    // options.PartnerAttributionId = config["PayPal:PartnerAttributionId"]; // optional: partner/platform BN code
});

Create an order and read it back:

public sealed class Checkout(IPayPalApiClient paypal)
{
    public async Task<string> CreateOrder()
    {
        var order = new Order_request
        {
            Intent = PayPalIntent.Capture,
            Purchase_units = new List<Purchase_units>
            {
                new Purchase_units { Amount = new Amount3 { Currency_code = PayPalCurrency.Usd, Value = "10.00" } },
            },
        };

        Order created = await paypal.Orders.CreateAsync(order, payPal_Request_Id: Guid.NewGuid().ToString("N"));
        Order fetched = await paypal.Orders.GetAsync(created.Id);
        return fetched.Status;   // compare with PayPalOrderStatus.Created, etc.
    }
}

Values like PayPalIntent.Capture and PayPalCurrency.Usd are typed constants (with an IsKnown validator) so you never hand-type a magic string. See Constants and enums.

As a partner, acting for a seller

Direct the funds to the seller with payee.merchant_id, and run the call on their behalf with an ActingAsMerchant scope (it adds the PayPal-Auth-Assertion header for that merchant):

using (paypal.ActingAsMerchant(sellerMerchantId))
{
    var order = new Order_request
    {
        Intent = "CAPTURE",
        Purchase_units = new List<Purchase_units>
        {
            new Purchase_units
            {
                Amount = new Amount3 { Currency_code = PayPalCurrency.Usd, Value = "10.00" },
                Payee  = new Payee3 { Merchant_id = sellerMerchantId },   // who gets the money
            },
        },
    };

    Order created = await paypal.Orders.CreateAsync(order, payPal_Request_Id: Guid.NewGuid().ToString("N"));
}

Documentation

Everything else lives in the wiki:

License

MIT. See LICENSE.md.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.0.17 108 7/7/2026
0.0.16 92 7/7/2026
0.0.15 95 7/7/2026
0.0.14 94 7/7/2026
0.0.13 99 7/7/2026
0.0.12 102 7/7/2026
0.0.11 102 7/7/2026
0.0.10 94 7/7/2026
0.0.9 94 7/7/2026
0.0.8 93 7/6/2026
0.0.7 100 7/6/2026
0.0.6 87 7/6/2026
0.0.5 96 7/6/2026
0.0.4 90 7/5/2026
0.0.3 93 7/5/2026
0.0.2 93 7/5/2026
0.0.1 91 7/5/2026
0.0.0 95 7/5/2026