Server Information
- Testing Env: https://staging.greendeal.com.au/rapi/v1
- Production: https://www.greendeal.com.au/rapi/v1
- Account: Please send an email to supportATgreendeal.com.au to request an clientid and secret_id for your retailer portal integration.
Rate limits
The rate limit of the endpoint is 3000 requests/hour.
When an application exceeds the rate limit for a given GreenDeal API endpoint, the following error message will be returned in the response body:
When an application exceeds the rate limit for a given GreenDeal API endpoint, the following error message will be returned in the response body:
{"code": 429, "error": "Rate limit exceeded"}
Request Parameter
For every web service call, following parameters must be present in the request.
Parameter | Type | Is Required? | Description |
---|---|---|---|
client_id | String | Yes | assign client_id to app |
timestamp | String | Yes |
1.Format is yyyy-MM-ddTHH:mm:ss:z,for example:2016-01-01T12:00:00+11:00. 2.The maximum time error that the API server allowed is 10 minutes. |
signature | String | Yes |
Please see Signature Algorithm section for working out the value of the signature. |
Signature
Signature Algorithm
For every request, we will need to have a 'signature' parameter in it for the authentication. Server will reject the request if the signature value failed in the validation.
- Append client id, timestamp, client_secret in the string, with the appendix of"GD:" eg. signature_string = "GD:"+ client_id+timestamp+client_secret
- Encrypt the signature_string that we have in the above step. eg. md5(signature_string).
-
MD5 uses a 128-bit length digest algorithm, which is expressed in hexadecimal.
A hexadecimal character can represent 4 bits, so the signed character length is fixed to 32 hexadecimal characters.
Signature Example:
client = 'uid7' timestamp = '2018-11-04T22:49:36+11:00' client_secret = 'secret7' signature string: signature_string = "GD:uid72018-11-04T22:49:36+11:00secret7" response from MD5: signature = b1dd868452f87473b91131e7a58e044a