> ## 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.

# Push stock and prices

> Up to 1,000 articles per call, identified by your own article number
(`pharmacy_sku`). GO JOE maps each number to its product once; until
then the article is reported `unmapped` and waits for GO JOE's team.
A push never creates products.

- `available: false` takes the product off sale; `true` puts it back
  on sale unless GO JOE's team switched it off (`kept_off`).
- `stock_grams`, the order rules and the price also apply while a
  product is off sale.
- Prices are gross cents per g/ml. A change of more than ±50 % is
  applied but comes back as a `price_change_large` warning, and GO JOE's
  team double-checks it.
- `mode=full`: the push is your complete catalogue. Mapped articles
  missing from it are treated as sold out. Use it for a nightly or
  hourly full sync, `partial` (default) for changes.

Validation is all-or-nothing: if any item is invalid, nothing is
applied and `errors` lists every problem.




## OpenAPI

````yaml /openapi.yaml put /pharmacies/{pharmacy_id}/inventory
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:
  /pharmacies/{pharmacy_id}/inventory:
    parameters:
      - $ref: '#/components/parameters/PharmacyId'
      - $ref: '#/components/parameters/IdempotencyKey'
    put:
      tags:
        - Inventory
      summary: Push stock and prices
      description: |
        Up to 1,000 articles per call, identified by your own article number
        (`pharmacy_sku`). GO JOE maps each number to its product once; until
        then the article is reported `unmapped` and waits for GO JOE's team.
        A push never creates products.

        - `available: false` takes the product off sale; `true` puts it back
          on sale unless GO JOE's team switched it off (`kept_off`).
        - `stock_grams`, the order rules and the price also apply while a
          product is off sale.
        - Prices are gross cents per g/ml. A change of more than ±50 % is
          applied but comes back as a `price_change_large` warning, and GO JOE's
          team double-checks it.
        - `mode=full`: the push is your complete catalogue. Mapped articles
          missing from it are treated as sold out. Use it for a nightly or
          hourly full sync, `partial` (default) for changes.

        Validation is all-or-nothing: if any item is invalid, nothing is
        applied and `errors` lists every problem.
      operationId: pushInventory
      parameters:
        - name: mode
          in: query
          schema:
            type: string
            enum:
              - partial
              - full
            default: partial
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                items:
                  type: array
                  minItems: 1
                  maxItems: 1000
                  items:
                    $ref: '#/components/schemas/InventoryItem'
      responses:
        '200':
          description: What happened to each article
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InventoryPushResult'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/PharmacyNotFound'
        '422':
          $ref: '#/components/responses/InvalidItems'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  parameters:
    PharmacyId:
      name: pharmacy_id
      in: path
      required: true
      description: A pharmacy your key acts for (see `GET /me`).
      schema:
        type: string
        format: uuid
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        Any unique string. Retrying with the same key within 24 h returns the
        first response without running the request again.
      schema:
        type: string
        maxLength: 255
  schemas:
    InventoryItem:
      type: object
      required:
        - pharmacy_sku
        - name
        - available
      properties:
        pharmacy_sku:
          type: string
          minLength: 1
          maxLength: 64
          description: Your article number.
        name:
          type: string
          maxLength: 200
          description: The article name as your ERP shows it (helps GO JOE map it).
        manufacturer:
          type:
            - string
            - 'null'
          maxLength: 200
        form:
          type:
            - string
            - 'null'
          enum:
            - flower
            - extract
            - null
        thc_percent:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 100
        cbd_percent:
          type:
            - number
            - 'null'
          minimum: 0
          maximum: 100
        available:
          type: boolean
          description: Can be sold now.
        stock_grams:
          type:
            - number
            - 'null'
          minimum: 0
          description: Stock in g (flower) or ml (extracts).
        price_cents:
          type:
            - integer
            - 'null'
          minimum: 1
          description: Gross price per g/ml in cents, e.g. 899 = 8,99 €/g.
        min_order_grams:
          type:
            - integer
            - 'null'
          minimum: 1
        order_increment:
          type:
            - integer
            - 'null'
          minimum: 1
    InventoryPushResult:
      type: object
      required:
        - mode
        - prices_applied
        - summary
        - results
      properties:
        mode:
          type: string
          enum:
            - partial
            - full
        prices_applied:
          type: boolean
          description: false if GO JOE keeps prices for this pharmacy itself.
        summary:
          type: object
          properties:
            received:
              type: integer
            updated:
              type: integer
            unmapped:
              type: integer
            kept_off:
              type: integer
            warnings:
              type: integer
            missing_switched_off:
              type: integer
              description: 'mode=full: mapped articles missing from the push, now off sale.'
        results:
          type: array
          items:
            $ref: '#/components/schemas/InventoryResultRow'
    InventoryResultRow:
      type: object
      required:
        - pharmacy_sku
        - status
        - warnings
      properties:
        pharmacy_sku:
          type: string
        status:
          type: string
          enum:
            - updated
            - unmapped
            - kept_off
          description: |
            `updated`: applied. `unmapped`: GO JOE has not mapped this number
            yet; stored and shown to GO JOE's team. `kept_off`: stock and price
            applied, but GO JOE's team has the product off sale.
        product_id:
          type:
            - string
            - 'null'
          format: uuid
        warnings:
          type: array
          items:
            type: object
            properties:
              code:
                type: string
                enum:
                  - price_change_large
              detail:
                type: string
              old_price_cents:
                type: integer
              new_price_cents:
                type: integer
    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'
    Forbidden:
      description: The key lacks the scope this call needs (`insufficient_scope`)
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    PharmacyNotFound:
      description: No such pharmacy for this key (also for pharmacies of other accounts)
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    InvalidItems:
      description: At least one item is invalid; nothing was applied
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/Problem'
              - type: object
                properties:
                  errors:
                    type: array
                    description: Up to 100 problems, each with the item's position.
                    items:
                      type: object
                      properties:
                        index:
                          type: integer
                        pharmacy_sku:
                          type:
                            - string
                            - 'null'
                        field:
                          type: string
                        detail:
                          type: string
    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.