Skip to content
PharmaFlow Knowledgebase
Esc
↑↓navigate↵open⌘Jpreview

Check a sale rate against tolerance

Any signed in user. Guards an offline sale that arrives with a locally cached rate. A deviation beyond tolerance_percent is refused with 409, so the till flags the sale for review.

POST/api/v1/currency/rates/check
Authorization
AuthorizationBearer token (JWT) · headerrequired

JWT from POST /api/v1/auth/login sent as Authorization Bearer.

Request body
requiredapplication/json
sale_ratenumberrequired
server_ratenumberrequired
tolerance_percentnumber
Responses
200

The rate is within tolerance

okbooleanrequired
400

The sale rate is not a positive number

detailstringrequired
401

Not authenticated

detailstringrequired
409

The rate moved beyond tolerance, so the sale has to be marked for review

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/currency/rates/check' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "sale_rate": 0,
  "server_rate": 0,
  "tolerance_percent": 0
}'
Response
{
  "ok": true
}