{
  "openapi": "3.1.0",
  "info": {
    "title": "die Internetausdrucker REST API",
    "version": "1.0.0",
    "description": "Subset using letter/specification and explicit preview/quote confirmation. Shares MCP access keys, wallet and limits. National A4 only. Unsupported options fail explicitly. IDs are strings, not provider IDs. See /rest-info."
  },
  "servers": [
    {
      "url": "https://die-internetausdrucker.de"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    },
    "schemas": {
      "Envelope": {
        "type": "object",
        "properties": {
          "status": {
            "type": "integer"
          },
          "message": {
            "type": "string"
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "Specification": {
        "type": "object",
        "required": [
          "color",
          "mode"
        ],
        "properties": {
          "pages": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000000
          },
          "color": {
            "type": "string",
            "enum": [
              "1",
              "4"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "simplex",
              "duplex"
            ]
          },
          "shipping": {
            "type": "string",
            "const": "national"
          },
          "c4": {
            "enum": [
              0,
              "0"
            ]
          }
        },
        "additionalProperties": false
      },
      "Auth": {
        "type": "object",
        "properties": {
          "apiKey": {
            "type": "string",
            "description": "SHA-256 hex of access key, used together with apiSecret"
          },
          "apiSecret": {
            "type": "string",
            "description": "Personal access key; alternatively use Authorization Bearer"
          },
          "mode": {
            "type": "string",
            "enum": [
              "test",
              "live"
            ],
            "default": "test"
          }
        },
        "additionalProperties": false
      },
      "Recipient": {
        "type": "object",
        "required": [
          "name",
          "street",
          "postcode",
          "city"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "street": {
            "type": "string"
          },
          "postcode": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "country": {
            "type": "string"
          }
        }
      },
      "Letter": {
        "type": "object",
        "required": [
          "specification"
        ],
        "properties": {
          "specification": {
            "$ref": "#/components/schemas/Specification"
          },
          "base64_file": {
            "type": "string",
            "maxLength": 66666668
          },
          "base64_file_checksum": {
            "type": "string",
            "description": "MD5 of base64 string"
          },
          "filename_original": {
            "type": "string"
          },
          "recipient": {
            "$ref": "#/components/schemas/Recipient"
          }
        },
        "additionalProperties": false
      }
    },
    "responses": {
      "Status200": {
        "description": "OK",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status202": {
        "description": "Draft queued, no charge",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status400": {
        "description": "Invalid request",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status401": {
        "description": "Invalid/expired/revoked access key",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status403": {
        "description": "Access or spending limit denied",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status404": {
        "description": "Not found",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status409": {
        "description": "Not ready or test mode",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status413": {
        "description": "Too large",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status422": {
        "description": "Unsupported option or invalid schema",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status429": {
        "description": "Rate limit",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      },
      "Status503": {
        "description": "Live operation unavailable",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Envelope"
            }
          }
        }
      }
    }
  },
  "paths": {
    "/v1/balance": {
      "get": {
        "summary": "GET /v1/balance",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        }
      }
    },
    "/v1/price": {
      "get": {
        "summary": "GET /v1/price",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "parameters": [
          {
            "name": "pages",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000
            }
          },
          {
            "name": "color",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "4"
              ]
            }
          },
          {
            "name": "mode",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "simplex",
                "duplex"
              ]
            }
          },
          {
            "name": "shipping",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "const": "national"
            }
          },
          {
            "name": "c4",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                0,
                "0"
              ]
            }
          }
        ]
      },
      "post": {
        "summary": "POST /v1/price",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "auth": {
                    "$ref": "#/components/schemas/Auth"
                  },
                  "letter": {
                    "$ref": "#/components/schemas/Letter"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/uploads": {
      "post": {
        "summary": "POST /v1/uploads",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "filename",
                  "color",
                  "duplex"
                ],
                "properties": {
                  "auth": {
                    "$ref": "#/components/schemas/Auth"
                  },
                  "filename": {
                    "type": "string"
                  },
                  "color": {
                    "enum": [
                      "bw",
                      "color"
                    ]
                  },
                  "duplex": {
                    "type": "boolean"
                  },
                  "recipient": {
                    "$ref": "#/components/schemas/Recipient"
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/printjobs": {
      "get": {
        "summary": "GET /v1/printjobs",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "filter",
            "in": "query",
            "schema": {
              "enum": [
                "draft",
                "queue",
                "done",
                "hold",
                "canceled"
              ]
            }
          }
        ]
      },
      "post": {
        "summary": "POST /v1/printjobs",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "auth": {
                    "$ref": "#/components/schemas/Auth"
                  },
                  "letter": {
                    "$ref": "#/components/schemas/Letter"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/printjobs/{id}": {
      "get": {
        "summary": "GET /v1/printjobs/{id}",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{48}$"
            }
          }
        ]
      }
    },
    "/v1/printjobs/{id}/delivery": {
      "post": {
        "summary": "POST /v1/printjobs/{id}/delivery",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{48}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "recipient"
                ],
                "properties": {
                  "auth": {
                    "$ref": "#/components/schemas/Auth"
                  },
                  "recipient": {
                    "$ref": "#/components/schemas/Recipient"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/printjobs/{id}/quote": {
      "get": {
        "summary": "GET /v1/printjobs/{id}/quote",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{48}$"
            }
          }
        ]
      },
      "post": {
        "summary": "POST /v1/printjobs/{id}/quote",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{48}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "auth": {
                    "$ref": "#/components/schemas/Auth"
                  },
                  "letter": {
                    "$ref": "#/components/schemas/Letter"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/printjobs/{id}/submit": {
      "post": {
        "summary": "POST /v1/printjobs/{id}/submit",
        "responses": {
          "200": {
            "$ref": "#/components/responses/Status200"
          },
          "202": {
            "$ref": "#/components/responses/Status202"
          },
          "400": {
            "$ref": "#/components/responses/Status400"
          },
          "401": {
            "$ref": "#/components/responses/Status401"
          },
          "403": {
            "$ref": "#/components/responses/Status403"
          },
          "404": {
            "$ref": "#/components/responses/Status404"
          },
          "409": {
            "$ref": "#/components/responses/Status409"
          },
          "413": {
            "$ref": "#/components/responses/Status413"
          },
          "422": {
            "$ref": "#/components/responses/Status422"
          },
          "429": {
            "$ref": "#/components/responses/Status429"
          },
          "503": {
            "$ref": "#/components/responses/Status503"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-f0-9]{48}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "auth",
                  "quote_id",
                  "preview_confirmed",
                  "confirmed_pdf_sha256",
                  "confirmed_amount_cents",
                  "idempotency_key",
                  "payment"
                ],
                "properties": {
                  "auth": {
                    "$ref": "#/components/schemas/Auth"
                  },
                  "quote_id": {
                    "type": "string"
                  },
                  "preview_confirmed": {
                    "const": true
                  },
                  "confirmed_pdf_sha256": {
                    "type": "string"
                  },
                  "confirmed_amount_cents": {
                    "type": "integer"
                  },
                  "idempotency_key": {
                    "type": "string",
                    "minLength": 8,
                    "maxLength": 128
                  },
                  "payment": {
                    "enum": [
                      "wallet",
                      "checkout"
                    ]
                  }
                },
                "additionalProperties": false
              }
            }
          }
        }
      }
    }
  }
}
