> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://schedule-docs.moxieservices.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://schedule-docs.moxieservices.com/_mcp/server.

# Order Complete

POST https://api.moxie.com/v1/signup/{signupId}/complete
Content-Type: application/json

Allowed from draft, failed and payment_declined (Try again uses a new Idempotency-Key); refused with 409 in any other state. Signing (FR-020): the server records the terms version, typed name, signature image and method, time and client IP. Saves the agreement evidence and the job in one transaction, publishes to Service Bus, and returns. The worker creates the customer, then takes the payment as the last step; if payment fails, the new customer is undone and nothing is charged. Success ends in awaiting_appointment.

Reference: https://schedule-docs.moxieservices.com/api-reference/customer-signup/complete-signup

## Authentication

- `X-Link-Token` header (required) — Random token from createSignup or the resume link. Stored hashed; expires.

## Servers

- `https://api.moxie.com` (Production (placeholder hostname), default)
- `https://api-dev.moxie.com` (Dev, FieldRoutes sandbox (placeholder hostname))

## Request

### Path parameters

- `signupId` (string, required)

### Headers

- `Idempotency-Key` (string, required) — One key per user attempt; retries reuse it and get the original result.
- `CF-Turnstile-Response` (string, required) — Token from the Turnstile widget.

### Body (application/json)

This endpoint expects a CompleteRequest.

- `quoteId` (string, required)
- `paymentToken` (string, required) — Token from the Payrix iframe. Card data never reaches the API.
- `agreement` (CompleteRequestAgreement, required)

## Response

### 202

Accepted; poll status

- `state` (enum, required) — awaiting_appointment: account and payment done, show the appointment step. payment_declined: back to the card step. slot_unavailable: back to the appointment step. complete: show the confirmation page.
  - Allowed values: `processing`, `awaiting_appointment`, `complete`, `failed`, `payment_declined`, `slot_unavailable`
- `steps` (list of SignupStatusStepsItems, required)
- `reference` (string, required) — Shown on the confirmation and failure screens, e.g. MX-8I64MVE.
- `accountNumber` (string, optional) — FieldRoutes customer ID. Present when state is complete.
- `confirmationSentTo` (string, optional) — Masked email, e.g. j***@gmail.com.
- `error` (Error, optional)
- `confirmation` (SignupStatusConfirmation, optional) — Everything the confirmation page shows. Present only when state is complete.

## Errors

### 404 Not Found Error

Unknown signup or wrong link token (not_found). The two are deliberately indistinguishable.

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

### 409 Conflict Error

invalid_state: not allowed from the signup's current state (only draft, failed and payment_declined may complete). price_changed, quote_expired or item_unavailable: details.quote holds a fresh quote for the customer to confirm; Order Complete again with a new Idempotency-Key.

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

### 410 Gone Error

Resume link expired (link_expired).

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

### 422 Unprocessable Entity Error

validation_failed (fieldErrors name the field: agreement.termsVersion when it isn't the current terms, agreement.signature.imagePng when it isn't a PNG or is over 200 KB, CF-Turnstile-Response when the bot check fails), or idempotency_mismatch (same key, different body).

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

### 429 Too Many Requests Error

Too many requests (rate_limited).

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

### 500 Internal Server Error

Unexpected server error (internal_error). Quote the requestId to support.

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

### 503 Service Unavailable Error

A required service such as the database or queue is temporarily unavailable (service_unavailable). Retry later.

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

## Types

### CompleteRequestAgreement

- `termsVersion` (string, required)
- `typedName` (string, required)
- `accepted` (any, required)
- `signature` (CompleteRequestAgreementSignature, required)

### SignupStatusStepsItems

- `key` (enum, required)
  - Allowed values: `agreement_saved`, `customer_created`, `payment_secured`, `appointment_scheduled`, `confirmation_sent`
- `label` (string, required) — Text from the server; the booking site shows it as sent (R7).
- `state` (enum, required)
  - Allowed values: `pending`, `running`, `done`, `failed`

### Error

- `code` (enum, required) — Every code the API returns, with its HTTP status, is listed in research R12.
  - Allowed values: `validation_failed`, `unauthenticated`, `forbidden`, `not_found`, `link_expired`, `version_conflict`, `duplicate`, `unresolved_overlaps`, `price_changed`, `quote_expired`, `item_unavailable`, `locked_after_redemption`, `zip_not_serviced`, `existing_customer`, `discount_not_applicable`, `idempotency_mismatch`, `invalid_state`, `rate_limited`, `processor_rejected`, `fieldroutes_unavailable`, `job_timeout`, `internal_error`, `service_unavailable`
- `message` (string, required) — Plain-language message the UI can show.
- `fieldErrors` (list of ErrorFieldErrorsItems, optional)
- `details` (ErrorDetails, optional) — Extra data for some codes, e.g. the new quote for price_changed.
- `requestId` (string, optional) — Same value as the X-Request-Id response header; quote it to support. Present on every API error response (0.9.3); may be absent on a job's error.

### SignupStatusConfirmation

Everything the confirmation page shows. Present only when state is complete.

- `firstName` (string, required)
- `appointment` (SignupStatusConfirmationAppointment, required)
- `serviceAddress` (Address, required)
- `plan` (SignupStatusConfirmationPlan, required)
- `addOns` (list of string, required) — Add-on titles, e.g. Cockroach Service.
- `initialServiceCents` (integer, required) — Amount in US cents.
- `chargedTodayCents` (integer, required) — Amount in US cents.
- `recurringCents` (integer, optional) — Amount in US cents.
- `recurringPeriod` (enum, optional)
  - Allowed values: `per_service`, `per_month`

### ErrorFieldErrorsItems

- `field` (string, required) — JSON path, e.g. pricing.initialCents
- `message` (string, required)

### ErrorDetails

Extra data for some codes, e.g. the new quote for price_changed.

### CompleteRequestAgreementSignature

- `method` (enum, required) — adopted = generated from the typed name; drawn = signed with mouse or finger.
  - Allowed values: `adopted`, `drawn`
- `imagePng` (string, required) — Base64 PNG of the signature as shown to the customer, up to 200 KB.
- `fontId` (string, optional) — Signature style used when adopted.

### SignupStatusConfirmationAppointment

- `date` (date, required)
- `window` (ArrivalWindow, required)

### Address

- `line1` (string, required)
- `city` (string, required)
- `state` (string, required)
- `zip` (string, required)
- `line2` (string, optional)

### SignupStatusConfirmationPlan

- `title` (string, required)
- `serviceInterval` (SignupStatusConfirmationPlanServiceInterval, optional) — Days between recurring visits, e.g. 80-100 for quarterly.

### ArrivalWindow

- `slot` (enum, required)
  - Allowed values: `am`, `pm`
- `label` (string, required) — e.g. Afternoon
- `start` (string, required) — Local time, 24-hour.
- `end` (string, required) — Local time, 24-hour.

### SignupStatusConfirmationPlanServiceInterval

Days between recurring visits, e.g. 80-100 for quarterly.

- `minDays` (integer, required)
- `maxDays` (integer, required)

## Examples

**Request**

```json
{
  "quoteId": "string",
  "paymentToken": "string",
  "agreement": {
    "termsVersion": "string",
    "typedName": "string",
    "accepted": null,
    "signature": {
      "method": "adopted",
      "imagePng": "string"
    }
  }
}
```

**Response**

```json
{
  "state": "processing",
  "steps": [
    {
      "key": "agreement_saved",
      "label": "string",
      "state": "pending"
    }
  ],
  "reference": "string",
  "accountNumber": "string",
  "confirmationSentTo": "string",
  "error": {
    "code": "validation_failed",
    "message": "string",
    "fieldErrors": [
      {
        "field": "string",
        "message": "string"
      }
    ],
    "details": {},
    "requestId": "string"
  },
  "confirmation": {
    "firstName": "string",
    "appointment": {
      "date": "2023-01-15",
      "window": {
        "slot": "am",
        "label": "string",
        "start": "12:00",
        "end": "16:00"
      }
    },
    "serviceAddress": {
      "line1": "string",
      "city": "string",
      "state": "string",
      "zip": "string",
      "line2": "string"
    },
    "plan": {
      "title": "string",
      "serviceInterval": {
        "minDays": 1,
        "maxDays": 1
      }
    },
    "addOns": [
      "string"
    ],
    "initialServiceCents": 1,
    "chargedTodayCents": 1,
    "recurringCents": 1,
    "recurringPeriod": "per_service"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.moxie.com/v1/signup/signupId/complete"

payload = {
    "quoteId": "string",
    "paymentToken": "string",
    "agreement": {
        "termsVersion": "string",
        "typedName": "string",
        "accepted": None,
        "signature": {
            "method": "adopted",
            "imagePng": "string"
        }
    }
}
headers = {
    "CF-Turnstile-Response": "CF-Turnstile-Response",
    "Idempotency-Key": "Idempotency-Key",
    "X-Link-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.moxie.com/v1/signup/signupId/complete';
const options = {
  method: 'POST',
  headers: {
    'CF-Turnstile-Response': 'CF-Turnstile-Response',
    'Idempotency-Key': 'Idempotency-Key',
    'X-Link-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"quoteId":"string","paymentToken":"string","agreement":{"termsVersion":"string","typedName":"string","accepted":null,"signature":{"method":"adopted","imagePng":"string"}}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.moxie.com/v1/signup/signupId/complete"

	payload := strings.NewReader("{\n  \"quoteId\": \"string\",\n  \"paymentToken\": \"string\",\n  \"agreement\": {\n    \"termsVersion\": \"string\",\n    \"typedName\": \"string\",\n    \"accepted\": null,\n    \"signature\": {\n      \"method\": \"adopted\",\n      \"imagePng\": \"string\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("CF-Turnstile-Response", "CF-Turnstile-Response")
	req.Header.Add("Idempotency-Key", "Idempotency-Key")
	req.Header.Add("X-Link-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.moxie.com/v1/signup/signupId/complete")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["CF-Turnstile-Response"] = 'CF-Turnstile-Response'
request["Idempotency-Key"] = 'Idempotency-Key'
request["X-Link-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"quoteId\": \"string\",\n  \"paymentToken\": \"string\",\n  \"agreement\": {\n    \"termsVersion\": \"string\",\n    \"typedName\": \"string\",\n    \"accepted\": null,\n    \"signature\": {\n      \"method\": \"adopted\",\n      \"imagePng\": \"string\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.moxie.com/v1/signup/signupId/complete")
  .header("CF-Turnstile-Response", "CF-Turnstile-Response")
  .header("Idempotency-Key", "Idempotency-Key")
  .header("X-Link-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"quoteId\": \"string\",\n  \"paymentToken\": \"string\",\n  \"agreement\": {\n    \"termsVersion\": \"string\",\n    \"typedName\": \"string\",\n    \"accepted\": null,\n    \"signature\": {\n      \"method\": \"adopted\",\n      \"imagePng\": \"string\"\n    }\n  }\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.moxie.com/v1/signup/signupId/complete', [
  'body' => '{
  "quoteId": "string",
  "paymentToken": "string",
  "agreement": {
    "termsVersion": "string",
    "typedName": "string",
    "accepted": null,
    "signature": {
      "method": "adopted",
      "imagePng": "string"
    }
  }
}',
  'headers' => [
    'CF-Turnstile-Response' => 'CF-Turnstile-Response',
    'Content-Type' => 'application/json',
    'Idempotency-Key' => 'Idempotency-Key',
    'X-Link-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.moxie.com/v1/signup/signupId/complete");
var request = new RestRequest(Method.POST);
request.AddHeader("CF-Turnstile-Response", "CF-Turnstile-Response");
request.AddHeader("Idempotency-Key", "Idempotency-Key");
request.AddHeader("X-Link-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"quoteId\": \"string\",\n  \"paymentToken\": \"string\",\n  \"agreement\": {\n    \"termsVersion\": \"string\",\n    \"typedName\": \"string\",\n    \"accepted\": null,\n    \"signature\": {\n      \"method\": \"adopted\",\n      \"imagePng\": \"string\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "CF-Turnstile-Response": "CF-Turnstile-Response",
  "Idempotency-Key": "Idempotency-Key",
  "X-Link-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "quoteId": "string",
  "paymentToken": "string",
  "agreement": [
    "termsVersion": "string",
    "typedName": "string",
    "accepted": ,
    "signature": [
      "method": "adopted",
      "imagePng": "string"
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moxie.com/v1/signup/signupId/complete")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```