> ## Documentation Index
> Fetch the complete documentation index at: https://terminal-docs.xendit.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Introduction

> Overview of the Terminal C2C API and Terminal C2C SDK for client-to-client terminal communication.

<Info>
  Client-to-client lets your POS or backend communicate directly with terminal devices over the local network, bypassing Xendit's cloud. You can interface with terminals using either the **Terminal C2C API** (HTTP REST) or the **Terminal C2C SDK** (native Android/iOS methods).
</Info>

<Tip>
  **Most integrations should use the [Terminal API (H2H)](/api-reference/terminal-api/introduction)** instead of C2C. The Terminal API provides centralized terminal management, better scalability, and simplified network requirements.
</Tip>

## Two C2C interfaces

<Tabs>
  <Tab title="Terminal C2C API (HTTP)">
    Send HTTP REST commands to the Gateway App running on the local network. Available endpoints:

    * `POST /commands/pay` — Create payments
    * `POST /commands/cancel` — Cancel payments
    * `POST /commands/receipt` — Print receipts
    * `POST /commands/settlement` — Run settlement
    * `POST /commands/histories` — Query transaction histories

    <Warning>
      **BRI / NTT pre-install required**: The Terminal C2C API communicates through the [Terminal Gateway App](/sdk/gateway/app-configuration). Install and configure it first. Other providers (Cashup, SHC) can receive C2C API calls directly — no Gateway App needed.
    </Warning>

    <Check>
      Works from any language or platform that can make HTTP requests — web POS, thick clients, or backend services.
    </Check>
  </Tab>

  <Tab title="Terminal C2C SDK (Native)">
    Call native Android/iOS SDK methods to talk to terminals directly from your mobile application.

    * For **BRI / NTT** terminals, the C2C SDK is the required install — it handles device connectivity.
    * For **other providers** (Cashup, SHC), the SDK is an optional convenience if you prefer native method calls over HTTP.

    <Tip>
      Start with the [Terminal C2C SDK overview](/sdk/c2c/introduction) then select the [Android](/sdk/c2c/android-sdk) or [iOS](/sdk/c2c/ios-sdk) guide.
    </Tip>
  </Tab>
</Tabs>

## Getting started

<Steps>
  <Step title="Choose your C2C interface">
    Decide between the **Terminal C2C API** (HTTP REST) and the **Terminal C2C SDK** (native methods). See the comparison above.
  </Step>

  <Step title="Configure device connectivity">
    * **Terminal C2C API path**: Follow the [Gateway App configuration](/sdk/gateway/app-configuration#client-to-client) to enable Client-to-Client mode. Note the device IP and port (default 8189) and set the API key.
    * **Terminal C2C SDK path**: Add the SDK to your Android or iOS project. See the [Android SDK](/sdk/c2c/android-sdk) or [iOS SDK](/sdk/c2c/ios-sdk) setup guide.

    <Check>
      For the C2C API path you should see the device IP on the Gateway App home screen and be able to reach `http://{IP}:{PORT}` from your network.
    </Check>
  </Step>

  <Step title="Send your first command">
    Use the Terminal C2C API endpoints documented below, or the equivalent SDK methods, to create payments and interact with terminals.
  </Step>
</Steps>

<Tip>
  Requests to the Terminal C2C API must include the correct provider header (e.g., `BRI`, `NTT`, `CASHUP`, `SHC`) and the `X-API-KEY` configured in the Gateway App.
</Tip>

## Choosing a connection mode

<AccordionGroup>
  <Accordion title="Recommended: Host-to-Host (H2H)">
    Host-to-Host is recommended for most integrations because it:

    * Centralizes terminal management and monitoring
    * Scales to many devices and locations
    * Simplifies network/security by avoiding direct device access
    * Reduces POS coupling to terminal networks

    <Tip>
      Use Host-to-Host unless you have a specific need for direct local access.
    </Tip>
  </Accordion>

  <Accordion title="Use Client-to-Client when">
    Consider Client-to-Client **only** for these specific use cases:

    * **Locally managed POS systems**: Your cashier/POS system runs entirely locally without a central server backend
    * **Bundled distribution**: You want to bundle your POS system with terminal devices for distribution to retail stores without any central backend system
    * **Offline-capable terminals**: You need terminals that can operate with intermittent connectivity, though internet access is still required for payment processing

    <Warning>
      Client-to-Client **still requires internet connectivity** to process payments and communicate with terminal device providers. It only removes the need for your POS to connect to a central server — the terminals and Gateway App or SDK themselves must still have internet access.
    </Warning>

    <Warning>
      This integration requires managing local network configuration, firewall rules, and direct IP/port access between your POS and terminal devices. You are responsible for ensuring secure network communication.
    </Warning>
  </Accordion>
</AccordionGroup>

## OpenAPI Specification

<Note>
  Download the complete OpenAPI 3.1.0 specification for the Terminal C2C API
  to integrate with your development tools. Import it into Postman, Insomnia,
  or any OpenAPI-compatible client.
</Note>

<CardGroup cols={2}>
  <Card title="Download YAML" icon="file-code" href="/openapi-spec-c2c.yaml" download="xendit-terminal-gateway-client-to-client.yaml">
    Download the Client-to-Client OpenAPI 3.1.0 spec (YAML)
  </Card>

  <Card title="View in Browser" icon="terminal" href="/api-reference/client-to-client-terminal-api/create-payment-request">
    View the API directly in your browser
  </Card>
</CardGroup>

<Tip>
  * Import the YAML into your API client for quick testing
  * Use it to generate client SDKs and ensure schema accuracy
  * The spec documents endpoints, headers, and request/response bodies
</Tip>
