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

# Quickstart Guide

> Get up and running with the Digitzs API in under 10 minutes

## Welcome

This quickstart guide will walk you through making your first API call to the Digitzs API. By the end of this guide, you'll have authenticated with the API, created a merchant account, and processed a test payment.

<Note>
  This guide uses test credentials and test card numbers. No real money will be processed.
</Note>

## Before You Begin

You'll need the following credentials provided during onboarding:

<CardGroup cols={3}>
  <Card title="API Key" icon="key">
    Your unique `x-api-key`
  </Card>

  <Card title="Application ID" icon="fingerprint">
    Your `appId`
  </Card>

  <Card title="Test Mode" icon="flask">
    Ensure you're using test credentials
  </Card>
</CardGroup>

## Step 1: Generate Authentication Tokens

First, generate the necessary authentication tokens to make API calls.

### 1.1 Create App Key

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.digitzs.com/auth/key \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "data": {
        "type": "auth",
        "attributes": {
          "appId": "YOUR_APP_ID"
        }
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const axios = require('axios');

  const API_KEY = 'YOUR_API_KEY';
  const APP_ID = 'YOUR_APP_ID';

  async function createAppKey() {
    const response = await axios.post(
      'https://api.digitzs.com/auth/key',
      {
        data: {
          type: 'auth',
          attributes: { appId: APP_ID }
        }
      },
      {
        headers: {
          'x-api-key': API_KEY,
          'Content-Type': 'application/json'
        }
      }
    );

    return response.data.data.attributes.appKey;
  }

  const appKey = await createAppKey();
  console.log('App Key:', appKey);
  ```

  ```python Python theme={null}
  import requests

  API_KEY = 'YOUR_API_KEY'
  APP_ID = 'YOUR_APP_ID'

  def create_app_key():
      response = requests.post(
          'https://api.digitzs.com/auth/key',
          headers={
              'x-api-key': API_KEY,
              'Content-Type': 'application/json'
          },
          json={
              'data': {
                  'type': 'auth',
                  'attributes': {
                      'appId': APP_ID
                  }
              }
          }
      )

      response.raise_for_status()
      return response.json()['data']['attributes']['appKey']

  app_key = create_app_key()
  print(f'App Key: {app_key}')
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "data": {
    "type": "auth",
    "id": "YOUR_API_KEY",
    "attributes": {
      "appKey": "generated-app-key-abc123"
    }
  }
}
```

<Tip>
  Save the `appKey` from the response. You'll need it for the next step.
</Tip>

### 1.2 Create App Token

Use the app key to generate an access token:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.digitzs.com/auth/token \
    -H "x-api-key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "data": {
        "type": "auth",
        "attributes": {
          "appKey": "YOUR_APP_KEY_FROM_STEP_1"
        }
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  async function createAppToken(appKey) {
    const response = await axios.post(
      'https://api.digitzs.com/auth/token',
      {
        data: {
          type: 'auth',
          attributes: { appKey }
        }
      },
      {
        headers: {
          'x-api-key': API_KEY,
          'Content-Type': 'application/json'
        }
      }
    );

    return response.data.data.attributes.appToken;
  }

  const appToken = await createAppToken(appKey);
  console.log('App Token:', appToken);
  ```

  ```python Python theme={null}
  def create_app_token(app_key):
      response = requests.post(
          'https://api.digitzs.com/auth/token',
          headers={
              'x-api-key': API_KEY,
              'Content-Type': 'application/json'
          },
          json={
              'data': {
                  'type': 'auth',
                  'attributes': {
                      'appKey': app_key
                  }
              }
          }
      )

      response.raise_for_status()
      return response.json()['data']['attributes']['appToken']

  app_token = create_app_token(app_key)
  print(f'App Token: {app_token}')
  ```
</CodeGroup>

**Response:**

```json theme={null}
{
  "data": {
    "type": "auth",
    "id": "YOUR_API_KEY",
    "attributes": {
      "appToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
    }
  }
}
```

<Warning>
  App tokens expire after 1 hour. Implement token refresh logic in your application.
</Warning>

## Step 2: List Merchants

Check existing merchants in your account:

```bash theme={null}
curl -X GET https://api.digitzs.com/merchants \
  -H "Authorization: Bearer YOUR_APP_TOKEN" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "appId: YOUR_APP_ID"
```

## Test Cards

Use these test card numbers in test mode:

| Card Number        | Result             |
| ------------------ | ------------------ |
| `4111111111111111` | Successful charge  |
| `4000000000000002` | Card declined      |
| `4000000000009995` | Insufficient funds |

<Tip>
  Use any future date for expiration and any 3-digit CVV for test cards.
</Tip>

## What's Next?

Congratulations! You've successfully authenticated with the Digitzs API.

### Next Steps

<CardGroup cols={2}>
  <Card title="Create Merchants" icon="store" href="/api-reference/merchants/overview">
    Set up merchant accounts
  </Card>

  <Card title="Process Payments" icon="credit-card" href="/api-reference/payments/overview">
    Accept card and ACH payments
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/error-codes">
    Handle errors properly
  </Card>

  <Card title="Full Authentication Guide" icon="key" href="/authentication">
    Learn advanced authentication
  </Card>
</CardGroup>

## Need Help?

<Card title="Contact Support" icon="headset" href="mailto:support@digitzs.com">
  Our team is here to help with any questions or issues
</Card>
