BillKit/DocsConsole
API reference

API reference

A REST API over HTTPS with predictable resources and JSON responses. Every operation a key can call has a page here, generated from the OpenAPI document the API itself publishes.


Conventions

Resource URLs are stable. Writes take JSON, and updates are POST requests to the object's URL. Amounts are integers in the smallest currency unit, and timestamps are Unix seconds in UTC.

shell
curl https://api.billkit.eu/v1/subscriptions/sub_Pv9Kc3nX8mQ2rTyLbd \
  -H "Authorization: Bearer $BILLKIT_API_KEY"

Pagination

List endpoints are cursor-based. Pass limit and page with starting_after, which takes the last id you saw. Responses carry has_more; never infer the end of a list from a short page. limit defaults to 10 and is capped at 100. Paging is forward-only, so to go back, keep the cursors you have already used.

Versioning

There is one version of the API, v1, and it is the path prefix on every request. Requests carry no version header and accounts are not pinned to a dated version. Instead, v1 only changes in additive ways, under a compatibility contract that lists what can change without notice, what cannot, and what your integration has to tolerate. Anything else goes through the deprecation policy, and the API changelog records every notable change.

The version on this site, v1.1.0, is the version of the OpenAPI document behind these pages. It versions the document, not your account, and there is nothing to send it in.

Resources

91 operations, every one of them reachable with an API key. Each has its own page, generated from the OpenAPI document and its required scope. To filter the whole surface in one view, use the explorer.

Meta

Check a key and the mode it resolves to. No scope required.

OperationEndpoint
Check a keyGET/v1/ping

Customers

People and organisations you bill.

OperationEndpoint
List customersGET/v1/customers
Create a customerPOST/v1/customers
Delete customerDELETE/v1/customers/{customer_id}
Retrieve a customerGET/v1/customers/{customer_id}
Update customerPOST/v1/customers/{customer_id}
Purge customerPOST/v1/customers/{customer_id}/purge
Set customer VAT numberPOST/v1/customers/{customer_id}/vat_number

Products

The things you sell, independent of what they cost.

OperationEndpoint
List productsGET/v1/products
Create productPOST/v1/products
Get productGET/v1/products/{product_id}
Update productPOST/v1/products/{product_id}

Prices

Amount, currency, interval and tax behaviour for a product.

OperationEndpoint
List pricesGET/v1/prices
Create pricePOST/v1/prices
Get priceGET/v1/prices/{price_id}
Update pricePOST/v1/prices/{price_id}

Subscriptions

Recurring agreements between a customer and a price.

OperationEndpoint
List subscriptionsGET/v1/subscriptions
Retrieve a subscriptionGET/v1/subscriptions/{subscription_id}
Cancel a subscriptionPOST/v1/subscriptions/{subscription_id}/cancel
Pause subscriptionPOST/v1/subscriptions/{subscription_id}/pause
Preview update subscriptionPOST/v1/subscriptions/{subscription_id}/preview_update
Reactivate subscriptionPOST/v1/subscriptions/{subscription_id}/reactivate
Reauthorize payment methodPOST/v1/subscriptions/{subscription_id}/reauthorize_payment_method
Resume subscriptionPOST/v1/subscriptions/{subscription_id}/resume
Change a subscription's planPOST/v1/subscriptions/{subscription_id}/update

Checkout

Hosted and embedded Checkout sessions, and one-off payments.

OperationEndpoint
List one shotsGET/v1/checkout/one_shot
Create one-shot paymentPOST/v1/checkout/one_shot
Get one-shot paymentGET/v1/checkout/one_shot/{one_shot_id}
Create a Checkout sessionPOST/v1/checkout/sessions
Get checkout sessionGET/v1/checkout/sessions/{checkout_id}

Usage records

Metered events reported against a subscription.

OperationEndpoint
List usage recordsGET/v1/subscriptions/{subscription_id}/usage_records
Create usage recordPOST/v1/subscriptions/{subscription_id}/usage_records
Get usage summaryGET/v1/subscriptions/{subscription_id}/usage_summary

Invoices

Documents issued when a charge settles.

OperationEndpoint
List invoicesGET/v1/invoices
Get invoiceGET/v1/invoices/{invoice_id}
Email invoicePOST/v1/invoices/{invoice_id}/email
Get invoice PDFGET/v1/invoices/{invoice_id}/pdf
Void invoicePOST/v1/invoices/{invoice_id}/void

Credit notes

Reversals issued against an invoice.

OperationEndpoint
List credit notesGET/v1/credit_notes
Get credit noteGET/v1/credit_notes/{credit_note_id}
Get credit note PDFGET/v1/credit_notes/{credit_note_id}/pdf

Payments

Individual charge attempts and their outcome.

OperationEndpoint
List paymentsGET/v1/payments
Get paymentGET/v1/payments/{payment_id}
Get payment provider payloadGET/v1/payments/{payment_id}/provider

Refunds

Full and partial returns against a settled payment.

OperationEndpoint
List refundsGET/v1/refunds
Create refundPOST/v1/refunds
Get refundGET/v1/refunds/{refund_id}

Disputes

Chargebacks raised by the cardholder or their bank.

OperationEndpoint
List disputesGET/v1/disputes
Get disputeGET/v1/disputes/{dispute_id}

Coupons

Percentage and fixed-amount discounts applied at checkout.

OperationEndpoint
List couponsGET/v1/coupons
Create couponPOST/v1/coupons
Get couponGET/v1/coupons/{coupon_id}
Update couponPOST/v1/coupons/{coupon_id}
Validate couponPOST/v1/coupons/validate

Tax rates

VAT rates by country, chosen by where the buyer is.

OperationEndpoint
List tax ratesGET/v1/tax_rates
Create tax ratePOST/v1/tax_rates
Get tax rateGET/v1/tax_rates/{tax_rate_id}
Update tax ratePOST/v1/tax_rates/{tax_rate_id}

Webhook endpoints

Endpoint registration, signing secrets and delivery attempts.

OperationEndpoint
List webhook endpointsGET/v1/webhook_endpoints
Create a webhook endpointPOST/v1/webhook_endpoints
Delete webhook endpointDELETE/v1/webhook_endpoints/{endpoint_id}
Get webhook endpointGET/v1/webhook_endpoints/{endpoint_id}
Update webhook endpointPOST/v1/webhook_endpoints/{endpoint_id}
List webhook endpoint deliveriesGET/v1/webhook_endpoints/{endpoint_id}/deliveries
Get webhook deliveryGET/v1/webhook_endpoints/{endpoint_id}/deliveries/{delivery_id}
Redeliver webhook deliveryPOST/v1/webhook_endpoints/{endpoint_id}/deliveries/{delivery_id}/redeliver
Rotate webhook endpoint secretPOST/v1/webhook_endpoints/{endpoint_id}/rotate_secret
List event typesGET/v1/webhook_endpoints/event_types

Events

The immutable log every webhook is delivered from.

OperationEndpoint
List eventsGET/v1/events
Get eventGET/v1/events/{event_id}
Stream eventsGET/v1/events/stream

API keys

Mint, scope and revoke the keys that reach this API.

OperationEndpoint
List API keysGET/v1/api_keys
Create API keyPOST/v1/api_keys
Get API keyGET/v1/api_keys/{api_key_id}
Revoke API keyPOST/v1/api_keys/{api_key_id}/revoke

Audit logs

Who changed what, from the console or the API.

OperationEndpoint
List audit logsGET/v1/audit_logs
Get audit logGET/v1/audit_logs/{audit_log_id}

Tenant

Your account settings, branding and data export.

OperationEndpoint
Get billing profileGET/v1/tenant/billing_profile
Update billing profilePOST/v1/tenant/billing_profile
Get tenant capabilitiesGET/v1/tenant/capabilities
Export tenant dataGET/v1/tenant/export
Get portal brandingGET/v1/tenant/portal_branding
Update portal brandingPOST/v1/tenant/portal_branding
Rotate tenant provider credentialPOST/v1/tenant/provider_credential

Test clocks

Advance time in test mode to exercise a year of billing in a minute.

OperationEndpoint
List test clocksGET/v1/test_clocks
Create test clockPOST/v1/test_clocks
Delete test clockDELETE/v1/test_clocks/{test_clock_id}
Get test clockGET/v1/test_clocks/{test_clock_id}
Advance test clockPOST/v1/test_clocks/{test_clock_id}/advance

Billing portal

Server-side entry points for the customer-facing portal.

OperationEndpoint
Create portal sessionPOST/v1/billing_portal/sessions
Revoke portal sessionPOST/v1/billing_portal/sessions/{session_id}/revoke