|
| 1 | +--- |
| 2 | +title: 'dotnet add package Interledger.OpenPayments' |
| 3 | +description: 'The missing link between your C# backend and the future of interoperable digital finance.' |
| 4 | +date: 2026-03-19 |
| 5 | +slug: open-payments-dotnet-sdk |
| 6 | +authors: |
| 7 | + - Cozmin Ungureanu |
| 8 | +author_urls: |
| 9 | + - https://github.com/cozminu |
| 10 | +tags: |
| 11 | + - Releases |
| 12 | + - Open Payments |
| 13 | + - Updates |
| 14 | +--- |
| 15 | + |
| 16 | +We're excited to announce the release of the [**Open Payments .NET SDK**](https://github.com/interledger/open-payments-dotnet), a fully typed, idiomatic C# client for the [Open Payments](https://openpayments.dev/) API standard. If you're building payment experiences in .NET, this SDK gives you everything you need to integrate interoperable payments into your backend. |
| 17 | + |
| 18 | +## What is Open Payments? |
| 19 | + |
| 20 | +[Open Payments](https://openpayments.dev/) is an open API standard that enables interoperable digital payments across banks, digital wallets, and mobile money providers. It covers eCommerce checkout, peer-to-peer transfers, subscriptions, Web Monetization, and more - all through a unified set of APIs for account discovery, payment management, and [GNAP](https://datatracker.ietf.org/doc/html/draft-ietf-gnap-core-protocol)-based authorization. Until now, .NET developers had to wire all of this up manually. Not anymore. |
| 21 | + |
| 22 | +## Why a .NET SDK? |
| 23 | + |
| 24 | +The .NET ecosystem powers a significant share of enterprise backends, fintech platforms, and payment processors worldwide. With this SDK, the same developers who build these systems can now integrate Open Payments natively with the type safety, dependency injection support and async patterns they already know and love. |
| 25 | + |
| 26 | +The SDK is generated from the [official Open Payments OpenAPI specifications](https://github.com/interledger/open-payments), then augmented with hand-crafted client interfaces, GNAP authentication, and automatic [HTTP Message Signatures](https://www.rfc-editor.org/rfc/rfc9421) (Ed25519). You get a clean, high-level API without sacrificing spec compliance. |
| 27 | + |
| 28 | +## Getting Started |
| 29 | + |
| 30 | +Install the NuGet package in your project: |
| 31 | + |
| 32 | +```bash |
| 33 | +dotnet add package Interledger.OpenPayments |
| 34 | +``` |
| 35 | + |
| 36 | +Then set up the client in a few lines: |
| 37 | + |
| 38 | +```csharp |
| 39 | +using Microsoft.Extensions.DependencyInjection; |
| 40 | +using OpenPayments.Sdk.Clients; |
| 41 | +using OpenPayments.Sdk.Extensions; |
| 42 | +using OpenPayments.Sdk.HttpSignatureUtils; |
| 43 | + |
| 44 | +var client = new ServiceCollection() |
| 45 | + .UseOpenPayments(opts => |
| 46 | + { |
| 47 | + opts.UseAuthenticatedClient = true; |
| 48 | + opts.KeyId = "your-key-id"; |
| 49 | + opts.PrivateKey = KeyUtils.LoadPem(yourPrivateKeyPem); |
| 50 | + opts.ClientUrl = new Uri("https://wallet.example.com/your-account"); |
| 51 | + }) |
| 52 | + .BuildServiceProvider() |
| 53 | + .GetRequiredService<IAuthenticatedClient>(); |
| 54 | +``` |
| 55 | + |
| 56 | +The SDK plugs directly into `Microsoft.Extensions.DependencyInjection`, so it fits naturally into ASP.NET Core applications, background workers, or any DI-enabled host. |
| 57 | + |
| 58 | +## What Can You Do With It? |
| 59 | + |
| 60 | +The SDK covers the full Open Payments API surface: |
| 61 | + |
| 62 | +**Wallet Addresses** - look up any Open Payments-enabled account: |
| 63 | + |
| 64 | +```csharp |
| 65 | +var walletAddress = await client.GetWalletAddressAsync( |
| 66 | + "https://wallet.example.com/alice" |
| 67 | +); |
| 68 | +// walletAddress.AuthServer, walletAddress.ResourceServer |
| 69 | +``` |
| 70 | + |
| 71 | +**Incoming Payments** - create, retrieve, list, and complete incoming payment resources: |
| 72 | + |
| 73 | +```csharp |
| 74 | +var incomingPayment = await client.CreateIncomingPaymentAsync( |
| 75 | + new AuthRequestArgs { Url = walletAddress.ResourceServer, AccessToken = token }, |
| 76 | + new IncomingPaymentBody |
| 77 | + { |
| 78 | + WalletAddress = walletAddress.Id, |
| 79 | + IncomingAmount = new Amount("10000", "USD", 2) // $100.00 |
| 80 | + } |
| 81 | +); |
| 82 | +``` |
| 83 | + |
| 84 | +**Quotes** - get exchange rates and fees before committing to a payment: |
| 85 | + |
| 86 | +```csharp |
| 87 | +var quote = await client.CreateQuoteAsync( |
| 88 | + new AuthRequestArgs { Url = senderWallet.ResourceServer, AccessToken = token }, |
| 89 | + new QuoteBody |
| 90 | + { |
| 91 | + WalletAddress = senderWallet.Id, |
| 92 | + Receiver = receiverWallet.Id, |
| 93 | + Method = PaymentMethod.Ilp |
| 94 | + } |
| 95 | +); |
| 96 | +// quote.DebitAmount, quote.ReceiveAmount, quote.ExpiresAt |
| 97 | +``` |
| 98 | + |
| 99 | +**Outgoing Payments** - execute payments based on quotes or direct to incoming payments: |
| 100 | + |
| 101 | +```csharp |
| 102 | +var payment = await client.CreateOutgoingPaymentAsync( |
| 103 | + new AuthRequestArgs { Url = senderWallet.ResourceServer, AccessToken = token }, |
| 104 | + new OutgoingPaymentBodyFromQuote |
| 105 | + { |
| 106 | + WalletAddress = senderWallet.Id, |
| 107 | + QuoteId = quote.Id |
| 108 | + } |
| 109 | +); |
| 110 | +``` |
| 111 | + |
| 112 | +**Grants and Tokens** - full GNAP authorization flow, including interactive grants with user consent, token rotation, and revocation. |
| 113 | + |
| 114 | +## Security Built In |
| 115 | + |
| 116 | +Every authenticated request is automatically signed using Ed25519 HTTP Message Signatures ([RFC 9421](https://www.rfc-editor.org/rfc/rfc9421)). The SDK handles this transparently - you never have to manually construct signature headers, compute content digests, or manage signing parameters. Just provide your private key at setup and make your API calls. |
| 117 | + |
| 118 | +The `Interledger.OpenPayments.HttpSignatureUtils` package is also available separately if you need HTTP signature functionality in other contexts. |
| 119 | + |
| 120 | +## Real-World Payment Scenarios |
| 121 | + |
| 122 | +The SDK ships with eight annotated guides covering end-to-end payment flows: |
| 123 | + |
| 124 | +1. **One-time e-commerce payment** - retailer checkout with quote and interactive grant |
| 125 | +2. **Fixed-debit remittance** - send fixed amount from your account |
| 126 | +3. **Fixed-receive remittance** - ensure the recipient gets an exact amount |
| 127 | +4. **Recurring payment setup** - monthly subscriptions with ISO 8601 intervals |
| 128 | +5. **Recurring fixed-debit** payments |
| 129 | +6. **Recurring fixed-receive** payments |
| 130 | +7. **Split payments** - divide a payment between multiple recipients |
| 131 | +8. **Pre-authorized future payments** - grant access for a service to initiate payments later |
| 132 | + |
| 133 | +Each guide walks through the full payment lifecycle. You can find the full guides and documentation at [openpayments.dev](https://openpayments.dev/). |
| 134 | + |
| 135 | +## What's Next |
| 136 | + |
| 137 | +This is just the beginning. We're actively working on improving the SDK and would love your feedback. Here's how to get involved: |
| 138 | + |
| 139 | +- **Try it out**: `dotnet add package Interledger.OpenPayments` |
| 140 | +- **Browse the source**: [github.com/interledger/open-payments-dotnet](https://github.com/interledger/open-payments-dotnet) |
| 141 | +- **Read the docs**: [openpayments.dev](https://openpayments.dev/) |
| 142 | +- **Join the conversation**: Our community catchup calls happen every other Wednesday at 13:00 GMT. [Join via Google Meet](https://meet.google.com/htd-eefo-ovn) |
| 143 | +- **Contribute**: Check the [contribution guidelines](https://github.com/interledger/open-payments-dotnet/blob/main/.github/contributing.md) and jump in |
| 144 | + |
| 145 | +If you run into issues or have feature requests, [open an issue](https://github.com/interledger/open-payments-dotnet/issues) on GitHub. We're building this for the community and your input matters. |
0 commit comments