{"openapi":"3.1.0","info":{"title":"Gridex Partner API","version":"2026-08-17.1","description":"Small backend-to-backend API for location resolution, electricity pricing, contract registration, customer/site data, invoices, measurements and change notifications. The API credential determines the company and Gridex resolves internal grid, market and product configuration server-side."},"servers":[{"url":"https://app.gridex.se/api/partner/v1"}],"security":[{"BearerAuth":[]}],"paths":{"/location":{"get":{"summary":"Resolve electricity location","description":"Resolves a Swedish postal code and optional address to price area, grid area and grid owner. A postal code that spans conflicting price areas is returned as ambiguous rather than guessed. `status: resolved` and `verified: true` require usable price-area assurance (fresh verified or estimated geodata). Last-known identifiers behind stale or unverified geodata are returned as provisional: `status: partial`, `verified: false` and the warning `location_identifiers_provisional`; such a location never yields a price. `grid_owner.verified` describes geographic identity only, not operational Ediel routing readiness.","parameters":[{"name":"postal_code","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{5}$"},"description":"Swedish five-digit postal code."},{"name":"address","in":"query","required":false,"schema":{"type":"string"},"description":"Street address. Recommended and required when the postal code is ambiguous."},{"name":"city","in":"query","required":false,"schema":{"type":"string"},"description":"City. Recommended together with address."}],"responses":{"200":{"description":"Location resolved","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LocationResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/price/current":{"get":{"summary":"Get current market electricity price","description":"Resolves the customer location and returns the current verified market-price interval from the same configured Gridex market-price source used internally.","parameters":[{"name":"postal_code","in":"query","required":true,"schema":{"type":"string","pattern":"^\\d{5}$"},"description":"Swedish five-digit postal code."},{"name":"address","in":"query","required":false,"schema":{"type":"string"},"description":"Street address. Recommended and required when the postal code is ambiguous."},{"name":"city","in":"query","required":false,"schema":{"type":"string"},"description":"City. Recommended together with address."}],"responses":{"200":{"description":"Current market price","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentPriceResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/price":{"post":{"summary":"Calculate customer price","description":"Resolves location and the credential default offer, then calculates the quote with the same Gridex pricing engine used by Ops. Internal company, product, price-area, grid-owner and offer identifiers are never accepted. The default offer and the quote both use the API publication channel: an API-only offer is quoted, a Website-only offer is never used. The result is a total customer price estimate for the offer (spot or other base price plus the offer's supplier components, VAT included where stated); `/price/current` instead returns the bare market spot interval excluding VAT and all fees.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceRequest"}}}},"responses":{"200":{"description":"Price calculated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/contract":{"post":{"summary":"Create contract","description":"Combined registration. Creates the customer, site and contract in one transaction. A power of attorney may be included. The site electricity type must match the selected published offer; a mismatch returns 422 site_offer_direction_mismatch before registration or document upload. An unavailable canonical offer direction returns 503 offer_direction_unavailable.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":200},"description":"Unique key for the business write. Reuse the same key only when retrying the same request. A completed write replays its stored result. `503 idempotency_completion_uncertain` means the write may already be saved: retry with the same key and payload, never with a new key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContractRequest"}}}},"responses":{"201":{"description":"Contract created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateContractResponse"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customer":{"post":{"summary":"Create customer","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":200},"description":"Unique key for the business write. Reuse the same key only when retrying the same request. A completed write replays its stored result. `503 idempotency_completion_uncertain` means the write may already be saved: retry with the same key and payload, never with a new key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerInput"}}}},"responses":{"201":{"description":"Customer created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customer/{customer_id}/site":{"post":{"summary":"Create site","parameters":[{"$ref":"#/components/parameters/CustomerId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":200},"description":"Unique key for the business write. Reuse the same key only when retrying the same request. A completed write replays its stored result. `503 idempotency_completion_uncertain` means the write may already be saved: retry with the same key and payload, never with a new key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SiteInput"}}}},"responses":{"201":{"description":"Site created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customer/{customer_id}/site/{site_id}/powerofattorney":{"post":{"summary":"Upload power of attorney","parameters":[{"$ref":"#/components/parameters/CustomerId"},{"$ref":"#/components/parameters/SiteId"},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":200},"description":"Unique key for the business write. Reuse the same key only when retrying the same request. A completed write replays its stored result. `503 idempotency_completion_uncertain` means the write may already be saved: retry with the same key and payload, never with a new key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PowerOfAttorneyInput"}}}},"responses":{"201":{"description":"Power of attorney created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"summary":"Get power of attorney","parameters":[{"$ref":"#/components/parameters/CustomerId"},{"$ref":"#/components/parameters/SiteId"}],"responses":{"200":{"description":"Power of attorney","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PowerOfAttorney"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/contract/{contract_id}/state":{"get":{"summary":"Get contract state","parameters":[{"$ref":"#/components/parameters/ContractId"}],"responses":{"200":{"description":"Contract state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContractState"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customer/{customer_id}":{"get":{"summary":"Get customer","parameters":[{"$ref":"#/components/parameters/CustomerId"}],"responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customer/{customer_id}/site/{site_id}":{"get":{"summary":"Get site","parameters":[{"$ref":"#/components/parameters/CustomerId"},{"$ref":"#/components/parameters/SiteId"}],"responses":{"200":{"description":"Site","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Site"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customer/{customer_id}/site/{site_id}/invoice":{"get":{"summary":"List invoices for site","description":"Returns invoices of contracts belonging to the requested site, newest first (issued_at descending, invoices without issued_at last), at most 100 per page. The site filter is applied before the page limit. Without `cursor` the response is the first page, identical to earlier V1 behaviour. When more invoices exist the response carries `X-Gridex-Next-Cursor`; send it unchanged as `cursor` with the same from_date/to_date to continue. The cursor is opaque and bound to the API company, customer, site and date filter; a modified or foreign cursor returns 400 invalid_cursor. Only invoices with status issued, sent, paid, overdue, cancelled or credited are returned (drafts and failed invoices never are; the same applies to invoice detail and PDF). from_date/to_date and invoice_date are Europe/Stockholm calendar dates.","parameters":[{"$ref":"#/components/parameters/CustomerId"},{"$ref":"#/components/parameters/SiteId"},{"name":"from_date","in":"query","schema":{"type":"string","format":"date"}},{"name":"to_date","in":"query","schema":{"type":"string","format":"date"}},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"Opaque continuation value from X-Gridex-Next-Cursor of the previous page."}],"responses":{"200":{"description":"Invoices","headers":{"X-Gridex-Next-Cursor":{"description":"Present only when another page exists.","schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceList"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/invoice/{invoice_id}":{"get":{"summary":"Get invoice","parameters":[{"$ref":"#/components/parameters/InvoiceId"}],"responses":{"200":{"description":"Invoice","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Invoice"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/invoice/{invoice_id}/pdf":{"get":{"summary":"Get invoice PDF","parameters":[{"$ref":"#/components/parameters/InvoiceId"}],"responses":{"200":{"description":"Invoice PDF","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PdfDocument"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/customer/{customer_id}/site/{site_id}/measurement":{"get":{"summary":"Get measurements","description":"Returns only the current revision of each interval (replaced, superseded and void corrections are excluded before the row limit), so a corrected interval appears once. `value` is always the canonical kWh quantity normalized at ingest (Wh/MWh sources are converted once at ingest and never again) and `unit` is always kWh. `type` is the gross direction CONSUMPTION or PRODUCTION; net series (net_consumption/net_production) are not part of this response, so they are never mislabelled as or added to gross values. from_date/to_date are Europe/Stockholm calendar days: intervals with period_start from 00:00 local on from_date up to (excluding) 00:00 local on the day after to_date, so the last interval of the day is included and DST days have 23 or 25 hourly values.","parameters":[{"$ref":"#/components/parameters/CustomerId"},{"$ref":"#/components/parameters/SiteId"},{"name":"from_date","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"to_date","in":"query","required":true,"schema":{"type":"string","format":"date"}},{"name":"resolution","in":"query","schema":{"type":"string","enum":["15m","1h"],"default":"1h"}}],"responses":{"200":{"description":"Complete measurements for the requested supported interval. Backend pagination is drained; results are never silently truncated. A failed or bounded-out read returns 503 measurement_read_incomplete. Concurrent writes are not represented by an atomic snapshot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeasurementResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/webhook/subscription":{"post":{"summary":"Create webhook subscription","description":"Registers one event subscription. target_url must be a public HTTPS endpoint. The signing secret is supplied by the partner and stored in Gridex Vault.","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","minLength":8,"maxLength":200},"description":"Unique key for the business write. Reuse the same key only when retrying the same request. A completed write replays its stored result. `503 idempotency_completion_uncertain` means the write may already be saved: retry with the same key and payload, never with a new key."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSubscriptionInput"}}}},"responses":{"201":{"description":"Webhook subscription created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"400":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"webhooks":{"resourceChanged":{"post":{"summary":"Signed change notification","description":"Treat the webhook as a signal. Verify the HMAC-SHA256 signature, then call the relevant GET endpoint for current state.","security":[],"parameters":[{"name":"x-gridex-timestamp","in":"header","required":true,"schema":{"type":"string"}},{"name":"x-gridex-signature","in":"header","required":true,"schema":{"type":"string","pattern":"^sha256="}},{"name":"x-gridex-event-id","in":"header","required":true,"schema":{"type":"string"}},{"name":"x-gridex-delivery-id","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookNotification"}}}},"responses":{"200":{"description":"Receiver accepted the notification"}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"Server-side Gridex API key. Never expose it in a browser or mobile application."}},"parameters":{"CustomerId":{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque entity_id returned by the Partner API."},"SiteId":{"name":"site_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque entity_id returned by the Partner API."},"ContractId":{"name":"contract_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque entity_id returned by the Partner API."},"InvoiceId":{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string"},"description":"Opaque entity_id returned by the Partner API."}},"schemas":{"EntityResponse":{"type":"object","additionalProperties":false,"required":["entity_id"],"properties":{"entity_id":{"type":"string"}}},"CustomerInput":{"type":"object","additionalProperties":false,"required":["soc_id","customer_type","email"],"properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"soc_id":{"type":"string","description":"Personal identity number for PRIVATE or organisation number for COMPANY."},"customer_type":{"type":"string","enum":["PRIVATE","COMPANY"]},"company_name":{"type":"string"},"invoice_address":{"type":"string"},"zip_code":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","default":"SE"},"email":{"type":"string","format":"email"},"cell_phone":{"type":"string"}}},"Customer":{"type":"object","additionalProperties":false,"description":"Customer as returned by GET. A closed response object: every field is always present; fields not stored for the customer are null.","required":["entity_id","first_name","last_name","soc_id","customer_type","company_name","invoice_address","zip_code","city","country","email","cell_phone"],"properties":{"entity_id":{"type":"string"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"soc_id":{"type":["string","null"],"description":"Personal identity number for PRIVATE or organisation number for COMPANY."},"customer_type":{"type":"string","enum":["PRIVATE","COMPANY"]},"company_name":{"type":["string","null"]},"invoice_address":{"type":["string","null"]},"zip_code":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"email":{"type":["string","null"]},"cell_phone":{"type":["string","null"]}}},"SiteInput":{"type":"object","additionalProperties":false,"required":["address","zip_code","city","site_electricity_type"],"properties":{"address":{"type":"string"},"zip_code":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","default":"SE"},"site_electricity_type":{"type":"string","enum":["CONSUMPTION","PRODUCTION"]}}},"Site":{"type":"object","additionalProperties":false,"description":"Site as returned by GET. A closed response object: every field is always present; address fields not stored for the site are null.","required":["entity_id","address","zip_code","city","country","site_electricity_type"],"properties":{"entity_id":{"type":"string"},"address":{"type":["string","null"]},"zip_code":{"type":["string","null"]},"city":{"type":["string","null"]},"country":{"type":["string","null"]},"site_electricity_type":{"type":"string","enum":["CONSUMPTION","PRODUCTION"]}}},"PowerOfAttorneyInput":{"type":"object","additionalProperties":false,"required":["poa_type","transaction_type","file_base64","file_extension"],"properties":{"poa_type":{"type":"string","enum":["WEB","PAPER","AUDIO"]},"transaction_type":{"type":"string","enum":["SWITCH","MOVE_OUT"]},"file_base64":{"type":"string","description":"Signed PDF encoded as base64. Maximum decoded size 5 MB. The file must be a readable PDF document (header, cross-reference, catalog and at least one page); otherwise 422 poa_file_signature_invalid and nothing is stored. Structural validation does not verify a digital signature."},"file_extension":{"type":"string","enum":["pdf"]}}},"PowerOfAttorney":{"type":"object","additionalProperties":false,"required":["entity_id","poa_type","transaction_type","file_base64","file_extension"],"properties":{"entity_id":{"type":"string"},"poa_type":{"type":"string","enum":["WEB","PAPER","AUDIO"]},"transaction_type":{"type":"string","enum":["SWITCH","MOVE_OUT"]},"file_base64":{"type":["string","null"]},"file_extension":{"type":["string","null"]}}},"CreateContractRequest":{"type":"object","additionalProperties":false,"required":["customer","site"],"properties":{"customer":{"$ref":"#/components/schemas/CustomerInput"},"site":{"$ref":"#/components/schemas/SiteInput"},"power_of_attorney":{"$ref":"#/components/schemas/PowerOfAttorneyInput"}}},"CreateContractResponse":{"type":"object","additionalProperties":false,"required":["entity_id","customer","site","power_of_attorney"],"properties":{"entity_id":{"type":"string"},"customer":{"$ref":"#/components/schemas/EntityResponse"},"site":{"$ref":"#/components/schemas/EntityResponse"},"power_of_attorney":{"anyOf":[{"$ref":"#/components/schemas/EntityResponse"},{"type":"null"}]}}},"ContractState":{"type":"object","additionalProperties":false,"required":["entity_id","state"],"properties":{"entity_id":{"type":"string"},"state":{"type":"string"}}},"Invoice":{"type":"object","additionalProperties":false,"required":["entity_id","invoice_number","invoice_date","due_date","amount","currency","status"],"properties":{"entity_id":{"type":"string"},"invoice_number":{"type":["string","null"]},"invoice_date":{"type":["string","null"],"format":"date"},"due_date":{"type":["string","null"],"format":"date"},"amount":{"type":["number","null"]},"currency":{"type":["string","null"],"default":"SEK"},"status":{"type":["string","null"]}}},"InvoiceList":{"type":"object","additionalProperties":false,"required":["invoices"],"properties":{"invoices":{"type":"array","items":{"$ref":"#/components/schemas/Invoice"}}}},"PdfDocument":{"type":"object","additionalProperties":false,"required":["entity_id","file_base64","file_extension"],"properties":{"entity_id":{"type":"string"},"file_base64":{"type":"string"},"file_extension":{"type":"string","const":"pdf"}}},"Measurement":{"type":"object","additionalProperties":false,"required":["timestamp","value","unit","type"],"properties":{"timestamp":{"type":"string","format":"date-time"},"value":{"type":["number","null"]},"unit":{"type":"string","const":"kWh"},"type":{"type":"string","enum":["CONSUMPTION","PRODUCTION"]}}},"MeasurementResponse":{"type":"object","additionalProperties":false,"required":["site_id","measurements"],"properties":{"site_id":{"type":"string"},"measurements":{"type":"array","items":{"$ref":"#/components/schemas/Measurement"}}}},"WebhookSubscriptionInput":{"type":"object","additionalProperties":false,"required":["webhook_event","target_url","signing_secret"],"properties":{"webhook_event":{"type":"string","enum":["CUSTOMER_CREATED","CUSTOMER_UPDATED","SITE_CREATED","SITE_UPDATED","POWER_OF_ATTORNEY_CREATED","CONTRACT_CREATED","CONTRACT_STATUS_CHANGE","INVOICE_CREATED","INVOICE_UPDATED"]},"target_url":{"type":"string","format":"uri","pattern":"^https://"},"notification_email":{"type":"string","format":"email"},"signing_secret":{"type":"string","minLength":32,"writeOnly":true}}},"WebhookNotification":{"type":"object","required":["event_id","event_type","created_at","resource","data","api_version","delivery_id"],"properties":{"event_id":{"type":"string"},"event_type":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"resource":{"type":"object","required":["type","reference"],"properties":{"type":{"type":"string"},"reference":{"type":"string"}}},"data":{"type":"object","additionalProperties":true},"api_version":{"type":"string"},"delivery_id":{"type":"string"}},"additionalProperties":true},"ErrorResponse":{"type":"object","required":["error","request_id"],"properties":{"error":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"field":{"type":"string"}}},"request_id":{"type":"string"}}},"Location":{"type":"object","additionalProperties":false,"required":["postal_code","status","price_area","grid_area","grid_owner","confidence","price_area_confidence","requires_address","required_fields"],"properties":{"postal_code":{"type":"string","pattern":"^\\d{5}$"},"city":{"type":["string","null"]},"status":{"type":"string","enum":["resolved","partial","ambiguous","unresolved"]},"price_area":{"type":["string","null"],"enum":["SE1","SE2","SE3","SE4",null],"description":"Null when the price area is ambiguous or unresolved."},"grid_area":{"type":["object","null"],"description":"Null when no grid area could be identified. `name` is null for postal-code-only (provisional) or partial results.","additionalProperties":false,"required":["code","name","verified"],"properties":{"code":{"type":"string"},"name":{"type":["string","null"]},"verified":{"type":"boolean"}}},"grid_owner":{"type":["object","null"],"description":"Null when the postal code spans several grid areas/owners; send address and city to resolve it.","additionalProperties":false,"required":["name","verified"],"properties":{"name":{"type":"string"},"verified":{"type":"boolean"}}},"confidence":{"type":"number","minimum":0,"maximum":1},"price_area_confidence":{"type":"number","minimum":0,"maximum":1},"resolution_method":{"type":["string","null"]},"requires_address":{"type":"boolean","description":"True when the area is ambiguous or unresolved, when price-area assurance is not usable, or when the postal code spans several grid areas/owners."},"required_fields":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}},"LocationResponse":{"type":"object","additionalProperties":false,"required":["location"],"properties":{"location":{"$ref":"#/components/schemas/Location"}}},"CurrentPriceResponse":{"type":"object","additionalProperties":false,"required":["location","market_price"],"properties":{"location":{"$ref":"#/components/schemas/Location"},"market_price":{"type":"object","additionalProperties":false,"required":["provider","price_area","resolution","available_resolutions","valid_from","valid_to","price_sek_per_kwh_ex_vat","price_ore_per_kwh_ex_vat","currency","includes_vat","includes_supplier_fees","includes_grid_fees","source_as_of","next_update_at"],"properties":{"provider":{"type":"string"},"price_area":{"type":"string","enum":["SE1","SE2","SE3","SE4"]},"resolution":{"type":"string","enum":["hourly","quarterly"]},"available_resolutions":{"type":"array","items":{"type":"string","enum":["hourly","quarterly"]}},"valid_from":{"type":"string","format":"date-time"},"valid_to":{"type":"string","format":"date-time"},"price_sek_per_kwh_ex_vat":{"type":"number"},"price_ore_per_kwh_ex_vat":{"type":"number"},"currency":{"type":"string","enum":["SEK"]},"includes_vat":{"type":"boolean","enum":[false]},"includes_supplier_fees":{"type":"boolean","enum":[false]},"includes_grid_fees":{"type":"boolean","enum":[false]},"source_as_of":{"type":"string","format":"date-time"},"next_update_at":{"type":"string","format":"date-time"}}}}},"PriceRequest":{"type":"object","additionalProperties":false,"required":["postal_code","annual_consumption_kwh"],"properties":{"postal_code":{"type":"string","pattern":"^\\d{5}$"},"address":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","default":"SE"},"annual_consumption_kwh":{"type":"number","exclusiveMinimum":0},"customer_type":{"type":"string","enum":["PRIVATE","COMPANY"],"default":"PRIVATE"},"start_date":{"type":"string","format":"date"},"invoice_delivery_method":{"type":"string","enum":["email","e_invoice","paper"]}},"example":{"postal_code":"11122","address":"Exempelgatan 1","city":"Stockholm","annual_consumption_kwh":3500,"customer_type":"PRIVATE"}},"PriceComponent":{"type":"object","additionalProperties":false,"properties":{"code":{"type":["string","null"]},"name":{"type":["string","null"]},"quantity":{"type":["number","null"]},"unit":{"type":["string","null"]},"unit_price_ex_vat":{"type":["number","null"]},"amount_ex_vat":{"type":["number","null"]},"vat_rate":{"type":["number","null"],"description":"Decimal VAT fraction: 0.25 means 25%; 0 means a VAT exemption. Null means the rate is unknown or not determined."},"vat_amount":{"type":["number","null"]},"amount_inc_vat":{"type":["number","null"]}}},"PriceResponse":{"type":"object","additionalProperties":false,"required":["quote_reference","valid_until","location","offer","customer_price","estimated_cost","price_components","is_binding","warnings","assumptions"],"properties":{"quote_reference":{"type":"string"},"valid_until":{"type":"string","format":"date-time"},"location":{"$ref":"#/components/schemas/Location"},"offer":{"type":"object","additionalProperties":false,"required":["name","code","contract_type"],"properties":{"name":{"type":["string","null"]},"code":{"type":["string","null"]},"contract_type":{"type":["string","null"]}}},"customer_price":{"type":"object","additionalProperties":false,"required":["estimated_sek_per_kwh_inc_vat","currency","unit"],"properties":{"estimated_sek_per_kwh_inc_vat":{"type":["number","null"]},"currency":{"type":"string","enum":["SEK"]},"unit":{"type":"string","enum":["kWh"]}}},"estimated_cost":{"type":"object","additionalProperties":false,"required":["monthly_ex_vat","monthly_vat","monthly_inc_vat","annual_ex_vat","annual_vat","annual_inc_vat","currency"],"properties":{"monthly_ex_vat":{"type":["number","null"]},"monthly_vat":{"type":["number","null"]},"monthly_inc_vat":{"type":["number","null"]},"annual_ex_vat":{"type":["number","null"]},"annual_vat":{"type":["number","null"]},"annual_inc_vat":{"type":["number","null"]},"currency":{"type":"string","enum":["SEK"]}}},"price_components":{"type":"array","items":{"$ref":"#/components/schemas/PriceComponent"}},"is_binding":{"type":"boolean","enum":[false]},"warnings":{"type":"array","items":{"type":"string"}},"assumptions":{"type":"array","items":{"type":"string"}}}}}}}