{"openapi":"3.1.0","info":{"title":"ParseID API","version":"0.1.0","description":"Deterministic parsing & validation for Indonesian document numbers (NIK, STNK plate, NPWP). No government database is queried and no personal data is stored."},"servers":[{"url":"https://parseid-api.parseid.workers.dev"}],"tags":[{"name":"NIK","description":"KTP identity number (16 digits)"},{"name":"Plate","description":"STNK vehicle plate"},{"name":"NPWP","description":"Taxpayer identification number"},{"name":"Batch","description":"Parse multiple documents in one request"}],"components":{"schemas":{},"parameters":{}},"paths":{"/nik/{nik}":{"get":{"tags":["NIK"],"summary":"Parse a 16-digit NIK (KTP)","description":"Decodes gender, birth date and region (province/regency/district) from a KTP identity number. No government database is queried and no personal data is stored.","parameters":[{"schema":{"type":"string","description":"16-digit NIK, e.g. 3174022501700001"},"required":true,"description":"16-digit NIK, e.g. 3174022501700001","name":"nik","in":"path"}],"responses":{"200":{"description":"Parse result. Always HTTP 200; check the `valid` field.","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"input":{"type":"string"},"normalized":{"type":"string"},"gender":{"type":"string","nullable":true,"enum":["L","P",null]},"birthDate":{"type":"object","nullable":true,"properties":{"day":{"type":"integer"},"month":{"type":"integer"},"yearTwoDigit":{"type":"integer"},"yearCandidates":{"type":"array","items":{"type":"integer"}},"yearResolved":{"type":"integer"},"yearIsAmbiguous":{"type":"boolean"}},"required":["day","month","yearTwoDigit","yearCandidates","yearResolved","yearIsAmbiguous"]},"region":{"type":"object","nullable":true,"properties":{"province":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["code","name"]},"regency":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["code","name"]},"district":{"type":"object","properties":{"code":{"type":"string"},"name":{"type":"string","nullable":true}},"required":["code","name"]}},"required":["province","regency","district"]},"serial":{"type":"string","nullable":true},"genderConsistent":{"type":"boolean"},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["valid","input","normalized","gender","birthDate","region","serial","genderConsistent","errors","warnings"]}}}}}}},"/plate/{plate}":{"get":{"tags":["Plate"],"summary":"Parse an Indonesian vehicle plate (STNK)","description":"Decodes registration region, vehicle class and suffix breakdown from a plate number.","parameters":[{"schema":{"type":"string","description":"Plate number, e.g. B 1234 ABC"},"required":true,"description":"Plate number, e.g. B 1234 ABC","name":"plate","in":"path"}],"responses":{"200":{"description":"Parse result. Always HTTP 200; check the `valid` field.","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"input":{"type":"string"},"normalized":{"type":"string"},"prefix":{"type":"string","nullable":true},"number":{"type":"string","nullable":true},"suffix":{"type":"string","nullable":true},"region":{"type":"object","nullable":true,"properties":{"code":{"type":"string"},"name":{"type":"string"},"area":{"type":"string"}},"required":["code","name","area"]},"vehicle":{"type":"object","nullable":true,"properties":{"code":{"type":"string"},"label":{"type":"string"}},"required":["code","label"]},"suffixDetail":{"type":"object","nullable":true,"properties":{"areaCode":{"type":"string","nullable":true},"classCode":{"type":"string","nullable":true},"serialCode":{"type":"string","nullable":true}},"required":["areaCode","classCode","serialCode"]},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["valid","input","normalized","prefix","number","suffix","region","vehicle","suffixDetail","errors","warnings"]}}}}}}},"/npwp/{npwp}":{"get":{"tags":["NPWP"],"summary":"Validate & parse an NPWP","description":"Validates the 15-digit legacy NPWP checksum and decodes its structure, or recognises the 16-digit NIK-based form.","parameters":[{"schema":{"type":"string","description":"15-digit NPWP, e.g. 09.254.294.3-407.000"},"required":true,"description":"15-digit NPWP, e.g. 09.254.294.3-407.000","name":"npwp","in":"path"}],"responses":{"200":{"description":"Parse result. Always HTTP 200; check the `valid` field.","content":{"application/json":{"schema":{"type":"object","properties":{"valid":{"type":"boolean"},"input":{"type":"string"},"normalized":{"type":"string"},"format":{"type":"string","nullable":true,"enum":["legacy-15","nik-16",null]},"type":{"type":"string","nullable":true},"typeLabel":{"type":"string","nullable":true},"kpp":{"type":"string","nullable":true},"serial":{"type":"string","nullable":true},"checkDigit":{"type":"string","nullable":true},"branch":{"type":"string","nullable":true},"branchLabel":{"type":"string","nullable":true},"status":{"type":"string","nullable":true},"checksumValid":{"type":"boolean","nullable":true},"errors":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]}}},"required":["valid","input","normalized","format","type","typeLabel","kpp","serial","checkDigit","branch","branchLabel","status","checksumValid","errors","warnings"]}}}}}}},"/batch":{"post":{"tags":["Batch"],"summary":"Parse multiple documents in one request","description":"Accepts up to 100 mixed NIK / plate / NPWP items and returns results in the same order.","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["nik","plate","npwp"]},"value":{"type":"string"}},"required":["type","value"]},"maxItems":100}},"required":["items"]}}}},"responses":{"200":{"description":"Results in request order","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["nik","plate","npwp"]},"value":{"type":"string"},"result":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","value","result"]}}},"required":["results"]}}}}}}}}}