> 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 or update an office override

PUT https://api.moxie.com/v1/admin/settings/employee-referrals/offices/{officeId}
Content-Type: application/json

Reference: https://schedule-docs.moxieservices.com/api-reference/referrals/override-customer-referrals-settings

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

### Path parameters

- `officeId` (string, required)

### Body (application/json)

This endpoint expects an EmployeeReferralSettingsWrite.

- `value` (EmployeeReferralSettings, required) — Apply to all types (RF-5) copies one type's config into all three before saving.
- `version` (integer, optional) — Omit when creating an office override.

## Response

### 200

Saved

- `global` (EmployeeReferralSettings, required) — Apply to all types (RF-5) copies one type's config into all three before saving.
- `globalVersion` (integer, required)
- `overrides` (list of EmployeeReferralSettingsScopedOverridesItems, required) — Every office with its own value; drives the 'offices with custom values' table (G-11).
- `effective` (EmployeeReferralSettings, optional) — Apply to all types (RF-5) copies one type's config into all three before saving.
- `effectiveSource` (enum, optional)
  - Allowed values: `global`, `office`

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

### 404 Not Found Error

No such record, or not visible to this user (not_found).

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

Someone else saved first (version_conflict). Reload and retry.

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

### EmployeeReferralSettings

Apply to all types (RF-5) copies one type's config into all three before saving.

- `enabled` (boolean, required)
- `byType` (EmployeeReferralSettingsByType, optional)

### EmployeeReferralSettingsScopedOverridesItems

- `officeId` (string, required)
- `value` (EmployeeReferralSettings, required) — Apply to all types (RF-5) copies one type's config into all three before saving.
- `version` (integer, required)
- `updatedAt` (datetime, optional)
- `updatedBy` (string, optional)

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

### EmployeeReferralSettingsByType

- `salesRep` (EmployeeReferralConfig, optional)
- `officeStaff` (EmployeeReferralConfig, optional)
- `technician` (EmployeeReferralConfig, optional)

### EmployeeReferralConfig

- `discounts` (EmployeeReferralConfigDiscounts, optional)
- `reward` (EmployeeReward, optional)
- `requirement` (string, optional) — Open question: option list.
- `fulfillment` (string, optional) — Open question: option list.

### EmployeeReferralConfigDiscounts

- `initial` (Discount, optional)
- `recurring` (Discount, optional)

### EmployeeReward

- `type` (enum, required)
  - Allowed values: `percent`, `amount`, `custom`
- `value` (double, required) — Percent of contract value (max 100), cents, or custom units.
- `customUnit` (string, optional) — Label when type is custom.

### Discount

- `type` (enum, required) — UI code values flat, pct, price, off.
  - Allowed values: `amount_off`, `percent_off`, `fixed_price`, `none`
- `value` (double, optional) — Cents for amount_off and fixed_price; 0-100 for percent_off; ignored for none.

## Examples

**Request**

```json
{
  "value": {
    "enabled": true
  }
}
```

**Response**

```json
{
  "global": {
    "enabled": true,
    "byType": {
      "salesRep": {
        "discounts": {
          "initial": {
            "type": "amount_off",
            "value": 1.1
          },
          "recurring": {
            "type": "amount_off",
            "value": 1.1
          }
        },
        "reward": {
          "type": "percent",
          "value": 1.1,
          "customUnit": "string"
        },
        "requirement": "string",
        "fulfillment": "string"
      },
      "officeStaff": {
        "discounts": {
          "initial": {
            "type": "amount_off",
            "value": 1.1
          },
          "recurring": {
            "type": "amount_off",
            "value": 1.1
          }
        },
        "reward": {
          "type": "percent",
          "value": 1.1,
          "customUnit": "string"
        },
        "requirement": "string",
        "fulfillment": "string"
      },
      "technician": {
        "discounts": {
          "initial": {
            "type": "amount_off",
            "value": 1.1
          },
          "recurring": {
            "type": "amount_off",
            "value": 1.1
          }
        },
        "reward": {
          "type": "percent",
          "value": 1.1,
          "customUnit": "string"
        },
        "requirement": "string",
        "fulfillment": "string"
      }
    }
  },
  "globalVersion": 1,
  "overrides": [
    {
      "officeId": "string",
      "value": {
        "enabled": true,
        "byType": {
          "salesRep": {
            "discounts": {
              "initial": {
                "type": "amount_off",
                "value": 1.1
              },
              "recurring": {
                "type": "amount_off",
                "value": 1.1
              }
            },
            "reward": {
              "type": "percent",
              "value": 1.1,
              "customUnit": "string"
            },
            "requirement": "string",
            "fulfillment": "string"
          },
          "officeStaff": {
            "discounts": {
              "initial": {
                "type": "amount_off",
                "value": 1.1
              },
              "recurring": {
                "type": "amount_off",
                "value": 1.1
              }
            },
            "reward": {
              "type": "percent",
              "value": 1.1,
              "customUnit": "string"
            },
            "requirement": "string",
            "fulfillment": "string"
          },
          "technician": {
            "discounts": {
              "initial": {
                "type": "amount_off",
                "value": 1.1
              },
              "recurring": {
                "type": "amount_off",
                "value": 1.1
              }
            },
            "reward": {
              "type": "percent",
              "value": 1.1,
              "customUnit": "string"
            },
            "requirement": "string",
            "fulfillment": "string"
          }
        }
      },
      "version": 1,
      "updatedAt": "2024-01-15T09:30:00Z",
      "updatedBy": "string"
    }
  ],
  "effective": {
    "enabled": true,
    "byType": {
      "salesRep": {
        "discounts": {
          "initial": {
            "type": "amount_off",
            "value": 1.1
          },
          "recurring": {
            "type": "amount_off",
            "value": 1.1
          }
        },
        "reward": {
          "type": "percent",
          "value": 1.1,
          "customUnit": "string"
        },
        "requirement": "string",
        "fulfillment": "string"
      },
      "officeStaff": {
        "discounts": {
          "initial": {
            "type": "amount_off",
            "value": 1.1
          },
          "recurring": {
            "type": "amount_off",
            "value": 1.1
          }
        },
        "reward": {
          "type": "percent",
          "value": 1.1,
          "customUnit": "string"
        },
        "requirement": "string",
        "fulfillment": "string"
      },
      "technician": {
        "discounts": {
          "initial": {
            "type": "amount_off",
            "value": 1.1
          },
          "recurring": {
            "type": "amount_off",
            "value": 1.1
          }
        },
        "reward": {
          "type": "percent",
          "value": 1.1,
          "customUnit": "string"
        },
        "requirement": "string",
        "fulfillment": "string"
      }
    }
  },
  "effectiveSource": "global"
}
```

**SDK Code**

```python
import requests

url = "https://api.moxie.com/v1/admin/settings/employee-referrals/offices/officeId"

payload = { "value": { "enabled": True } }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript
const url = 'https://api.moxie.com/v1/admin/settings/employee-referrals/offices/officeId';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"value":{"enabled":true}}'
};

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/settings/employee-referrals/offices/officeId"

	payload := strings.NewReader("{\n  \"value\": {\n    \"enabled\": true\n  }\n}")

	req, _ := http.NewRequest("PUT", 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/settings/employee-referrals/offices/officeId")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"value\": {\n    \"enabled\": true\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.put("https://api.moxie.com/v1/admin/settings/employee-referrals/offices/officeId")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"value\": {\n    \"enabled\": true\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.moxie.com/v1/admin/settings/employee-referrals/offices/officeId', [
  'body' => '{
  "value": {
    "enabled": true
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.moxie.com/v1/admin/settings/employee-referrals/offices/officeId");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"value\": {\n    \"enabled\": true\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["value": ["enabled": true]] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moxie.com/v1/admin/settings/employee-referrals/offices/officeId")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```