Sandbox API sign in
We begin by signing in with /v2/Login.json
, and then you can perform a set of BILL v2 API operations. This includes adding a vendor, creating a bill, setting up an organization bank account, and submitting a payment.
See API login in the API reference for more information.
Prerequisites
Sign in to your BILL developer account with the /v2/Login.json
API endpoint. The required fields for signing in are username
, password
, orgId
, 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 Sandbox API sign up for information about setting up your credentials.
Sample login request
In this cURL example, you sign in to your API sandbox developer account with /v2/Login.json
. See Development environments for information about the sandbox and production environments.
curl --request POST \
--url 'https://api-stage.bill.com/api/v2/Login.json' \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'userName={username}' \
--data 'password={password}' \
--data 'orgId={organization_id}' \
--data 'devKey={developer_key}'
In the response, your API session is created and a sessionId
is generated. Use the sessionId
in all subsequent API calls to confirm that you are in a signed-in API session. See Login in the API reference for more information.
Token-based sign in
When you sign in with your credentials, the generated
sessionId
enables you to call any BILL API endpoint without restrictions. ThissessionId
expires when it is inactive or idle for 35 minutes and you are automatically signed out.You can also sign in to your BILL developer account with a user-generated token. The generated
sessionId
expires when it is inactive or idle for 48 hours, and provides limited access to the BILL API. See Token-based sign in for more information.
Retrieve organization ID with the API
You can retrieve the organization ID (orgId
) linked to your API sandbox account with /v2/ListOrgs.json
. Set the required values in your request and run the command in your choice of command line system.
curl --request POST \
--url 'https://api-stage.bill.com/api/v2/ListOrgs.json' \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'devKey={developer_key}' \
--data 'userName={email_address}' \
--data 'password={password}'
In the response, the orgId
and orgName
values are retrieved. See Retrieve organizations for the current user in the API reference for more information.
Updated 15 days ago