Service accounts
Give an integration (ERP, agency, automation) its own access to the store, with permission sets and keys that do not depend on a person's account.
A service account is a team member that is not a person. It receives permission sets like any member, can join groups and owns its own API keys, which start with mobi_sa_. Use one when an external system (the ERP, the agency's tool, a sync script) needs to reach the store: the access keeps working when whoever set it up leaves the team, and never exceeds what the sets allow. After reading this page you can create a service account, issue and revoke keys, switch the account off without losing anything and find out why someone cannot do something.
Before you start
- To see service accounts, you need the View team permission. To create, edit, switch off or delete, Manage access. To see keys, View tokens; to issue or revoke, Manage tokens. The store owner has all of them.
- A service account only receives sets whose permissions you hold yourself. If the set asks for more than you have, the panel refuses.
- It does not sign in to the panel: it only acts through the API, with a key. Service accounts do not count as people in the plan limit.
Why not a personal token?
Keys belong to service accounts and only to them. A key that acted as one person would stop working, or silently change what it could do, whenever that person's access changed. A service account is its own identity with its own permission sets, shows up in the audit trail under its own name and can be switched off in one click.
Create a service account
- Go to Settings → Team and access, API keys tab. The Service accounts list sits below the Test store card, which opens a separate store to try the API without reaching customers, money or partners.
- Click New service account.
- Fill in the Name (for example "ERP sync") and, if you want, the Description (optional): what it is for and who looks after it.
- Under Permission sets, check at least one. The Effective access with these sets panel shows what the account will be able to do in this store.
- Click New service account.
To change the name, the description or the sets, open the row's actions menu and pick Edit. The change applies at once to every key of the account. Click the row to open the account's page, on the same screen: its groups, every policy reaching it and the permissions it holds in this store. A service account can also join a group (on the group's page, Add) and receive what the group gives, or receive a rule like any person.
Prefer a set just for the integration
On the Policies tab, create a permission set with only what the integration needs (for example, read products and write stock) and give the account only that. A leaked key then exposes neither orders nor customers.
Issue a key
- On the API keys tab, open the account's actions menu and pick Keys (or click the row's active key count).
- Click New key.
- Under Where the key lives, say where it will be stored (for example "ERP server").
- Pick Expires: Never, 30, 90 or 365 days.
- Click New key and copy the value.
The key starts with mobi_sa_ and shows only once. If you lose it, revoke it and issue another. Whoever uses the key sends Authorization: Bearer mobi_sa_... on every call, like any token; see Authentication.
The key list shows the start and end of each key, its Last used and when it expires. An account can have several keys, one per system: that way you can rotate one place without touching the others.
Revoke a key
In the key list, click the row's trash icon and confirm with Revoke. The system using the key stops working at once; there is no grace period. Keys have no rotation: revoke and issue another.
Switch off, switch on and delete
- Switch off (the account's actions menu) refuses all its keys at once, without deleting anything. The account shows as Off and accepts no new keys. Use it when a vendor stops responding or while investigating odd usage. Switch on makes the keys work again.
- Delete revokes the keys and removes the account from the store. What it already did stays in the Audit log.
Why can't they?
When someone (or an integration) gets "no permission", in Settings → Team and access click Explain an access at the top of the screen (or Why can't they? on the person's or the account's page). In the Why can't they? window, pick the member or service account under Who, and the action under Permission. The panel shows:
- Allowed right now or Denied right now, the way the API would decide at this moment.
- What grants it: owner of the store or the organization, or the permission set that includes the action, with the group it came through in parentheses. If nothing shows, no set reaching the person has that permission.
- What denies it, when the result is refused by a rule, a Cedar policy or the key's scope.
- Recent decisions: the latest actions logged for them in the store, with Allowed or Denied and the time. Denials are always logged; allows are sampled.
This tool needs Manage access.
If something goes wrong
- "The policy grants permissions you do not hold": the chosen set has permissions you lack. Ask the owner or pick a smaller set.
- I cannot issue a key and the account shows as Off: switch the account on first, from the actions menu.
- The integration gets 401: the key was revoked, expired, or the account is off. Check the key list and issue another if needed.
- The integration gets 403: the key works, but the account's sets do not include the permission (or a rule refuses it). Use Why can't they? to see which one is missing and adjust the sets under Edit.
- I do not see the API keys tab: Team and access needs View team.
Next steps
- Team and access: create your own permission sets and adjust people's access.
- Account security: API keys and the store's audit log.
- Authentication: how to use the key in code.
Team and access
Invite people, build groups, choose what each one can do with policies, grant access for a limited time, see why someone cannot and hand the store to a new owner.
Access rules
Limit what a group or a person can do beyond the permission sets, with a maximum amount, hours, a reach or only their own records.