Fragment

Fragment is a ledger API for engineering teams. It provides a real-time, double-entry ledger to track money movement, model balances, and reconcile against external systems (banks, processors, PSPs). The product is GraphQL-first - developers define a Schema (chart of accounts and entry types), create Ledgers, post immutable Ledger Entries composed of balanced debit/credit lines, and read balances and lines back through a single GraphQL endpoint. Every write mutation is idempotent.

6 APIs 0 Features
LedgerDouble-EntryAccountingFintechPaymentsReconciliationGraphQLBalances

APIs

Fragment Ledger GraphQL API

Single GraphQL endpoint for defining a ledger Schema, creating Ledgers, posting balanced double-entry Ledger Entries, and reading balances and lines. All write mutations are ide...

Fragment Schema API

Define and version the ledger Schema - the chart of accounts, account types (asset, liability, income, expense), currency modes, and the ledger entry types your product posts. S...

Fragment Ledgers API

Create and query Ledgers from a stored Schema. A Ledger is an isolated database for tracking money for a use case, tenant, or environment, created with createLedger and read wit...

Fragment Ledger Entries API

Post immutable, balanced double-entry Ledger Entries made of debit and credit lines against accounts. Uses addLedgerEntry with an idempotency key (ik), reverseLedgerEntry to cor...

Fragment Balances API

Read real-time balances and the underlying lines. Query overall ledger balances (getLedgerBalances), per-account balances (getLedgerAccountBalances), and the debit/credit lines ...

Fragment Reconciliation API

Match ledger activity against external money movement. reconcileTx reconciles a transaction idempotently by transaction ID, while syncCustomAccounts and syncCustomTxs ingest ext...

Collections

GraphQL

Fragment Ledger GraphQL API

Fragment (fragment.dev) is a ledger API for engineering teams. It provides a

GRAPHQL

Pricing Plans

Rate Limits

Fragment Dev Rate Limits

2 limits

RATE LIMITS

FinOps

Resources

🔗
DomainSecurity
DomainSecurity
🔗
LinkedIn
LinkedIn
🔗
Website
Website
🔗
Documentation
Documentation
📝
SignUp
SignUp
🟢
StatusPage
StatusPage
📄
ChangeLog
ChangeLog
🔗
Plans
Plans
🔗
RateLimits
RateLimits
🔗
FinOps
FinOps

Sources

apis.yml Raw ↑
opencollection: 1.0.0
info:
  name: Fragment Ledger GraphQL API
  version: '1.0'
request:
  auth:
    type: bearer
    token: '{{bearerToken}}'
items:
- info:
    name: Authentication
    type: folder
  items:
  - info:
      name: Get OAuth2 Access Token (client_credentials)
      type: http
    http:
      method: POST
      url: https://auth.us-west-2.fragment.dev/oauth2/token
      auth:
        type: basic
        username: '{{clientId}}'
        password: '{{clientSecret}}'
      headers:
      - name: Content-Type
        value: application/x-www-form-urlencoded
      body:
        type: urlencoded
        data: grant_type=client_credentials&scope=https://api.us-west-2.fragment.dev/*&client_id={{clientId}}
    docs: Exchange client_id/client_secret (Basic auth) for a Bearer access token that expires in ~1 hour.
- info:
    name: Schema
    type: folder
  items:
  - info:
      name: storeSchema
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"mutation StoreSchema($key: String!, $schema: JSON!) { storeSchema(key: $key, schema: $schema) { __typename
          ... on StoreSchemaResult { schema { key version } } ... on BadRequestError { code message } } }","variables":{"key":"wallet-v1","schema":{"accounts":[],"entryTypes":[]}}}'
    docs: Store / version a ledger Schema (chart of accounts + entry types).
- info:
    name: Ledgers
    type: folder
  items:
  - info:
      name: createLedger
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"mutation CreateLedger($ik: SafeString!, $name: String!, $schemaKey: String!) { createLedger(ik: $ik,
          name: $name, schemaKey: $schemaKey) { __typename ... on CreateLedgerResult { ledger { ik name type } } ... on BadRequestError
          { code message } } }","variables":{"ik":"main","name":"Main Ledger","schemaKey":"wallet-v1"}}'
    docs: Create a new ledger from a stored Schema.
  - info:
      name: ledger (query)
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"query GetLedger($ik: SafeString!) { ledger(ik: $ik) { ik name type created ledgerAccounts { path
          type } } }","variables":{"ik":"main"}}'
    docs: Retrieve a ledger's configuration, schema, and accounts.
- info:
    name: Ledger Entries
    type: folder
  items:
  - info:
      name: addLedgerEntry (idempotent)
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"mutation PostEntry($ik: SafeString!) { addLedgerEntry(ledgerIk: \"main\", ik: $ik, type: \"deposit\",
          date: \"2026-07-01\", parameters: {amount: \"10.00\", currency: {code: \"USD\"}, userId: \"user-123\"}) { __typename
          ... on AddLedgerEntryResult { entry { ik posted lines { amount currency { code } type account { path } } } } ...
          on BadRequestError { code message } } }","variables":{"ik":"deposit-0001"}}'
    docs: Post a balanced double-entry ledger entry. The ik makes retries safe.
  - info:
      name: reverseLedgerEntry
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"mutation Reverse($ik: SafeString!) { reverseLedgerEntry(ledgerIk: \"main\", ik: $ik, entryIk: \"deposit-0001\")
          { __typename ... on ReverseLedgerEntryResult { entry { ik isReversal } } ... on BadRequestError { code message }
          } }","variables":{"ik":"reverse-0001"}}'
    docs: Reverse a previously posted ledger entry.
- info:
    name: Balances
    type: folder
  items:
  - info:
      name: getLedgerBalances
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"query Balances { getLedgerBalances(ledgerIk: \"main\") { amount currency { code } } }"}'
    docs: Read overall balances for a ledger.
  - info:
      name: getLedgerAccountLines
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"query Lines { getLedgerAccountLines(ledgerIk: \"main\", path: \"user_funds/user-123\", first: 20)
          { nodes { amount currency { code } type posted } pageInfo { hasNextPage endCursor } } }"}'
    docs: Read the debit/credit lines behind an account.
- info:
    name: Reconciliation
    type: folder
  items:
  - info:
      name: reconcileTx (idempotent by txId)
      type: http
    http:
      method: POST
      url: https://api.us-west-2.fragment.dev/graphql
      headers:
      - name: Content-Type
        value: application/json
      body:
        type: json
        data: '{"query":"mutation Reconcile { reconcileTx(ledgerIk: \"main\", txId: \"psp-tx-987\", parameters: {amount: \"10.00\",
          currency: {code: \"USD\"}}) { __typename ... on ReconcileTxResult { reconciled } ... on BadRequestError { code message
          } } }"}'
    docs: Reconcile a transaction against external money movement, idempotent by transaction ID.