{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/plugsurfing/json-schema/plugsurfing-charging-key-orders-list-response-schema.json",
  "title": "ChargingKeyOrdersListResponse",
  "description": "Response containing charging key orders for a user.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/plugsurfing-charging-key-orders-api-openapi.yml#/components/schemas/ChargingKeyOrdersListResponse",
  "type": "array",
  "items": {
    "$ref": "#/$defs/ChargingKeyOrdersListItem"
  },
  "$defs": {
    "ChargingKeyAddress": {
      "type": "object",
      "properties": {
        "companyName": {
          "type": "string",
          "description": "Company name for business delivery addresses."
        },
        "firstName": {
          "type": "string",
          "description": "Recipient first name."
        },
        "lastName": {
          "type": "string",
          "description": "Recipient last name."
        },
        "addressLine1": {
          "type": "string",
          "description": "Primary street address line."
        },
        "addressLine2": {
          "type": "string",
          "description": "Secondary address line such as apartment or suite."
        },
        "postalCode": {
          "type": "string",
          "description": "Postal or ZIP code."
        },
        "city": {
          "type": "string",
          "description": "City name."
        },
        "country": {
          "type": "string",
          "description": "Country code in ISO 3166-1 alpha-2 format."
        }
      },
      "description": "Postal address associated with a charging key order."
    },
    "ChargingKeyOrdersListItem": {
      "type": "object",
      "required": [
        "id",
        "created",
        "updated",
        "state",
        "quantity"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Unique identifier of the order."
        },
        "created": {
          "type": "string",
          "format": "date-time",
          "description": "UTC timestamp when this order was created."
        },
        "updated": {
          "type": "string",
          "format": "date-time",
          "description": "UTC timestamp when this order was last updated."
        },
        "address": {
          "$ref": "#/$defs/ChargingKeyAddress",
          "description": "Shipping address associated with this order."
        },
        "quantity": {
          "type": "number",
          "description": "Number of charging keys included in the order."
        },
        "currency": {
          "type": "string",
          "description": "3-letter currency code"
        },
        "priceMinorInclVat": {
          "type": "integer",
          "format": "int32",
          "description": "price in minor units (example value is 10.10 SEK)"
        },
        "state": {
          "$ref": "#/$defs/OrderState",
          "description": "Current order state."
        },
        "hasReceipt": {
          "type": "boolean",
          "description": "Indicates whether a receipt is available for this order."
        }
      },
      "description": "A single charging key order entry in a list response."
    },
    "OrderState": {
      "type": "string",
      "enum": [
        "ORDER_FILLED",
        "ORDER_CANCELLED",
        "ORDER_PROCESSING",
        "ORDER_WAITING_3DS",
        "ORDER_PAYMENT_FAILED",
        "ORDER_REFUND_FAILED",
        "ORDER_REFUNDED",
        "ORDER_PLACED",
        "ORDER_PAID"
      ]
    }
  }
}