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

# Incomm

This document provides specific details for using the Fluz Gift Card Vendor API Connector with Incomm as the vendor.

# Original Incomm API vs Fluz API Adapter

### Base URL

* Original Incomm API: [https://app.giftango.com](https://app.giftango.com)
* Fluz API Adapter:
  * Staging: [https://api-adapter.staging.fluzapp.com/incomm](https://api-adapter.staging.fluzapp.com/incomm)

### Original Incomm

* Uses Bearer Authentication with the Authorization header - need to generate authorization token first.

```text theme={null}
Authorization: Bearer <INCOMM-AUTH-TOKEN>
```

To generate AuthToken send request to `/auth/token` endpoint with body:

```text theme={null}
{
  grant_type: 'client_credentials',
  client_id: INCOMM_CLIENT_ID,
  client_secret: INCOMM_SECRET_KEY,
}
```

### Fluz API Adapter

* Uses Basic Authentication with the `Authorization` header (same as all vendor integrations).

```text theme={null}
Authorization: Basic <FLUZ-API-Key>
```

## API Endpoint Comparison

| Operation         | Incomm Endpoint                                    | Fluz Endpoint                                      | Notes                                      |
| :---------------- | :------------------------------------------------- | :------------------------------------------------- | :----------------------------------------- |
| Get Order Details | `GET /orders/:orderId/cards`                       | `GET /orders/:orderId/cards`                       | Retrieve card details for a specific order |
| Get Order         | `GET /orders/:orderId`                             | `GET /orders/:orderId`                             | Retrieve details for a specific order      |
| Create Order      | `POST /orders/immediate`                           | `POST /orders/immediate`                           | Create a new gift card order               |
| Get Balance       | `GET /programs/programs/:programId/programbalance` | `GET /programs/programs/:programId/programbalance` | Get balance for all currencies             |

# Request Examples

## Create Order

### Original Incomm Request:

```text theme={null}
{
  "PurchaseOrderNumber": "cddabd6d-1f7a-483d-8126-8bc676f7bd63",
  "CustomerOrderId": "cddabd6d-1f7a-483d-8126-8bc676f7bd63",
  "Recipients": [
    {
      "FirstName": "testFirstName",
      "LastName": "testLastName",
      "EmailAddress": "testEmail@test.com",
      "DeliverEmail": false,
      "Products": [
        {
          "Sku": "VUSA-D-2500-00",
          "Quantity": 1,
          "Value": 25
        }
      ]
    }
  ]
}
```

### Fluz API Adapter Request:

```text theme={null}
{
  "PurchaseOrderNumber": "cddabd6d-1f7a-483d-8126-8bc676f7bd63",
  "CustomerOrderId": "cddabd6d-1f7a-483d-8126-8bc676f7bd63",
  "Recipients": [
    {
      "FirstName": "testFirstName",
      "LastName": "testLastName",
      "EmailAddress": "testEmail@test.com",
      "DeliverEmail": false,
      "Products": [
        {
          "Sku": "VUSA-D-2500-00",
          "Quantity": 1,
          "Value": 25
        }
      ]
    }
  ]
}
```

## Background Processing for Incomm Orders

All purchase operations through the Incomm integration are processed as background operations. However, for compatibility with Incomm API behavior, the Fluz API Adapter may return full results synchronously by default.

<Callout icon="📘">
  **Note:** Even when results appear synchronous, all purchases are still scheduled and tracked as background operations internally for improved reliability and better handling of retries.
</Callout>

# Example Usage with cURL

## Example 1: Get a Specific Order with Gift Cards

```text theme={null}
# Get gift cards from order with Incomm via Fluz API Adapter
curl -X GET "https://api-adapter.staging.fluzapp.com/incomm/v1/orders/353a4151-2d51-48b6-81c9-90fd6815f12b/cards" \
  -H "Authorization: Basic <FLUZ-API-Key>"
```

## Example 2: Get Order Details

```text theme={null}
# Get order details with Incomm via Fluz API Adapter
curl -X GET "https://api-adapter.staging.fluzapp.com/incomm/v1/orders/353a4151-2d51-48b6-81c9-90fd6815f12b" \
  -H "Authorization: Basic <FLUZ-API-Key>"
```

## Example 3: Get Balance

```text theme={null}
# Get Balance with Incomm via Fluz API Adapter
curl -X GET "https://api-adapter.staging.fluzapp.com/incomm/v1/balance" \
  -H "Authorization: Basic <FLUZ-API-Key>"
```

## Example 4: Create a New Order

```text theme={null}
# Create Order with Incomm via Fluz API Adapter
# Note: This operation runs as a background process but may return complete results
curl -X POST "https://api-adapter.staging.fluzapp.com/incomm/v1/orders/immediate" \
  -H "Authorization: Basic <FLUZ-API-Key>" \
  -H "Content-Type: application/json" \
  -d '{
  "PurchaseOrderNumber": "cddabd6d-1f7a-483d-8126-8bc676f7bd63",
  "CustomerOrderId": "cddabd6d-1f7a-483d-8126-8bc676f7bd63",
  "Recipients": [
    {
      "FirstName": "testFirstName",
      "LastName": "testLastName",
      "EmailAddress": "testEmail@test.com",
      "DeliverEmail": false,
      "Products": [
        {
          "Sku": "VUSA-D-2500-00",
          "Quantity": 1,
          "Value": 25
        }
      ]
    }
  ]
}'
```
