Build with AI
Working with Claude, ChatGPT, Copilot, or another assistant? Copy the prompt below into your AI tool of choice to scaffold your iOS POSLink integration.
Feed it the full docs
Every page on this portal has a "Copy as Markdown" button in the top right. Paste the pages the prompt references into your AI's context for the best results, or point it at the OpenAPI specs on the Downloads page.
You are helping me integrate my iOS ePOS application with Teya card machines using the
Teya Unified ePOS SDK (POSLink: my ePOS and the Teya card machine are separate devices).
My stack: [describe your app language/framework, e.g. Swift/SwiftUI]
Key facts:
- Add the SDK via Swift Package Manager, package URL
https://github.com/teya-engineering/teya-unified-epos-sdk-pod-spm (File -> Add Package Dependencies
in Xcode, pin an exact version), or via CocoaPods with
pod 'TeyaUnifiedEposSDK', :podspec => 'https://raw.githubusercontent.com/teya-engineering/teya-unified-epos-sdk-pod-spm/<version>/TeyaUnifiedEposSDK.podspec'
(the SDK is not on the CocoaPods trunk any more, and :git installs an empty pod).
- If using SPM, I must also manually add the SDK's compose-resources folder to my target's
Copy Bundle Resources build phase (Project settings -> Build Phases -> Copy Bundle
Resources -> Add Other... -> select the compose-resources folder inside the
TeyaUnifiedEposSDK.xcframework in DerivedData -> Create folder references).
- I need a Client ID and Client Secret from the Teya Developer Portal (partner.teya.xyz for
development, partner.teya.com for production). This is one set for my whole application,
not one per merchant - merchants authenticate separately with their own Teya ID.
- Initialize the SDK with:
let teyaPosLinkSDK = TeyaPosLinkSDKKt.initialize(
authConfig: PosLinkSDKAuthConfigManaged(clientId: "...", clientSecret: "..."),
isProductionEnv: false,
eposInstanceId: nil, // optional identifier for this ePOS instance
logger: SDKLoggerImpl() // optional, implements the TeyaSDKLogger protocol
)
- Call teyaPosLinkSDK.setup(onFailure:onSuccess:) to run the SDK's built-in UI for
authentication, store selection, and card machine selection. After setup succeeds, use
teyaPosLinkSDK.transactionsApi and teyaPosLinkSDK.printingApi.
- To make a payment, call teyaPosLinkSDK.transactionsApi.makePayment(transactionId:amount:
currency:tip:). amount and tip are Int32 values in the smallest currency unit (e.g. cents,
with tip needing conversion to KotlinInt) and currency is an ISO 4217 code (e.g. "GBP").
This returns a subscription for real-time payment status updates.
- Tips, cancellations, refunds, receipts, and Pay at Table are additional SDK calls with
real-time responses.
Documentation to follow (read these before writing code):
- https://docs.teya.com/epos-sdk/poslink/ios/getting-started
- https://docs.teya.com/epos-sdk/poslink/ios/make-payment
- https://docs.teya.com/epos-sdk/overview
Task: add the SDK package, implement the Connect to Teya flow via setup(), and implement a
basic make-payment call with result handling. Follow the documentation exactly and do not
invent SDK methods - if unsure of an API name, tell me to check the docs page rather than
guessing.