← OnGravy

OnGravy API

A REST API to read and create your accounting data programmatically — invoices, parties, and items. Authenticate with an API key scoped to a single business.

Authentication

Create a key in Settings → API keys. Keys look like ogv_… and carry a scope: read, write, or admin. Send it on every request:

curl https://www.ongravy.com/api/v1/ping \
  -H "Authorization: Bearer ogv_your_key_here"

Or use the x-api-key header. All responses are JSON.

Endpoints

GET/api/v1/pingread

Validate your key — returns the resolved business id + scope.

GET/api/v1/invoicesread

List sales invoices. Filters: ?status=&from=&to=&limit= (max 200).

GET/api/v1/partiesread

List customers/suppliers. Filters: ?type=customer|supplier&limit=.

POST/api/v1/partieswrite

Create a party. Body: { name, party_type?, gstin?, phone?, email? }.

GET/api/v1/itemsread

List stock items. ?limit= (max 200).

Example — create a customer

curl -X POST https://www.ongravy.com/api/v1/parties \
  -H "Authorization: Bearer ogv_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"name":"Acme Pvt Ltd","party_type":"customer","gstin":"29AABCA1234A1Z5"}'

# → { "data": { "id": "…", "name": "Acme Pvt Ltd", "gstin": "29AABCA1234A1Z5", "party_type": "customer" } }

Errors & limits

  • 401 — missing / invalid / expired key. 403 — key scope too low for the endpoint.
  • List endpoints cap at limit=200; default 50.
  • Every key is scoped to one business — data is automatically isolated.

More endpoints (create invoices, webhooks) are rolling out. Need one sooner? Ask support.