Included in this document:
Description
Query to validate customer address details. For New Zealand addresses, the addresses are also assessed for rural delivery, saturday delivery and residential delivery.
Requests
Method: POST
Content Type: application/json
URL: https://api.gosweetspot.com/v2/addressvalidation
Headers
access_key : your unqiue api key provided by GSS.
site_id : which site you are requesting action for.
Request
The body of the message should be sent as a Json object.
Attribute | Type | Description |
---|---|---|
consignee | string | Company name or person name, max length is 50. |
contactperson | string | Contact person at address, optional; max length is 50. |
phonenumber | string | Phone number is optional, max length is 50. |
deliveryinstructions | string | Special instructions to print on the label. For origin, this field is ignored, the max length is 120. |
string | Email address: max length is 200. | |
address | object | V2 validation address model. |
Return format
A JSON object with validation response.
Response
Attribute | Type | Description |
---|---|---|
validated | boolean | Result of state/suburb/postcode/country validation. |
address | object | Address, with additional property AvailableServices. |
errors | string list | List of validation messages. |
Request example
curl --location 'https://api.gosweetspot.com/v2/addressvalidation' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json' \
--data '{
"Consignee": "0123456789 0123456789 0123456789 0123456789",
"Address": {
"BuildingName": "",
"StreetAddress": "1 Some Street",
"Suburb": "MascotX",
"City": "NSW",
"PostCode": "2020",
"CountryCode": "AU",
"IsRural": false
},
"Email": "",
"ContactPerson": "",
"PhoneNumber": "",
"DeliveryInstructions": "",
}'
Response example
{
"Address": {
"Consignee": "0123456789 0123456789 0123456789 0123456789",
"Address": {
"BuildingName": "",
"StreetAddress": "1 Chesham Lane",
"Suburb": "Clevedon",
"City": "Auckland",
"PostCode": "2248",
"CountryCode": "NZ",
"IsRural": false,
"IsResidential": false
},
"Email": "",
"ContactPerson": "",
"PhoneNumber": "",
"DeliveryInstructions": "",
"AvailableServices": [
{
"Carrier": "NZCouriers",
"IsResidential": true,
"IsRural": true,
"HasSaturdayService": false,
"BranchCode": "MKC",
"RunNumber": ""
},
{
"Carrier": "PostHaste",
"IsResidential": true,
"IsRural": true,
"HasSaturdayService": false,
"BranchCode": "AKL",
"RunNumber": ""
},
{
"Carrier": "CastleParcel",
"IsResidential": true,
"IsRural": true,
"HasSaturdayService": false,
"BranchCode": "AKL",
"RunNumber": ""
},
{
"Carrier": "NOWCouriers",
"IsResidential": true,
"IsRural": true,
"HasSaturdayService": false,
"BranchCode": "AKL",
"RunNumber": ""
}
]
},
"Validated": true,
"Errors": []
}