تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
يوضّح هذا المستند عددًا من السيناريوهات الواقعية التي تقدّم فيها واجهة برمجة التطبيقات Address Validation API إشارات استجابة قد تستدعي سلوك إصلاح من نظامك. اطّلِع على
أمثلة على سير العمل في
إنشاء منطق التحقّق من الصحة للحصول على السياق.
أمثلة شائعة: إصلاح
يوضّح هذا القسم أمثلة شائعة تقدّم فيها واجهة برمجة التطبيقات Address Validation API إشارات استجابة تشير إلى انخفاض جودة معلومات العنوان.
يجب إدخال المدينة والرمز البريدي
يوضّح هذا المثال إدخالاً يتضمّن عنوان الشارع فقط، بدون مدينة أو رمز بريدي.
تقدّم possibleNextAction إشارة أولية إلى أنّ العنوان قد لا يكون صالحًا للتسليم. تتيح المكوّنات الأخرى المميّزة أيضًا هذه الإمكانية، لذا يمكنك الاستعلام عن addressComponents لمعرفة المزيد:
تعرض Address Validation API البلد (الولايات المتحدة) فقط كـ CONFIRMED.
وتُرجع جميع عناصر العنوان الأخرى بتنسيق UNCONFIRMED_BUT_PLAUSIBLE، مع بعض الإغفالات المهمة للبيانات، مثل الموقع الجغرافي والرمز البريدي.
مرة أخرى، يقدّم الرمز possibleNextAction إشارة أولية إلى أنّ العنوان قد لا يكون صالحًا للتسليم. بالإضافة إلى ذلك، يشير validationGranularity إلى ROUTE، ما يعني أنّ هناك تطابقًا مع الشارع، ولكن لا تتوفّر معلومات كافية للوصول إلى المكان. بالإضافة إلى ذلك، السمة addressComplete غير متوفّرة في النتيجة، وبالتالي تكون قيمتها false. يكشف طلب بحث إضافي عن العنصر address
عن نوع مكوّن غير متوفّر:
"missingComponentTypes": [
"street_number"
]
أمثلة على الحالات الحدّية: إصلاح
في بعض الحالات، يعتمد قرارك بشأن تعديل العنوان أو تأكيده أو قبوله على سيناريو نشاطك التجاري المحدّد. توضّح الأمثلة أدناه سيناريوهات قد لا تندرج بشكل صارم ضمن فئة الإصلاح.
رقم شارع لم يتم تأكيده
في هذا السيناريو، لا يمكن لواجهة برمجة التطبيقات Address Validation API تأكيد رقم الشارع المقدَّم، ولكنها تشير إلى أنّ العنوان مكتمل.
ننصحك بالتحقّق من دمج مستوى دقّة التحقّق مع تقريب على مستوى المبنى فقط، بالإضافة إلى المكوّنات غير المؤكَّدة. يعرض طلب البحث عن السمة addressComponentscomponentType غير المؤكَّدة التالية:
في هذا المثال، تم ضبط confirmation_level الخاص بـ street_number على UNCONFIRMED_BUT_PLAUSIBLE. تعني الحالة غير مؤكَّدة أنّ الخدمة لا يمكنها مطابقة رقم الشارع 84 في مجموعة البيانات الخاصة بها، بينما تعني الحالة مقبولة أنّ بيانات المكوّن قد تظل صالحة.
لم يتم إدخال العنوان الفرعي
يصف هذا السيناريو عنوانًا لا يتضمّن سوى معلومات المبنى الفرعي، مثل رقم الشقة أو القسم. بخلاف ذلك، يمكن لواجهة برمجة التطبيقات Address Validation API التحقّق من صحة العنوان بالكامل. كما هو الحال عند عدم توفّر أي جزء من العنوان، تكون قيمة addressComplete هي false، وبالتالي لا تظهر عند الفحص اليدوي للقرار.
على سبيل المثال، لنفترض أنّ أحد العملاء أدخل عنوانًا صالحًا لمكتب تقييم الضرائب في مدينة سان فرانسيسكو، ولكنّه لم يُدخل رقم الغرفة.
تم إدخال العنوان
المنطقة
1 Doctor Carlton B Goodlett Place, San Francisco, CA 94102
الولايات المتحدة الأمريكية
قرار بشأن عدم توفّر العنوان الفرعي
في هذا المثال، لا تعرض النتيجة السمة addressComplete، لذا تكون false. لهذا السبب، ستعرف أنّ هناك عنصر عنوان واحدًا على الأقل غير متوقّع أو لم يتم حله أو غير متوفّر.
تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],["تاريخ التعديل الأخير: 2025-08-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThis document provides real-world examples of when the Address Validation API signals that an address needs to be fixed.\u003c/p\u003e\n"],["\u003cp\u003eThe API provides signals such as \u003ccode\u003evalidationGranularity\u003c/code\u003e, \u003ccode\u003econfirmationLevel\u003c/code\u003e, and \u003ccode\u003emissingComponentTypes\u003c/code\u003e to indicate potential issues with an address.\u003c/p\u003e\n"],["\u003cp\u003eCommon fix scenarios include missing city/postal code, missing street number, unconfirmed street number, and missing subpremise.\u003c/p\u003e\n"],["\u003cp\u003eThe recommended action for these scenarios is typically to prompt the user for the missing or unconfirmed information.\u003c/p\u003e\n"],["\u003cp\u003eWhether to fix, confirm, or accept an address can depend on specific business needs and risk tolerance.\u003c/p\u003e\n"]]],["The Address Validation API flags addresses needing correction through response signals. Common issues include missing city/postal codes or street numbers, where the API returns unconfirmed components and suggests user prompts for missing data. Edge cases, like unconfirmed street numbers or missing subpremises, trigger `UNCONFIRMED_BUT_PLAUSIBLE` or missing `addressComplete`, respectively. These scenarios might require user confirmation, depending on delivery risk. Missing subpremises are specifically flagged in the US and prompt a request to the user.\n"],null,["This document describes a number of real-world scenarios where the\nAddress Validation API provides response signals that might warrant a *fix* behavior\nfrom your system. See\n[Example workflows](/maps/documentation/address-validation/build-validation-logic#example-workflows) in\n**Build your validation logic** for context.\n| **Note:** The examples here are illustrative, but don't cover all scenarios.\n\nCommon examples: fix\n\nThis section describes common examples where the Address Validation API\nprovides response signals indicating lower quality address information.\n\nMissing city and postal code\n\nThis example illustrates an entry having only the street address, with no city\nor postal code.\n\n| Address entered | Region |\n|-------------------|--------|\n| 21 45 40th street | USA |\n\nVerdict for missing city and postal code\n\nThe example below emphasizes the important signals from the response. \n\n {\n \"inputGranularity\": \"PREMISE\",\n \"validationGranularity\": \"OTHER\",\n \"geocodeGranularity\": \"OTHER\",\n \"hasUnconfirmedComponents\": true,\n \"possibleNextAction\": \"FIX\"\n }\n\nThe `possibleNextAction` provides an initial indication that the address might\nnot be deliverable. The other highlighted components also support this\npossibility, so you can query the `addressComponents` to learn more: \n\n {\n \"componentName\": {\n \"text\": \"21\",\n \"languageCode\": \"en\"\n },\n \"componentType\": \"street_number\",\n \"confirmationLevel\": \"UNCONFIRMED_BUT_PLAUSIBLE\"\n },\n {\n \"componentName\": {\n \"text\": \"45 40th street\",\n \"languageCode\": \"en\"\n },\n \"componentType\": \"route\",\n \"confirmationLevel\": \"UNCONFIRMED_BUT_PLAUSIBLE\"\n },\n {\n \"componentName\": {\n \"text\": \"United States\",\n \"languageCode\": \"en\"\n },\n \"componentType\": \"country\",\n \"confirmationLevel\": \"CONFIRMED\"\n }\n\nThe Address Validation API returns only the country (United States) as `CONFIRMED`.\nIt returns all other address components as `UNCONFIRMED_BUT_PLAUSIBLE`, with\nsome important omissions to the data, such as locality and postal code.\n| **Action:** For this address, you might prompt your user for the missing information.\n\nMissing street number\n\nThis example shows a missing street number.\n\n| Address entered | Region |\n|-----------------------------------------|--------|\n| Buckingham Palace Road, SW1W 9TQ London | UK |\n\nVerdict for missing street number \n\n {\n \"inputGranularity\": \"PREMISE_PROXIMITY\",\n \"validationGranularity\": \"ROUTE\",\n \"geocodeGranularity\": \"ROUTE\",\n \"possibleNextAction\": \"FIX\"\n }\n\nOnce again, the `possibleNextAction` provides an initial indication that the\naddress might not be deliverable. Furthermore, the `validationGranularity` is\n`ROUTE`, which indicates a match to the street, but not enough information to\nget to the premise. Additionally, the `addressComplete` property is missing from\nthe verdict, and therefore it is `false`. A further query of the `address`\nobject reveals a missing component type: \n\n \"missingComponentTypes\": [\n \"street_number\"\n ]\n\n| **Action:** For this address, you might prompt your user for the missing information.\n\nEdge-case examples: fix\n\nIn some situations, whether you fix, confirm, or accept an address\ndepends on your particular business scenario. The examples below illustrate\nscenarios that might not strictly fall into a fix category.\n\nUnconfirmed street number\n\nIn this scenario, the Address Validation API cannot confirm the supplied street\nnumber, yet it indicates that the address is complete.\n\n| Address entered | Region |\n|---------------------------------------------|--------|\n| 84 Buckingham Palace Road, SW1W 9TQ, London | UK |\n\nVerdict for unconfirmed street number\n\nThe example below emphasizes the important signals. \n\n {\n \"inputGranularity\": \"PREMISE\",\n \"validationGranularity\": \"PREMISE_PROXIMITY\",\n \"geocodeGranularity\": \"PREMISE_PROXIMITY\",\n \"addressComplete\" : true,\n \"hasUnconfirmedComponents\": true,\n \"possibleNextAction\": \"ACCEPT\"\n }\n\nIt's worth investigating the combination of a validation granularity only to\npremise-level approximation along with unconfirmed components. A query of the\n`addressComponents` property shows the following unconfirmed `componentType`: \n\n {\n \"componentName\": {\n \"text\": \"84\",\n \"languageCode\": \"en\"\n },\n \"componentType\": \"street_number\",\n \"confirmationLevel\": \"UNCONFIRMED_BUT_PLAUSIBLE\"\n }\n\nHere, the `confirmation_level` of the `street_number` is set to\n`UNCONFIRMED_BUT_PLAUSIBLE`. *Unconfirmed* means that the service cannot match\nthe street number of 84 in its dataset, and *plausible* means that the\ncomponent data could still be valid.\n| **Action:** You can either accept the input as entered, or confirm with the customer to determine if the street number entered was intended or an error. Your response depends on the level of risk associated with your delivery. See [Implementation guidance](/maps/documentation/address-validation/build-validation-logic#implementation_guidance) in **Build your validation logic**.\n\nMissing subpremise\n\nThis scenario describes an address that is only missing a subpremise, such as an\napartment or department number. Otherwise, the Address Validation API can fully\nvalidate the address. As is the case when any address component is missing, the\nthe `addressComplete` is `false` and therefore not present on manual inspection\nof the verdict.\n| **Note:** In some countries, the Address Validation API cannot detect a missing subpremise; while in the US, a missing `SUB_PREMISE` indicates a non-deliverable address.\n\nTo illustrate, suppose a customer enters a valid address for the San Francisco\ncity assessor's office, but misses the room number from the input.\n\n| Address entered | Region |\n|------------------------------------------------------------|--------|\n| 1 Doctor Carlton B Goodlett Place, San Francisco, CA 94102 | USA |\n\nVerdict for missing subpremise\n\nIn this example, the verdict does not display the `addressComplete` property, so\ntherefore it is `false`. Because of this, you know that at least one address\nelement is unexpected, unresolved, or missing. \n\n {\n \"inputGranularity\": \"PREMISE\",\n \"validationGranularity\": \"PREMISE\",\n \"geocodeGranularity\": \"PREMISE\",\n \"hasInferredComponents\": true,\n \"possibleNextAction\": \"CONFIRM_ADD_SUBPREMISES\"\n }\n\nAn `address` query reveals the following: \n\n \"missingComponentTypes\": [\n \"subpremise\"\n ]\n\nUpon further inquiry, the USPS data provides a `dpvConfirmation` code of\n`D`, which also indicates a missing subpremise.\n| **Action:** For this address, you might prompt your user for the missing information."]]