{
	"info": {
		"_postman_id": "passport-extractor-api-collection-v1",
		"name": "Passport Extractor API",
		"description": "API collection for passport data page extraction.\n\n## Features\n- Extract passport data from image files (JPG, JPEG, PNG)\n- Reads printed fields and the MRZ\n- MRZ is preferred when it disagrees with printed text\n\n## Authentication\nAll requests require an API key in the `x-api-co-id` header.\n\n## Base URL\n```\nhttps://use.api.co.id/ocr\n```\n\n## File Requirements\n- **Supported formats**: JPG, JPEG, PNG\n- **Maximum file size**: 5 MB\n- **Content**: Passport data page (photo page) image\n\n## Extracted Fields\n- Passport type\n- Country code\n- Passport number\n- Full name\n- Surname / given names (from MRZ)\n- Nationality\n- Date of birth\n- Sex\n- Place of birth\n- Date of issue\n- Date of expiry\n- Issuing office\n- Registration number\n- MRZ lines 1 & 2\n\nDates are returned as DD-MM-YYYY.",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "passport-extractor-api"
	},
	"item": [
		{
			"name": "Passport Extraction",
			"item": [
				{
					"name": "Extract Passport from Image",
					"request": {
						"method": "POST",
						"header": [
							{
								"key": "x-api-co-id",
								"value": "{{api_key}}",
								"description": "Your API key for authentication",
								"type": "text"
							}
						],
						"body": {
							"mode": "formdata",
							"formdata": [
								{
									"key": "file",
									"type": "file",
									"src": [],
									"description": "Passport data page image (JPG, JPEG, or PNG). Maximum size: 5 MB"
								}
							]
						},
						"url": {
							"raw": "{{base_url}}/ocr/passport-extract",
							"host": [
								"{{base_url}}"
							],
							"path": [
								"ocr",
								"passport-extract"
							]
						},
						"description": "Extract structured passport data from an uploaded image of the passport data page.\n\n### Request\n- **Method**: POST\n- **Content-Type**: multipart/form-data\n- **File field**: `file` (required)\n\n### Supported File Types\n- JPG/JPEG (image/jpeg)\n- PNG (image/png)\n\n### File Size Limit\n- Maximum: 5 MB\n\n### Response\nReturns passport fields plus the raw MRZ lines. Dates are DD-MM-YYYY, sex is M or F."
					},
					"response": [
						{
							"name": "Success - Passport Extracted",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "x-api-co-id",
										"value": "{{api_key}}",
										"type": "text"
									}
								],
								"body": {
									"mode": "formdata",
									"formdata": [
										{
											"key": "file",
											"type": "file",
											"src": "sim_sample.jpg"
										}
									]
								},
								"url": {
									"raw": "{{base_url}}/ocr/passport-extract",
									"host": [
										"{{base_url}}"
									],
									"path": [
										"ocr",
										"passport-extract"
									]
								}
							},
							"status": "OK",
							"code": 200,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n    \"is_success\": true,\n    \"message\": \"Success\",\n    \"data\": {\n        \"passport_type\": \"P\",\n        \"country_code\": \"IDN\",\n        \"passport_number\": \"X1234567\",\n        \"full_name\": \"JOHN DOE\",\n        \"surname\": \"DOE\",\n        \"given_names\": \"JOHN\",\n        \"nationality\": \"INDONESIA\",\n        \"date_of_birth\": \"01-01-1990\",\n        \"sex\": \"M\",\n        \"place_of_birth\": \"JAKARTA\",\n        \"date_of_issue\": \"01-01-2024\",\n        \"date_of_expiry\": \"01-01-2034\",\n        \"issuing_office\": \"JAKARTA PUSAT\",\n        \"registration_number\": \"1A2B3C4D5E6F\",\n        \"mrz_line1\": \"P<IDNDOE<<JOHN<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\",\n        \"mrz_line2\": \"X1234567<7IDN9001011M3401011<<<<<<<<<<<<<<<2\"\n    }\n}"
						},
						{
							"name": "Error - Missing API Key",
							"originalRequest": {
								"method": "POST",
								"header": [],
								"body": {
									"mode": "formdata",
									"formdata": [
										{
											"key": "file",
											"type": "file",
											"src": "sim_sample.jpg"
										}
									]
								},
								"url": {
									"raw": "{{base_url}}/ocr/passport-extract",
									"host": [
										"{{base_url}}"
									],
									"path": [
										"ocr",
										"passport-extract"
									]
								}
							},
							"status": "Unauthorized",
							"code": 401,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n    \"is_success\": false,\n    \"message\": \"User not authenticated\",\n    \"data\": null\n}"
						},
						{
							"name": "Error - Missing File",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "x-api-co-id",
										"value": "{{api_key}}",
										"type": "text"
									}
								],
								"body": {
									"mode": "formdata",
									"formdata": []
								},
								"url": {
									"raw": "{{base_url}}/ocr/passport-extract",
									"host": [
										"{{base_url}}"
									],
									"path": [
										"ocr",
										"passport-extract"
									]
								}
							},
							"status": "Bad Request",
							"code": 400,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n    \"is_success\": false,\n    \"message\": \"File is required. Please upload an image file using 'file' field in multipart/form-data\",\n    \"data\": null\n}"
						},
						{
							"name": "Error - Invalid File Type",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "x-api-co-id",
										"value": "{{api_key}}",
										"type": "text"
									}
								],
								"body": {
									"mode": "formdata",
									"formdata": [
										{
											"key": "file",
											"type": "file",
											"src": "document.pdf"
										}
									]
								},
								"url": {
									"raw": "{{base_url}}/ocr/passport-extract",
									"host": [
										"{{base_url}}"
									],
									"path": [
										"ocr",
										"passport-extract"
									]
								}
							},
							"status": "Bad Request",
							"code": 400,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n    \"is_success\": false,\n    \"message\": \"Invalid file type. Only JPG, JPEG, and PNG image files are allowed\",\n    \"data\": null\n}"
						},
						{
							"name": "Error - File Too Large",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "x-api-co-id",
										"value": "{{api_key}}",
										"type": "text"
									}
								],
								"body": {
									"mode": "formdata",
									"formdata": [
										{
											"key": "file",
											"type": "file",
											"src": "large_image.jpg"
										}
									]
								},
								"url": {
									"raw": "{{base_url}}/ocr/passport-extract",
									"host": [
										"{{base_url}}"
									],
									"path": [
										"ocr",
										"passport-extract"
									]
								}
							},
							"status": "Bad Request",
							"code": 400,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n    \"is_success\": false,\n    \"message\": \"File size exceeds maximum limit of 5 MB\",\n    \"data\": null\n}"
						},
						{
							"name": "Error - Insufficient Balance",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "x-api-co-id",
										"value": "{{api_key}}",
										"type": "text"
									}
								],
								"body": {
									"mode": "formdata",
									"formdata": [
										{
											"key": "file",
											"type": "file",
											"src": "sim_sample.jpg"
										}
									]
								},
								"url": {
									"raw": "{{base_url}}/ocr/passport-extract",
									"host": [
										"{{base_url}}"
									],
									"path": [
										"ocr",
										"passport-extract"
									]
								}
							},
							"status": "Payment Required",
							"code": 402,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n    \"is_success\": false,\n    \"message\": \"Insufficient points balance. Please top up to continue.\",\n    \"data\": null\n}"
						},
						{
							"name": "Error - Invalid Passport Image",
							"originalRequest": {
								"method": "POST",
								"header": [
									{
										"key": "x-api-co-id",
										"value": "{{api_key}}",
										"type": "text"
									}
								],
								"body": {
									"mode": "formdata",
									"formdata": [
										{
											"key": "file",
											"type": "file",
											"src": "random_image.jpg"
										}
									]
								},
								"url": {
									"raw": "{{base_url}}/ocr/passport-extract",
									"host": [
										"{{base_url}}"
									],
									"path": [
										"ocr",
										"passport-extract"
									]
								}
							},
							"status": "Bad Request",
							"code": 400,
							"_postman_previewlanguage": "json",
							"header": [
								{
									"key": "Content-Type",
									"value": "application/json"
								}
							],
							"cookie": [],
							"body": "{\n    \"is_success\": false,\n    \"message\": \"invalid passport or image blurry\",\n    \"data\": null\n}"
						}
					],
					"description": "Main endpoint for extracting passport data from uploaded images."
				}
			],
			"description": "Passport extraction endpoints for processing passport data page images."
		}
	],
	"variable": [
		{
			"key": "base_url",
			"value": "https://use.api.co.id",
			"type": "string",
			"description": "Base URL for the API"
		},
		{
			"key": "api_key",
			"value": "YOUR_API_KEY_HERE",
			"type": "string",
			"description": "Your API key for authentication. Get it from api.dashboard or your database."
		}
	]
}
