Skip to main content

Cashflow connector — API spec

Swagger-style reference for integrators. Import the OpenAPI file into Postman, Insomnia, or Swagger Editor if you prefer a generated client.

Download OpenAPI (YAML) · Partner setup · Guide with curl examples

Base URL (production)https://service.oflync.com
Base URL (local)http://localhost:1997
AuthAPI key oflk_…
Content-Typeapplication/json
HTTPSRequired in production

Authentication

External endpoints accept either header:

X-Api-Key: oflk_YOUR_SECRET
Authorization: Bearer oflk_YOUR_SECRET

The key is bound to one account and one outlet. Create, rotate, and revoke keys only in the Partner Portal (API connectors). There is no external API to manage keys.

A Partner Portal login token is rejected on /ordering-service/v1/external/**.


Endpoints

POST /ordering-service/v1/external/cashflow/summary

POST Recommended — period totals. Your system keeps line items; Oflync stores inflow + outflow and computes net cashflow.

Auth: API key · Idempotent on externalReference

Request body

FieldTypeRequiredDescription
outletIduuidyesMust match the key’s bound outlet
inflownumber ≥ 0yesTotal money in
outflownumber ≥ 0yesTotal money out
externalReferencestring (max 100)yesIdempotency key, e.g. connector-2026-08
currencystring (3)noDefault INR
categorystringnoDefault Period totals
descriptionstringnoFree text
periodyyyy-MMnoMonthly job; used to default the booking date
transactionDateyyyy-MM-ddnoIf omitted: last day of period, else today

inflow and outflow cannot both be 0.

{
"outletId": "f9128203-e2f1-4f20-8b0a-dae3cb13c27d",
"period": "2026-08",
"inflow": 185000.00,
"outflow": 42000.00,
"currency": "INR",
"description": "Monthly totals from the connected system",
"externalReference": "connector-2026-08"
}

Responses

CodeMeaning
201New period totals
200Same externalReference updated
400Validation (both zero, negative amounts, missing fields, bad period)
401Missing / invalid / revoked / expired key
403Wrong outlet, Cashflow not subscribed, or JWT used instead of API key
{
"outletId": "f9128203-e2f1-4f20-8b0a-dae3cb13c27d",
"period": "2026-08",
"transactionDate": "2026-08-31",
"inflow": 185000.00,
"outflow": 42000.00,
"netCashflow": 143000.00,
"currency": "INR",
"externalReference": "connector-2026-08",
"incomeTransactionId": "3a1c0b12-9e44-4c21-8f11-0d2a4b6c8e90",
"expenseTransactionId": "7b2d1c23-ae55-4d32-9a22-1e3b5c7d9f01",
"updated": false
}

netCashflow is inflow − outflow (here 143000.00).

curl -sS -X POST 'https://service.oflync.com/ordering-service/v1/external/cashflow/summary' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: oflk_YOUR_SECRET' \
-d '{
"outletId": "OUTLET_UUID",
"period": "2026-08",
"inflow": 185000,
"outflow": 42000,
"externalReference": "connector-2026-08"
}'

POST /ordering-service/v1/external/cashflow

POST Single INCOME or EXPENSE row. Prefer /summary when you only have period totals.

Auth: API key · Idempotent on externalReference

Request body

FieldTypeRequiredDescription
outletIduuidyesMust match the key’s bound outlet
typeINCOME | EXPENSEyesEntry type
amountnumber ≥ 0.01yesPositive amount
externalReferencestring (max 120)yesIdempotency key
currencystring (3)noDefault INR
categorystringno
descriptionstringno
periodyyyy-MMno
transactionDateyyyy-MM-ddnoIf omitted: last day of period, else today
{
"outletId": "f9128203-e2f1-4f20-8b0a-dae3cb13c27d",
"type": "INCOME",
"amount": 185000.00,
"currency": "INR",
"category": "Connected system sales",
"period": "2026-08",
"externalReference": "connector-2026-08-income"
}

Responses

CodeMeaning
201New entry
200Same externalReference updated
400 / 401 / 403Same as /summary
{
"id": "transaction-uuid",
"vendorOutletId": "f9128203-e2f1-4f20-8b0a-dae3cb13c27d",
"accountId": "account-uuid",
"type": "INCOME",
"amount": 185000.00,
"currency": "INR",
"category": "Connected system sales",
"transactionDate": "2026-08-31",
"referenceType": "EXTERNAL_API",
"externalReference": "connector-2026-08-income",
"updated": false
}

Schemas

CashflowSummaryRequest

PropertyTypeRequired
outletIdstring (uuid)yes
inflownumber ≥ 0yes
outflownumber ≥ 0yes
externalReferencestringyes
currencystringno
categorystringno
descriptionstringno
periodstring yyyy-MMno
transactionDatedateno

CashflowSummaryResponse

PropertyTypeNotes
outletIduuidBound outlet
periodstringEcho of request period
transactionDatedateBooking date used
inflownumberStored as INCOME
outflownumberStored as EXPENSE
netCashflownumberinflow − outflow
currencystring
externalReferencestring
incomeTransactionIduuid | nullOmitted row if inflow was 0
expenseTransactionIduuid | nullOmitted row if outflow was 0
updatedbooleantrue if this reference already existed

Error body (validation / business)

{
"statusCode": 400,
"message": "inflow and outflow cannot both be zero"
}

Error body (auth filter)

{
"error": "AUTHENTICATION_FAILED",
"message": "Invalid or revoked API key",
"status": 401,
"timestamp": "2026-08-18T14:00:00Z",
"path": "/ordering-service/v1/external/cashflow/summary"
}

Importing this spec

  1. Download cashflow-connector.yaml
  2. Open Swagger Editor or Postman → Import
  3. Set the X-Api-Key value from API connectors in the Partner Portal

The live service also exposes Springdoc at /swagger-ui.html and /api-docs on the core-service host (for local debugging). This Help Center page is the supported public reference.