{"openapi":"3.0.0","info":{"version":"1.0.0","title":"OAuth Authentication"},"servers":[{"url":"https://auth.stage.bill.com"}],"tags":[{"name":"authentication"}],"paths":{"/authx/token":{"post":{"summary":"Create an access token","description":"Use OAuth client credentials to authenticate your requests to the BILL v3 API across AP, AR, and Spend & Expense.\n\nYou create a developer app in the BILL web app to generate a client ID and a client secret. Use your client ID and client secret with the token endpoint (`POST /authx/token`) to generate a short-lived access token. Then pass the access token as a **Bearer** token in the **Authorization** header of your BILL v3 API requests.\n\nFor step-by-step setup instructions, see <a href=\"https://developer.bill.com/docs/oauth-client-credentials\" target=\"_blank\" rel=\"noopener noreferrer\">Get started with BILL OAuth</a> in the Guides section.\n\n> 📘 Authorization header format\n>\n> ```\n> Authorization: Bearer {access_token}\n> ```\n\nYour access token inherits the exact product permissions of the BILL user who created the developer app. The access token is the only credential you need to send with your requests.\n\n> ❗ Important\n>\n> OAuth client credentials are not supported for Account Console, BILL partners, BILL app partner integrations, or webhooks. Continue using your existing authentication methods for these specific integrations.","tags":["authentication"],"operationId":"createAccessToken","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","required":["grant_type","client_id","client_secret"],"properties":{"grant_type":{"type":"string","description":"The credential type for authentication. Always set this value to `client_credentials`.","default":"client_credentials","example":"client_credentials"},"client_id":{"type":"string","description":"Client ID generated when you create a developer app in the BILL web app.","example":"{{client_id}}"},"client_secret":{"type":"string","format":"password","description":"Client secret generated with the client ID when you create the developer app.","example":"{{client_secret}}"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","required":["access_token","expires_in","token_type"],"properties":{"access_token":{"type":"string","description":"A short-lived security token generated using a client ID and a client secret. Enter it as a **Bearer** token in the **Authorization** header to authorize and run BILL v3 API requests across AP, AR, and Spend & Expense. In an API client such as Postman, select **Bearer** token to set the header automatically.","example":"{access_token}"},"expires_in":{"type":"integer","description":"Token validity in seconds. The access token expires after 3600 seconds (1 hour). Regenerate it using the API when it expires.","example":3600},"token_type":{"type":"string","description":"The token type. The value is always `Bearer`.","example":"Bearer"}}},"example":{"access_token":"{access_token}","expires_in":3600,"token_type":"Bearer"}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"example":{"message":"AUTHX-116 invalid_request, details=Client id is missing from token request."}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"example":{"message":"AUTHX-102 invalid_client, details=Client is invalid."}}}},"500":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","required":["message"],"properties":{"message":{"type":"string"}}},"example":{"message":"An unexpected error occurred. Try again later. If the issue persists, contact BILL support (https://help.bill.com/direct/s/contact-us)."}}}}}}}},"x-readme":{},"components":{}}