> 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.

# Create a add-on

POST https://api.moxie.com/v1/admin/add-ons
Content-Type: application/json

ID is server-generated (JQ-08). Definition, pricing, availability and office settings save in one transaction (JQ-03).

Reference: https://schedule-docs.moxieservices.com/api-reference/add-ons/create-add-on

## Authentication

- `Authorization` header (bearer token, required) — API session token from POST /v1/admin/session (8 hours). Sign-in itself is Google Workspace; see research R2.

## Servers

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

## Request

### Query parameters

- `officeId` (string, optional) — Set when creating while viewing one office: the new item is active only there.

### Headers

- `Idempotency-Key` (string, optional) — One key per user attempt; retries reuse it and get the original result.

### Body (application/json)

This endpoint expects an AddOn.

- `title` (string, required)
- `compatiblePlanIds` (list of string, required)
- `active` (boolean, required)
- `pricing` (AddOnPricing, required) — Quotes resolve each of initial and recurring as: office price, else per-plan price, else global price (FR-046).
- `id` (string, optional) — Server-generated.
- `description` (string, optional)
- `linkedPestIds` (list of string, optional)
- `offices` (list of AddOnOfficeSetting, optional) — Saved in the same transaction (JQ-03).
- `version` (integer, optional) — Version you last read. Omit on create; required on update. A stale value returns 409 version_conflict.

## Response

### 201

Created

- `title` (string, required)
- `compatiblePlanIds` (list of string, required)
- `active` (boolean, required)
- `pricing` (AddOnPricing, required) — Quotes resolve each of initial and recurring as: office price, else per-plan price, else global price (FR-046).
- `id` (string, optional) — Server-generated.
- `description` (string, optional)
- `linkedPestIds` (list of string, optional)
- `offices` (list of AddOnOfficeSetting, optional) — Saved in the same transaction (JQ-03).
- `version` (integer, optional) — Version you last read. Omit on create; required on update. A stale value returns 409 version_conflict.

## Errors

### 401 Unauthorized Error

Missing or invalid token (unauthenticated).

- `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.

### 403 Forbidden Error

Valid login but missing permission or office access (forbidden).

- `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

Body failed validation (validation_failed); see fieldErrors.

- `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

### AddOnPricing

Quotes resolve each of initial and recurring as: office price, else per-plan price, else global price (FR-046).

- `initialCents` (integer, required) — Amount in US cents.
- `recurringCents` (integer, required) — Amount in US cents.
- `perPlan` (list of AddOnPricingPerPlanItems, optional) — Empty when the per-plan toggle is off (AO-6).

### AddOnOfficeSetting

- `active` (boolean, required)
- `officeId` (string, optional)
- `fieldRoutesAddOnId` (integer, optional) — FieldRoutes numeric ID (per office). Always stored by ID, never by name; names come from the mirror (FR-082).
- `priceOverride` (AddOnOfficeSettingPriceOverride, optional) — Omit a value to inherit (AO-5).
- `inherited` (boolean, optional)
- `version` (integer, optional) — Version you last read. Omit on create; required on update. A stale value returns 409 version_conflict.

### 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.

### AddOnPricingPerPlanItems

- `planId` (string, required)
- `initialCents` (integer, optional) — Amount in US cents.
- `recurringCents` (integer, optional) — Amount in US cents.

### AddOnOfficeSettingPriceOverride

Omit a value to inherit (AO-5).

- `initialCents` (integer, optional) — Amount in US cents.
- `recurringCents` (integer, optional) — Amount in US cents.

## Examples

**Request**

```json
{
  "title": "string",
  "compatiblePlanIds": [
    "string"
  ],
  "active": true,
  "pricing": {
    "initialCents": 1,
    "recurringCents": 1
  }
}
```

**Response**

```json
{
  "title": "string",
  "compatiblePlanIds": [
    "string"
  ],
  "active": true,
  "pricing": {
    "initialCents": 1,
    "recurringCents": 1,
    "perPlan": [
      {
        "planId": "string",
        "initialCents": 1,
        "recurringCents": 1
      }
    ]
  },
  "id": "string",
  "description": "string",
  "linkedPestIds": [
    "string"
  ],
  "offices": [
    {
      "active": true,
      "officeId": "string",
      "fieldRoutesAddOnId": 1,
      "priceOverride": {
        "initialCents": 1,
        "recurringCents": 1
      },
      "inherited": true,
      "version": 1
    }
  ],
  "version": 1
}
```

**SDK Code**

```python
import requests

url = "https://api.moxie.com/v1/admin/add-ons"

payload = {
    "title": "string",
    "compatiblePlanIds": ["string"],
    "active": True,
    "pricing": {
        "initialCents": 1,
        "recurringCents": 1
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.moxie.com/v1/admin/add-ons';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"title":"string","compatiblePlanIds":["string"],"active":true,"pricing":{"initialCents":1,"recurringCents":1}}'
};

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/admin/add-ons"

	payload := strings.NewReader("{\n  \"title\": \"string\",\n  \"compatiblePlanIds\": [\n    \"string\"\n  ],\n  \"active\": true,\n  \"pricing\": {\n    \"initialCents\": 1,\n    \"recurringCents\": 1\n  }\n}")

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

	req.Header.Add("Authorization", "Bearer <token>")
	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/admin/add-ons")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"title\": \"string\",\n  \"compatiblePlanIds\": [\n    \"string\"\n  ],\n  \"active\": true,\n  \"pricing\": {\n    \"initialCents\": 1,\n    \"recurringCents\": 1\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/admin/add-ons")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"title\": \"string\",\n  \"compatiblePlanIds\": [\n    \"string\"\n  ],\n  \"active\": true,\n  \"pricing\": {\n    \"initialCents\": 1,\n    \"recurringCents\": 1\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.moxie.com/v1/admin/add-ons', [
  'body' => '{
  "title": "string",
  "compatiblePlanIds": [
    "string"
  ],
  "active": true,
  "pricing": {
    "initialCents": 1,
    "recurringCents": 1
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.moxie.com/v1/admin/add-ons");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"title\": \"string\",\n  \"compatiblePlanIds\": [\n    \"string\"\n  ],\n  \"active\": true,\n  \"pricing\": {\n    \"initialCents\": 1,\n    \"recurringCents\": 1\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "title": "string",
  "compatiblePlanIds": ["string"],
  "active": true,
  "pricing": [
    "initialCents": 1,
    "recurringCents": 1
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moxie.com/v1/admin/add-ons")! 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()
```