Skip to main content

Cashflow connector API

Server-to-server API for posting cashflow to a single Oflync outlet. Authenticate with a partner API key — not a user login.

Typical use: Whatzneu (or another system) calls Oflync once a month to record that outlet’s inflow and/or outflow.

Partner setup (creating and rotating keys) is in API connectors.

API spec (Swagger-style): Cashflow connector — API spec · Download OpenAPI YAML

Base URL

EnvironmentHost
Productionhttps://service.oflync.com
Localhttp://localhost:1997

All paths below are under /ordering-service/v1.

Authentication

Send the key on every request:

X-Api-Key: oflk_…

Alternatively:

Authorization: Bearer oflk_…

Keys start with oflk_. They are bound to one account and one outlet. Using a partner JWT on this endpoint is rejected.

HTTPS is required in production.

Capture cashflow

POST /ordering-service/v1/external/cashflow

Creates a cashflow row for the outlet bound to the key. If externalReference already exists for that outlet, the row is updated (idempotent monthly retry).

The outletId in the body must match the outlet the key was created for.

Request

POST /ordering-service/v1/external/cashflow
Content-Type: application/json
X-Api-Key: oflk_YOUR_SECRET
{
"outletId": "f9128203-e2f1-4f20-8b0a-dae3cb13c27d",
"type": "INCOME",
"amount": 185000.00,
"currency": "INR",
"category": "WhatsApp sales",
"description": "Whatzneu collections for August 2026",
"period": "2026-08",
"externalReference": "whatzneu-2026-08-income"
}
FieldRequiredNotes
outletIdYesMust equal the key’s bound outlet
typeYesINCOME or EXPENSE
amountYesPositive number, two decimal places
currencyNoDefaults to INR
categoryNoe.g. WhatsApp sales
descriptionNoFree text
transactionDateNoyyyy-MM-dd. If omitted, last day of period, else today
periodNoyyyy-MM (useful for monthly jobs)
externalReferenceYesUnique per outlet. Reuse the same value to update instead of duplicating

Monthly Whatzneu example

Post income and expense as two calls (or two jobs), with distinct references:

curl -sS -X POST 'https://service.oflync.com/ordering-service/v1/external/cashflow' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: oflk_YOUR_SECRET' \
-d '{
"outletId": "OUTLET_UUID",
"type": "INCOME",
"amount": 185000,
"category": "WhatsApp sales",
"period": "2026-08",
"externalReference": "whatzneu-2026-08-income"
}'
curl -sS -X POST 'https://service.oflync.com/ordering-service/v1/external/cashflow' \
-H 'Content-Type: application/json' \
-H 'X-Api-Key: oflk_YOUR_SECRET' \
-d '{
"outletId": "OUTLET_UUID",
"type": "EXPENSE",
"amount": 12000,
"category": "WhatsApp ads",
"period": "2026-08",
"externalReference": "whatzneu-2026-08-expense"
}'

Running the same job again in August updates those two rows; it does not add duplicates.

Success

StatusMeaning
201 CreatedNew entry
200 OKExisting externalReference was updated
{
"id": "transaction-uuid",
"vendorOutletId": "f9128203-e2f1-4f20-8b0a-dae3cb13c27d",
"accountId": "account-uuid",
"type": "INCOME",
"amount": 185000.00,
"currency": "INR",
"category": "WhatsApp sales",
"description": "Whatzneu collections for August 2026",
"transactionDate": "2026-08-31",
"referenceType": "EXTERNAL_API",
"externalReference": "whatzneu-2026-08-income",
"updated": false
}

The amount is included in that outlet’s Cashflow monthly and yearly totals.

Post aggregated inflow and outflow (recommended for monthly jobs)

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

Use this when the connected system keeps its own line items and only needs to send period totals. Send inflow and outflow; Oflync stores those two totals and computes net cashflow (inflow − outflow).

Re-posting the same externalReference updates the period instead of duplicating it.

Request

POST /ordering-service/v1/external/cashflow/summary
Content-Type: application/json
X-Api-Key: oflk_YOUR_SECRET
{
"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"
}
FieldRequiredNotes
outletIdYesMust equal the key’s bound outlet
inflowYesTotal money in for the period (>= 0)
outflowYesTotal money out for the period (>= 0)
currencyNoDefaults to INR
categoryNoDefaults to Period totals
descriptionNoFree text
transactionDateNoyyyy-MM-dd. If omitted, last day of period, else today
periodNoyyyy-MM (recommended for monthly jobs)
externalReferenceYesUnique per outlet + period. Reuse to update

inflow and outflow cannot both be 0.

Example

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"
}'

Success

StatusMeaning
201 CreatedNew period totals
200 OKSame externalReference was updated
{
"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": "…",
"expenseTransactionId": "…",
"updated": false
}

netCashflow is calculated by Oflync. The two totals appear on that outlet’s Cashflow ledger as inflow and outflow for the period.

Errors

Same as the single-entry API, plus 400 if both amounts are zero or either amount is negative.

StatusTypical cause
401Missing, unknown, revoked, or expired API key
403Key used on a different outlet, or Cashflow is not on the partner’s plan; or a login token was sent instead of an API key
400Validation (amount, type, period format, missing externalReference)

Error body:

{
"status": 401,
"message": "Invalid or revoked API key"
}

Scope

This API only captures cashflow for the bound outlet. It cannot:

  • List or change other outlets
  • Read the partner’s full ledger (use the Partner Portal)
  • Create, list, rotate, or revoke API keys (partners do that in API connectors in the Partner Portal)

Security checklist for integrators

  • Store the secret in your vault / env vars, never in source control or chat logs
  • Call over TLS
  • Use a stable externalReference per outlet + period (/summary) or per outlet + period + type (single entry)
  • If the partner rotates the key in the Partner Portal, switch to the new secret the same day