{"openapi":"3.1.0","info":{"title":"FormNord partner-API","version":"1.0.0","description":"For FormNords printpartnere: hent printjobbene du har fått tilbud om, last ned filene, ta jobben og meld den sendt. Nøkkel bestilles på kundeservice@formnord.no. Maks 60 kall i minuttet per nøkkel. Dokumentasjon: https://formnord.no/print/partner/api","contact":{"email":"kundeservice@formnord.no","url":"https://formnord.no/print/partner/api"}},"servers":[{"url":"https://formnord.no/api/print/partner/v1"}],"security":[{"nokkel":[]}],"paths":{"/meg":{"get":{"summary":"Hvem nøkkelen tilhører","responses":{"200":{"description":"Partneren","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"partner":{"type":"object"}}}}}},"401":{"description":"Mangler eller ugyldig nøkkel","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}}}}},"/jobber":{"get":{"summary":"Jobbene du ser (uten leveringsadresse)","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["alle","ledig","mine"],"default":"alle"}}],"responses":{"200":{"description":"Jobbene, nyeste først","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"jobber":{"type":"array","items":{"$ref":"#/components/schemas/Jobb"}}}}}}},"401":{"description":"Mangler eller ugyldig nøkkel","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}},"429":{"description":"For mange kall","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}}}}},"/jobber/{id}":{"get":{"summary":"Én jobb, med leveringsadresse når du har tatt den","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]{12}$"}}],"responses":{"200":{"description":"Jobben","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"jobb":{"$ref":"#/components/schemas/Jobb"}}}}}},"404":{"description":"Fant ikke jobben","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}}}}},"/jobber/{id}/ta":{"post":{"summary":"Ta jobben. Den som tar den først, får den.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]{12}$"}}],"responses":{"200":{"description":"Jobben","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"jobb":{"$ref":"#/components/schemas/Jobb"}}}}}},"409":{"description":"Jobben er ikke ledig lenger (not_available)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}}}}},"/jobber/{id}/sendt":{"post":{"summary":"Meld jobben som sendt","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]{12}$"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["selskap","sporing","porto","kvittering"],"properties":{"selskap":{"type":"string","enum":["posten","postnord"]},"sporing":{"type":"string","description":"Sporingsnummeret, 8–40 bokstaver og tall"},"porto":{"type":"string","description":"Hva portoen kostet i kroner, f.eks. 76 eller 76,50"},"kvittering":{"type":"string","format":"binary","description":"Bilde (JPG, PNG, WEBP, HEIC) eller PDF, maks 10 MB"}}}}}},"responses":{"200":{"description":"Jobben","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"const":true},"jobb":{"$ref":"#/components/schemas/Jobb"}}}}}},"400":{"description":"Ugyldige felt (invalid_input)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}},"404":{"description":"Ikke din jobb","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}},"409":{"description":"Allerede meldt sendt (already_sent)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}}}}},"/jobber/{id}/filer/{hva}":{"get":{"summary":"Last ned en fil","description":"modell kan lastes ned før du tar jobben. slicet og kvittering først når jobben er din.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","pattern":"^[a-z0-9]{12}$"}},{"name":"hva","in":"path","required":true,"schema":{"type":"string","enum":["modell","slicet","kvittering"]}}],"responses":{"200":{"description":"Filen","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"403":{"description":"Ta jobben først (take_job_first)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}},"404":{"description":"Fant ikke filen","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Feil"}}}}}}}},"components":{"securitySchemes":{"nokkel":{"type":"http","scheme":"bearer","description":"fnp_…-nøkkelen du fikk fra FormNord"}},"schemas":{"Feil":{"type":"object","properties":{"ok":{"const":false},"kode":{"type":"string","enum":["unauthorized","rate_limited","invalid_request","invalid_input","not_found","not_available","already_sent","take_job_first"]},"grunn":{"type":"string","description":"Forklaring på norsk"}}},"Jobb":{"type":"object","properties":{"id":{"type":"string"},"ordre":{"type":"integer"},"status":{"type":"string","enum":["ledig","tatt","sendt"],"description":"ledig = du kan ta den. tatt/sendt = din jobb."},"min":{"type":"boolean"},"lagt_ut":{"type":"string","format":"date-time"},"frist":{"type":"string","format":"date","description":"Siste dag for sending"},"fil":{"type":"string"},"antall":{"type":"integer"},"materiale":{"type":"string"},"farge":{"type":"string"},"fyll_prosent":{"type":"number"},"mal_mm":{"type":"array","items":{"type":"number"}},"timer":{"type":"number"},"gram":{"type":"number"},"godtgjorelse_kr":{"type":"object","properties":{"tid":{"type":"number"},"plast":{"type":"number"},"emballasje":{"type":"number"},"totalt":{"type":"number"}}},"merknad":{"type":["string","null"]},"til":{"type":"object","properties":{"postnummer":{"type":"string"},"poststed":{"type":"string"}}},"filer":{"type":"object","properties":{"modell":{"type":"string"},"slicet":{"type":["string","null"]},"kvittering":{"type":["string","null"]}}},"tatt":{"type":["string","null"],"format":"date-time"},"mottaker":{"type":["object","null"],"description":"Bare i GET /jobber/{id} når jobben er din og ikke sendt. epost bare når kunden mangler mobilnummer.","properties":{"navn":{"type":"string"},"adresse":{"type":"string"},"postnummer":{"type":"string"},"poststed":{"type":"string"},"telefon":{"type":"string"},"epost":{"type":"string"}}},"sendt":{"type":["object","null"],"properties":{"tid":{"type":"string"},"selskap":{"type":"string"},"sporing":{"type":"string"},"sporing_url":{"type":"string"},"porto_kr":{"type":"number"}}}}}}}}