Ledger
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 Paymentscurl -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
transactionIdstringtypestring- COLLECTION · PAYOUT · REVERSAL
statusstring- COMPLETED · FAILED · REVERSED
amountintegercurrencystringcounterpartystringreferencestringcompletedAtdate-time
404No transaction with that receipt.Fields
404 body
errorstringmessagestringrequestIdstring
Sandbox scenarios
Founddefault
200Unknown receipttransactionId = "RCT_missing"
404curl -X GET 'https://devportal.softwaregroup.com/api/sandbox/ledger/v2/transactions/RCT_5h1v9k2b' \
-H "Authorization: Bearer $LANGO_TOKEN"Choose what happens
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
reversalIdstringstatusstring- QUEUED
Sandbox scenarios
Reversal succeedsdefault
202 + callbackcurl -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"
}'{
"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
shortCodestringcurrencystringavailableintegerreservedintegerasOfdate-time
Sandbox scenarios
Healthy floatdefault
200curl -X GET 'https://devportal.softwaregroup.com/api/sandbox/ledger/v2/balance?shortCode=600100' \
-H "Authorization: Bearer $LANGO_TOKEN"Choose what happens