Skip to main content

v2/addressvalidation

About 1 min

v2/addressvalidation

Description

Query to validation customer address details. For NZ addresses, the addresses are also assessed for rural delivery, saturday delivery and residential delivery.

Request

  • 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 an Json object.

AttributeTypeDescription
consigneestringCompany name or persons name, max length is 50.
contactpersonstringContact person at address, optional, max length is 50.
phonenumberstringPhone number, optional, max length is 50.
deliveryinstructionsstringSpecial instructions to print on the label. For origin this field is ignored, max length is 120.
emailstringEmail address, max length is 200.
addressobjectV2 validation address model.

Return format

A JSON object with validation response.

Response

AttributeTypeDescription
validatedbooleanResult of state/suburb/postcode/country validation.
addressobjectAddress, with additional property AvailableServices.
errorsstring listList 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": []
}
Last update: