Skip to main content

Shipping Options

Less than 1 minute

Shipping Options

Description

To use Shipping Options API, you may follow the steps to set it up first

GoSweetSpot Shipping Options Appopen in new window

Once you have it ready, you can use the following endpoint to get shipping rates for your website.

PS. This is NOT the same as POST api/rates

Header X-GSS-Hmac-Sha256 is based on your request body and a secret assigned to you.

To automatically generate the header in postman, you can use Pre-request Script below.

var signBytes = CryptoJS.HmacSHA256(pm.request.body.raw, 'YOUR_SECRET');
var signHex = CryptoJS.enc.Hex.stringify(signBytes);
pm.request.headers.add({
    key: "X-GSS-Hmac-Sha256",
    value: signHex
});

Replace YOUR_SECRET with your real secret.

Request

  • Method: POST
  • Content Type: application/json
  • URL: https://checkout.gosweetspot.com/CustomApi/Rates/{{your shipping options app ID}}

Headers

  • X-GSS-Hmac-Sha256 : hash-based message authentication code, generate by your request body and secret assigned to you.

Parameters

AttributeTypeDescription
weightdecimalTotal weight of the shipping cart in kg.
cartvaluedecimalTotal cart value of the shipping cart.
destinationobjectShipping Options Address Model.

Return format

A JSON array of objects.

Response

The response is a JSON array of object with the following fields.

AttributeTypeDescription
descriptionstringDescription of the shipping rate.
shortcodestringA short code associated with the shipping rate.
ratedecimalTotal price of the shipping rate.
Last update: