Webhook API general rules
The BILL webhook API follows a set of rules.
Access rules
Design | Description |
---|---|
Sandbox base URL |
|
Production base URL |
|
Security | When you create a new subscription, a one-time The generated hash is sent as the Keep the security key for your subscription updated in a timely manner. Generate a new security key for your subscription with See Test with BILL webhook security for more information. |
Authentication rules
Both organization-level users and partner users can set up webhooks. Simply set the required header values in your webhook API requests and you have access to webhooks at the desired level.
Organization-level header values for webhooks | Partner-level header values for webhooks |
---|---|
sessionId : API session ID generated with /v3/login | sessionId : Partner API session ID generated with /v3/partner/login |
devKey : Developer key sent to you by BILL when you create a developer account | appKey : Application key sent to you by BILL when you create a partner account |
Header value for setting up subscriptions for Spend & Expense events |
---|
apiToken : Access token for Spend & Expense API authentication |
Idempotent key rules
An API request is idempotent when the response shows the same result each time the same request is made.
Design | Description |
---|---|
Endpoints that require an idempotent key | Only two BILL webhook endpoints require an idempotent key.
|
| The idempotent key is set as an additional |
Time To Live (TTL) | For an idempotent key used in an API request, the API response is cached for 24 hours. For this duration, if your API request results in a successful response, and then you make another API request with the same If your API request results in an error, and then you use the same |
UUID4 format | All your idempotent keys must be in the UUID4 format. UUID4 is a randomly-generated 128-bit identifier. You can easily generate a value for your integration. For example, in Python, you can generate a UUID4 value with |
Errors | Incorrect usage of the idempotent key results in errors. See the next section for more information about idempotent key errors. When you receive an idempotent key error, fix the problem at your end and retry. |
Idempotent key errors
Incorrect usage of the idempotent key results in errors.
Error | HTTP status |
---|---|
Missing idempotent key | 400 Bad Request |
Malformed idempotent key | 400 Bad Request |
The same idempotent key is used for different operations | 409 Conflict |
Additional requests are made with the same idempotent key when another request is in progress | 429 Too Many Requests |
See Webhook API error responses for information about the complete list of webhook API error responses.
Updated 15 days ago