Skip to content
GitHub

Before you begin

The Open Payments SDKs provide developers with pre-built functions that simplify interactions with the Open Payments API. Currently, we offer a TypeScript/NodeJS SDK and a PHP SDK, with plans to expand to additional languages and frameworks in the future.

Each SDK snippet page uses a tabbed interface to support multiple programming languages. This means you can find the relevant code snippets for the language of your choice with ease, without needing individual pages for each language. The basic structure of each page is as follows:

  • The page title reflects the operation, function, or action being performed.
  • A few overview paragraphs provide context about the function, its role in the Open Payments flow, and any general information that may be helpful.
  • The “Before you begin” section that links back to this page for steps to create a test wallet.
  • The main content area includes the tabbed interface where you can select your preferred programming language.

Within the tabbed interface, you’ll notice the following sections:

  • A “Prerequisites” button that links to the respective SDK’s README on GitHub for setup instructions.
  • Any additional configuration steps required for the selected language.
  • Code blocks for each step in the process, broken down into manageable chunks.
  • After the code snippets, any other commands that need to be run are mentioned, along with links to the relevant API reference documentation or other pertinent resources.

This consistent structure across all SDK snippet pages allow you to quickly grasp the functionality and implementation details, making it easier to work with the Open Payments SDKs.

Before working with our SDK snippets, we recommend creating a wallet account on the test wallet that’s part of the Interledger testnet.

The test wallet lets you create developer keys and wallet accounts, funded with play money, for making Interledger transactions via the Open Payments APIs.

  1. Go to wallet.interledger-test.dev.
  2. Click Create account at the bottom-right of the screen.
  3. Enter your e-mail address, a strong password, then confirm the password. Click the arrowhead.
  4. Go to your inbox and look for an e-mail sent by tech@interledger.org with the subject “[Test.Wallet] Verify your account”. Click Confirm my email address.
  5. Click Login to your account at the email verification screen.
  6. Log in with your credentials.
  7. Complete the Know Your Customer (KYC) steps. The only real information you need to share is your email address. All other information can be fake.

You’re now ready to create a test wallet and add money to it!

  1. Click New account on the Interledger Wallet dashboard.

    Test wallet dashboard screen showing the new account option
  2. Enter any account name, select an asset (currency), then click Create account.

    Create a new account screen with account name field and asset drop-down menu
  3. Click Close, then click Accounts from the left nav bar.

  4. Select the account you just created.

  5. Click Deposit.

    Account options screen showing buttons for deposit and add payment pointer
  6. Enter an amount between 50 to 1,000 to deposit into the account, then click Deposit.

    Deposit to account screen with amount field

    You now have a funded test wallet!

Add a payment pointer to your wallet account

Section titled “Add a payment pointer to your wallet account”
  1. Select the account from the Test Wallet dashboard.
  2. Click Add payment pointer. Account options screen showing buttons for add payment pointer and deposit
  3. Enter a Payment Pointer name and a Public name of your choosing. Create payment pointer screen with fields for payment pointer name and public name
  4. Click Create. Your account now has a payment pointer.

Obtain a public-private key pair and key ID

Section titled “Obtain a public-private key pair and key ID”

Before you can initialize an authenticated Open Payments client, you must obtain a public-private key pair and a key ID.

  1. Click Settings in the left sidebar on the dashboard.
  2. Click the Developer Keys tab.
  3. Expand the menu for your wallet account. Developer keys tab with account expanded, showing the upload key and the generate public and private key buttons
  4. Click Generate public & private key.
  5. Enter any nickname for the key pair, then click Generate keys. A file named private.key automatically downloads to your machine Generate public and private key screen with nickname field Key pair generation success screen
  6. Click Close. Your key ID appears on the screen, along with a Show/Hide option for your public key. Developer keys tab with account expanded, showing the newly generated key id and an option to show the public key

You can now use your keys and payment pointer to initialize an authenticated Open Payments client.