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

# Introduction

> Getting started with the iQpay Order API.

# API Introduction

The iQpay Order API enables sponsors and organizations to programmatically create orders and send digital benefit cards to their members.

## Overview

Once integrated, your organization can:

* **Create orders** and deliver digital cards to members via SMS, email, or webhook
* **Authenticate securely** using JWT tokens
* **Track transactions** with external IDs for reconciliation

## Base URL

<Note>
  The iQpay API is available in the following environments for integration and testing. Production URL will be shared by the iQpay team during onboarding.
</Note>

| Environment | Base URL                        |
| ----------- | ------------------------------- |
| Demo        | `https://api-demo.bridgepo.com` |
| Production  | Provided by iQpay team          |

## Authentication

All API requests (except sign-in) require a valid JWT Bearer token in the `Authorization` header.

<Steps>
  <Step title="Get your credentials">
    iQpay provides your organization with a username and password during onboarding.
  </Step>

  <Step title="Request a token">
    Call the [Sign In](/api-reference/authentication/sign-in) endpoint with your credentials to receive a JWT access token.
  </Step>

  <Step title="Include the token">
    Pass the token in the `Authorization` header of every subsequent request:

    ```
    Authorization: Bearer <your-access-token>
    ```
  </Step>
</Steps>

## Integration Flow

<Steps>
  <Step title="Program setup">
    iQpay sets up your program with product codes, program codes, and card configurations.
  </Step>

  <Step title="Authenticate">
    Your system authenticates via the Sign In endpoint to obtain a JWT token.
  </Step>

  <Step title="Create orders">
    Call the Create Order endpoint for each member who should receive a digital card.
  </Step>

  <Step title="Card delivery">
    Cards are delivered to members via SMS/email (by iQpay) or via webhook (by your system).
  </Step>
</Steps>

## Webhooks

If your program is configured for **webhook-based delivery**, iQpay sends a payload to your configured endpoint containing the card activation URL and member details. Your webhook must return a `200` status on success.

See the [Webhooks](/api-reference/webhooks) page for payload details.

## Error Handling

All error responses follow a consistent format:

```json theme={null}
{
  "type": "string",
  "title": "Short error description",
  "status": 400,
  "detail": "Detailed error explanation",
  "traceId": "Unique trace ID for debugging"
}
```

<Tip>
  Include the `traceId` when contacting iQpay support to help diagnose issues quickly.
</Tip>
