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

Create a receipt template

Admin only. Creates a receipt template with paper, header, footer, and logo or VAT toggles. The name is required and printed nowhere but the template picker, so it is not unique.

POST/api/v1/printing/receipt-templates
Authorization
AuthorizationBearer token (JWT) · headerrequired

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

Request body
requiredapplication/json
branch_idstring
namestringrequired
paperstring
header_textstring
footer_textstring
show_logoboolean
show_vatboolean
show_batchboolean
is_defaultboolean
Responses
201

Receipt template created

idstringrequired
branch_idstring | nullrequired
namestringrequired
paperstringrequired
header_textstringrequired
footer_textstringrequired
show_logointegerrequired
min -9007199254740991 · max 9007199254740991
show_vatintegerrequired
min -9007199254740991 · max 9007199254740991
show_batchintegerrequired
min -9007199254740991 · max 9007199254740991
is_defaultintegerrequired
min -9007199254740991 · max 9007199254740991
is_activeintegerrequired
min -9007199254740991 · max 9007199254740991
is_deletedintegerrequired
min -9007199254740991 · max 9007199254740991
created_atstringrequired
updated_atstringrequired
400

Template name is required

detailstringrequired
401

Not authenticated

detailstringrequired
403

Caller is not an admin, or the branch is outside your ownership

detailstringrequired
Try it
Server
Authorization
Bodyapplication/json
Request
curl -X POST 'http://localhost:8000/api/v1/printing/receipt-templates' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "branch_id": "string",
  "name": "string",
  "paper": "string",
  "header_text": "string",
  "footer_text": "string",
  "show_logo": true,
  "show_vat": true,
  "show_batch": true,
  "is_default": true
}'
Response
{
  "id": "string",
  "branch_id": "string",
  "name": "string",
  "paper": "string",
  "header_text": "string",
  "footer_text": "string",
  "show_logo": -9007199254740991,
  "show_vat": -9007199254740991,
  "show_batch": -9007199254740991,
  "is_default": -9007199254740991,
  "is_active": -9007199254740991,
  "is_deleted": -9007199254740991,
  "created_at": "string",
  "updated_at": "string"
}