---
raw: true
search:
  tags:
    - Domains
    - POST
seo:
  description: >-
    Buys up to 10 registrable apex domains in one checkout. Quotes each, adds…
    Reference for the POST /v1/domains/purchases endpoint in the Spacefast
    Partner API.
sidebar:
  label: Buy domains
  badge: POST
title: Buy domains
type: openapi-operation
---
Buys up to 10 registrable apex domains in one checkout. Quotes each, adds it to the team's inventory, and holds them all for one payment. Returns every registration (`pending_payment`) and `data.checkout.url` for a person to open and pay; nothing is registered or charged until they do. One name that can't be bought refuses the whole cart. Pass `expectedTotalCents` (before tax) to refuse if the price moved. A hostname the team already holds is registered on its existing record.

`POST /v1/domains/purchases`

**Request body** (`application/json`, required)

- `analytics` (object)
- `domains` (object[], required) — Domains to buy in one checkout (up to 10).
- `teamId` (string) — Owning team. Defaults to the active team.
- `contactId` (string, required) — Registrant contact (\`dcon\_...\`) from createDomainContact.
- `expectedTotalCents` (integer) — Refuse with domain\_checkout\_total\_changed if the live total (before tax, ICANN fees included) differs.

Request body example:

```json
{
  "analytics": {
    "sessionId": "f6567dd8-e069-418e-8893-7d22fcf12459",
    "traceId": "729bb1bf-882d-483b-89d3-5855dc5af3aa",
    "anonymousId": "string",
    "path": "string"
  },
  "domains": [
    {
      "name": "string",
      "period": 1
    }
  ],
  "teamId": "string",
  "contactId": "string",
  "expectedTotalCents": 1
}
```

**Responses**

- `200` — Response for status 200
- `default` — Problem details (RFC 9457). Any 4xx/5xx response is one \`application/problem+json\` document.

Response example, 200:

```json
{
  "$schema": "http://example.com",
  "data": {
    "registrations": [
      {
        "id": "string",
        "domainId": "string",
        "hostname": "string",
        "provider": "dsapi",
        "status": "string",
        "expiresAt": "2019-08-24T14:15:22Z",
        "redemptionEndsAt": "2019-08-24T14:15:22Z",
        "autoRenew": true,
        "transferLock": true,
        "privacySetting": "enable_privacy_service",
        "contactId": "string",
        "failureReason": "string",
        "purchase": {
          "intentId": "string",
          "lineStatus": "awaiting_payment",
          "checkout": {
            "id": "string",
            "url": "http://example.com",
            "expiresAt": "2019-08-24T14:15:22Z"
          },
          "checkoutUnavailable": true,
          "quotedFeeAmountCents": -9007199254740991,
          "paidAmountCents": -9007199254740991,
          "refund": {
            "reference": "string",
            "amountCents": -9007199254740991,
            "refundedAt": "2019-08-24T14:15:22Z"
          }
        },
        "createdAt": "2019-08-24T14:15:22Z",
        "updatedAt": "2019-08-24T14:15:22Z"
      }
    ],
    "checkout": {
      "id": "string",
      "url": "http://example.com",
      "expiresAt": "2019-08-24T14:15:22Z",
      "subtotalCents": -9007199254740991,
      "currency": "USD",
      "lines": [
        {
          "domainId": "string",
          "registrationId": "string",
          "name": "string",
          "amountCents": -9007199254740991
        }
      ]
    }
  },
  "operation": {
    "id": "string",
    "kind": "string",
    "status": "queued",
    "resources": [
      {
        "type": "string",
        "id": "string"
      }
    ],
    "progress": {
      "total": 0,
      "completed": 0,
      "failed": 0
    },
    "diagnostics": [
      {
        "code": "string",
        "severity": "info",
        "message": "string",
        "path": "string",
        "provider": "infra",
        "details": {
          "property1": null,
          "property2": null
        },
        "fix": "string",
        "retryable": true
      }
    ],
    "createdAt": "2019-08-24T14:15:22Z",
    "finishedAt": "2019-08-24T14:15:22Z"
  }
}
```
