BILL v3 API in Postman

In the API reference section, you can test with the BILL v3 API endpoints and get a server response. For example, fill in the required fields for creating a customer (name, email, sessionId, and devKey) and click Try It! to see the server response.

The BILL v3 API documentation is auto-generated with OpenAPI. You can import the OpenAPI specification in Postman and test with the API endpoints on Postman.

👍

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.

Import the OpenAPI spec in Postman

Use the published BILL v3 API OpenAPI specification to import all the BILL v3 API endpoints in Postman.

  1. Copy the contents of the OpenAPI specification.
  2. In Postman, click File > Import.
  3. In the import modal, paste the contents of the OpenAPI specification.
  4. Under Choose how to import your Specification, select Postman Collection and click Import.

Under Collections in your Postman Workspace, the BILL v3 API is imported as Connect API.

Set up your sandbox environment

When you save your sandbox API credentials as environment variables in Postman, you can simply refer to the variables when you are testing with the BILL v3 API.

❗️

Ensure that your sandbox API sign-up is complete

When your sandbox API sign-up is complete, you have all the credentials you need for signing in performing other BILL v3 API operations - username, password, devKey, and orgId. See Sandbox API sign up for more information.

For example, if you save the base URL as a baseUrl variable, you can then use the variable for any API operation, such as creating a customer. In this case, the endpoint path in Postman is POST {{baseUrl}}/v3/customers.

  1. In your Postman Workspace, click New > Environment. Set up the environment variables for your sandbox environment.
VariableCurrent value
baseUrlhttps://gateway.stage.bill.com/connect
usernameYour username
passwordYour password
devKeyYour developer key
orgIdYour organization ID
  1. Click Save to save this sandbox environment information.

The environment is available under Environments in your Postman Workspace. You can set this environment from the list at the top-right in Postman.

Sign in with POST /v3/login in Postman

When you are ready to test with the BILL v3 API in Postman, sign in with POST /v3/login. In the response, a generated sessionId is available. Use the sessionId in all subsequent API calls to confirm that you are in a signed-in API session.

  1. Under Collections, click Connect API > v3 > login > API login. The POST /v3/login endpoint appears on the right.
  2. Under Body, set the type as raw, and update the required information. In this example, we update the variable names that we saved as environment variables in the previous section.
  1. Under Scripts, select Post-res and paste the following code to save the generated sessionId value as an environment variable in Postman for all your subsequent API calls.
let jsonData = pm.response.json();
let sessionId = jsonData.sessionId;
pm.globals.set("sessionId", sessionId);
  1. Click Save, and then click Send. The success 200 OK response is available. The response includes the sessionId, which is required for all subsequent API calls along with your developer key.

For example, for creating a customer (Connect API > v3 > customers > Create a customer), when you set sessionId as {{sessionId}} and devKey as {{devKey}} under Headers, these values are set by the sandbox environment variables.