> ## Documentation Index
> Fetch the complete documentation index at: https://developers.gojoe.de/llms.txt
> Use this file to discover all available pages before exploring further.

# Event feed

> Every event GO JOE sent (or would have sent) as a webhook, in order,
for 30 days. Store `next_cursor` and pass it as `cursor` on the next
call, also when `data` is empty. Events become visible a few seconds
after they happen. Order events need the `orders:read` scope for the
pharmacy, inventory events `inventory:write`.




## OpenAPI

````yaml /openapi.yaml get /events
openapi: 3.1.0
info:
  title: GO JOE Pharmacy API
  version: 1.0.0-prototype
  summary: >-
    Receive GO JOE orders in your ERP, report back what happens to them, and
    keep GO JOE's stock and prices current.
  description: >
    The GO JOE Pharmacy API lets a pharmacy (or the ERP of a pharmacy group)

    receive paid, doctor-approved GO JOE orders and report their progress.


    **How it works**


    1. GO JOE sends a short, signed **webhook** (`order.created`) to your
    endpoint.

    2. Your ERP **fetches the full order** with `GET /orders/{id}` and downloads
    the
       prescription with `GET /orders/{id}/prescription`.
    3. You **accept** the order with your own order number (`POST
    /orders/{id}/accept`).

    4. You **report progress**: `packed`, `ready_for_pickup`,
    `out_for_delivery`,
       `completed` (`POST /orders/{id}/status`).
    5. Missed a webhook? Everything is also in the **event feed** (`GET
    /events`),
       which you can replay from your last cursor.
    6. Keep **stock and prices** current with `PUT
    /pharmacies/{pharmacy_id}/inventory`
       (whole catalogue or changed rows) and `PATCH …/inventory/{pharmacy_sku}` (one article).

    **Prescriptions come in two stages.** An order appears as soon as the

    *Vorab-Rezept* exists (`prescription.stage = vorab`). When the doctor's

    qualified electronic signature (QES) is done you receive

    `order.prescription_signed`; download the document again and file the signed

    version in place of the Vorab-Rezept.


    **Conventions:** JSON, UTF-8, timestamps in ISO-8601 UTC, money in integer

    cents (EUR, gross), quantities in g (flower) or ml (extracts). Ignore fields

    you don't know: new fields can appear at any time without a version change.

    Errors are `application/problem+json` with a stable `code`.
  contact:
    name: GO JOE Integrations
    email: support@gojoe.de
servers:
  - url: https://gojoe.de/api/pharm/v1
    description: Production (live keys, gj_live_…)
  - url: https://sandbox-api.gojoe.de/api/pharm/v1
    description: Sandbox (test keys, gj_test_…; fake orders and MUSTER prescriptions only)
security:
  - apiKey: []
tags:
  - name: Account
  - name: Orders
  - name: Events
  - name: Inventory
  - name: Webhooks
    description: What GO JOE sends to your webhook URL.
  - name: Sandbox
    description: >-
      Simulator endpoints. They exist on the sandbox only and answer 404 on
      production.
paths:
  /events:
    get:
      tags:
        - Events
      summary: Event feed
      description: |
        Every event GO JOE sent (or would have sent) as a webhook, in order,
        for 30 days. Store `next_cursor` and pass it as `cursor` on the next
        call, also when `data` is empty. Events become visible a few seconds
        after they happen. Order events need the `orders:read` scope for the
        pharmacy, inventory events `inventory:write`.
      operationId: listEvents
      parameters:
        - name: cursor
          in: query
          schema:
            type: string
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 500
            default: 50
      responses:
        '200':
          description: Events after the cursor
          content:
            application/json:
              schema:
                type: object
                required:
                  - data
                  - next_cursor
                  - has_more
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Event'
                  next_cursor:
                    type: string
                  has_more:
                    type: boolean
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  schemas:
    Event:
      type: object
      required:
        - id
        - type
        - created_at
        - data
      properties:
        id:
          type: string
          format: uuid
          description: Same as the webhook-id header. De-duplicate on it.
        type:
          type: string
          enum:
            - order.created
            - order.updated
            - order.status_changed
            - order.cancelled
            - order.prescription_signed
            - order.prescription_replaced
            - inventory.sku_unmapped
            - ping
          description: >
            New types may be added; ignore types you do not know.

            - `order.created`: a new order for you (Vorab-Rezept available).

            - `order.prescription_signed`: the signed prescription is ready;
            download it again.

            - `order.prescription_replaced`: a new Vorab-Rezept replaces the
            previous one.

            - `order.status_changed`: the public status changed (also when GO
            JOE's courier moves it).

            - `order.updated`: delivery address or time changed.

            - `order.cancelled`: stop; do not dispense.

            - `inventory.sku_unmapped`: a stock push contained article numbers
            GO JOE
              has not seen before for this pharmacy. They are stored and wait for GO JOE
              to map them; the shop does not sell them yet. One event per push.
            - `ping`: a test sent from the GO JOE portal ("Test-Webhook
            senden"). Webhook
              only, never in the feed. Answer 2xx.
        created_at:
          type: string
          format: date-time
        data:
          type: object
          properties:
            pharmacy_id:
              type: string
              format: uuid
            order_id:
              type: string
              format: uuid
            status:
              $ref: '#/components/schemas/OrderStatus'
            prescription_stage:
              type: string
              enum:
                - vorab
                - signed
            pharmacy_skus:
              type: array
              items:
                type: string
              description: >-
                `inventory.sku_unmapped` only: the new article numbers (first
                100).
            count:
              type: integer
              description: >-
                `inventory.sku_unmapped` only: how many new article numbers the
                push had.
            account_id:
              type: string
              format: uuid
              description: '`ping` only.'
    OrderStatus:
      type: string
      enum:
        - new
        - accepted
        - packed
        - ready_for_pickup
        - out_for_delivery
        - completed
        - returning
        - returned
        - cancelled
      description: >
        `new` → `accepted` → `packed` → `ready_for_pickup` | `out_for_delivery`
        → `completed`.

        `returning`/`returned` when a courier could not deliver. `cancelled`: do
        not dispense.
    Problem:
      type: object
      required:
        - status
        - code
        - detail
        - request_id
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
        status:
          type: integer
        code:
          type: string
          example: invalid_transition
          description: >
            Stable error code, e.g. `unauthorized`, `wrong_environment`,
            `insufficient_scope`,

            `rate_limited`, `order_not_found`, `not_accepted`,
            `already_accepted`,

            `invalid_transition`, `courier_managed_by_gojoe`, `order_cancelled`,

            `order_rejected`, `idempotency_key_reused`.
        detail:
          type: string
        request_id:
          type: string
          description: Quote this to GO JOE support.
  responses:
    BadRequest:
      description: Invalid query
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    Unauthorized:
      description: Missing, unknown or revoked key, or a key for the other environment
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    RateLimited:
      description: More than the account's limit (default 120) requests per minute
      headers:
        Retry-After:
          schema:
            type: integer
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: '`Authorization: Bearer gj_live_…` (production) or `gj_test_…` (sandbox).'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.