Dev Portal
Sandbox operational5 APIs5 groups11 operations

Catalog/Treasury/Ledger

Ledger

v2.1.0Sandbox ready

Read-side companion to Collect and Payouts. Reconcile what happened, reverse a payment made in error and check your float.

New in 2.1.0Balance now returns the reserved amount separately from available.

DownloadOpenAPI (JSON)OpenAPI (YAML)Postman collectionGenerated clients

Authentication

Swap your keys for a token

Send your app's consumer key and secret to the token endpoint using HTTP Basic auth. You get a bearer token that lasts one hour. Send it in the Authorization header of every call.

Sandbox base URL https://devportal.softwaregroup.com/api/sandbox

Get keys for Treasury
curl -X POST 'https://devportal.softwaregroup.com/api/sandbox/oauth/v1/token' \
  -u "$LANGO_KEY:$LANGO_SECRET" \
  -d 'grant_type=client_credentials'

Look up a transaction

GET/ledger/v2/transactions/{transactionId}

Path parameters

transactionIdstringrequired
The receipt number from a callback.

Responses

200The transaction.Fields

200 body

transactionIdstring
typestring
COLLECTION · PAYOUT · REVERSAL
statusstring
COMPLETED · FAILED · REVERSED
amountinteger
currencystring
counterpartystring
referencestring
completedAtdate-time
404No transaction with that receipt.Fields

404 body

errorstring
messagestring
requestIdstring

Sandbox scenarios

Founddefault

200

Unknown receipttransactionId = "RCT_missing"

404
curl -X GET 'https://devportal.softwaregroup.com/api/sandbox/ledger/v2/transactions/RCT_5h1v9k2b' \
  -H "Authorization: Bearer $LANGO_TOKEN"
Try it in the sandboxno keys needed
GET/ledger/v2/transactions/RCT_5h1v9k2b

Choose what happens

Result by callbackMoves money

Reverse a transaction

POST/ledger/v2/transactions/{transactionId}/reversal

Returns the money to the payer. Only completed collections can be reversed, once.

Path parameters

transactionIdstringrequired

Request body

reasonstringrequired
max length 64
callbackUrlurirequired

Responses

202Reversal queued.Fields

202 body

reversalIdstring
statusstring
QUEUED

Sandbox scenarios

Reversal succeedsdefault

202 + callback
curl -X POST 'https://devportal.softwaregroup.com/api/sandbox/ledger/v2/transactions/RCT_5h1v9k2b/reversal' \
  -H "Authorization: Bearer $LANGO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "reason": "Customer paid twice",
    "callbackUrl": "https://example.com/hooks/lango"
  }'
Try it in the sandboxno keys needed
POST/ledger/v2/transactions/RCT_5h1v9k2b/reversal
{
  "reason": "Customer paid twice",
  "callbackUrl": "https://example.com/hooks/lango"
}

Choose what happens

Read your balances

GET/ledger/v2/balance

Query parameters

shortCodestringrequired

Responses

200Balances for the short code.Fields

200 body

shortCodestring
currencystring
availableinteger
reservedinteger
asOfdate-time

Sandbox scenarios

Healthy floatdefault

200
curl -X GET 'https://devportal.softwaregroup.com/api/sandbox/ledger/v2/balance?shortCode=600100' \
  -H "Authorization: Bearer $LANGO_TOKEN"
Try it in the sandboxno keys needed
GET/ledger/v2/balance?shortCode=600100

Choose what happens