---
title: "Finalize ACME order for a domain"
method: POST
path: "/domains/{domain_id}/order/finalize"
tags: ["Domains"]
---

# Finalize ACME order for a domain

`POST /domains/{domain_id}/order/finalize`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/domains/{domain_id}/order/finalize`
- Auth: HTTP bearer

Finalizes the ACME order by completing the challenge validation and requesting the certificate.
This should be called after the challenge has been set up (DNS record added or HTTP token served).

## Path parameters

- `domain_id` integer, required

## Response `200`

Order finalized successfully

- DomainResponse
  - `certificate` string, nullable: The PEM-encoded certificate chain (can be displayed in browser or downloaded)
  - `created_at` string, date-time, required
  - `dns_challenge_token` string, nullable
  - `dns_challenge_value` string, nullable
  - `domain` string, required
  - `expiration_time` string, date-time, nullable
  - `failure_cause` 'dns_lookup' | 'unreachable' | 'upstream_answered' | 'dns_record_mismatch' | 'caa_forbids' | 'rate_limited' | 'ca_transient' | 'config' | 'unknown', nullable: Why the last certificate attempt for a domain failed.
  - `id` integer, required
  - `is_wildcard` boolean, required
  - `last_error` string, nullable
  - `last_error_type` string, nullable
  - `last_renewed` string, date-time, nullable
  - `on_demand_backoff_until` string, date-time, nullable: On-demand TLS negative-cache deadline (ISO 8601, UTC), when this hostname's on-demand HTTP-01 issuance is in backoff after a failure (ADR-018 §4). `None` means no active backoff.
  - `status` string, required
  - `updated_at` string, date-time, required
  - `verification_method` string, required

## Other responses

- `400`: Bad request - account email or ACME order is invalid
- `401`: Unauthorized
- `403`: Domain or DNS provider permission denied
- `404`: Domain or order not found
- `409`: The ACME challenge was invalidated and cannot be retried (start a new order with POST /domains/{domain_id}/order), or the certificate was issued but DNS cleanup requires operator action
- `500`: Internal server error
- `502`: Certificate issued but DNS provider cleanup failed
- `503`: Certificate issued but DNS provider service is unavailable

## Changes

- **2026-11-26** `e1864d950604`: 5 breaking
  - the `created_at` response's property type changed from `integer` to `string`, and format from `int64` to `date-time` for status `200`
  - the `expiration_time` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `last_renewed` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - the `on_demand_backoff_until` response's property type changed from `integer, null` to `string, null`, and format from `int64` to `date-time` for status `200`
  - …1 more
- **2026-11-20** `e9e929961b13`: 1 info
  - added the optional property `failure_cause` to the response with the `200` status
- **2026-11-20** `f71460bccb8d`: 1 warning
  - removed the optional property `failure_cause` from the response with the `200` status
- **2026-11-19** `3be7f6c6c717`: 1 info
  - added the optional property `failure_cause` to the response with the `200` status
- **2026-09-07** `c2a1f69745e7`: 5 info
  - added the non-success response with the status `400`
  - added the non-success response with the status `403`
  - added the non-success response with the status `409`
  - added the non-success response with the status `502`
  - …1 more

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/domains/:domain_id/order/finalize/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
