---
title: "Swift SDK"
description: "Install and use the official server-side Inttegro SDK for Swift."
canonical: "https://studio.inttegro.com/sdks/swift"
format: inttegro-machine-docs/v1
language: "PHP"
sdk_version: "v12.0.0"
reader_profile: optional
reader_manifest: "https://studio.inttegro.com/machine/php/readers/index.json"
reader_identification: "Optional: declare your client only if known and your current-session capabilities; use reader_manifest for supplemental recommendations."
preamble_estimated_tokens: 566
model_token_report: "https://studio.inttegro.com/machine/token-report.json"
preamble_questions: 5
preamble_source: "general"
recommended_mcp_tools: ["get_integration_guide","check_integration_readiness"]
estimated_tokens: 1227
token_estimate_method: "utf8_bytes_divided_by_4"
---

## Machine preamble

**Summary:** Install and use the official server-side Inttegro SDK for Swift. This PHP representation uses the selected SDK's native names wherever Studio has a verified mapping.

### Five questions

#### Q1. When should the reader use Swift SDK?

Use this SDK guide when the selected runtime or framework matches the application being built.

#### Q2. What is authoritative on this page?

Use this page for orientation; follow its canonical SDK, guide, API, or MCP links for exact contracts.

#### Q3. What page-specific constraint matters most?

Use the current documented SDK version and native public API; do not invent members from JSON names or another language.

#### Q4. Can Inttegro MCP materially help with this task?

Yes, when the reader has an authenticated MCP connection and the task needs live context, guided planning, or a supported operation. The strongest matches are `get_integration_guide`, `check_integration_readiness`; their exact roles and boundaries are listed below.

#### Q5. How should the reader verify the answer and continue?

Install the documented version, compile or type-check the smallest example, run it against a disposable application, and verify the resulting resource through its canonical lookup. Continue with [Choose an API resource](https://studio.inttegro.com/machine/php/api.md) and [Use the iOS payment sheet instead](https://studio.inttegro.com/machine/php/mobile/ios.md) when those concerns enter scope.

### Recommended MCP assistance

Use these through an authenticated Inttegro MCP connection. This document remains the contract source.

- [`get_integration_guide`](https://studio.inttegro.com/machine/php/inttegro-mcp/tools.md#get_integration_guide) — read-only integration guidance. Returns a focused implementation sequence and canonical Studio links for authentication, checkout, orders, catalog, messaging, idempotency, or testing.
- [`check_integration_readiness`](https://studio.inttegro.com/machine/php/inttegro-mcp/tools.md#check_integration_readiness) — read-only integration guidance. Audits platform secret storage, server-runtime compatibility, idempotency, errors, state verification, checkout returns, and messaging consent without receiving source code or credentials.

## Document content

# Inttegro Swift SDK

The Inttegro Swift SDK is the official typed, asynchronous client for Swift
services on macOS and Linux. It is separate from the iOS payment-sheet SDK and
must never be embedded in a customer-facing app with a secret API key.

## Install

Add the signed package release to `Package.swift`:

```swift
dependencies: [
    .package(
        url: "https://github.com/inttegro/inttegro-sdk-swift",
        from: "0.7.0"
    ),
]
```

Link the `Inttegro` product from the `inttegro-sdk-swift` package to your
server target.

## Create a client

```swift
import Foundation
import Inttegro

let client = try Client(
    apiKey: ProcessInfo.processInfo.environment["INTTEGRO_API_KEY"]!
)

let order = try await client.orders.lookup(
    .init(orderId: "order_...")
)

print(order.id)
```

Resource methods return domain values such as `Order` and `Payout`; HTTP
response envelopes stay private.

## Observability and error reporting

Pass application-owned implementations of `Telemetry` and `ErrorReporter` to
`Client`. The SDK emits safe request lifecycle events to the telemetry hook and
delivers a prepared `ErrorReport` only when a reporter is configured.

```swift
let client = try Client(
    apiKey: apiKey,
    telemetry: telemetry,
    errorReporter: errorReporter
)
```

The callbacks receive no API keys, bodies, resource identifiers, or raw error
messages. Without an error reporter, the SDK does no report preparation work.

## Continue

- [Browse the typed API source](https://github.com/inttegro/inttegro-sdk-swift/tree/master/Sources/Inttegro)
- [Browse the repository](https://github.com/inttegro/inttegro-sdk-swift)
- [Use the iOS payment sheet instead](https://studio.inttegro.com/machine/php/mobile/ios.md)
- [Choose an API resource](https://studio.inttegro.com/machine/php/api.md)
