A Quickstart#

a. Authentication

#

The FRAGMENT Payments API uses OAuth2 client credentials for authentication. You'll need a Client ID and Client Secret from the FRAGMENT Dashboard.

The token endpoint is:

https://auth.us-west-2.fragment.dev/oauth2/token

b. Install the SDK

#
Install
npm install @fragment-dev/ts-node

c. Initialize the Client

#
Initialize
import Fragment from '@fragment-dev/ts-node';

const client = new Fragment({
  clientId: process.env['FRAGMENT_CLIENT_ID'],
  clientSecret: process.env['FRAGMENT_CLIENT_SECRET'],
});

d. Resources

#

The Payments API provides the following resources:

  • External Accounts — Bank accounts and payment sources
  • Invoices — Create and manage invoices with line items
  • Products — Define products with pricing and roles
  • Roles — Define roles for invoice participants
  • Transactions — Sync and allocate transactions
  • Users — Manage users and their roles