Skip to content
Bahasa Indonesia

API Access

API Access lets an administrator create read-only public API tokens for external systems that need KartuStok data.

Use API Access when another trusted system needs to read KartuStok company metadata, items, warehouses, categories, or stock report data.

Open Manage -> Integrations -> API Access.

ActionPermission
View API tokensapiAccessView
Generate tokenapiAccessCreate
Revoke tokenapiAccessRevoke

Token List

API access token list

The list shows:

ColumnMeaning
NameToken label for the integration.
PrefixFirst part of the token, used to identify it later.
ScopesData scopes granted to the token.
StatusActive or inactive.
Last UsedLast time the token was used, if available.
ExpiresExpiry date, if configured.
RevokeAction to deactivate an active token.

Create API Access

FieldMeaning
NameIntegration name, required.
Expires AtOptional expiry date. If left blank, the token has no configured expiry date.
ScopesAt least one scope must be selected. Available scopes include company metadata, items, warehouses, item categories, and stock reports.
Allowed IPsOptional IP allowlist. Values can be entered on separate lines or separated by commas.

After selecting Generate Token, KartuStok shows the full token once in a Copy Token Now card. Store it securely. Later the list only shows the token prefix, not the full token.

Important: The full token is shown only once. If it is not copied and stored immediately, create a new token.

Example Endpoint Display

The page shows an example public API base URL using the active browser origin and an example /public/v1/items request with a bearer token header.

Operational Example: Reporting Integration

StepActionWhy
1Create a token named after the integration, for example BI Dashboard.Tokens are easier to audit later.
2Select only read scopes needed by that integration.Limits exposed data.
3Set Expires At if the integration is temporary.Avoids forgotten long-lived access.
4Fill Allowed IPs if the integration has stable server IPs.Reduces token misuse risk.
5Copy the token immediately.The full token is shown only once.

Create a separate token for each integration. Do not share one token across unrelated systems.

Common Problems

ProblemFix
Token disappeared after creationThis is expected; full token is shown only once. Create a new token if it was not stored.
External system gets unauthorized responseCheck token value, active status, expiry date, and scopes.
Token should no longer workUse Revoke on the token list.

Security Practice

  1. Create one token per integration.
  2. Give each token only the scopes it needs.
  3. Use Allowed IPs when the integration runs from stable server addresses.
  4. Revoke tokens that are no longer used.
  5. Store the full token in the external system immediately because it is shown only once.

Technical endpoint details are maintained separately from this user guide.