# Subscription

### Fetch Subscriptions

To fetch the list of subscriptions, the following API can be used.

### Concrete example

{% tabs %}
{% tab title="Swift" %}

```swift
let service = SubscriptionService()
service.fetchContractDates(then: { result in
    switch result {
    case .success:
        // fetch successful
    case .failure:
        // error
    }
})
```

{% endtab %}

{% tab title="Kotlin" %}

```kotlin
val subscriptionsService = SubscriptionsService()
subscriptionsService.fetch(callback = { result ->
    if (result?.value == null || result.throwable != null) {
        // failure
    } else {
        // Success
        val response = result.value
    }
})
```

{% endtab %}
{% endtabs %}

The HostApp now have the list of subscriptions upon success.
