Skip to main content
POST
Create hosted checkout link
Use this endpoint when your own website owns the customer-facing dashboard but you still want BillingServ to host checkout and payment collection. The endpoint creates a hosted checkout URL for an existing package, one domain, or up to 50 domains. callback_url is required and customer_id is optional. If you provide customer_id, it must be a customer account (account_type 2). When the customer opens the returned URL, BillingServ creates a checkout-only session so supported saved payment methods can be used without giving the customer access to the full BillingServ panel. The link expires after 30 minutes if it is not completed.

Request

Send the request with an API key that has access to this endpoint:
Choose one checkout type for each request: Leave out customer_id for checkout-first flows where BillingServ collects the customer’s details. See the domain search and hosted checkout guide for complete domain lookup, multi-domain, and callback examples.

Response

Redirect the customer to the returned url. If a requested domain is unavailable, the API returns 422 and does not create a checkout link.

Callback

After payment, BillingServ redirects the customer back to callback_url with query parameters. Successful payment includes:
Failed payment includes:
Treat the callback as a browser return URL. For server-side reconciliation, use the returned IDs with the transactions, orders, or invoices API.

Authorizations

Authorization
string
header
required

Use Authorization: Bearer <live_api_key>.

Body

Provide exactly one checkout type: an existing package, one domain, or a list of domains.

package_id
integer
required

Package or order-group package ID to add to checkout.

Required range: x >= 1
cycle_id
integer
required

Billing cycle ID for the selected package.

Required range: x >= 1
callback_url
string<uri>
required

URL BillingServ redirects to after hosted checkout succeeds or fails.

customer_id
integer | null

Optional existing BillingServ customer user ID. If supplied, the user must have account_type 2.

Required range: x >= 1

Response

OK

A hosted checkout URL created by BillingServ. The URL expires after 30 minutes if it is not completed.

success
boolean
required
message
string
required
Example:

"Successfully"

url
string<uri>
required

Hosted checkout URL to open or redirect the customer to.