---
title: "Turn auto-renew on or off."
method: PATCH
path: "/v1/domain-purchases/{id}"
tags: ["Domain purchases"]
---

# Turn auto-renew on or off.

`PATCH /v1/domain-purchases/{id}`

## Request

- Base URL: `https://api.domainee.dev`
- URL: `https://api.domainee.dev/v1/domain-purchases/{id}`
- Auth: HTTP bearer

Setting `autoRenew` to false is how you cancel: the domain simply lapses at `expiresAt`.

## Request body

- object
  - `autoRenew` boolean, required

## Response `200`

The purchase.

- object
  - `purchase` DomainPurchase, required: A domain registered through Domainee on the customer's behalf.
    - `id` string, required
    - `workspaceId` string, required
    - `hostname` string, required
    - `years` integer, required
    - `wholesaleCents` integer: Registrar cost at purchase time.
    - `feeCents` integer: Domainee's per-purchase fee.
    - `totalCents` integer: What the workspace was charged.
    - `currency` 'USD'
    - `registrar` 'namecheap'
    - `registrarDomainId` string, nullable
    - `status` 'pending' | 'completed' | 'failed' | 'refunded', required: `pending` means the charge cleared but the registration is not confirmed yet; a failed registration is refunded automatically.
    - `errorMessage` string, nullable
    - `registrant` object: Minimal owner snapshot. The registrar remains the source of truth.
      - `firstName` string
      - `lastName` string
      - `email` string, email
      - `country` string: ISO 3166-1 alpha-2.
    - `whoisPrivacyEnabled` boolean
    - `autoRenew` boolean
    - `expiresAt` string, date-time, nullable
    - `connectedDomainId` string, nullable: Set when the purchase was auto-connected to a /v1/domains entry.
    - `customerReference` string, nullable: Opaque caller-supplied reference, echoed on reads and webhooks.
    - `createdAt` string, date-time, required
    - `updatedAt` string, date-time

## Other responses

- `400`: The request body or query failed validation.
- `401`: Missing, malformed, revoked, or expired Bearer token.
- `404`: No such object in this workspace.

---

[API](https://skmtc.dev/domainee/apis/domainee-api.md) · [All operations](https://skmtc.dev/domainee/apis/domainee-api/llms.txt) · [OpenAPI document](https://skmtc.dev/domainee/apis/domainee-api/revisions/756d54434372?raw)
