SH
Work

Treddy.se

I led the architecture and development of Treddy, a service that makes second-hand trades between people safe, from payment link to partner API.

Role
Technical architecture and development lead
Years
2021–2024
Pillar
Integrations
Result
6 partner integrations

Behind the Treddy API

hover a partner
  • BankID: Swedish e-ID.
  • FTN: Finnish e-ID through the Finnish Trust Network.
  • Stripe: Card payments.
  • Swish: Swedish mobile payments.
  • Ping Payments: Marketplace payments.
  • nShift: Shipping.
  • Schenker: Freight.
Treddy API

Problem

Buying second-hand from a stranger online means one side has to trust the other. The buyer pays first and hopes the item arrives, or the seller ships first and hopes to get paid. The Swedish National Council for Crime Prevention (BRÅ) counted 449,000 Swedes exposed to sales fraud in 2020.

Treddy's CEO started the company after paying for a used camera that never arrived. The goal was a service between buyer and seller on any ad site, such as Facebook Marketplace, so that neither side has to trust the other.

My role

I led the technical architecture and development from September 2021 to April 2024, as a consultant through Skoglit. I built the consumer product that launched on treddy.se in early 2022. From December 2022 I also built the Treddy Developer Platform, which let marketplaces build Treddy into their own sites.

How a trade works

Treddy has no listings of its own. The seller lists the item wherever they like, and Treddy handles the deal: identity, payment, shipping and support.

The treddy.se home page: 'Buy, sell and ship second-hand. On Facebook and every other marketplace', with buttons to create or request a payment link.
The treddy.se home page in November 2022. Sellers create a payment link. Buyers can request one.

A trade runs in five steps:

  1. The seller creates a payment link. They describe the item, choose shipping and get a link to share in the ad or with the buyer.
  2. The buyer pays. Treddy holds the money until the buyer has the item.
  3. The seller ships. Treddy books shipping with DB Schenker and emails the label to the seller.
  4. The buyer collects and inspects. The buyer picks up the parcel at a Schenker agent and has 24 hours to inspect and approve it.
  5. The seller gets paid. Treddy pays out when the buyer approves, or after 24 hours if the buyer does nothing.
The five steps of a Treddy trade on a vertical timeline, from creating a payment link to the seller getting paid.
The five steps, as the home page explained them.

Users sign in with BankID, which verifies both sides of every trade. Selling is free. The buyer pays shipping plus 2.5% of the price. The site met WCAG 2.1 AA.

The treddy.se home page on a laptop and a phone.
An earlier version of the home page, on desktop and mobile.

Decisions

A payment link instead of a marketplace

A payment link works on any ad site without the site doing anything, so Treddy could launch before a single marketplace signed on. The seller creates the link once, and anyone with it can buy, as in a web shop.

Hold the money until the buyer approves

Treddy locks the buyer's money at payment and releases it only when the buyer approves the item. Each step has a deadline, and each deadline has an outcome:

  • If the seller does not ship within 7 days, Treddy refunds the buyer.
  • If the buyer does not collect the parcel within 14 days, it goes back to the seller.
  • If the buyer does not respond within 24 hours of collecting, the item counts as approved.

No deal stays open forever.

Connect every provider behind one API

Each part of a trade depends on an outside provider. I connected them all behind one API layer, which both the consumer product and the partners use.

Treddy platform, built up in five steps: marketplace core, identity, payments, shipping, partner API.Treddy corefraud reductionIdentityBankIDFinnish Trust NetworkPaymentsStripeSwishPing PaymentsShippingnShiftSchenkerPartner API, 6 partner integrationsOAuthRESTWebhook events

The core. The core runs the trade flow: payment links, the payment hold, deadlines and payouts. Every integration below connects to it.

Identity. Users verify their identity with BankID or the Finnish Trust Network. Buyer and seller also sign the digital purchase contract with BankID.

Payments. Stripe, Swish and Ping Payments handle payments, the payment hold and payouts.

Shipping. nShift and Schenker book shipping, print labels and report when a parcel is delivered or collected.

Partner API. Partners call a REST API with OAuth and receive signed webhook events in real time. This is the Treddy Developer Platform.

Open the platform to marketplaces

The payment link brought Treddy to users. The Developer Platform brought it to marketplaces and rental sites, so they could offer safe payment and shipping on their own listings. Through one API, partners got BankID verification and signing, locked payments, Schenker shipping labels and delivery tracking. Treddy handled customer support for each deal.

I worked on the developer docs, which cover authorization, the API reference, webhook events and webhook signatures. I also helped onboard partners.

Result

Six partners integrated through the Developer Platform, among them Citiboard, Torggruppen, Hifitorget and Findit. Citiboard offered Treddy shipping and safe payment on every listing.

Stack

  • BankID
  • Finnish Trust Network
  • Stripe
  • Swish
  • Ping Payments
  • nShift
  • Schenker
  • OAuth
  • REST
  • Webhooks