# ProductDetails

```swift
struct ProductDetails
```

The purchase line-item fields a campaign's `productScope` can target.

Mirrors the backend's `PRODUCT_SCOPE_FIELDS` allowlist and `sdk/core`'s `ProductDetails`
exactly (`sdk/core/src/types/product.ts`) — a field outside this set cannot have been
published on a campaign, so adding one here without a matching backend change would be
dead weight.

`Double`, not `Int`, for every numeric: the wire type is a JSON number and the backend
compares numerically; an `Int` would silently truncate a fractional `unitPrice`.

Decoding lives on a private wire type in `RewardsDecoder.swift`: a synthesized `Decodable`
throws on a present-but-wrong-typed value even for an `Optional` property, which would let one
reshaped field inside `matchedProducts` take down the whole rewards response.

**Conforms to** `Swift.Equatable`, `Swift.Hashable`, `Swift.Sendable`

Defined in: [Sources/FrakSDK/Core/ProductDetails.swift:16](https://github.com/frak-id/wallet/blob/35995d05c807efe1e0d6319fdede3ad363124d1e/sdk/ios/Sources/FrakSDK/Core/ProductDetails.swift#L16)

## Initializers

### init(productId:sku:name:quantity:unitPrice:totalPrice:)

```swift
init(
    productId: String? = nil,
    sku: String? = nil,
    name: String? = nil,
    quantity: Double? = nil,
    unitPrice: Double? = nil,
    totalPrice: Double? = nil
)
```

## Properties

### name

```swift
let name: String?
```

### productId

```swift
let productId: String?
```

### quantity

```swift
let quantity: Double?
```

### sku

```swift
let sku: String?
```

### totalPrice

```swift
let totalPrice: Double?
```

### unitPrice

```swift
let unitPrice: Double?
```

## Operators

### !=(_:_:)

```swift
static func != (lhs: Self, rhs: Self) -> Bool
```

Returns a Boolean value indicating whether two values are not equal.

Inequality is the inverse of equality. For any values `a` and `b`, `a != b`
implies that `a == b` is `false`.

This is the default implementation of the not-equal-to operator (`!=`)
for any type that conforms to `Equatable`.

- Parameters:
  - lhs: A value to compare.
  - rhs: Another value to compare.