Appearance
Device API
현재 POS 디바이스의 정보를 조회하는 API입니다.
Types
DeviceInfo
디바이스 정보를 나타내는 객체입니다.
ts
{
name: string; // 디바이스 이름 (예: "toss-pos")
version: string; // 앱 버전 (예: "0.0.12962")
platform: string; // 플랫폼 (예: "windows")
arch: string; // CPU 아키텍처 (예: "x64")
serialNumber: string; // 포스 고유번호 (예: "262P0000WP01029")
osVersion?: string; // OS 버전. Windows와 macOS에서만 지원됩니다 (예: "10.0.26200")
businessType:
| {
business: { type: 'CAFE' | 'RESTAURANT' };
operation: {
payment: { type: 'PAY_FIRST' | 'PAY_LATER' };
table: { enabled: boolean };
booking: { enabled: boolean };
};
}
| {
business: { type: 'RETAIL' | 'SERVICE' };
operation: {
payment: { type: 'PAY_FIRST' };
table: { enabled: false };
booking: { enabled: boolean };
};
};
}json
{
"arch": "x64",
"businessType": {
"business": {
"type": "RESTAURANT"
},
"operation": {
"booking": {
"enabled": true
},
"payment": {
"type": "PAY_LATER"
},
"table": {
"enabled": true
}
}
},
"name": "toss-pos",
"osVersion": "10.0.26200",
"platform": "windows",
"serialNumber": "262P0000WP00000",
"version": "0.0.1000"
}| 필드 | 타입 | 설명 |
|---|---|---|
| name | string | 디바이스 이름 |
| version | string | 앱 버전 |
| platform | string | 플랫폼 (win32, darwin 등) |
| arch | string | CPU 아키텍처 |
| serialNumber | string | 포스 고유번호 |
| osVersion | string | undefined | OS 버전. Windows와 macOS에서만 지원됩니다 |
| businessType | object | 업종 및 운영 방식 정보 |
businessType.business.type
| 값 | 설명 |
|---|---|
CAFE | 카페 |
RESTAURANT | 음식점 |
RETAIL | 도소매 |
SERVICE | 서비스업 |
businessType.operation.payment.type
| 값 | 설명 |
|---|---|
PAY_FIRST | 선결제 |
PAY_LATER | 후결제 |
Methods
getDeviceInfo
현재 디바이스의 정보를 조회합니다.
ts
import { posPluginSdk } from '@tossplace/pos-plugin-sdk';
const deviceInfo = await posPluginSdk.device.getDeviceInfo();사용 예시
업종별 분기 처리
ts
import { posPluginSdk } from '@tossplace/pos-plugin-sdk';
async function handleByBusinessType() {
const deviceInfo = await posPluginSdk.device.getDeviceInfo();
const { type } = deviceInfo.businessType.business;
if (type === 'CAFE' || type === 'RESTAURANT') {
console.log('음식점 업종');
} else {
console.log('비음식점 업종');
}
}디바이스 정보 로깅
ts
import { posPluginSdk } from '@tossplace/pos-plugin-sdk';
async function logDeviceInfo() {
const info = await posPluginSdk.device.getDeviceInfo();
console.log(`포스 번호: ${info.serialNumber}`);
console.log(`앱 버전: ${info.version}`);
console.log(`플랫폼: ${info.platform} (${info.arch})`);
if (info.osVersion) {
console.log(`OS 버전: ${info.osVersion}`);
}
}