Open API reference

Build on SiteGiant ERP & WMS

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.

Customer management
Inventory management
Order management
Item management
Product management
Payment method
Shipping method
Channel method

01API endpoint

Every request goes to the API URL below and carries these two headers.

API URL

BASE URL
https://opensgapi.sitegiant.co/api/v1

Headers

HTTP HEADERS
Content-Type: application/json
Access-Token: YOUR-API-TOKEN

02API call limit

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.

Avoiding 429 Too Many Requests errors

You can check how many calls you have already made from the headers SiteGiant sends back with every API response:

X-RateLimit-Remaining
How many calls you can still make for that particular shop.
X-RateLimit-Limit
The maximum number of calls you can make for that particular shop.

03Postman collection

Our 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.

04Webhook

SiteGiant can call your server whenever an event happens in a store, so you do not have to keep asking the API for changes.

  1. Configure a webhook

    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:

    • Localhost
    • "Fake" domains like www.example.com
    • SiteGiant domains (i.e. sitegiant.co and www.sitegiant.co)
    The channel Settings window, with the Webhook switch and the Webhook URL field
    Switch Webhook on in the channel's settings and enter your webhook URL.
  2. Receive a webhook

    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.

    SSL
    SiteGiant verifies SSL certificates when delivering to HTTPS addresses. Make sure your server supports HTTPS with a valid SSL certificate.
    Retries
    A maximum of 3 retries for a webhook request.
    Timeout
    10 seconds for each request.
  3. Verify a webhook

    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
    <?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.