API Reference

Lightweight quick-reference for mypos-api-gateway. For full examples see Sample Code.

GatewayConfig

Passed to new MyPOSGateway(config):

OptionTypeDescription
gatewayUrlstringBase URL for the gateway (use DEMO_GATEWAY_URL or PRODUCTION_GATEWAY_URL)
integration.clientIdstringOAuth client ID from Partner Portal
integration.clientSecretstringOAuth client secret from Partner Portal
partnerIdstringYour partner identifier
applicationIdstringYour application identifier
timeoutnumberRequest timeout in milliseconds (optional)

MerchantCredentials

Passed to gateway.createClient(credentials):

OptionTypeDescription
clientIdstringMerchant client ID (prefixed cli_)
clientSecretstringMerchant client secret (prefixed sec_)

Exported Constants

ConstantValueDescription
DEMO_GATEWAY_URLGateway demo base URLUse in development and testing
PRODUCTION_GATEWAY_URLGateway production base URLUse in live environments

Banking Methods (client.banking.*)

MethodParametersReturnsDescription
getAccounts(opts){ page, size }Promise<Result<Paginated<Account>>>List merchant accounts
getTransactions(opts){ fromDate, toDate, sign?, order?, page, size }Promise<Result<Paginated<Transaction>>>Filter transactions by date range
getTransaction(ref)stringPromise<Result<Transaction>>Get single transaction by reference
getMultipleTransactions(refs)string[]Promise<Result<Transaction[]>>Batch retrieve transactions
generateStatement(opts){ accountNumber, documentType, date }Promise<Result<Statement>>Generate account statement

Ecommerce Methods (client.ecommerce.*)

MethodParametersReturnsDescription
create(opts)CreatePaymentLinkOptionsPromise<Result<PaymentLink>>Create a payment link
list(opts){ page, size }Promise<Result<Paginated<PaymentLink>>>List payment links
listAll()AsyncGenerator<PaymentLink>Auto-paginate all payment links
get(id)stringPromise<Result<PaymentLink>>Get a payment link
update(id, opts)string, UpdatePaymentLinkOptionsPromise<Result<PaymentLink>>Update a payment link
delete(id)stringPromise<Result<void>>Delete a payment link
getTransactions(id)stringPromise<Result<Transaction[]>>Get transactions for a link

Payment Buttons (client.ecommerce.paymentButtons.*)

MethodParametersReturnsDescription
create(opts)CreatePaymentButtonOptionsPromise<Result<PaymentButton>>Create a payment button
list(opts){ page, size }Promise<Result<Paginated<PaymentButton>>>List payment buttons
get(id)stringPromise<Result<PaymentButton>>Get a payment button

Payment Requests (client.ecommerce.paymentRequests.*)

MethodParametersReturnsDescription
create(opts)CreatePaymentRequestOptionsPromise<Result<PaymentRequest>>Create a payment request
list(opts){ status?, page, size }Promise<Result<Paginated<PaymentRequest>>>List payment requests
get(id)stringPromise<Result<PaymentRequest>>Get a payment request
sendReminder(id)stringPromise<Result<void>>Send reminder for a request

Utilities (client.ecommerce.*)

MethodReturnsDescription
getLanguages()Promise<Result<Language[]>>List supported languages
getSettlementData()Promise<Result<SettlementData>>Get settlement information

ePOS Methods (client.epos.*)

Payments (client.epos.payments.*)

MethodParametersReturnsDescription
create(opts)CreateEposPaymentOptionsPromise<Result<EposPayment>>Create an ePOS payment
get(id)stringPromise<Result<EposPayment>>Get a payment
list(opts){ terminalId, page, size }Promise<Result<Paginated<EposPayment>>>List payments by terminal
cancel(id)stringPromise<Result<void>>Cancel a payment
reverse(id, opts)string, { description }Promise<Result<void>>Reverse a payment
refund(id, opts)string, { amount: AmountValue }Promise<Result<void>>Partially refund a payment

Terminals (client.epos.terminals.*)

MethodParametersReturnsDescription
list(opts){ page, size }Promise<Result<Paginated<Terminal>>>List terminals
get(id)stringPromise<Result<Terminal>>Get a terminal
getTransactions(opts){ terminalId, fromDate, toDate }Promise<Result<Transaction[]>>All transaction types for a terminal
getTerminalTransactions(opts){ terminalId, fromDate, toDate, page, size }Promise<Result<Paginated<Transaction>>>Per-terminal transactions with pagination
getModels()Promise<Result<TerminalModel[]>>List available terminal models
getOutlets()Promise<Result<Outlet[]>>List outlets
activate(id, opts)string, { activationCode }Promise<Result<void>>Activate a terminal
deactivate(id, opts)string, { activationCode }Promise<Result<void>>Deactivate a terminal
getReceipt(paymentId)stringPromise<Result<Receipt>>Get payment receipt
refund(id, opts)string, TerminalRefundOptionsPromise<Result<void>>Terminal-level refund

Error Types

Error typeThrownCondition
GatewayConfigErrorYes (thrown)Missing or invalid GatewayConfig
GatewayAuthErrorYes (thrown)Authentication failed; auto-retry exhausted

All other API failures are returned as result.success === false — they do not throw.

AmountValue

All amount fields use minor currency units:

FieldTypeExample
valuenumber2500 (= €25.00)
currencyCodestring'EUR'