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 |
| Auth | API key oflk_… |
| Content-Type | application/json |
| HTTPS | Required 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
| Field | Type | Required | Description |
|---|---|---|---|
outletId | uuid | yes | Must match the key’s bound outlet |
inflow | number ≥ 0 | yes | Total money in |
outflow | number ≥ 0 | yes | Total money out |
externalReference | string (max 100) | yes | Idempotency key, e.g. connector-2026-08 |
currency | string (3) | no | Default INR |
category | string | no | Default Period totals |
description | string | no | Free text |
period | yyyy-MM | no | Monthly job; used to default the booking date |
transactionDate | yyyy-MM-dd | no | If 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
| Code | Meaning |
|---|---|
| 201 | New period totals |
| 200 | Same externalReference updated |
| 400 | Validation (both zero, negative amounts, missing fields, bad period) |
| 401 | Missing / invalid / revoked / expired key |
| 403 | Wrong 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
| Field | Type | Required | Description |
|---|---|---|---|
outletId | uuid | yes | Must match the key’s bound outlet |
type | INCOME | EXPENSE | yes | Entry type |
amount | number ≥ 0.01 | yes | Positive amount |
externalReference | string (max 120) | yes | Idempotency key |
currency | string (3) | no | Default INR |
category | string | no | |
description | string | no | |
period | yyyy-MM | no | |
transactionDate | yyyy-MM-dd | no | If 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
| Code | Meaning |
|---|---|
| 201 | New entry |
| 200 | Same externalReference updated |
| 400 / 401 / 403 | Same 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
| Property | Type | Required |
|---|---|---|
| outletId | string (uuid) | yes |
| inflow | number ≥ 0 | yes |
| outflow | number ≥ 0 | yes |
| externalReference | string | yes |
| currency | string | no |
| category | string | no |
| description | string | no |
| period | string yyyy-MM | no |
| transactionDate | date | no |
CashflowSummaryResponse
| Property | Type | Notes |
|---|---|---|
| outletId | uuid | Bound outlet |
| period | string | Echo of request period |
| transactionDate | date | Booking date used |
| inflow | number | Stored as INCOME |
| outflow | number | Stored as EXPENSE |
| netCashflow | number | inflow − outflow |
| currency | string | |
| externalReference | string | |
| incomeTransactionId | uuid | null | Omitted row if inflow was 0 |
| expenseTransactionId | uuid | null | Omitted row if outflow was 0 |
| updated | boolean | true 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
- Download cashflow-connector.yaml
- Open Swagger Editor or Postman → Import
- Set the
X-Api-Keyvalue 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.