---
raw: true
search:
  tags:
    - Domains
    - POST
seo:
  description: >-
    renew (and purchase, a one-name purchaseDomain) returns… Reference for the
    POST /v1/domains/{domainId}/registration endpoint in the Spacefast API.
sidebar:
  label: Renew or register a held domain
  badge: POST
title: Renew or register a held domain
type: openapi-operation
---
`renew` (and `purchase`, a one-name purchaseDomain) returns `data.checkout.url` for a person to open; nothing is charged until they pay there, and the registrar is asked only after payment. Poll getDomainRegistration for the outcome. Transfers aren't available yet: `transfer_in` and `transfer_out` refuse with `domain_transfer_unavailable` and change nothing.

`POST /v1/domains/{domainId}/registration`

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

Request body example:

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

**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": {
    "registration": {
      "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"
  }
}
```
