API Specifications
This document specifies an API exposed by SellerCenter. The purpose is to allow the Shop System to set up different configurations on Seller and Shipment Provider level.
URL Request Parameters
ServiceName |
Identifies the external service that is making the request |
Shop |
Timestamp |
Timestamp of the request, in UTC ISO8601 format. The API implements timestamp verification to avoid replay attacks. Old requests or too far in the future are denied |
undefined |
Signature |
HMAC SHA256 signature used for authentication. It will be computed using the API Key of the calling Service and all the other parameters in the URL sorted. See code example. |
undefined |
Headers
Requests to these endpoints must include the following header: Accept: application/json
Signature calculation example
$parameters = array(
'Timestamp' => (new DateTime())->format(DateTime::ISO8601),
'ServiceName' => 'SHOP'
);
function buildQueryString(array $params)
{
$fields = $params;
ksort($fields);
return http_build_query($fields, '', '&', PHP_QUERY_RFC3986);
}
$strToSign = buildQueryString($parameters);
$hash = hash_hmac('sha256', $strToSign, $apiKey, false);
$parameters['Signature'] = $hash;
$queryString = buildQueryString($parameters);
$fullUrl = "https://SELLERCENTER-API/shop-api/v1/shipment-provider-configurations/?" . $queryString;