SShortSingh.
Back to feed

Why VAT APIs Must Handle Rates, History, and Calculation Context

0
·9 views

Adding VAT to ecommerce or SaaS products appears straightforward at first, but quickly becomes complex once edge cases like refunds, historical transactions, and product-specific rates emerge. EU member states apply standard, reduced, and zero rates differently depending on product categories such as books, food, or pharmaceuticals, making a simple country-to-rate lookup insufficient. APIs also need to account for the date of a transaction, since the rate in effect today may differ from the one used when an original sale was recorded. A further distinction exists between VAT-inclusive and VAT-exclusive pricing, as the VAT portion differs significantly depending on the price basis used. Storing calculation metadata — including country, product tax class, transaction date, and rate provenance — transforms a VAT result from a one-time response into an auditable, traceable record.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Retail Manager Pivots to Tech Mid-Industry Upheaval, Embraces the Chaos

A former Trader Joe's manager and front-desk worker is transitioning into software engineering despite having no traditional tech background on paper. Along the way, she built a 50,000-follower TikTok LIVE community and managed a team of 16 volunteer moderators, skills she now frames as directly transferable to a tech role. She is entering the field at a moment of widespread uncertainty, with debates raging over AI adoption, shifting frameworks, and what skills actually matter for new developers. Rather than waiting for stability, she argues there is no "non-burning" version of tech to hold out for, and that career changers must simply choose which set of challenges they are willing to tackle. Her core takeaway is that an unconventional background is a strength, not a liability, as long as you can understand and defend the work you ship.

0
ProgrammingDEV Community ·

Popular Webhook Deduplication Pattern Has a Silent Data-Loss Bug

A widely copied webhook deduplication technique using SQL's INSERT ON CONFLICT DO NOTHING contains a critical flaw that can silently drop events. The pattern claims a processed-event key before executing the actual work, meaning a process crash between those two steps leaves the key marked as handled while the work never runs. Because webhook providers like Stripe and GitHub use at-least-once delivery and retry for days, duplicates are a normal occurrence that handlers must safely absorb. The failure is especially dangerous because it produces no error, no alert, and no retry — the event simply disappears until a customer reports a problem. The fix is straightforward: wrapping both the claim insert and the business logic in a single database transaction so a crash rolls back both, allowing the next retry to succeed cleanly.

0
ProgrammingDEV Community ·

AI Search Shifts Link Building Focus From Backlink Volume to Broader Authority Signals

Search Engine Land's latest guidance highlights how AI-driven search is changing the way online authority is evaluated, moving beyond simple backlink counts. AI Overviews and large language models can surface businesses based on unlinked brand mentions, citations, and content quality — not just hyperlinks. This shift is framed around entity SEO, where a business builds credibility by being consistently associated with reliable information across diverse, reputable sources. High-quality editorial links still matter, but their value is amplified when part of genuine coverage rather than volume-focused outreach campaigns. Experts recommend coordinating content, PR, and outreach efforts to build a multi-signal presence that AI search systems can reliably associate with expertise and relevance.

0
ProgrammingDEV Community ·

Developer builds same portfolio in React, Vue, Angular and Kotlin using Clean Architecture

A senior full-stack and mobile developer built a single portfolio application replicated identically across four frameworks — React 19, Vue 3.5, Angular 19, and Kotlin Multiplatform Compose HTML — to demonstrate cross-technology proficiency during technical interviews. The project is structured as a Yarn Workspaces monorepo, with a shared core package written in pure TypeScript containing domain entities, repository interfaces, and business logic use cases. A separate content adapter package implements data fetching from JSON files and handles dynamic Spanish-English translation, ensuring no framework owns the data or logic layer. Each framework app is responsible only for rendering view models, with reactivity handled through their respective native patterns such as React hooks, Vue composables, and Angular Signals. Users can switch between frameworks live with a single click without losing application state or scroll position, solving the common problem of maintaining four separate codebases.