Tejas help

Help / Developers

REST API

The transactions endpoints under /api/2026-11/transactions, with the headers and bodies they take.

All paths start with /api/2026-11/transactions. Send Authorization: Bearer <key> on every call. See Authentication. Bodies are JSON. A body with a field the API does not know is refused, so a misspelt field never goes unnoticed.

Read #

CallWhat it returns
GET /api/2026-11/transactionsOne page of the shop's transactions, newest first. Each has its customer's name and needs_you.
GET /api/2026-11/transactions/{id}One transaction.
GET /api/2026-11/transactions/{id}/eventsEvery move of the transaction, oldest first: who acted, from and to which state.
GET /api/2026-11/transactions/buyersThe shop's customers, a page at a time.
POST /api/2026-11/transactions/buyers/findOne customer by external_ref or phone. Give exactly one.

The list takes state (one or more of placed, confirmed, packed, fulfilled, cancelled, expired), limit (1 to 100, default 50) and offset. Leave out state to see the open ones. The answer has transactions, next_offset (null on the last page) and elsewhere.

curl "$TEJAS_API/api/2026-11/transactions?state=placed&limit=20" \
  -H "Authorization: Bearer $TEJAS_API_KEY"

A transaction #

Every answer that holds a transaction uses one shape. These are its main fields:

FieldMeaning
id, referenceThe id, and the short reference the shop and customer both see.
stateplaced, confirmed, packed, fulfilled, cancelled or expired.
versionGoes up with every change. Send it back when you decide.
buyerThe customer's id, name and masked phone.
needs_youTrue when the seller has to answer.
openTrue until the transaction is finished.
next_verbThe one move the shop's button makes next: confirm, pack or fulfil. Null when there is none.
linesThe items. Each has a key, a title, a quantity and a price.
taxable, tax, total, currencyThe money, as decimal strings.
payment, feeWhat was received and refunded, and Tejas's fee.
created_at, updated_atISO 8601 times.

Decide as the seller #

Each decision is POST /api/2026-11/transactions/{id}/<verb> with a JSON body:

{ "version": 3, "reason": "out_of_stock", "confirmed": false }

The verbs are confirm, reject, pack, fulfil, accept, refuse, mark_paid, not_received and refund.

  • version is the version you decided on. You can send it in an If-Match header instead. If the transaction moved since you read it, the call is 409 with the code stale, and the current transaction.
  • reason is for reject. Use one of the reject_reasons ids in the shop's settings.
  • confirmed: true answers yes to a question the call asked. Confirming a short line, rejecting a confirmed transaction and refunding ask first.
  • amount is for refund only: the money to give back. Leave it out to refund everything that is left.

Every change needs an Idempotency-Key header. See Idempotency.

Edit the lines #

POST /api/2026-11/transactions/{id}/edit replaces the whole set of lines:

{
  "version": 3,
  "lines": [
    { "offering_key": "atta-5kg", "quantity": "2" },
    { "offering_key": "toor-dal-1kg", "quantity": "1" }
  ]
}

A line can carry at, an ISO 8601 time, for an item the shop books by time. Up to 100 lines.

Act for a customer #

  1. POST /api/2026-11/transactions/buyers onboards a customer: { "phone": "+91…", "name": "…", "external_ref": "…" }. The same phone again, in any spacing, is the same customer. It sends the customer no message.
  2. POST /api/2026-11/transactions/buyers/{id}/browse shows what the shop offers, as the customer sees it. The body takes max_price, sort, available_only, groups, filters, offset and limit (1 to 20, default 5).
  3. PUT /api/2026-11/transactions/buyers/{id}/cart sets the customer's cart. The body is the same lines as an edit.
  4. POST /api/2026-11/transactions/buyers/{id}/place places the cart. The answer's kind is placed_waiting when the seller has to decide, or auto_confirmed when the shop's rules confirmed it. A shop with several places answers needs_place and lists them. Send { "place": "<id>" } to choose.

Show the customer the lines and the total before you place. If a price moved, the cart answer carries a price_changed problem. Show the new total and ask again.

An answer that holds problems is still a successful call. Read each problem's kind, such as not_enough or price_changed.

Setup #

CallUse
GET and PUT /api/2026-11/transactions/settingsRead and change the approval settings.
GET and PUT /api/2026-11/transactions/storefrontRead and change which source the shop sells from, and the storefront's filters.
GET /api/2026-11/transactions/linkThe shop's entry link.
GET /api/2026-11/transactions/fee-invoices/{id}Tejas's monthly fee invoice, by month.

GET /api/2026-11/transactions/settings/schema describes every setting, so you can build a form from it.

Did this page help?

Last checked: 2026-11-07