API Reference
See it in the demo — Connect your app with API keys (~50s)Reference for the BillDog offering, paywall, subscription, and event endpoints. Auth is not on this page: its 32 operations share the same base URL and the same key format, and are documented in the Auth API reference.
Base URL
https://api.billdog.io/v1Authentication
Every request carries a project API key, and the prefix decides both the kind of key and the environment. A public key (bd_public_test_…, bd_public_live_…) is the one you ship inside an app. A secret key (bd_secret_test_…, bd_secret_live_…) is server-side only. A key with no recognised prefix is rejected before any lookup.
The dedicated header is the preferred form and takes precedence over every other channel:
X-BillDog-API-Key: bd_public_live_your_api_key_hereIf that header is absent, the key is read from api_key in the JSON body, the form the examples below use. Those are the only two places a key is read from: Authorization: Bearer is never taken as a key, and a ?api_key= query parameter is ignored.
{
"api_key": "bd_public_live_your_api_key_here"
}BillDog Auth takes the same keys: a public key for the endpoints an app calls, a secret key for the server-side ones. Those endpoints are listed in the Auth API reference.
Customer authority (proofs)
A public key says which project is asking and nothing about a person. Endpoints that read or change one customer's state (purchases, restores, redemptions, entitlement checks, customer info, push tokens, virtual currency, journey actions, web checkout) derive the customer from a proof, never from a body field:
- Secret key (
bd_secret_…, owned by the project): acts on any customer of its project, named bycustomer_idorapp_user_id. - Session:
X-BillDog-Session: <BillDog Auth access token>. Acts on the session's own customer. - Device key:
X-BillDog-Device: $BillDogAnonymousID:…andX-BillDog-Device-Key: bdk_…(43 base64url characters). Acts on the device's own anonymous customer. The SDKs generate the pair once per install and send it on every request.
Under a session, a body app_user_id / customer_id may only agree with the session's customer; naming someone else is 403 ACCESS_DENIED with details.reason: "target_mismatch". Under a device key, a body customer_id follows the same rule, but a body app_user_id is ignored: the device acts on its own anonymous customer whatever label it sends. A public key alone is 403 PROOF_REQUIRED. A presented proof that fails is 401 PROOF_INVALID. Money and account erasure need a sign-in at most 900 s old, else 403 REAUTH_REQUIRED. A store purchase belongs to one customer per (project, environment, platform, store subscription id): a receipt posted by another customer moves the purchase only when it is paid and the project's collision policy allows, else 409 PURCHASE_OWNER_CONFLICT. The static identity hash is no longer accepted. A machine-readable summary of this contract is the "API contract" section of llms.txt.
Rate Limits
Rate limits are applied per endpoint, per API key, per minute — there is no hourly quota. The ceiling depends on what the endpoint does: high-volume ingestion endpoints allow 1,000 requests per minute, while endpoints that change money or send mail are much tighter.
Exceeding a limit returns 429 with the RATE_LIMITED error code. Honour the Retry-After header (seconds) when it is sent; not every limiter sends it, so fall back to waiting out the minute.
Not every endpoint is rate-limited today. Where no limit is listed, treat the documented value as the one that will apply when it is — do not design an integration that depends on an endpoint being unlimited.
Removed endpoints
These paths no longer exist and return 404. Older SDK builds that still call them should move to the replacement.
/fetch-offeringUse /get-wall-for-placement with render_mode "headless"/fetch-offerings-for-placementUse /get-wall-for-placement with render_mode "headless"/get-placement-configUse /get-wall-for-placement/get-placement-offeringUse /get-wall-for-placement with render_mode "headless"/get-placement-gatesUse /get-wall-for-placement with render_mode "headless" (presentation.gated + presentation.required_entitlement)/create-app-to-web-checkoutUse /create-web-checkout with source "app_to_web"/trackUse /ingest-eventsError Responses
Errors use this envelope:
{
"success": false,
"error": {
"code": "ERROR_CODE",
"message": "Error message description",
"details": { }
},
"meta": { "request_id": "req_...", "timestamp": "2026-09-30T12:00:00Z" }
}A few older functions still return a flat body instead: { "error": "message", "error_code": "ERROR_CODE" }. Route on the code, not the message.
Common Error Codes
INVALID_API_KEYNo API key was sentINVALID_KEYThe key is unknown, or its prefix disagrees with its environmentKEY_REVOKEDThe key has been revokedKEY_EXPIREDThe key has expiredUNAUTHORIZEDAuthentication failedPROOF_REQUIREDThe endpoint acts on a customer and needs a session, device key or secret key, not a public key aloneACCESS_DENIEDThe caller is authenticated but may not act on this resourceVALIDATION_ERRORThe request body or query failed validationRATE_LIMITEDToo many requestsCUSTOMER_NOT_FOUNDNo customer found with the provided user IDOFFERING_NOT_FOUNDNo offering found with the provided ID or identifierPAYWALL_NOT_FOUNDNo paywall found with the provided ID or identifierPRODUCT_NOT_FOUNDNo product in the key's project matchesINTERNAL_ERRORAn unexpected server errorNext Steps
iOS Integration
Swift code examples
Android Integration
Kotlin code examples
React Native Integration
SoonJavaScript code examples
Was this page helpful?
Or rate this page: