Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.foodsave.kz/llms.txt

Use this file to discover all available pages before exploring further.

Guide — Integrate a POS system

This guide shows steps to integrate a POS (Poster, iiko, etc.) with FoodSave.

Steps

  1. Register partner and provide POS credentials in the Partner Portal.
  2. Configure webhook URL in POS provider: https://api.foodsave.kz/api/v1/pos/webhooks/{provider}.
  3. Ensure HMAC secret is configured in both systems.
  4. Map menu items using POST /api/v1/menu/pos/sync or CSV import.

Example webhook verification (node)

import crypto from 'crypto'

function verify(signature, body, secret){
  const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(body).digest('hex')
  return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected))
}

// Use within an express handler: verify(req.headers['x-poster-signature'], JSON.stringify(req.body), process.env.POSTER_SECRET)

Troubleshooting

  • If orders are duplicated, enable Idempotency-Key mapping and inspect delivered externalId.
  • If images fail to upload, check S3 policy returned by POST /api/v1/files/upload.