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

# Quickstart

> Get a token, add the headers and fetch your first customer list.

Before you start, you need:

* **OrgName** and **ApiKey**: issued by Noyax.
* **User ID** (`X-UserID`): the Noyax user the requests are made on behalf of.
* **Company ID** (`X-CompanyID`): the company whose data you access. The user must be assigned to this company.

<Steps>
  <Step title="Get an access token">
    Exchange your API key for an access token and a refresh token at the auth service.

    <CodeGroup>
      ```bash cURL theme={null}
      curl -X POST https://app.noyax.com/services/bb_auth_service/api/ApiAuth/login \
        -H "Content-Type: application/json" \
        -d '{
          "OrgName": "YOUR_ORG_NAME",
          "ApiKey": "YOUR_API_KEY"
        }'
      ```

      ```json Response theme={null}
      {
        "Data": {
          "AccessToken": "eyJhbGciOiJSUzI1NiIsImtpZCI6ImFwaSIs...",
          "RefreshToken": "q3Jv1mYt8Rk0bXw2LzH5nD7sPfA9cGe4..."
        },
        "Success": true,
        "Message": null
      }
      ```
    </CodeGroup>

    Access tokens are short-lived. When one expires, use the refresh token to get a new one. See [Authentication](/en/v1/guides/authentication).
  </Step>

  <Step title="Make your first request">
    Put the token in the `Authorization` header and the user and company IDs in `X-UserID` and `X-CompanyID`.

    <CodeGroup>
      ```bash cURL theme={null}
      curl "https://api.noyax.com/api/v1/customers?page=1&pageSize=10" \
        -H "Authorization: Bearer ACCESS_TOKEN" \
        -H "X-UserID: 12" \
        -H "X-CompanyID: 3"
      ```

      ```csharp C# theme={null}
      using var client = new HttpClient { BaseAddress = new Uri("https://api.noyax.com/api/v1/") };
      client.DefaultRequestHeaders.Authorization = new("Bearer", accessToken);
      client.DefaultRequestHeaders.Add("X-UserID", "12");
      client.DefaultRequestHeaders.Add("X-CompanyID", "3");

      var json = await client.GetStringAsync("customers?page=1&pageSize=10");
      ```

      ```javascript Node.js theme={null}
      const response = await fetch("https://api.noyax.com/api/v1/customers?page=1&pageSize=10", {
        headers: {
          Authorization: `Bearer ${accessToken}`,
          "X-UserID": "12",
          "X-CompanyID": "3",
        },
      });
      const result = await response.json();
      ```

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

      response = requests.get(
          "https://api.noyax.com/api/v1/customers",
          params={"page": 1, "pageSize": 10},
          headers={
              "Authorization": f"Bearer {access_token}",
              "X-UserID": "12",
              "X-CompanyID": "3",
          },
      )
      result = response.json()
      ```
    </CodeGroup>
  </Step>

  <Step title="Read the response">
    Records are in `Data.Items` and the total record count is in `Data.TotalCount`.

    ```json theme={null}
    {
      "Success": true,
      "ResultCode": "0000",
      "Message": null,
      "Data": {
        "Page": 1,
        "PageSize": 10,
        "TotalCount": 128,
        "Items": [
          {
            "Id": "3f2b8c1e-5d47-4a9b-9e21-6c0d8f7a1b24",
            "CustomerCode": "0000382026",
            "Name": "Example Trading Ltd.",
            "TaxNumber": "1234567890",
            "MovementType": 3
          }
        ]
      }
    }
    ```

    The `X-Daily-Remaining` response header shows how many requests you have left today.
  </Step>
</Steps>

## Next steps

<CardGroup cols={2}>
  <Card title="Create a customer" icon="user-plus" href="/en/v1/customers/create">
    Create a customer with addresses, telephones and other sub-records in one request.
  </Card>

  <Card title="Handle errors" icon="triangle-exclamation" href="/en/v1/guides/errors">
    Learn which HTTP status code is returned in which case.
  </Card>
</CardGroup>
