BILL v3 API Postman collection
In the API reference section, you can test with the BILL v3 API endpoints and get a response. For example, fill in the required fields for API login (username
, password
, devKey
, and organizationId
) and click Try It! to get a sessionId
in your HTTP 200 response.
The BILL v3 API Postman collection is another way for you to test with the BILL v3 API. Simply fork the collection from the Postman API Network and begin testing with different BILL v3 API workflows.
Create a free Postman account
This section assumes that you have a Postman account and access to the Postman app (or web app). See postman.com for more information.
Prerequisites
Before you begin testing with the BILL v3 API in Postman, sign-up and generate a developer key. With this key, you can build with the AP, AR, and BILL network workflows. See Sandbox API sign up for more information.
Note: An API token is required to begin testing with the Spend & Expense API. See Authentication with Spend & Expense API token for more information.
Get the BILL v3 API Postman collection
Fork the BILL v3 API collection and related environment in your Postman workspace. This section assumes that you have created your free Postman account.
- Click Run in Postman. A new browser tab is available called Collection Web View.
- Click Fork Collection.
- Under Fork collection, set your configuration and then click Fork collection.
Field | Detail |
---|---|
Fork label | Enter a fork label name. The label appears next to the forked collection name in your workspace. |
Workspace | Select your workspace in which the collection will be forked |
Notifications | Select Watch original collection |
Make your Postman profile public
In case you see a message from Postman stating that your profile must be public, simply click Make Profile Public. This does not have an impact on your testing with the BILL v3 API.
A fork of the BILL v3 API collection is now available in your selected workspace.
Get the BILL v3 API Sandbox environment
In addition to the Postman collection, BILL also provides the BILL v3 API Sandbox environment. With this environment, you set and reuse variables across different BILL v3 API endpoints effectively speeding up the process of testing with the API.
Fork the BILL v3 API Sandbox environment to use with the collection.
- Search for
BILL v3 API
in Postman search. - Click BILL API Platform Workspace from the search results.
- In the BILL API Platform Workspace, click Environments in the left navigation bar.
- Right-click the BILL v3 API Sandbox environment, and then click Create a fork.
- In the new Create Fork tab, set the workspace as the one you set when you forked the BILL v3 API collection, and then click Fork Environment.
A fork of the BILL v3 API Sandbox environment is now available in your selected workspace.
Set your credentials in the environment
When you complete your sandbox API sign-up, you set up four credentials required for signing in with the BILL v3 API. Set these credentials in your forked environment and click Save.
Variable | Current value |
---|---|
username | Email address used to sign in to your BILL developer account |
password | Password used to sign in to your BILL developer account |
developer_key | Developer key generated with 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 . |
API token for the Spend & Expense API
When you complete your Spend & Expense API sign-up, you set up an API token. Simply set api_token
in the environment and continue testing with the Spend & Expense API endpoints. No API sign in required. See developer.bill.com to learn about the Spend & Expense API capabilities.
Sandbox vs Production
You begin testing with the BILL v3 API in the sandbox environment. When you are ready to make your solution available to your customers, you build and test in the production environment. Both the sandbox and production environments have their own baseUrl
.
Environment | baseUrl |
---|---|
Sandbox | https://gateway.stage.bill.com/connect |
Production | https://gateway.prod.bill.com/connect |
API sign in
With the credentials set in the previous step, you can now sign in with POST /v3/login
.
- In the collection, navigate to Authentication > authentication > API login.
- In the API login tab, simply click Send. When you set your credentials in the previous step, this information is automatically set as variables in the body of your API call.
In the response, a generated sessionId
is available. The sesion ID is automatically saved as a variable in the environment and is available in all subsequent API requests made with this collection.
Note: BILL requires an MFA-trusted API session for a set of API operations. See MFA setup in the API reference to learn about the MFA setup process to generate an MFA-trusted API session.
Continue testing with the BILL v3 API
The BILL v3 API gives you access to the same infrastructure that powers the AP, AR, and S&E products. In this section, we look at creating a vendor and then creating a bill for the vendor. Complete API sign in with POST /v3/login
.
1. Create a vendor
- In the collection, navigate to AP & AR > vendors > Create a vendor.
- In the Create a vendor tab, simply click Send. The body of your API call is preset with a working example for creating a vendor.
In the response, a generated vendor id
is available. The vendor ID is automatically set in the environment and is available in all API requests that require a vendor ID.
2. Create a bill for the vendor
- In the collection, navigate to AP & AR > bills > Create a bill.
- In the Create a bill tab, simply click Send. The body of your API call is preset with a working example for creating a bill. This includes the vendor ID that was generated in the previous step.
In the response, a generated bill id
is available. The bill ID is automatically set in the environment and is available in all API requests that require a bill ID.
Next steps
From here, you can continue with creating a payment with POST /v3/payments
. This endpoint requires an MFA-trusted API session.
In addition, a test bank account ID is required. You can get the list of test bank accounts in your sandbox developer account with GET /v3/funding-accounts/banks
. If your account does not have a test bank account, you can easily add one. See Sandbox API bank account setup for more information.
You can also start testing with other workflows. See the Recipes section for example workflows.
Updated 3 days ago