This reference describes the resources our partners use to manage a store's information on SiteGiant ERP & WMS: what each endpoint needs, and what it returns.
Every request goes to the API URL below and carries these two headers.
https://opensgapi.sitegiant.co/api/v1
Content-Type: application/json Access-Token: YOUR-API-TOKEN
Automated tasks that pause and resume are the best way to stay within the API call limit, because you do not need to wait while things get done.
Have your program take small pauses so that it stays a few calls short of the limit. This guards you against a
429 Too Many Requests error.
You can check how many calls you have already made from the headers SiteGiant sends back with every API response:
X-RateLimit-RemainingX-RateLimit-LimitOur API Postman collection is available for importing. It includes the REST API for all of our endpoints.
The collection is updated periodically, so keep checking back. When a new version of the REST API is released, import the collection again to get the updates.
Import our Postman collection for easier integration View, import or fork the collection in Postman.
SiteGiant can call your server whenever an event happens in a store, so you do not have to keep asking the API for changes.
To test webhooks you need a publicly visible URL to receive them. Unlike client-side redirects, webhooks come directly from our server.
You cannot use the following as an endpoint in your testing environment:
Once you register a webhook URL with SiteGiant, we send an HTTP POST request to that URL every time the event occurs. The request's POST parameters contain JSON data relevant to the event that triggered it.
Each webhook request includes an Authorization header, which is generated using the store secret token along with the data sent in the request.
To verify that the request came from SiteGiant, compute the HMAC digest as shown below and compare it to the value in the
Authorization header. If they match, the webhook was sent by SiteGiant and the data has not been tampered with.
<?php function verify_webhook($data, $hmac_header, $store_secret_token) { $calculated_hmac = hash_hmac('sha256', $data, $store_secret_token); return hash_equals($hmac_header, $calculated_hmac); } $store_secret_token = '32has256'; $hmac_header = $_SERVER['Authorization']; $data = file_get_contents('php://input'); $verified = verify_webhook($data, $hmac_header, $store_secret_token); error_log('Webhook verified: ' . var_export($verified, true)); //check error.log to see the result ?>
Choose an endpoint in the menu on the left to see its parameters and responses. News about changes to the API is posted under Announcements.