Zum Inhalt

Bestellungen

Apotheken-Bestellungen Ihrer Organisation lesen und schreiben.

Bestellungen auflisten

GET /api/v2/public/orgs/{orgId}/orders?limit=50&offset=0&status=awaiting_packing&shop_id=shop1
Authorization: Bearer {token}

Bereich: orders.read

Query Standard Max Beschreibung
limit 50 200 Seitengröße
offset 0 Offset
status Nach Status filtern
shop_id Nach Shop filtern

Antwort

{
  "data": [
    {
      "id": "ORD_20260605_abc123",
      "external_id": "POS-999",
      "status": "awaiting_packing",
      "shop_id": "shop1",
      "customer_name": "Max Mustermann",
      "total_amount": 42.99,
      "payment_status": "paid",
      "created_at": "2026-06-05T10:00:00Z",
      "updated_at": "2026-06-05T11:00:00Z"
    }
  ],
  "pagination": { "limit": 50, "offset": 0, "total": 705 }
}

Bestellung abrufen

GET /api/v2/public/orgs/{orgId}/orders/{orderId}
Authorization: Bearer {token}

Bereich: orders.read

Enthält Lieferadresse, Positionen und Flags:

{
  "id": "ORD_20260605_abc123",
  "external_id": "POS-999",
  "status": "awaiting_packing",
  "shop_id": "shop1",
  "customer_name": "Max Mustermann",
  "customer_email": "max@example.com",
  "total_amount": 42.99,
  "payment_status": "paid",
  "payment_reference": "TX-123",
  "shipped": false,
  "picked_up": false,
  "cash_on_pickup": true,
  "shipping_address": {
    "street": "Musterstr. 1",
    "city": "Berlin",
    "postal_code": "10115",
    "phone": "+49123456789"
  },
  "items": [
    { "p1_id": "12345", "name": "Cannabis flos", "quantity": 5, "price": 8.59 }
  ],
  "created_at": "2026-06-05T10:00:00Z",
  "updated_at": "2026-06-05T11:00:00Z"
}

Bestellung anlegen oder upserten

Upsert über external_id + shop_id.

POST /api/v2/public/orgs/{orgId}/orders
Authorization: Bearer {token}
Content-Type: application/json

Bereich: orders.write

Request-Body

{
  "shop_id": "shop1",
  "external_id": "POS-ORDER-123",
  "order_number": "optional-existing-number",
  "order_datetime": "2026-06-05T12:00:00Z",
  "customer_name": "Max Mustermann",
  "customer_email": "max@example.com",
  "address_street": "Musterstr. 1",
  "address_city": "Berlin",
  "address_postal_code": "10115",
  "address_phone": "+49123456789",
  "total_amount": 42.99,
  "payment_status": "paid",
  "payment_reference": "TX-123",
  "shipping_option": "Abholung",
  "shipped": false,
  "picked_up": false,
  "cash_on_pickup": true,
  "items": [
    { "name": "Cannabis flos 27/1", "qty": 5, "price": 8.59, "p1_id": "12345" }
  ]
}

Positionen nutzen qty

Beim Order-Upsert heißt die Menge qty, nicht quantity. Bestellanfragen nutzen quantity — siehe Bestellanfragen.


Bestellung aktualisieren

PUT /api/v2/public/orgs/{orgId}/orders/{orderId}
Authorization: Bearer {token}
Content-Type: application/json

Bereich: orders.write

Partielles Update — nur extern-sichere Felder werden akzeptiert.


Status patchen

PATCH /api/v2/public/orgs/{orgId}/orders/{orderId}/status
Authorization: Bearer {token}
Content-Type: application/json

{
  "status": "ready_pickup",
  "payment_status": "paid",
  "shipped": true,
  "picked_up": false
}

Bereich: orders.write

Mindestens ein Feld erforderlich. Löst bei Abonnement Webhook order_status_updated aus.

Antwort

{
  "order_id": "ORD_20260605_abc123",
  "status": "ready_pickup",
  "updated_at": "2026-06-05T12:00:00Z"
}

Häufige Bestellstatus

Status Beschreibung
pending Neu / unverarbeitet
awaiting_payment Zahlung ausstehend
awaiting_packing Bezahlt, Verpackung offen
ready_pickup Abholbereit
shipped Versendet
picked_up Abgeholt
completed Abgeschlossen
cancelled Storniert

Exakter Workflow kann je nach Org-Konfiguration variieren.