ePOS
The client.epos namespace provides two sub-namespaces: payments for transaction operations and terminals for terminal and outlet management.
Amount units: All amount.value fields use minor currency units (e.g., 2500 = €25.00). Specify the currency with amount.currencyCode.
Payments
Create Payment
const result = await client.epos.payments.create({
amount: {
value: 2500,
currencyCode: 'EUR',
},
terminalId: 'TERM_001',
appName: 'MyShopApp',
appVersion: '1.0.0',
})
if (result.success) {
console.log('Payment created:', result.data.paymentId)
}
const result = await client.epos.payments.create({
amount: {
value: 2500,
currencyCode: 'EUR',
},
terminalId: 'TERM_001',
appName: 'MyShopApp',
appVersion: '1.0.0',
})
if (result.success) {
console.log('Payment created:', result.data.paymentId)
}
Get Payment
const result = await client.epos.payments.get('payment_id_123')
if (result.success) {
console.log(`Status: ${result.data.status} — ${result.data.amount.value / 100} ${result.data.amount.currencyCode}`)
}
const result = await client.epos.payments.get('payment_id_123')
List Payments by Terminal
const result = await client.epos.payments.list({ terminalId: 'TERM_001', page: 1, size: 20 })
if (result.success) {
for (const payment of result.data.items) {
console.log(`${payment.paymentId} — ${payment.status}`)
}
}
const result = await client.epos.payments.list({ terminalId: 'TERM_001', page: 1, size: 20 })
Cancel Payment
const result = await client.epos.payments.cancel('payment_id_123')
if (result.success) {
console.log('Payment cancelled')
}
const result = await client.epos.payments.cancel('payment_id_123')
Reverse Payment
const result = await client.epos.payments.reverse('payment_id_123', {
description: 'Customer requested cancellation',
})
if (result.success) {
console.log('Payment reversed')
}
const result = await client.epos.payments.reverse('payment_id_123', {
description: 'Customer requested cancellation',
})
Refund Payment (partial)
const result = await client.epos.payments.refund('payment_id_123', {
amount: {
value: 1000,
currencyCode: 'EUR',
},
})
if (result.success) {
console.log('Partial refund of €10.00 issued')
}
const result = await client.epos.payments.refund('payment_id_123', {
amount: { value: 1000, currencyCode: 'EUR' },
})
Terminals
List & Get Terminals
// List all terminals
const listResult = await client.epos.terminals.list({ page: 1, size: 20 })
// Get a specific terminal
const getResult = await client.epos.terminals.get('TERM_001')
if (getResult.success) {
console.log(`Terminal: ${getResult.data.terminalId} — ${getResult.data.status}`)
}
const listResult = await client.epos.terminals.list({ page: 1, size: 20 })
const getResult = await client.epos.terminals.get('TERM_001')
Terminal Transactions
// All transaction types for a terminal in a date range
const txnResult = await client.epos.terminals.getTransactions({
terminalId: 'TERM_001',
fromDate: '2024-01-01',
toDate: '2024-01-31',
})
// Per-terminal transaction list with pagination
const perTermResult = await client.epos.terminals.getTerminalTransactions({
terminalId: 'TERM_001',
fromDate: '2024-01-01',
toDate: '2024-01-31',
page: 1,
size: 50,
})
const txnResult = await client.epos.terminals.getTransactions({
terminalId: 'TERM_001',
fromDate: '2024-01-01',
toDate: '2024-01-31',
})
const perTermResult = await client.epos.terminals.getTerminalTransactions({
terminalId: 'TERM_001',
fromDate: '2024-01-01',
toDate: '2024-01-31',
page: 1,
size: 50,
})
Terminal Management
// Get available terminal models
const models = await client.epos.terminals.getModels()
// Get outlets
const outlets = await client.epos.terminals.getOutlets()
// Activate terminal
const activateResult = await client.epos.terminals.activate('TERM_001', {
activationCode: 'ACT-12345',
})
// Deactivate terminal
const deactivateResult = await client.epos.terminals.deactivate('TERM_001', {
activationCode: 'ACT-12345',
})
// Get payment receipt
const receipt = await client.epos.terminals.getReceipt('payment_id_123')
// Terminal-level refund
const refundResult = await client.epos.terminals.refund('TERM_001', {
originalPaymentId: 'payment_id_123',
amount: { value: 500, currencyCode: 'EUR' },
})
const models = await client.epos.terminals.getModels()
const outlets = await client.epos.terminals.getOutlets()
const activateResult = await client.epos.terminals.activate('TERM_001', { activationCode: 'ACT-12345' })
const deactivateResult = await client.epos.terminals.deactivate('TERM_001', { activationCode: 'ACT-12345' })
const receipt = await client.epos.terminals.getReceipt('payment_id_123')
const refundResult = await client.epos.terminals.refund('TERM_001', {
originalPaymentId: 'payment_id_123',
amount: { value: 500, currencyCode: 'EUR' },
})