Upsert accounting form¶
Summary¶
Source repository:
jef-systems/jef-accounting-backendSource SHA:
eaca6413a00fd211146c504137047c3d327f687bSource run id:
31404676080Module:
AccountingLambda function:
jef-accounting-upsert-formHTTP method:
POSTInvocation mode:
syncPackage mode:
no-packageAPI category:
Accounting Complex Sync No Package POST APIsAPI path:
/accounting/complex-sync-no-packages/jef-accounting-upsert-formEndpoint URL:
https://api.jefoffice.com/accounting/complex-sync-no-packages/jef-accounting-upsert-formDocumentation scope:
lambda-complex-sync-no-packages
Synchronous Lambda Complex Rule¶
This API is documented as a synchronous Lambda complex no-package API. API Gateway waits for the Lambda result and returns the final Lambda response.
Description¶
Creates a form or publishes a new immutable form specification version for the entity identified by the supplied jsin.
Payload Example¶
{
"jsin": "1513",
"specification": {
"form": {
"id": "customer_card_a6_form",
"name": "Customer Card A6 Form",
"qr_code_value": 20001
},
"page": {
"size": "A6",
"unit": "mm",
"margin": 5
},
"theme": {
"preset": "enterprise-controlled-form",
"effective_date": "2026-06-30"
},
"qr_codes": [
{
"id": "top_right_qr",
"position": {
"anchor": "top-right",
"offset_x": 1.0,
"offset_y": 1.0
},
"size": 6,
"value_source": "qr_code_value"
},
{
"id": "bottom_left_qr",
"position": {
"anchor": "bottom-left",
"offset_x": 1.0,
"offset_y": 1.0
},
"size": 6,
"value_source": "qr_code_value"
}
],
"defaults": {
"row_height": 6.0,
"width_total": 1.0,
"font": "OCR-B",
"font_size": 6.2,
"border": true,
"padding": 1.0
},
"validation": {
"row_width_must_equal": 1.0,
"fixed_row_height": false,
"allowed_types": [
"manual-filled",
"pre-filled"
],
"prefilled_requires_prefilled_message": true,
"manual_filled_must_not_have_prefilled_message": true,
"ocr_text": true,
"header": {
"required": true
},
"footer": {
"required": true
},
"qr_code": {
"enabled": true,
"fixed_position": true,
"required_count": 2,
"allowed_positions": [
"top-right",
"bottom-left"
],
"allowed_value_sources": [
"qr_code_value"
]
}
},
"header": {
"title": "Customer Card",
"description": "Compact customer identity and contact capture form."
},
"footer": {
"title": "Customer Confirmation",
"description": "Customer confirms that the recorded details are correct."
},
"rows": [
{
"height": 8,
"columns": [
{
"width": 1.0,
"type": "pre-filled",
"prefilled_message": "CUSTOMER CARD",
"align": "center",
"bold": true
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 1,
"prefilled_message": "Customer No.",
"align": "left",
"field_short_description": "Ex. CUST-0001"
},
{
"width": 0.32,
"type": "manual-filled"
},
{
"width": 0.16,
"type": "pre-filled",
"field_number": 2,
"prefilled_message": "Date",
"align": "left",
"field_short_description": "Ex. 2026-06-30"
},
{
"width": 0.24,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 3,
"prefilled_message": "Full Name",
"align": "left",
"field_short_description": "Ex. Juan Dela Cruz"
},
{
"width": 0.72,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 4,
"prefilled_message": "Mobile No.",
"align": "left",
"field_short_description": "Ex. 09171234567"
},
{
"width": 0.32,
"type": "manual-filled"
},
{
"width": 0.14,
"type": "pre-filled",
"field_number": 5,
"prefilled_message": "TIN",
"align": "left",
"field_short_description": "Ex. 123-456-789"
},
{
"width": 0.26,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 6,
"prefilled_message": "Address",
"align": "left",
"field_short_description": "Ex. Cebu City"
},
{
"width": 0.72,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 7,
"prefilled_message": "Customer Type",
"align": "left",
"field_short_description": "Ex. Retail"
},
{
"width": 0.32,
"type": "manual-filled"
},
{
"width": 0.16,
"type": "pre-filled",
"field_number": 8,
"prefilled_message": "Status",
"align": "left",
"field_short_description": "Ex. Active"
},
{
"width": 0.24,
"type": "manual-filled"
}
]
},
{
"height": 9,
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 9,
"prefilled_message": "Notes",
"align": "left",
"field_short_description": "Ex. Verify ID"
},
{
"width": 0.72,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 10,
"prefilled_message": "Signature",
"align": "left",
"field_short_description": "Ex. J. Dela Cruz"
},
{
"width": 0.42,
"type": "manual-filled"
},
{
"width": 0.12,
"type": "pre-filled",
"field_number": 11,
"prefilled_message": "Date",
"align": "left",
"field_short_description": "Ex. 2026-06-30"
},
{
"width": 0.18,
"type": "manual-filled"
}
]
}
],
"aruco": {
"enabled": true,
"alignment_required": true,
"dictionary": "DICT_4X4_50",
"marker_size_mm": 5,
"corner_offset_mm": 3,
"minimum_marker_count": 4,
"allow_three_marker_recovery": false,
"validation": {
"max_reprojection_error_px": 6,
"max_rotation_degrees": 25,
"max_scale_difference_ratio": 0.12,
"max_crop_fraction": 0.05,
"minimum_blur_score": 35
},
"markers": {
"top_left": {
"id": 1
},
"top_right": {
"id": 2
},
"bottom_right": {
"id": 3
},
"bottom_left": {
"id": 4
}
},
"carrier": {
"layout": "auto_a6_four_up",
"expected_instances": 4
}
}
}
}
Payload Schema¶
{
"root": {
"type": "M",
"required": true,
"additional_properties": false,
"attributes": {
"jsin": {
"type": "S",
"required": true,
"regex": "^[0-9]{4}$"
},
"specification": {
"type": "M",
"required": true,
"additional_properties": false,
"attributes": {
"form": {
"type": "M",
"required": true,
"attributes": {
"id": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"name": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
},
"qr_code_value": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"page": {
"type": "M",
"required": true,
"attributes": {
"size": {
"type": "S",
"required": true,
"regex": "^[A-Za-z0-9_-]{1,32}$"
},
"unit": {
"type": "S",
"required": true,
"regex": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
},
"margin": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"theme": {
"type": "M",
"required": true,
"attributes": {
"preset": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"effective_date": {
"type": "S",
"required": true,
"regex": "^\\d{4}-\\d{2}-\\d{2}$"
}
},
"additional_properties": false
},
"qr_codes": {
"type": "L",
"required": true,
"items": {
"type": "M",
"required": true,
"attributes": {
"id": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"position": {
"type": "M",
"required": true,
"attributes": {
"anchor": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"offset_x": {
"type": "N",
"required": true
},
"offset_y": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"size": {
"type": "N",
"required": true
},
"value_source": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
}
},
"additional_properties": false
}
},
"defaults": {
"type": "M",
"required": true,
"attributes": {
"row_height": {
"type": "N",
"required": true
},
"width_total": {
"type": "N",
"required": true
},
"font": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"font_size": {
"type": "N",
"required": true
},
"border": {
"type": "BOOL",
"required": true
},
"padding": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"validation": {
"type": "M",
"required": true,
"attributes": {
"row_width_must_equal": {
"type": "N",
"required": true
},
"fixed_row_height": {
"type": "BOOL",
"required": true
},
"allowed_types": {
"type": "L",
"required": true,
"items": {
"type": "S",
"required": true
}
},
"prefilled_requires_prefilled_message": {
"type": "BOOL",
"required": true
},
"manual_filled_must_not_have_prefilled_message": {
"type": "BOOL",
"required": true
},
"ocr_text": {
"type": "BOOL",
"required": true
},
"header": {
"type": "M",
"required": true,
"attributes": {
"required": {
"type": "BOOL",
"required": false
},
"allowed_fields": {
"type": "L",
"required": false,
"items": {
"type": "S",
"required": true
}
},
"required_fields": {
"type": "L",
"required": false,
"items": {
"type": "S",
"required": true
}
}
},
"additional_properties": false
},
"footer": {
"type": "M",
"required": true,
"attributes": {
"required": {
"type": "BOOL",
"required": false
},
"allowed_fields": {
"type": "L",
"required": false,
"items": {
"type": "S",
"required": true
}
},
"required_fields": {
"type": "L",
"required": false,
"items": {
"type": "S",
"required": true
}
}
},
"additional_properties": false
},
"qr_code": {
"type": "M",
"required": true,
"attributes": {
"enabled": {
"type": "BOOL",
"required": true
},
"fixed_position": {
"type": "BOOL",
"required": true
},
"required_count": {
"type": "N",
"required": true
},
"allowed_positions": {
"type": "L",
"required": true,
"items": {
"type": "S",
"required": true
}
},
"allowed_value_sources": {
"type": "L",
"required": true,
"items": {
"type": "S",
"required": true
}
},
"required_fields": {
"type": "L",
"required": false,
"items": {
"type": "S",
"required": true
}
}
},
"additional_properties": false
},
"field_numbering": {
"type": "M",
"required": false,
"attributes": {
"enabled": {
"type": "BOOL",
"required": true
},
"sequence_required": {
"type": "BOOL",
"required": true
},
"numbered_fields_align": {
"type": "S",
"required": true,
"regex": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
},
"description_font_size_delta": {
"type": "N",
"required": true
},
"description_min_font_size": {
"type": "N",
"required": true
},
"description_max_chars": {
"type": "N",
"required": true
}
},
"additional_properties": false
}
},
"additional_properties": false
},
"header": {
"type": "M",
"required": true,
"attributes": {
"title": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
},
"description": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
}
},
"additional_properties": false
},
"footer": {
"type": "M",
"required": true,
"attributes": {
"title": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
},
"description": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
}
},
"additional_properties": false
},
"rows": {
"type": "L",
"required": false,
"items": {
"type": "M",
"required": true,
"attributes": {
"height": {
"type": "N",
"required": false
},
"columns": {
"type": "L",
"required": true,
"items": {
"type": "M",
"required": true,
"attributes": {
"width": {
"type": "N",
"required": true
},
"type": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,64}$"
},
"field_number": {
"type": "N",
"required": false
},
"prefilled_message": {
"type": "S",
"required": false,
"regex": "^[\\s\\S]{1,4096}$"
},
"field_short_description": {
"type": "S",
"required": false,
"regex": "^[\\s\\S]{1,4096}$"
},
"align": {
"type": "S",
"required": false,
"regex": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
},
"bold": {
"type": "BOOL",
"required": false
}
},
"additional_properties": false
}
}
},
"additional_properties": false
}
},
"pages": {
"type": "L",
"required": false,
"items": {
"type": "M",
"required": true,
"attributes": {
"id": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"name": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
},
"header": {
"type": "M",
"required": true,
"attributes": {
"title": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
},
"description": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
}
},
"additional_properties": false
},
"footer": {
"type": "M",
"required": false,
"attributes": {
"title": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
},
"description": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,4096}$"
}
},
"additional_properties": false
},
"rows": {
"type": "L",
"required": true,
"items": {
"type": "M",
"required": true,
"attributes": {
"height": {
"type": "N",
"required": false
},
"columns": {
"type": "L",
"required": true,
"items": {
"type": "M",
"required": true,
"attributes": {
"width": {
"type": "N",
"required": true
},
"type": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,64}$"
},
"field_number": {
"type": "N",
"required": false
},
"prefilled_message": {
"type": "S",
"required": false,
"regex": "^[\\s\\S]{1,4096}$"
},
"field_short_description": {
"type": "S",
"required": false,
"regex": "^[\\s\\S]{1,4096}$"
},
"align": {
"type": "S",
"required": false,
"regex": "^[A-Za-z][A-Za-z0-9_-]{0,31}$"
},
"bold": {
"type": "BOOL",
"required": false
}
},
"additional_properties": false
}
}
},
"additional_properties": false
}
}
},
"additional_properties": false
}
},
"aruco": {
"type": "M",
"required": true,
"attributes": {
"enabled": {
"type": "BOOL",
"required": true
},
"alignment_required": {
"type": "BOOL",
"required": true
},
"dictionary": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"marker_size_mm": {
"type": "N",
"required": true
},
"corner_offset_mm": {
"type": "N",
"required": true
},
"minimum_marker_count": {
"type": "N",
"required": true
},
"allow_three_marker_recovery": {
"type": "BOOL",
"required": true
},
"validation": {
"type": "M",
"required": true,
"attributes": {
"max_reprojection_error_px": {
"type": "N",
"required": true
},
"max_rotation_degrees": {
"type": "N",
"required": true
},
"max_scale_difference_ratio": {
"type": "N",
"required": true
},
"max_crop_fraction": {
"type": "N",
"required": true
},
"minimum_blur_score": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"markers": {
"type": "M",
"required": true,
"attributes": {
"top_left": {
"type": "M",
"required": true,
"attributes": {
"id": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"top_right": {
"type": "M",
"required": true,
"attributes": {
"id": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"bottom_right": {
"type": "M",
"required": true,
"attributes": {
"id": {
"type": "N",
"required": true
}
},
"additional_properties": false
},
"bottom_left": {
"type": "M",
"required": true,
"attributes": {
"id": {
"type": "N",
"required": true
}
},
"additional_properties": false
}
},
"additional_properties": false
},
"carrier": {
"type": "M",
"required": true,
"attributes": {
"layout": {
"type": "S",
"required": true,
"regex": "^[\\s\\S]{1,512}$"
},
"expected_instances": {
"type": "N",
"required": true
}
},
"additional_properties": false
}
},
"additional_properties": false
}
}
}
}
}
}
Response Schema¶
{
"root": {
"type": "M",
"required": true,
"additional_properties": false,
"attributes": {
"form_name": {
"type": "S",
"required": false,
"regex": "^[a-z][a-z0-9_-]{1,127}$"
},
"spec_version": {
"type": "S",
"required": false,
"regex": "^[0-9]{9}$"
},
"created": {
"type": "BOOL",
"required": false
},
"published_at": {
"type": "S",
"required": false,
"regex": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{3}Z$"
},
"error_code": {
"type": "S",
"required": false
},
"message": {
"type": "S",
"required": false
}
}
}
}
Request Payload¶
{
"jsin": "1513",
"specification": {
"form": {
"id": "customer_card_a6_form",
"name": "Customer Card A6 Form",
"qr_code_value": 20001
},
"page": {
"size": "A6",
"unit": "mm",
"margin": 5
},
"theme": {
"preset": "enterprise-controlled-form",
"effective_date": "2026-06-30"
},
"qr_codes": [
{
"id": "top_right_qr",
"position": {
"anchor": "top-right",
"offset_x": 1.0,
"offset_y": 1.0
},
"size": 6,
"value_source": "qr_code_value"
},
{
"id": "bottom_left_qr",
"position": {
"anchor": "bottom-left",
"offset_x": 1.0,
"offset_y": 1.0
},
"size": 6,
"value_source": "qr_code_value"
}
],
"defaults": {
"row_height": 6.0,
"width_total": 1.0,
"font": "OCR-B",
"font_size": 6.2,
"border": true,
"padding": 1.0
},
"validation": {
"row_width_must_equal": 1.0,
"fixed_row_height": false,
"allowed_types": [
"manual-filled",
"pre-filled"
],
"prefilled_requires_prefilled_message": true,
"manual_filled_must_not_have_prefilled_message": true,
"ocr_text": true,
"header": {
"required": true
},
"footer": {
"required": true
},
"qr_code": {
"enabled": true,
"fixed_position": true,
"required_count": 2,
"allowed_positions": [
"top-right",
"bottom-left"
],
"allowed_value_sources": [
"qr_code_value"
]
}
},
"header": {
"title": "Customer Card",
"description": "Compact customer identity and contact capture form."
},
"footer": {
"title": "Customer Confirmation",
"description": "Customer confirms that the recorded details are correct."
},
"rows": [
{
"height": 8,
"columns": [
{
"width": 1.0,
"type": "pre-filled",
"prefilled_message": "CUSTOMER CARD",
"align": "center",
"bold": true
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 1,
"prefilled_message": "Customer No.",
"align": "left",
"field_short_description": "Ex. CUST-0001"
},
{
"width": 0.32,
"type": "manual-filled"
},
{
"width": 0.16,
"type": "pre-filled",
"field_number": 2,
"prefilled_message": "Date",
"align": "left",
"field_short_description": "Ex. 2026-06-30"
},
{
"width": 0.24,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 3,
"prefilled_message": "Full Name",
"align": "left",
"field_short_description": "Ex. Juan Dela Cruz"
},
{
"width": 0.72,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 4,
"prefilled_message": "Mobile No.",
"align": "left",
"field_short_description": "Ex. 09171234567"
},
{
"width": 0.32,
"type": "manual-filled"
},
{
"width": 0.14,
"type": "pre-filled",
"field_number": 5,
"prefilled_message": "TIN",
"align": "left",
"field_short_description": "Ex. 123-456-789"
},
{
"width": 0.26,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 6,
"prefilled_message": "Address",
"align": "left",
"field_short_description": "Ex. Cebu City"
},
{
"width": 0.72,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 7,
"prefilled_message": "Customer Type",
"align": "left",
"field_short_description": "Ex. Retail"
},
{
"width": 0.32,
"type": "manual-filled"
},
{
"width": 0.16,
"type": "pre-filled",
"field_number": 8,
"prefilled_message": "Status",
"align": "left",
"field_short_description": "Ex. Active"
},
{
"width": 0.24,
"type": "manual-filled"
}
]
},
{
"height": 9,
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 9,
"prefilled_message": "Notes",
"align": "left",
"field_short_description": "Ex. Verify ID"
},
{
"width": 0.72,
"type": "manual-filled"
}
]
},
{
"columns": [
{
"width": 0.28,
"type": "pre-filled",
"field_number": 10,
"prefilled_message": "Signature",
"align": "left",
"field_short_description": "Ex. J. Dela Cruz"
},
{
"width": 0.42,
"type": "manual-filled"
},
{
"width": 0.12,
"type": "pre-filled",
"field_number": 11,
"prefilled_message": "Date",
"align": "left",
"field_short_description": "Ex. 2026-06-30"
},
{
"width": 0.18,
"type": "manual-filled"
}
]
}
],
"aruco": {
"enabled": true,
"alignment_required": true,
"dictionary": "DICT_4X4_50",
"marker_size_mm": 5,
"corner_offset_mm": 3,
"minimum_marker_count": 4,
"allow_three_marker_recovery": false,
"validation": {
"max_reprojection_error_px": 6,
"max_rotation_degrees": 25,
"max_scale_difference_ratio": 0.12,
"max_crop_fraction": 0.05,
"minimum_blur_score": 35
},
"markers": {
"top_left": {
"id": 1
},
"top_right": {
"id": 2
},
"bottom_right": {
"id": 3
},
"bottom_left": {
"id": 4
}
},
"carrier": {
"layout": "auto_a6_four_up",
"expected_instances": 4
}
}
}
}
CMD curl¶
curl.exe -X POST "https://api.jefoffice.com/accounting/complex-sync-no-packages/jef-accounting-upsert-form" -H "Content-Type: application/json" --data-raw '{}'
PowerShell curl¶
curl.exe -X POST "https://api.jefoffice.com/accounting/complex-sync-no-packages/jef-accounting-upsert-form" -H "Content-Type: application/json" --data-raw '{}'