Documentation

How Agrivia works.

What the platform does, who it serves, how it earns, and the workflows that move produce and money through it. The calculators on this page call the same functions the marketplace does — if the fee engine changes, this page changes with it.

01

What the platform is

Most agricultural produce in the Philippines reaches the consumer through three or four layers of traders, each taking a cut. The farmer accepts whatever price is offered at the roadside on the morning of harvest, and never learns what the produce eventually sold for.

Agrivia removes those layers. It is a two-sided subscription marketplace where farmers and suppliers list their own harvests, and buyers — from a household buying two kilos of mangoes to a processor clearing a 400-kilo pallet — source directly from the farm that grew them.

The same catalog serves both. Wholesale tiers apply automatically as quantity grows, so B2B and B2C are not separate products — they are the same listing at different points on a price ladder.

02

Who it serves

An account is one role, chosen at signup. That choice determines which subscription tiers are offered and which surfaces the account can reach.

🌾

Farmer

Lists harvests, sets wholesale tiers, dispatches orders, receives payouts.

🚚

Supplier

Everything a farmer does, plus multi-warehouse sync, contract pricing, and buyer credit terms.

🧺

Buyer (B2C)

Households browsing, filling a basket, paying, and confirming delivery.

🏭

Buyer (B2B)

Restaurants, groceries, and processors — same catalog, plus wholesale tiers, POs, and net-30.

Two parties never sign up but always participate: the logistics partner, who moves the goods and is paid at cost with no platform margin, and Agrivia itself, which verifies farms, holds escrow, and resolves disputes.

03

How the platform earns

Two revenue lines, and the important thing is that they trade off against each other. A monthly subscription, and a commission on every completed transaction, deducted from the seller's proceeds when escrow releases.

The subscription buys down the commission rate. A higher tier costs more up front and takes less per sale, so the platform's incentive is aligned with the seller's growth rather than opposed to it.

Break-even

Seller planMonthlyCommissionBeats Sprout above

Sprout

15 listings · 1 seat

Free8%

Grower

Unlimited listings · 3 seats

₱8995%₱29,967 / mo

Harvest

Unlimited listings · 15 seats

₱2,4993.5%₱55,533 / mo

Cooperative

Unlimited everything

Custom2%Negotiated
Buyer planMonthlyService feeDelivery

Market Basket

For households buying direct.

Free1.5%, capped at ₱75₱149 flat

Pantry

For families and small kitchens.

₱299WaivedFree above ₱1,500

Trade

For restaurants, groceries, and processors.

₱1,999WaivedAlways free

What the platform never charges for: listing a harvest, unsold inventory, failed deliveries, or farm verification visits. And there is no margin on delivery — the courier fee passes straight through at cost.

Where a peso actually goes

Move the slider and switch the plans. Everything below is computed by computeOrderTotals() — the same function the basket, checkout, and seller dashboard call.

₱10,000
Seller's plan
Buyer's plan

Buyer is charged

₱10,224.00

To the farm₱10,000 less 5% commission
₱9,500.00
To Agrivia₱500 commission + ₱75 service fee
₱575.00
To the courierPassed through at cost, no platform margin
₱149.00

Take rate

5.8%

Processing cost

− ₱235

Agrivia net

₱340

Take rate is Agrivia's gross as a share of goods sold — not of the buyer's total, which would flatter it by including delivery. Processing is what the payment provider takes off the full charge.

04

Core workflows

Seller onboarding

  1. 1

    Sign up

    Choose farmer, supplier, or buyer. The role determines which subscription tiers you are shown.

  2. 2

    Pick a starting tier

    Most sellers begin on Sprout — free, 8% commission, fifteen listings.

  3. 3

    Verify your email

    Standard confirmation link. Buyer accounts are live from this point.

  4. 4

    Agronomist call

    Within one business day, for seller accounts. Schedules the site visit.

  5. 5

    On-site verification

    Someone walks the land, checks certifications, and audits the cold chain. Agrivia pays for the visit.

  6. 6

    Listings go live

    The verified badge is granted. Buyers can filter on it, so it carries real weight.

Verification is not a checkbox. It gates the badge buyers filter on, and the platform pays for the visit.

Listing a harvest

A listing carries everything a buyer needs to decide without a phone call:

  • Unit and minimum order

    kg, litre, tray of 30 — with a floor quantity

  • Stock and harvest window

    "Feb–Jun", "Milked daily at 5am"

  • Lead time

    Days to dispatch, shown before checkout

  • Wholesale tiers

    Ascending quantity breaks, applied automatically

  • Certifications

    Organic, GAP, BFAR-registered, cold-chain

  • Farm provenance

    Named farm, province, rating, years trading

Listing is free on every tier. Sprout caps at fifteen active listings; every paid tier is unlimited. A seller is never charged for produce that does not move, which is the whole reason smallholders can afford to be here.

Buyer discovery

Buyers filter the marketplace by category, province, verified-only, and whether wholesale tiers exist, then sort by most traded, price, or newest. Each product page shows the wholesale ladder, the farm behind it, the harvest window — and the exact commission Agrivia takes on that sale.

A buyer looking at a Grower-tier listing can see that ₱95 of every ₱100 reaches the farm. Very few marketplaces show this. It is the point.

Pricing as quantity grows

This is the mechanism that lets one catalog serve both B2C and B2B. priceAtQuantity() walks the ladder and returns the best unit price the quantity qualifies for. Tiers are ascending, so the last threshold cleared wins. No negotiation, no purchase order, no phone call.

Live example

Benguet Romaine Lettuce

₱180/ kg

12 kg

Add 8 more kg to drop the unit price to ₱158. This is the nudge the basket shows.

  • 1–19 kg₱180retail
  • 20–59 kg₱158−12.2%
  • 60–149 kg₱142−21.1%
  • 150+ kg₱128−28.9%

Checkout and the order lifecycle

Step through the stages. Watch where the money sits, and when — if ever — Agrivia earns.

No funds heldNothing charged

The buyer picks a plan, which determines the service fee and delivery rate. Wholesale tiers resolve automatically from the quantity in the basket. No money has moved.

Multi-seller baskets

A basket can span several farms sitting on different subscription tiers. Commission is therefore charged per seller, at that seller's own rate, and only blended afterwards for display.

Cooperative-tier farm₱1,0002%₱20
Sprout-tier farm₱1,0008%₱80
Total commission · blended rate 5%₱100

Payouts and plan changes

Settlement

Sprout
Weekly
All paid tiers
Next business day after delivery

Paid to a bank account, GCash, or a cooperative's pooled wallet.

Changing plans

Upgrades
Immediate. The lower commission applies to orders placed from that moment.
Downgrades
At the next billing date, so nothing shifts mid-cycle.
05

How money is represented

All arithmetic runs in integer centavos. Pesos exist only at the moment of display.

This is not pedantry. A 5% commission on ₱1,234.55 computed in floating point yields 61.7275000000001. Computed in centavos it yields exactly 6173, which formats to ₱61.73. On a platform whose entire revenue is a percentage of other people's money, that difference compounds into a reconciliation problem.

Floating point

1234.55 * 0.05

61.7275000000001

Integer centavos

Math.round(123455 * 0.05)

6173 → ₱61.73

rate(amount, percent) rounds half-up to the nearest centavo. toCentavos() and formatPeso() handle the boundary. Nothing else in the codebase multiplies a price by a rate.

06

Where the logic lives

  • Subscription tiers and commission ratessrc/lib/plans.ts
  • Order totals, fees, take rate, escrow mathsrc/lib/fees.ts
  • Centavo arithmetic and formattingsrc/lib/money.ts
  • Catalog, farms, wholesale tierssrc/lib/products.ts
  • Basket state (localStorage, external store)src/lib/cart-store.ts
07

Implementation status

This is a frontend implementation with mocked data. Concretely:

No database

Catalog, farms, orders, and dashboard figures are in-memory fixtures.

No authentication

Login and signup render and validate, but no session is created.

No payment processor

Checkout simulates the payment intent and escrow hold, then shows a confirmation.

The basket is real

It persists to localStorage and survives reloads.

The fee engine is real

Pure, tested against 27 assertions, and production-shaped.

When you wire a backend

computeOrderTotals() must be called server-side at order creation, and its result stored on the order record. Never trust a client-submitted total. The client-side math exists so the buyer sees the price update as they change quantity — it is a display affordance, not a security boundary.

Rules the backend must enforce

  1. 1Commission is charged on escrow release, never on order creation.
  2. 2A disputed or failed order charges no commission at all.
  3. 3Each seller's commission uses that seller's own plan at time of sale.
  4. 4Stock is decremented under a lock — the client's quantity clamp is advisory.
  5. 5Wholesale tiers are re-resolved server-side from the authoritative product record.