---
title: "Purchase Domain"
method: POST
path: "/v1/domains/purchase"
tags: ["Domains"]
---

# Purchase Domain

`POST /v1/domains/purchase`

Start a domain purchase. Returns a Stripe checkout URL the account owner opens and pays in a browser. Domains are billed yearly and renew automatically. The domain registers only after payment clears, and failed registrations are refunded automatically. Requires an active paid Migma subscription (returns 409 otherwise) and an API key with domain:write permission.

## Request body

- PurchaseDomainRequest
  - `domain` string, required — The domain to purchase, e.g. 'acme.com'
  - `redirectUrl` string, uri — Where to send the account owner after checkout completes

## Response `200`

Domain purchase started

- ApiResponseDomainPurchaseStarted
  - `success` boolean, required
  - `data` object, nullable
    - `checkoutUrl` string, required — Stripe checkout URL the account owner opens and pays in a browser
    - `checkoutSessionId` string — Stripe Checkout session id, when applicable
    - `stripeInvoiceId` string — Stripe invoice id, when applicable
    - `stripeSubscriptionId` string — Stripe subscription id, when applicable
    - `billingMode` 'annual_subscription' — How the domain is billed. Domains renew yearly.
    - `updateApplied` boolean — Whether the purchase was applied to an existing subscription
  - `error` string, nullable

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `403` — Forbidden - Missing required permissions or access denied
- `409` — Conflict - the Idempotency-Key was reused with a different request body (code: IDEMPOTENCY_CONFLICT)

---

[API](https://skmtc.net/migma/apis/migma-ai-api-v1.md) · [All operations](https://skmtc.net/migma/apis/migma-ai-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/migma/migma-ai-api-v1/revisions/2d06ad0e0bc3/schema)
