Environments
Test and live keys use the same address: https://api-gateway.lunixi.com/api/v1/physical-pos. There is no separate test address. The key you sign the request with decides the environment:
| Key | Environment |
|---|---|
mk_test_… | Test (TEST) |
mk_live_… | Live (LIVE) |
Do not send the environment in the request. If you send an environment field in the query or the body (whatever its value), the request gets 400 physical_pos.input.environment_invalid with details.field environment and details.reason not_allowed.
A test key can only read
In Physical POS, a test key can only read every record. Every request that creates a record, changes it or changes its status (all POST and PATCH endpoints) gets 403 physical_pos.environment.test_key_read_only with a test key. The request is rejected without touching any record.
Manage records with a live key or in the panel. You can call every GET endpoint with a test key.
A test key sees the same stores and registers as a live key. Because terminal and device records cannot be created in the test environment, a test key's terminal, bank row, device and device link lists come back empty.
You can try the read flows and signature, authentication and scope errors with a test key. Write flows work only with a live key; keep the live key on your server only.
Which record lives where
| Record | Environment | With a test key | With a live key |
|---|---|---|---|
| Catalog (vendors, models, banks) | Platform-wide | Read | Read |
| Store | Environment-less | Read | Read and write |
| Register | Environment-less | Read | Read and write |
| Logical terminal | The record's environment | Read (the list comes back empty) | Live terminals, read and write |
| Bank row | The terminal's environment | Read (the list comes back empty) | Read and write |
| Device | The record's environment | Read (the list comes back empty) | Live devices, read and write |
| Device link | The terminal's environment | Read (the list comes back empty) | Read and write |
| Overview counts | Mixed | Store and register counts are environment-less; terminal and device counts come from test | Store and register counts are environment-less; terminal and device counts come from live |
Stores and registers are environment-less
Your stores and registers are your real-world points of sale; test and live keys see the same store and register records.
Terminal and device records are environment-bound
Logical terminal and device records belong to an environment, and their environment never changes. A terminal's bank rows and device links are in the terminal's environment too.
- A key sees only the terminals and devices in its own environment.
- A request for a record in the other environment gets the same
404as a record that does not exist (for example404 physical_pos.terminal.not_found). - A terminal code is unique within an environment.
- A device can be linked only to a terminal in its own environment.
- The
environmentfield in responses shows the record's environment (TESTorLIVE).
Idempotency keys are separated by environment
Idempotency-Key values are kept separately per key environment. Details: Common Rules › Idempotency-Key.
Related
- Common testing rules: Testing
- Environment in overview counts: Overview Counts