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

Preview the EFRIS payload for a sale

Any signed in user. Builds the EFRIS payload for one sale: seller, buyer, totals, and items. The payload is a preview still to be submitted to EFRIS, and an unknown sale id is a 404.

GET/api/v1/compliance/efris-preview/{saleId}
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Path parameters
saleIdstringrequired

The sale to build a fiscal payload for.

Responses
200

The fiscal payload for the sale

sellerobjectrequired
Show properties
tinstringrequired
branch_idstring | nullrequired
invoice_numberstringrequired
icvintegerrequired
min -9007199254740991 · max 9007199254740991
buyerobjectrequired
Show properties
tinstringrequired
namestringrequired
totalsobjectrequired
Show properties
subtotalnumberrequired
vatnumberrequired
totalnumberrequired
vat_breakdownobject[]required
Show properties
Array of object
ratenumberrequired
taxable_amountnumberrequired
vat_amountnumberrequired
itemsobject[]required
Show properties
Array of object
idstringrequired
sale_idstringrequired
medicine_idstringrequired
batch_idstringrequired
quantityintegerrequired
min -9007199254740991 · max 9007199254740991
unit_pricenumberrequired
vat_rateintegerrequired
min -9007199254740991 · max 9007199254740991
vat_amountnumberrequired
cost_at_salenumberrequired
fiscalizationobjectrequired
Show properties
modestringrequired
notestringrequired
401

Not authenticated

detailstringrequired
404

Sale not found

detailstringrequired
Try it
Server
Authorization
Parameters
Request
curl -X GET 'http://localhost:8000/api/v1/compliance/efris-preview/string' \
  -H 'Authorization: Bearer YOUR_TOKEN'
Response
{
  "seller": {
    "tin": "string",
    "branch_id": "string",
    "invoice_number": "string",
    "icv": -9007199254740991
  },
  "buyer": {
    "tin": "string",
    "name": "string"
  },
  "totals": {
    "subtotal": 0,
    "vat": 0,
    "total": 0,
    "vat_breakdown": [
      {
        "rate": 0,
        "taxable_amount": 0,
        "vat_amount": 0
      }
    ]
  },
  "items": [
    {
      "id": "string",
      "sale_id": "string",
      "medicine_id": "string",
      "batch_id": "string",
      "quantity": -9007199254740991,
      "unit_price": 0,
      "vat_rate": -9007199254740991,
      "vat_amount": 0,
      "cost_at_sale": 0
    }
  ],
  "fiscalization": {
    "mode": "string",
    "note": "string"
  }
}