Postal Code Validation API
บทนำ
API สำหรับตรวจสอบรหัสไปรษณีย์ของ FedEx จะช่วยให้ลูกค้าของ FedEx สามารถตรวจสอบรหัสไปรษณีย์และรับข้อตกลงการให้บริการ โดยจะรองรับการค้นหาและการตรวจสอบที่เกี่ยวข้องกับเมือง รหัสไปรษณีย์ ประเทศ รวมถึงต้นทางและปลายทาง ซึ่งจะส่งคืนรายละเอียดที่ทำการไปรษณีย์และศูนย์บริการที่ยืนยันแล้วในการตอบกลับ
รายละเอียด API สำหรับการตรวจสอบรหัสไปรษณีย์
การตรวจสอบรหัสไปรษณีย์จะตรวจสอบความถูกต้องของรหัสไปรษณีย์สำหรับประเทศและเมืองต่างๆ และระบุรหัสไปรษณีย์ที่สะอาดเป็นการตอบกลับ โดยรหัสไปรษณีย์ที่มีรูปแบบถูกต้องจำเป็นสำหรับการดำเนินการจัดส่งหรือฉลากการจัดส่ง
API นี้จะใช้ข้อมูลที่ป้อนเข้ามา เช่น วันที่จัดส่ง รหัสไปรษณีย์ รหัสประเทศ และข้อมูลอื่นๆ และตรวจสอบความไม่ตรงกันระหว่างค่าของรัฐและเมือง โดยระบบจะตั้งค่าเมืองและรัฐหากพบว่าไม่ตรงกัน และหากประเทศเป็นสหรัฐอเมริกาหรือแคลิฟอร์เนีย ตัวอย่างเช่น: FDXE - FedEx Express®, FDXG - FedEx Ground® และ FXSP - FedEx Ground® Economy (เดิมเรียกว่า FedEx SmartPost®). API จะตรวจสอบข้อมูลที่ป้อนเข้ามาและระบุรายละเอียดสถานที่และรหัสไปรษณีย์ที่สะอาด
FedEx รองรับบริการทั้งในประเทศที่ใช้รหัสไปรษณีย์และประเทศที่ไม่ใช้รหัสไปรษณีย์
ประเทศที่ใช้รหัสไปรษณีย์
การจัดส่งไปยังประเทศเหล่านี้ควรมีรหัสไปรษณีย์ในใบตราส่งสินค้าทางอากาศและเอกสารอื่นๆ เพื่อช่วยลดความล่าช้าและเพิ่มประสิทธิภาพให้สูงสุด โดยลูกค้า FedEx Express ควรได้รับการแนะนำให้ใส่รหัสไปรษณีย์ที่ถูกต้องในที่อยู่สำหรับผู้รับที่อยู่ในประเทศด้านล่าง
หากต้องการข้อมูลเพิ่มเติมเกี่ยวกับประเทศที่ใช้รหัสไปรษณีย์ กรุณาดูที่ ประเทศที่ใช้รหัสไปรษณีย์
ประเทศที่ไม่ใช้รหัสไปรษณีย์
ตามชื่อที่แนะนำ มีประเทศที่ไม่ใช้รหัสไปรษณีย์ที่ FedEx รองรับ ซึ่งไม่ได้บังคับให้ใช้รหัสไปรษณีย์ในการจัดส่ง รหัสรัฐหรือชื่อเมืองก็เพียงพอแล้วเมื่อลูกค้าจะจัดส่งไปยังประเทศที่ไม่มีรหัสไปรษณีย์ ทั้งนี้ หากเกิดข้อผิดพลาดในการตรวจสอบความถูกต้องสำหรับประเทศที่ไม่ได้ใช้รหัสไปรษณีย์ ให้ใช้ที่อยู่โดยป้อน \"00000\" เพื่อใช้แทนรหัสไปรษณีย์ ซึ่งการใช้รหัสไปรษณีย์ปลอมนี้จะไม่ทำให้เกิดปัญหาเนื่องจากไม่มีอยู่จริง
ต่อไปนี้เป็นประโยชน์ของการใช้ API สำหรับการตรวจสอบรหัสไปรษณีย์:
- ลดความล่าช้าในการจัดส่งและเพิ่มประสิทธิภาพ
- เพิ่มโอกาสในการส่งมอบที่ตรงเวลาและครบถ้วน
- ปรับปรุงบริการ FedEx ไปยังพื้นที่เขตเมืองให้มีความยืดหยุ่นสำหรับเวลาตัดรอบและการนัดรับพัสดุ
API สำหรับการตรวจสอบรหัสไปรษณีย์ทำงานอย่างไร
การตรวจสอบรหัสไปรษณีย์ของ FedEx จะใช้ปลายทางด้านล่างเพื่อตรวจสอบรหัสไปรษณีย์สำหรับเมือง ประเทศ รวมถึงต้นทางและปลายทาง โดยส่วนต่อไปนี้จะอธิบายถึงข้อมูลสำคัญและการตอบสนองสำหรับปลายทาง:
ตรวจสอบที่ทำการไปรษณีย์
คำขอนี้ใช้เพื่อส่งคืนรายละเอียดทำการไปรษณีย์ รหัสไปรษณีย์ที่สะอาดและคำอธิบายตำแหน่งตามรายละเอียดข้อมูลที่ป้อนเข้ามา โดยข้อมูลสำคัญที่เกี่ยวข้องกับคำขอนี้มีดังต่อไปนี้:
- รหัสผู้ให้บริการขนส่ง
- รหัสประเทศ
- รหัสรัฐหรือจังหวัด
- รหัสไปรษณีย์
- วันที่จัดส่ง
ผลลัพธ์ที่สำเร็จของคำขอนี้คือ locationdetails และcleanedpostalcode สำหรับข้อมูลที่ป้อนให้ โดยคำขอจะล้มเหลวหากรหัสไปรษณีย์ไม่ถูกต้อง เช่น การรวมรหัสประเทศ รัฐ/ จังหวัด และรหัสไปรษณีย์ไม่ถูกต้อง
คำชี้แจงความเข้าใจผิดที่พบบ่อย
- การอ้างอิงการจัดอาณาเขตกับการจัดรหัสไปรษณีย์เป็นไปไม่ได้เนื่องจากสิ่งเหล่านี้เป็นข้อมูลที่ประมวลผลแยกกันอย่างชัดเจน
- ไม่ใช่ทุกสถานที่ทางภูมิศาสตร์ในโลกที่มีรหัสไปรษณีย์
หากต้องการข้อมูลเพิ่มเติมเกี่ยวกับรายการเฉพาะภูมิภาค กรุณาดูที่ รายการบริการเฉพาะภูมิภาค
กฎการดำเนินธุรกิจ
- ต้องรวมบ้านเลขที่ ชื่อถนน ฯลฯ อย่างน้อยหนึ่งบรรทัดสำหรับที่อยู่จริง และที่อยู่จะต้องไม่เว้นว่างไว้
- ต้องระบุรหัสรัฐหรือจังหวัด 2 ตัวอักษรหากประเทศของผู้รับคือสหรัฐอเมริกาหรือแคนาดา หรือหากใช้ EEI และประเทศคือเม็กซิโก {MX}
- อาจใช้ข้อมูลเชิงบรรยายสำหรับสถานที่ตั้งจริงเป็นที่อยู่จริง (สถานที่ที่สามารถไปได้) หรือเป็นคอนเทนเนอร์ของ \"ส่วนที่อยู่\" ซึ่งควรจัดการเป็นหน่วย (เช่น การรวมเมือง รัฐ และรหัสไปรษณีย์ภายในสหรัฐอเมริกา)
- รูปแบบและการแสดงของช่องรหัสไปรษณีย์จะแตกต่างกันไปตามแต่ละประเทศ
คอลเล็กชัน 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
- 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
|
countryCode required | string The two-letter code used to identify a country. |
stateOrProvinceCode required | string This is the state or province code. Format and presence of this field will vary, depending on country. |
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. |
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. |
routingCode | string Specify the routing code for the shipment. Routing code is the information that identifies the route the package or shipment may take. |
checkForMismatch | boolean This element checks for mismatch between State/Province Code and Postal Code.
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
Success
Bad Request
Unauthorized
Forbidden
Not Found
Failure
Service Unavailable
Sandbox Server
Production Server
Request samples
- Payload
- C#
- JAVA
- JAVASCRIPT
- PHP
- PYTHON
- RUST
- SWIFT
- "carrierCode": "FDXG",
- "countryCode": "US",
- "stateOrProvinceCode": "US",
- "postalCode": "502267",
- "shipDate": "2019-10-04",
- "routingCode": "Memphis 38017 - HKA/NQA",
- "checkForMismatch": true
Response samples
- 200
- 400
- 401
- 403
- 404
- 500
- 503
- "transactionId": "624deea6-b709-470c-8c39-4b5511281492",
- "customerTransactionId": "AnyCo_order123456789",
- "output": {
- "countryCode": "US",
- "cityFirstInitials": "string",
- "stateOrProvinceCode": "US",
- "alerts": [
- {
- "code": "CITYNAME.POSTALCODE.REQUIRED",
- "alertType": "NOTE",
- "parameterList": [
- {
- "value": "string",
- "key": "string"
- "message": "We are unable to process this request. Please try again later or contact FedEx Customer Service."
- "locationDescriptions": [
- {
- "locationId": "MAAPD",
- "locationNumber": "6955",
- "serviceArea": "AA",
- "airportId": "BLR"
- "cleanedPostalCode": "94267"
Response