Documentație API

API public B2B pentru quotes, AWB, tracking, wallet și puncte de predare. Specificația brută: /openapi.json.

Base URL

https://ts.ybomedia.ro/v1

Pe același host ca site-ul: https://ts.ybomedia.ro/v1. Toate rutele de mai jos sunt relative la acest prefix.

Autentificare

Ai două variante, echivalente pentru rutele de tenant:

  1. JWT — obții un token la POST /auth/login sau POST /auth/register, apoi trimiți Authorization: Bearer <token>.
  2. X-Api-Key — generezi o cheie din aplicație, la Setări → API keys. O trimiți în header-ul X-Api-Key.

Cheia se vede o singură dată la creare. Prefixul rămâne listat în setări; dacă o pierzi, generează alta.

Login JWT

curl -s -X POST https://ts.ybomedia.ro/v1/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"owner@demo.shop","password":"demo123"}'

Quotes — compară tarife

curl -s -X POST https://ts.ybomedia.ro/v1/quotes \
  -H 'Authorization: Bearer TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
    "sender": {"name":"Shop SRL","phone":"0722000111","city":"București","county":"București","street":"Strada Exemplu 10","postal_code":"010011"},
    "receiver": {"name":"Andrei Pop","phone":"0744111222","city":"Cluj-Napoca","county":"Cluj","street":"Strada Memorandumului 12","postal_code":"400114"},
    "weight": 2, "length_cm": 30, "width_cm": 20, "height_cm": 15,
    "pickup_type": "address", "delivery_type": "address"
  }'

Shipments — generează AWB

curl -s -X POST https://ts.ybomedia.ro/v1/shipments \
  -H 'X-Api-Key: YOUR_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"offer_id": 123}'

curl -s https://ts.ybomedia.ro/v1/shipments \
  -H 'X-Api-Key: YOUR_KEY'

curl -s https://ts.ybomedia.ro/v1/shipments/1 \
  -H 'X-Api-Key: YOUR_KEY'

curl -s -X POST https://ts.ybomedia.ro/v1/shipments/1/cancel \
  -H 'X-Api-Key: YOUR_KEY'

Tracking

curl -s https://ts.ybomedia.ro/v1/tracking/FAN-STUB-ABCD \
  -H 'X-Api-Key: YOUR_KEY'

Wallet

curl -s https://ts.ybomedia.ro/v1/wallet \
  -H 'X-Api-Key: YOUR_KEY'

Sold și ultimele mișcări din ledger. Creditarea se face din aplicație (top-up mock în v1) sau din admin.

Pickup points / lockere

curl -s 'https://ts.ybomedia.ro/v1/pickup-points?city=București' \
  -H 'X-Api-Key: YOUR_KEY'

Alte rute utile

Creează cont și o cheie API Deschide OpenAPI