# How It Works

Integrators instantiate a provider, pass it to the client, and interact exclusively through the `CityCardClient` surface. The provider translates each call into the issuer's native API. This separation ensures that switching or adding providers does not require changes to application-level code.

{% stepper %}
{% step %}

#### **Configure**

The integrator selects and instantiates a provider (e.g., `ReapCardProvider`) with the appropriate API credentials. Credentials remain server-side and are never exposed to client environments.
{% endstep %}

{% step %}

#### **Initialize**

The provider instance is passed to `CityCardClient`, which becomes the sole interface for all card operations.
{% endstep %}

{% step %}

#### **Create**

The integrator calls `createCard` with the required card parameters, KYC payload, and optional metadata. The provider forwards the request to the underlying issuer and returns a normalized card object.
{% endstep %}

{% step %}

#### **Manage**

Post-issuance, the integrator uses lifecycle methods, including `setFreeze`, `revealCard`, `replaceCard` , to control card state. Each action is routed through the provider's implementation and subject to its security model.
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://city-protocol.gitbook.io/docs/neofinance-as-a-service/card-module/how-it-works.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
