---
updatedAt: 2026-06-23T18:28:16.000Z
agentTools:
  projectIndex: https://developer.bill.com/llms.txt
---

# Sandbox API sign in

> 👍 Important
>
> This section is about authentication to begin testing with the BILL AP & AR API. See <Anchor label="Authentication with Spend & Expense API token" target="_blank" href="doc:authentication-with-api-token">Authentication with Spend & Expense API token</Anchor> for information about authentication for the Spend & Expense API endpoints.

We begin by signing in with `POST /v3/login`, and then you can perform a set of BILL AP & AR API operations. This includes adding a vendor, creating a bill, setting up an organization bank account, and submitting a payment.

See <Anchor label="API login" target="_blank" href="ref:login">API login</Anchor> in the API reference for more information.

## Prerequisites

Sign in to your BILL developer account with the `POST /v3/login` API endpoint. The required fields for signing in are `username`, `password`, `organizationId`, and `devKey`.

| Credential      | Description                                                                                                                                  |
| :-------------- | :------------------------------------------------------------------------------------------------------------------------------------------- |
| Username        | Your username is the email address used to sign in to your BILL developer account.                                                           |
| Password        | Your password is used to sign in to your BILL developer account.                                                                             |
| Organization ID | Your BILL developer account represents your organization in BILL. The organization ID is a unique alphanumeric value that begins with `008`. |
| Developer key   | Your developer key is used to identify your developer account in your API requests.                                                          |

See <Anchor label="Sandbox API sign up" target="_blank" href="doc:api-sandbox-sign-up">Sandbox API sign up</Anchor> for information about setting up your credentials.

## You sign in as an organization user

When you sign in to your BILL developer account, you sign in as a user of your BILL organization. In the API response, `userId` is the BILL-generated ID of the signed-in user.

> 👍 Who is a BILL partner?
>
> A BILL partner can perform partner-level operations, which includes creating an organization, and then creating and managing users for that organization. See <Anchor label="BILL partner operations" target="_blank" href="doc:bill-partner-operations">BILL partner operations</Anchor> for more information.
>
> If you are interested in becoming a BILL partner, please reach out to your account manager for more information.

## Sample API login request

In this cURL example, you sign in to your BILL developer account in the API sandbox environment with `POST /v3/login`. See <Anchor label="Sandbox vs Production" target="_blank" href="doc:development-environments">Sandbox vs Production</Anchor> for information about the API sandbox and production environments.

> 📘 The AP & AR API `header` value
>
> The `header` value in the AP & AR API requests is `content-type: application/json`.

```curl Sign in with POST /v3/login
curl --request POST \
--url 'https://gateway.stage.bill.com/connect/v3/login' \
--header 'content-type: application/json' \
--data '{
  "username": "{username}", 
  "password": "{password}",
  "organizationId": "{organization_id}", 
  "devKey": "{developer_key}"
}'
```

## Response

In the response, your API session is created and a generated `sessionId` is available. Use the `sessionId` in all subsequent API calls to confirm that you are in a signed-in API session. In addition, `userId` is the BILL-generated ID of the signed-in user.

```json API login response
{
    "sessionId": "{session_id}",
    "organizationId": "{organization_id}",
    "userId": "{user_id}",
    "trusted": false
}
```

## `sessionId` properties

If your API session is inactive for 35 minutes, the session expires and you are automatically signed out. In addition, when you sign in with `POST /v3/login`, the generated `sessionId` in the response is available only for the selected `devKey` in your request. This `sessionId` does not work with another `devKey`.

See <Anchor label="API login" target="_blank" href="ref:login">API login</Anchor> in the API reference for more information.