{
  "openapi": "3.1.0",
  "info": {
    "title": "Hiroship public API",
    "version": "2026-10",
    "summary": "Plans and prices for Hiroship, a Shopify app for Bring and Helthjem shipping.",
    "description": "Public, free and read-only. No authentication, no API key. Errors use RFC 9457 problem details (application/problem+json). Limits: 60 requests a minute per client (RateLimit headers on every response). Versioning follows Shopify: a dated stable version every quarter (January, April, July, October) in the path, /api/{version}/…, each supported for at least 12 months; \"unstable\" changes at any time. GET /api/versions lists them, and every answer names its version in the Hiroship-Api-Version header. This document describes 2026-10, the latest stable version.",
    "contact": {
      "name": "Hiroship",
      "email": "support@hiroship.no",
      "url": "https://hiroship.no/en/contact"
    }
  },
  "servers": [
    {
      "url": "https://hiroship.no"
    }
  ],
  "externalDocs": {
    "description": "Developer docs",
    "url": "https://hiroship.no/en/docs"
  },
  "tags": [
    {
      "name": "pricing",
      "description": "Plans and quotes"
    },
    {
      "name": "leads",
      "description": "Waitlist and call requests from the website"
    }
  ],
  "paths": {
    "/api/2026-10/quote": {
      "get": {
        "operationId": "getQuote",
        "tags": [
          "pricing"
        ],
        "summary": "Quote the plan for a shipment volume",
        "description": "Returns the cheapest plan that covers the shipments per month and locations, with the monthly price.",
        "parameters": [
          {
            "name": "shipments",
            "in": "query",
            "required": true,
            "description": "Shipments per month.",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 1000000
            },
            "example": 120
          },
          {
            "name": "locations",
            "in": "query",
            "required": false,
            "description": "Locations that ship.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000,
              "default": 1
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language of the plan name.",
            "schema": {
              "type": "string",
              "enum": [
                "nb",
                "en"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The quote.",
            "headers": {
              "RateLimit-Policy": {
                "description": "The rate-limit policy (IETF draft): name, quota q and window w in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Remaining requests r and seconds to reset t in the current window.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Quote"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is missing or out of range.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says when to try again.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/2026-10/plans": {
      "get": {
        "operationId": "listPlans",
        "tags": [
          "pricing"
        ],
        "summary": "List every plan",
        "description": "Every plan with its price and limits. Plans differ only by shipments per month and locations.",
        "responses": {
          "200": {
            "description": "The plans.",
            "headers": {
              "RateLimit-Policy": {
                "description": "The rate-limit policy (IETF draft): name, quota q and window w in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Remaining requests r and seconds to reset t in the current window.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "currency": {
                      "type": "string"
                    },
                    "nokPerUsd": {
                      "type": "number"
                    },
                    "placeholderPrices": {
                      "type": "boolean"
                    },
                    "billing": {
                      "type": "string"
                    },
                    "plans": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Plan"
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/2026-10/savings": {
      "post": {
        "operationId": "estimateSavings",
        "tags": [
          "pricing"
        ],
        "summary": "Estimate shipping savings with the planned Bring pool agreement",
        "description": "Takes totals per Bring product code (parcels and NOK over a number of months) and returns a yearly savings range. An estimate only: the agreement with Bring is not signed.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "months",
                  "products"
                ],
                "properties": {
                  "months": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 12,
                    "description": "Months the totals cover."
                  },
                  "products": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "required": [
                        "productCode",
                        "qty",
                        "nok"
                      ],
                      "properties": {
                        "productCode": {
                          "type": "string",
                          "pattern": "^\\d{3,6}$",
                          "description": "Bring product code, such as 5800."
                        },
                        "qty": {
                          "type": "number",
                          "minimum": 0
                        },
                        "nok": {
                          "type": "number",
                          "minimum": 0,
                          "description": "Agreement price total in NOK, excl. VAT."
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "months": 1,
                "products": [
                  {
                    "productCode": "5800",
                    "qty": 120,
                    "nok": 11400
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The estimate.",
            "headers": {
              "RateLimit-Policy": {
                "description": "The rate-limit policy (IETF draft): name, quota q and window w in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Remaining requests r and seconds to reset t in the current window.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "currency",
                    "period",
                    "low",
                    "high",
                    "label"
                  ],
                  "properties": {
                    "currency": {
                      "type": "string",
                      "const": "NOK"
                    },
                    "period": {
                      "type": "string",
                      "const": "year"
                    },
                    "low": {
                      "type": "integer"
                    },
                    "high": {
                      "type": "integer"
                    },
                    "coveredQty": {
                      "type": "integer"
                    },
                    "uncoveredQty": {
                      "type": "integer"
                    },
                    "label": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is invalid.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/versions": {
      "get": {
        "operationId": "listVersions",
        "tags": [
          "pricing"
        ],
        "summary": "List the API versions",
        "description": "Every API version with its status (stable, release_candidate, unstable), release date and the date its support ends. latest is the newest stable version.",
        "responses": {
          "200": {
            "description": "The versions.",
            "headers": {
              "RateLimit-Policy": {
                "description": "The rate-limit policy (IETF draft): name, quota q and window w in seconds.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Remaining requests r and seconds to reset t in the current window.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "latest",
                    "versions"
                  ],
                  "properties": {
                    "latest": {
                      "type": "string",
                      "example": "2026-10"
                    },
                    "versions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "name",
                          "status"
                        ],
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string",
                            "enum": [
                              "stable",
                              "release_candidate",
                              "unstable"
                            ]
                          },
                          "releasedOn": {
                            "type": "string",
                            "format": "date"
                          },
                          "supportedUntil": {
                            "type": "string",
                            "format": "date"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/lead": {
      "post": {
        "operationId": "createLead",
        "tags": [
          "leads"
        ],
        "summary": "Join the waitlist or request a call",
        "description": "Used by the website's forms. Stores the request and notifies the Hiroship team.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "kind",
                  "name",
                  "phone",
                  "storeUrl"
                ],
                "properties": {
                  "kind": {
                    "type": "string",
                    "enum": [
                      "waitlist",
                      "call"
                    ]
                  },
                  "name": {
                    "type": "string"
                  },
                  "phone": {
                    "type": "string"
                  },
                  "storeUrl": {
                    "type": "string"
                  },
                  "parcelsPerMonth": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "marketingConsent": {
                    "type": "boolean",
                    "default": false
                  },
                  "lang": {
                    "type": "string",
                    "enum": [
                      "nb",
                      "en"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "kind": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is invalid; errors names them.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "The lead could not be stored.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Quote": {
        "type": "object",
        "required": [
          "plan",
          "planName",
          "priceUsd",
          "priceNokApprox",
          "shipmentsIncluded",
          "locationsIncluded",
          "usdPerShipment",
          "placeholderPrices"
        ],
        "properties": {
          "plan": {
            "type": "string",
            "enum": [
              "free",
              "starter",
              "growth",
              "pro"
            ],
            "description": "Plan id."
          },
          "planName": {
            "type": "string",
            "description": "Plan name in the requested language."
          },
          "priceUsd": {
            "type": "number",
            "description": "Monthly price in USD, billed through Shopify."
          },
          "priceNokApprox": {
            "type": "number",
            "description": "Approximate monthly price in NOK at 11 NOK per USD."
          },
          "shipmentsIncluded": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Shipments per calendar month. Null is unlimited."
          },
          "locationsIncluded": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Locations that can book. Null is unlimited."
          },
          "usdPerShipment": {
            "type": [
              "number",
              "null"
            ],
            "description": "Price per shipment at the requested volume, in USD."
          },
          "placeholderPrices": {
            "type": "boolean",
            "description": "True while the prices are placeholders not yet confirmed."
          }
        }
      },
      "Plan": {
        "type": "object",
        "required": [
          "id",
          "name",
          "priceUsd",
          "priceNokApprox",
          "shipmentsPerMonth",
          "locations"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "object",
            "properties": {
              "nb": {
                "type": "string"
              },
              "en": {
                "type": "string"
              }
            }
          },
          "priceUsd": {
            "type": "number"
          },
          "priceNokApprox": {
            "type": "number"
          },
          "shipmentsPerMonth": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null is unlimited."
          },
          "locations": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Null is unlimited."
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details.",
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code."
          },
          "detail": {
            "type": "string"
          },
          "hint": {
            "type": "string",
            "description": "How to fix the request."
          },
          "errors": {
            "type": "object",
            "additionalProperties": true
          }
        }
      }
    }
  }
}