OGOship has an open API for developers. You can update products, orders and webhooks through the API.
Test account and merchant
Please create a free test account and a merchant profile to myOGO. You can generate and copy a new secret token at the merchant setting edit page in your myOGO account.
API documentation can be found from here.
.Net standard 2.0 library can be found: Github or as a Nuget package.
PHP sample can be found on GitHub.
Generating authentication token
The API uses an JWT token for authentication. Currently, it is possible to use a Resource owner password based flow to generate a token. The token is valid for 1.5 hours and must be refreshed after that time. The refresh token is valid for 2 weeks and for one refresh. The new refresh token is returned after each refresh.
Use https://my.ogoship.com server for token requests.
We only support form data and parameter data types (not json currently) for generating the token.
curl
https://my.ogoship.com/OAuth/Token -d grant_type=password -d client_id=123456 -d client_secret=abcdef -d username=[merchantId] -d password=[secretToken] -d scope="read:order read:product write:product write:order"
WebHooks
You can find webhook models in the API description. API calls will have a "X-OGOship-Hmac-SHA256" header.
It will contain body of message HMACSHA256 calculated using Webhook key. Hash is then saved to header using Base64 encoding.
C# implementation:
var bytes = Encoding.UTF8.GetBytes(webhookSecretKey);
var hmac = new HMACSHA256(bytes);
var hashString = Convert.ToBase64String(hmac.ComputeHash(Encoding.UTF8.GetBytes(data)));
Your own Application ID and secret
You can test everything with a demo account client_id/client_secret = 123456/abcdef .
Before you wish to go live, request your own client ID & secret via email from our Tech team.
When authorizing Ogoship API in swagger:
You can find the username & password from your myOGO merchant, under Edit Merchant --> Integrations --> API Information.
In case of any issues, please email our Tech team for assistance.