Ping
The request we send to you periodically and whenever there are new changes.
Request
POST
Headers
| HTTP header | Description |
|---|---|
|
Base64 encoded HMAC-SHA2-256 signature of the body signed with your API key. |
Fields
| JSON field | Description |
|---|---|
|
The shopid this ping is for. |
|
The current maximum seq value.
|
When you receive the ping request you can verify its authenticity using the X-Signature header.
For our mutual benefit, we include the maximum "seq" value at the time of the ping in the request body. That way, you can compare it to the "seq" value you received from the last successful call to seq and, if the value received in the ping is less than or equal to it, avoid calling seq, thus saving us both an unnecessary request.
To ensure eventual consistency, we also send periodic pings. That way, if, for whatever reason, you have not synchronized some changes, you will be notified to synchronize again eventually.
if Base64(HMAC-SHA2-256(body, apikey)) ≠ headers["X-Signature"] then
Log("Warning: Invalid ping signature!")
exit
end if
ping := JSONDecode(body)
if ping.seq > localSeq then
Synchronize()
end if
You can configure your ping endpoint in our dashboard (here). We recommend that you use TLS, but this is not a requirement.