Skip to main content
Challenge

Build a Logistics Cargo Declaration FormSG Webhook Processor

Process incoming cargo declaration webhooks from FormSG. Verify webhook authenticity, classify cargo descriptions into standardized HS codes using an LLM, and calculate initial port handling fees.

Business OperationsHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Process incoming cargo declaration webhooks from FormSG. Verify webhook authenticity, classify cargo descriptions into standardized HS codes using an LLM, and calculate initial port handling fees.

Freight forwarding operations agent

Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG.

Authenticate the payload by verifying the mock FormSG webhook signature to ensure data origin authenticity.

Analyze the cargo description field with an LLM to predict the most likely 6-digit HS commodity code.

Calculate port handling fees based on the submitted weight (0.50 SGD per kg for standard cargo, 0.70 SGD per kg for hazardous cargo), generating a billing draft.

Freight operations dashboard showing verified FormSG submissions, predicted HS codes, and calculated handling fee estimates.

Synthetic JSON array of 20 simplified synthetic app records (not complete official schema files) representing mock FormSG webhook payloads containing cargo descriptions and weights. Starter examples below are synthetic. They are not downloaded records.

Singapore government FormSG Utilizes the FormSG webhook verification concepts to authenticate incoming cargo declarations before processing.

dspy, fastapi, pydantic. DSPy provides robust LLM prompt optimization for accurate text-to-HS code classification from raw cargo descriptions. Capable LLM for classifying varied cargo descriptions into standardized HS codes.

Submit runnable source, pinned dependencies, setup commands, a working interface, example outputs, and a recorded end-to-end demo. Include tests and an action log.

Correctly parses and validates mock FormSG webhook payload structures.

Predicts valid 6-digit HS codes for diverse cargo descriptions using the LLM.

Accurately calculates handling fees using the specified weight-based formula.

Outputs a structured billing summary JSON for each authenticated payload.

```json [ { "input": { "submission_id": "sub_123", "signature_valid": true, "form_responses": { "cargo_description": "Frozen Atlantic Salmon fillets, packaged in dry ice", "weight_kg": 500, "hazardous": false } }, "expected_output": { "submission_id": "sub_123", "authentication_status": "VERIFIED", "predicted_hs_code": "0304.41", "cargo_category": "FROZEN_SEAFOOD", "handling_fee_sgd": 250, "billing_status": "DRAFT_READY" } }, { "input": { "submission_id": "sub_124", "signature_valid": true, "form_responses": { "cargo_description": "Lithium-ion batteries for electric vehicles, UN3480", "weight_kg": 1200, "hazardous": true } }, "expected_output": { "submission_id": "sub_124", "authentication_status": "VERIFIED", "predicted_hs_code": "8507.60", "cargo_category": "DANGEROUS_GOODS", "handling_fee_sgd": 840, "billing_status": "DRAFT_READY" } } ] ```

Maintains offline processing of mock webhook payloads without connecting to live customs or government endpoints. Use mock external writes. Require human review before any real deployment.

Rules

Participation guide

Maintains offline processing of mock webhook payloads without connecting to live customs or government endpoints. Use mock external writes and human review.

Delivery guide

How work is evaluated

Evaluation

Correctly parses and validates mock FormSG webhook payload structures. Predicts valid 6-digit HS codes for diverse cargo descriptions using the LLM. Accurately calculates handling fees using the specified weight-based formula. Outputs a structured billing summary JSON for each authenticated payload.

Submission format

Runnable source, pinned dependencies, setup commands, working interface, example outputs, recorded demo, tests, and action logs.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
4 scoring checks
Binary
1 pass or fail dimensions
Ordinal
3 scaled dimensions
Dimension 1

Complete workflow

Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG. Authenticate the payload by verifying the mock FormSG webhook signature to ensure data origin authenticity. Analyze the cargo description field with an LLM to predict the most likely 6-digit HS commodity code. Calculate port handling fees based on the submitted weight (0.50 SGD per kg for standard cargo, 0.70 SGD per kg for hazardous cargo), generating a billing draft.

Score scale
012
Score 0

Missing or incorrect.

Score 1

Partly complete, with documented gaps.

Score 2

Complete, with reproducible evidence.

Dimension 2

Correctness and evidence

Correctly parses and validates mock FormSG webhook payload structures. Predicts valid 6-digit HS codes for diverse cargo descriptions using the LLM. Accurately calculates handling fees using the specified weight-based formula. Outputs a structured billing summary JSON for each authenticated payload.

Score scale
012
Score 0

Missing or incorrect.

Score 1

Partly complete, with documented gaps.

Score 2

Complete, with reproducible evidence.

Dimension 3

Review interface

Freight operations dashboard showing verified FormSG submissions, predicted HS codes, and calculated handling fee estimates.

Score scale
012
Score 0

Missing or incorrect.

Score 1

Partly complete, with documented gaps.

Score 2

Complete, with reproducible evidence.

Dimension 4

Safe execution

Maintains offline processing of mock webhook payloads without connecting to live customs or government endpoints.

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG.

  • Authenticate the payload by verifying the mock FormSG webhook signature to ensure data origin authenticity.

  • Analyze the cargo description field with an LLM to predict the most likely 6-digit HS commodity code.

  • Calculate port handling fees based on the submitted weight (0.50 SGD per kg for standard cargo, 0.70 SGD per kg for hazardous cargo), generating a billing draft.

Resources and assets

Reference links and supporting material

Dataset notes

Synthetic JSON array of 20 simplified synthetic app records (not complete official schema files) representing mock FormSG webhook payloads containing cargo descriptions and weights. Supplied starter examples are synthetic, not source extracts.

Challenge setup

Configuration summary for this challenge.

Challenge input

Input details are not configured.

DSPy

Prompt and LM program optimization framework.

Evaluated output

No output checks are configured.

Evaluation checks
  • Ingest incoming webhook payloads representing cargo declaration forms submitted via FormSG. Authenticate th...
  • Correctly parses and validates mock FormSG webhook payload structures. Predicts valid 6-digit HS codes for...
  • Freight operations dashboard showing verified FormSG submissions, predicted HS codes, and calculated handli...
Configured evaluation evidence
  • 2 public reference cases
Configured runtime
  • 3 configured tools

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • DSPy · Optional
Training Infra
  • DSPy · Optional
Orchestration
  • DSPy · Optional

Evaluation contract

  • Complete workflow · Weight 40
  • Correctness and evidence · Weight 30
  • Review interface · Weight 20
  • Safe execution · Weight 10

Reference cases

  • 2 public reference cases

Workflow tasks

No workflow tasks are configured.

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about Build a Logistics Cargo Declaration FormSG Webhook Processor