Welcome Servies To Emole Services Developer Documention
You Can Learn How TO Create Services And ALso Create New Mobile App
If your app acts on the merchant's behalf at another company (a carrier, an accounting system, a CRM), define the link in step 6. The platform collects the key or runs OAuth2, stores it encrypted, and sends it to your server with every request.

| Method | What the merchant does | What you define in step 6 |
|---|---|---|
| Key or personal token | Pastes their key and clicks Link account | Company name and its API base URL |
| OAuth2 | Clicks Link my account at … and approves at the company | Company name, API base URL, authorization URL, token URL, Client ID and Secret, and scopes (scope) |
For OAuth2 the platform generates the redirect URL and shows it in step 6: register it in the company's developer console.
refresh_token and expires_in, the platform refreshes it before it expires.connection: events, shipping, waybills, payments and actions.connected: false.


{ "hook": "shipping.create", "storeId": 10, "config": { }, "appToken": "…",
"connection": {
"company": "Transport Co",
"type": "oauth2",
"connected": true,
"apiBaseUrl": "https://api.company.com/v1",
"account": "Dream Store — account 4471",
"accessToken": "…",
"tokenType": "Bearer",
"expiresAt": "2026-11-26T16:49:37Z",
"apiKey": null
},
"data": { } }
| State | Meaning |
|---|---|
connection: null | Your app defines no link |
connected: false | The merchant hasn't linked yet. Reply with a clear error and it's shown to them |
type: "apiKey" | The key is in apiKey; accessToken is empty |
type: "oauth2" | The token is in accessToken with type tokenType |
async function shippingCreate({ data, connection: c }) {
if (!c || !c.connected)
return { error: 'Link your Transport Co account in the app settings first' };
const auth = c.type === 'oauth2' ? `${c.tokenType} ${c.accessToken}` : `Bearer ${c.apiKey}`;
const r = await fetch(c.apiBaseUrl + '/shipments', {
method: 'POST',
headers: { Authorization: auth, 'Content-Type': 'application/json' },
body: JSON.stringify(data)
});
if (!r.ok) return { error: `The carrier refused the shipment (${r.status})` };
const s = await r.json();
return { trackingNumber: s.awb, labelUrl: s.label };
}
response_type=code, client_id, redirect_uri and state, plus scope if you set it.POST as application/x-www-form-urlencoded with grant_type (authorization_code or refresh_token), client_id and client_secret. The JSON reply has access_token, optionally refresh_token, expires_in and token_type, and account as a display name for the merchant.state is valid for 15 minutes. If the merchant declines or it expires, they return to the app page with the reason and can retry any time.The company's own events (shipment delivered, invoice updated) arrive at your server directly from the company. Identify the store from the linked account, and update it through the Apps API with
appToken.