Skip to main content

api/rates

About 1 min

api/rates

Description

Query to get available courier services and rates for the destination.

Request

  • Method: POST
  • Content Type: application/json
  • URL: https://api.gosweetspot.com/api/rates

Headers

  • access_key : your unqiue api key provided by GSS.
  • site_id : which site you are requesting action for.

Parameters

The body of the message should be sent as an Json object.

ParameterTypeDescription
originobjectSender address - contact model.
destinationobjectReceiver Address - contact model.
packagesobject listArray of package.
issignaturerequiredbooleanIs signature required?
issaturdaydeliverybooleanIs Saturday delivery?
deliveryreferencestringOrder reference, max lengther is 60.

Return format

A JSON object array of available rates. These are group into Available, Hidden, Rejected. The Hidden rates, are available rates, but have been filtered out due to user preference, based on cost centre, or destination courier preference.

Response

AttributeTypeDescription
Availableobject listAvailable Rate.
Rejectedobject listRejected rates with reason why it rejected (Rejected Rate Model).
ValidationErrorsobject listAll validation errors (Rate Validation Error Model).

Request example

curl --location 'https://api.gosweetspot.com/api/rates' \
--header 'Content-Type: application/json' \
--header 'access_key: nikhi-74-4EFF2E1BE49E807E89DF1790C4407921CD813B2C1' \
--header 'site_id: 108633' \
--data-raw '{
  "DeliveryReference": "ORDER123",
  "Destination": {
    "Id": 0,
    "Name": "DestinationName",
    "Address": {
      "BuildingName": "",
      "StreetAddress": "DestinationStreetAddress",
      "Suburb": "Avonside",
      "City": "Christchurch",
      "PostCode": "8061",
      "CountryCode": "NZ"
    },
    "ContactPerson": "DestinationContact",
    "PhoneNumber": "123456789",
    "Email": "destinationemail@email.com",
    "DeliveryInstructions": "Desinationdeliveryinstructions"
  },
  "IsSaturdayDelivery": false,
  "IsSignatureRequired": true,
  "IsResidentialDelivery": true,
  "Packages": [
    {
      "Height": 1,
      "Length": 1,
      "Id": 0,
      "Width": 10,
      "Kg": 0.1,
      "Name": "GSS-DLE SATCHEL",
      "PackageCode": "DLE",
      "Type": "Box"
    }
  ]
}'

Response example

Binary blocks below have been trimmed for presentation.

{
  "Available": [
    {
      "QuoteId": "3104eb7e-6354-4de4-a250-fa96297282d2",
      "CarrierId": 102,
      "CarrierName": "Post Haste",
      "DeliveryType": "Overnight",
      "Cost": 8.58,
      "ServiceStandard": "By 11am next business day",
      "Comments": "Satchel ",
      "Route": "AKL- LOCAL->AKL- SI",
      "IsRuralDelivery": false,
      "IsSaturdayDelivery": false,
      "IsFreightForward": false,
      "CarrierServiceType": "DomesticCourier"
    },
    {
      "QuoteId": "22401e18-e097-4ac8-9e6f-271734e92a50",
      "CarrierId": 147,
      "CarrierName": "PBT Couriers",
      "DeliveryType": "Overnight",
      "Cost": 8.89,
      "ServiceStandard": "By 12pm next business day",
      "Comments": "Satchel ",
      "Route": "AKL- LOCAL->AKL- SI",
      "IsRuralDelivery": false,
      "IsSaturdayDelivery": false,
      "IsFreightForward": false,
      "CarrierServiceType": "DomesticCourier"
    },
    {
      "QuoteId": "489898a3-85e8-47fe-8184-916dd75b2b79",
      "CarrierId": 205,
      "CarrierName": "Mainstream Freight",
      "DeliveryType": "Standard",
      "Cost": 65.42,
      "ServiceStandard": "Next day within island, 2 day inter island",
      "Comments": "VM ",
      "Route": "MS-AKL->CHRISTCHURCH",
      "IsRuralDelivery": false,
      "IsSaturdayDelivery": false,
      "IsFreightForward": false,
      "CarrierServiceType": "DomesticBulk"
    }
  ],
  "Rejected": [
    {
      "Reason": "MS-AKL -> CHRISTCHURCH: Consignment undersize/weight",
      "Carrier": "Mainstream AKL",
      "DeliveryType": "Standard 1000kg+"
    }
  ],
  "ValidationErrors": {}
}
Last update: