Skip to content
Internal docs

Checkout Utilities

These endpoints are called from your checkout UI before the subscriber completes their order. All three are public (no auth required) and limited to 60 requests / minute each — per API key when you send X-API-Key, otherwise per client IP. Over the limit kurnl answers 429 Too Many Requests; back off and retry (see Rate limits).


Check email availability

POST /partner/checkout/check-email

Check whether an email address is already registered as a kurnl account. The check is platform-wide — it is not scoped to your provider.

Request body

{
"email": "alice@example.com"
}

Response

{
"email": "alice@example.com",
"is_taken": false,
"message": "Email is available"
}

Check subscription at location

GET /partner/checkout/has-subscription-at-location

Check whether a location already has an active subscription. Used to block booking a second product at the same connection.

Query parameters

Pass one of the two (there is no provider parameter):

Parameter Type Description
location_hash string 10-char location hash (preferred)
location_identifier string Legacy structured identifier

Response

{
"has_active_subscription": false
}

has_active_subscription: true means the location already has an active subscription — your checkout UI should show an error or redirect.


Validate discount code

POST /partner/checkout/validate-discount-code

Validate a discount code and return its terms so you can display them in the checkout UI.

Request body

{
"code": "SUMMER25",
"plan_version_id": "uuid"
}

Response — 200 OK (valid)

{
"valid": true,
"discount": {
"document_id": "uuid",
"name": "Summer promo",
"discount_type": "PERCENTAGE",
"discount_value": 25.0,
"duration_months": 3,
"overwrite_setup_fee": false,
"setup_fee": null
},
"source": "provider",
"label": "Summer promo",
"promo_price_monthly": 59.25,
"list_price_monthly": 79.0,
"duration_months": 3,
"setup_fee": null,
"applied": true,
"reason": null
}

The request takes two optional fields that let a kurnl operator discount answer: building_id and location_identifier (either names the building). The response fields beyond discount:

Field Meaning
source provider (the provider’s own code) or operator (a kurnl operator discount). A provider’s own code is looked up first.
label The name to show the shopper, in the form name — first N months.
promo_price_monthly / list_price_monthly The monthly price with the code and without.
duration_months How many months the promo price runs; null = for the life of the line.
setup_fee null unless a provider code overrides the fee (null = the plan’s own fee).
applied false when the code is valid but will not lower the price.
reason campaign_better — the plan’s own campaign is cheaper, so it stays and the code is not applied; unavailable — the check could not run (a temporary read failure), try again; otherwise null.

With applied: false (reason: "campaign_better"), label, promo_price_monthly and duration_months describe the plan’s campaign (the terms the order will get), while discount is still the operator’s. The comparison is on the monthly promo price only; a tie keeps the campaign.

A bulk plan answers valid: false: operator codes never apply to bulk plans.

Response — 200 OK (invalid)

{
"valid": false,
"error": "Invalid or expired discount code"
}

error is free text (e.g. "Plan version not found", "Invalid or expired discount code").


Payments not configured (409)

The checkout-creation step that follows these helper calls — and the subscriber payment-method routes (see Subscriber Self-Service) — needs the provider’s own Stripe account. If that provider has not connected one, it returns 409:

{
"detail": {
"code": "payments_not_configured",
"message": "This provider has not connected a Stripe account yet, so online payment is not available.",
"provider_id": "uuid"
}
}