Included in this document:
Description
To use Shipping Options API, you may follow the steps to set it up first
GoSweetSpot Shipping Options App
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.
Requests
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
Attribute | Type | Description |
---|---|---|
weight | decimal | Total weight of the shipping cart in kg. |
cartvalue | decimal | Total cart value of the shipping cart. |
destination | object | Shipping Options Address Model. |
Return format
A JSON array of objects.
Response
The response is a JSON array of object with the following fields.
Attribute | Type | Description |
---|---|---|
description | string | Description of the shipping rate. |
shortcode | string | A short code is associated with the shipping rate. |
rate | decimal | Total price of the shipping rate. |