Fedex Logo
Developer Portal

Postal Code Validation API

はじめに

フェデックスのお客様はフェデックス郵便番号検証 API によって、郵便番号を検証してサービス予定情報を取得できます。市区町村、郵便番号、国、および出荷地や仕向地に関連する検索と検証をサポートしています。確認済みの郵便番号および位置の詳細を返します。

郵便番号検証 API の詳細

郵便番号検証は、国および市区町村の郵便番号を検証し、正しい形式の郵便番号を返します。貨物の処理および出荷ラベルの作成には、正確な形式の郵便番号が必須です。

この API は、出荷日、郵便番号、国コード、その他のさまざまな情報など、提供された入力情報を基に、都道府県・州・省と市区町村に不一致がないか確認します。米国またはカナダの場合で、ならびに不一致が見つかった場合は、市区町村と州が設定されます。例えば:FDXE - FedEx Express®、FDXG - FedEx Ground® and FXSP - FedEx Ground® Economy(旧FedEx SmartPost®)。API は指定された入力を検証し、位置の詳細と正しい形式の郵便番号を提供します。

フェデックスは、郵便番号が存在する国と郵便番号が存在しない国の両方へのサービスをサポートしています。

郵便番号が存在する国

郵便番号が存在する国への出荷の場合、遅延を減らし輸送効率を上げるため、航空貨物運送状やその他の出荷書類に郵便番号を記入して頂く必要があります。FedEx Express のお客様は、以下の国に所在する荷受人の住所に有効な郵便番号をご記入ください。

郵便番号が存在する国の詳細については、郵便番号が存在する国を参照してください。

郵便番号が存在しない国

FedExがサービスを提供する国々の中には、郵便番号が存在しない国があり、その国への発送には郵便番号の記入を義務付けていません。顧客が郵便番号のない国に配送する場合は、都道府県・州・省コードまたは市区町村名で十分です。郵便番号を使用しない国に対して検証エラーが起きた場合は、郵便番号として\"00000\"を入力し、住所を強制的に通過させてみてください。この郵便番号は実際には存在しないため、入力しても問題が発生することはありません。

フェデックス郵便番号検証 API の利点:

  • 出荷の遅延を減らし、効率を高めます。
  • 時間通りの配達数および配達完了数を増やします。
  • 市街地へのフェデックスサービスを改善し、柔軟な集荷締切時間と集荷予約を提供します。

郵便番号検証 API のしくみ

フェデックス郵便番号検証は、以下のエンドポイントを使用して、市区町村、国、および出荷地と仕向地の郵便番号を検証します。次のセクションでは、エンドポイントの主要な入力と応答について説明します。

郵便番号の検証

このリクエストは、入力された詳細に基づいて、郵便番号の詳細、正しい形式の郵便番号、位置説明の応答を要求します。このリクエストに関連する主要な入力情報:

  • carrierCode
  • countryCode
  • stateOrProvinceCode
  • postalCode
  • shipDate

このリクエストの応答が成功すると、提供された入力のlocationdetailscleanedpostalcodeが返されます。国コード、都道府県・州・省/県、ZIP コード/郵便番号の組み合わせの郵便番号が無効な場合、リクエストは失敗に終わります。

一般的な誤解の明確化

  • テリトリーアライメントと ZIP コード/郵便アライメントは、まったく別個のアライメントプロセス出力であるため、相互参照することはできません。
  • 世界のすべての地理的位置に郵便番号または ZIP コードが存在するわけではありません。

特定の国または地域のリストの詳細については、特定の国または地域のサービスリストを参照してください。

ビジネス規則

  • 道路名と番地名などの組み合わせが、住所欄に記入されていなければなりません。住所欄がすべて空欄であってはなりません。
  • 荷受人の国が米国またはカナダの場合、あるいは EEI が適用されるメキシコ{MX}の場合は、2文字の都道府県・州・省または県のコードを記入しなければなりません。
  • 物理的な場所(行くことができる場所)の記述データは、実際の住所として、または一単位(米国内の州/ZIP コードの組み合わせなど)として扱わなければならない「\"address parts\」」の一部として使用することができます。
  • 郵便番号の形式と郵便番号の欄が存在するかどうかは国によって異なります。

JSON APIコレクション

Postal Code Validation API (1.0.0)

Validate Postal

Use this endpoint to validate postal codes and service commitments. Supports city, postal, country and origin-destination related lookups and validations.
Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.

header Parameters
x-customer-transaction-id
string
Example: 624deea6-b709-470c-8c39-4b5511281492

This element allows you to assign a unique identifier to your transaction. This element is also returned in the reply and helps you match the request to the reply.

content-type
required
string
Example: application/json

This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.

x-locale
string
Example: en_US

This indicates the combination of language code and country code. Click here to see Locales

authorization
required
string
Example: Bearer XXX

This indicates the authorization token for the input request.

Request Body schema: application/json
One of
  • FullSchema-ValidatePostal
  • MinimumSamplePayload
carrierCode
required
string
Enum: "FDXE" "FDXG" "FXSP" "FDXC" "FXCC"

Specify the four letter code of a FedEx operating company that meets your requirements
Examples of FedEx Operating Companies are:

  • FDXE - FedEx Express
  • FDXG - FedEx Ground
  • FXSP - FedEx SmartPost
  • FXCC - FedEx Custom Critical.

countryCode
required
string

The two-letter code used to identify a country.
Example:US
Click here to see Country Codes

stateOrProvinceCode
required
string

This is the state or province code. Format and presence of this field will vary, depending on country.
Example: US
Click here to see State Or Province Code

postalCode
required
string

Identification code of a region (usally small) for easier and accurate mail/package delivery. The format and presence of this field may vary depending on the country.
Example: 75063-8659
Click here to see Postal aware countries

shipDate
required
string

Specify the date on which the package is to be shipped. The specified date should not be the current date or any date, 10 days after the current date. The date format must be YYYY-MM-DD.
Example: 2019-10-04

routingCode
string

Specify the routing code for the shipment. Routing code is the information that identifies the route the package or shipment may take.
Example: Memphis 38017 - HKA/NQA

checkForMismatch
boolean

This element checks for mismatch between State/Province Code and Postal Code.

  • When the checkForMismatch is set TRUE, for U.S. and Canada: The values in State/Province Code are checked with respect to Postal Code provided. If these entries are valid, the response provides respective State/Province Code and Postal Code. In case of mismatch of Postal Code and State/Province Code an error message is displayed.
  • When the checkForMismatch is set FALSE, for U.S. and Canada: The values in State/Province Code are not checked with respect to Postal Code provided. Instead the given data is reflected in the response.

For regions other than U.S and Canada regardless of the value of checkForMismatch the State/Province Code are checked with respect to the Postal Code and the response provides the respective State/Province Code and Postal Code.

Responses

200

Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

Failure

503

Service Unavailable

post /country/v1/postal/validate

Sandbox Server

https://apis-sandbox.fedex.com/country/v1/postal/validate

Production Server

https://apis.fedex.com/country/v1/postal/validate

Request samples

Content type
application/json
Example
Copy
Expand all Collapse all
{
  • "carrierCode": "FDXG",
  • "countryCode": "US",
  • "stateOrProvinceCode": "US",
  • "postalCode": "502267",
  • "shipDate": "2019-10-04",
  • "routingCode": "Memphis 38017 - HKA/NQA",
  • "checkForMismatch": true
}

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "transactionId": "624deea6-b709-470c-8c39-4b5511281492",
  • "customerTransactionId": "AnyCo_order123456789",
  • "output":
    {
    }
}
CLOSE

Response

Copy