{
  "openapi": "3.1.1",
  "info": {
    "title": "MyRepairApp Public API",
    "version": "2.0.0",
    "description": "Public API for MyRepairApp stores. Monetary values documented as currency amounts are expressed in dollars at the API boundary. The human and raw documentation at https://www.myrepairapp.com/api-docs provides resource-specific examples."
  },
  "servers": [
    {
      "url": "https://www.myrepairapp.com/api/v2",
      "description": "Production"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    { "name": "Store" },
    { "name": "Customers" },
    { "name": "Inventory" },
    { "name": "Purchase Orders" },
    { "name": "Suppliers" },
    { "name": "Invoices" },
    { "name": "Trade-ins" },
    { "name": "Check-in Tickets" },
    { "name": "SMS" }
  ],
  "paths": {
    "/store": {
      "get": {
        "operationId": "getStore",
        "tags": ["Store"],
        "summary": "Get the authenticated store",
        "responses": {
          "200": {
            "description": "Store record",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Store" }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/customers": {
      "get": {
        "operationId": "listCustomers",
        "tags": ["Customers"],
        "summary": "List customers",
        "responses": {
          "200": {
            "description": "Customers",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/Customer" }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "operationId": "createCustomer",
        "tags": ["Customers"],
        "summary": "Create a customer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CustomerInput" }
            }
          }
        },
        "responses": {
          "201": { "$ref": "#/components/responses/CustomerResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/customers/{customerId}": {
      "parameters": [{ "$ref": "#/components/parameters/CustomerId" }],
      "get": {
        "operationId": "getCustomer",
        "tags": ["Customers"],
        "summary": "Get a customer",
        "responses": {
          "200": { "$ref": "#/components/responses/CustomerResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "patch": {
        "operationId": "updateCustomer",
        "tags": ["Customers"],
        "summary": "Update a customer",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CustomerUpdate" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/CustomerUpdateResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "delete": {
        "operationId": "deleteCustomer",
        "tags": ["Customers"],
        "summary": "Delete a customer",
        "responses": {
          "200": { "$ref": "#/components/responses/SuccessFlagResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/inventory": {
      "post": {
        "operationId": "createInventoryItem",
        "tags": ["Inventory"],
        "summary": "Create an inventory item",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/InventoryItemInput" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/InventoryCreateResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "409": { "$ref": "#/components/responses/Conflict" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/inventory/{itemId}": {
      "parameters": [{ "$ref": "#/components/parameters/ItemId" }],
      "patch": {
        "operationId": "updateInventoryItem",
        "tags": ["Inventory"],
        "summary": "Update an inventory item",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/InventoryItemUpdate" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/InventoryUpdateResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "delete": {
        "operationId": "deleteInventoryItem",
        "tags": ["Inventory"],
        "summary": "Delete an inventory item",
        "responses": {
          "200": { "$ref": "#/components/responses/SuccessFlagResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/inventory/search": {
      "get": {
        "operationId": "searchInventory",
        "tags": ["Inventory"],
        "summary": "Search inventory items",
        "parameters": [
          { "$ref": "#/components/parameters/Query" },
          {
            "name": "storeIds",
            "in": "query",
            "schema": { "type": "string" },
            "description": "Comma-separated store IDs. Access remains limited to stores available to the authenticated account."
          },
          {
            "name": "relevanceSort",
            "in": "query",
            "schema": { "type": "boolean", "default": true }
          },
          {
            "name": "categories",
            "in": "query",
            "schema": { "type": "string" },
            "description": "Comma-separated inventory categories."
          },
          {
            "name": "types",
            "in": "query",
            "schema": { "type": "string" },
            "description": "Comma-separated inventory types."
          },
          {
            "name": "instockOnly",
            "in": "query",
            "schema": { "type": "boolean" }
          },
          { "$ref": "#/components/parameters/Page" },
          { "$ref": "#/components/parameters/PageSize" },
          {
            "name": "suppressUnavailableTradeins",
            "in": "query",
            "schema": { "type": "boolean" }
          }
        ],
        "responses": {
          "200": {
            "description": "Inventory items",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/InventoryItem" }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/inventory/order": {
      "get": {
        "operationId": "listPurchaseOrders",
        "tags": ["Purchase Orders"],
        "summary": "List purchase orders",
        "responses": {
          "200": { "$ref": "#/components/responses/PurchaseOrderListResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "operationId": "createPurchaseOrder",
        "tags": ["Purchase Orders"],
        "summary": "Create an empty draft purchase order",
        "description": "This operation does not accept a request body.",
        "responses": {
          "200": {
            "$ref": "#/components/responses/PurchaseOrderCreateResponse"
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/inventory/order/{orderId}": {
      "parameters": [{ "$ref": "#/components/parameters/OrderId" }],
      "get": {
        "operationId": "getPurchaseOrder",
        "tags": ["Purchase Orders"],
        "summary": "Get purchase-order details",
        "responses": {
          "200": { "$ref": "#/components/responses/PurchaseOrderResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "patch": {
        "operationId": "updatePurchaseOrder",
        "tags": ["Purchase Orders"],
        "summary": "Update a purchase order",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/PurchaseOrderUpdate" }
            }
          }
        },
        "responses": {
          "200": {
            "$ref": "#/components/responses/PurchaseOrderUpdateResponse"
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "delete": {
        "operationId": "deletePurchaseOrder",
        "tags": ["Purchase Orders"],
        "summary": "Delete a purchase order",
        "responses": {
          "200": { "$ref": "#/components/responses/SuccessFlagResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/inventory/transfer": {
      "post": {
        "operationId": "transferInventory",
        "tags": ["Inventory"],
        "summary": "Transfer inventory between store locations",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InventoryTransferInput"
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/InventoryTransferResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "403": { "$ref": "#/components/responses/Forbidden" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/supplier": {
      "get": {
        "operationId": "listSuppliers",
        "tags": ["Suppliers"],
        "summary": "List global and store suppliers",
        "responses": {
          "200": {
            "description": "Suppliers",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/Supplier" }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "operationId": "createSupplier",
        "tags": ["Suppliers"],
        "summary": "Create a store supplier",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/SupplierInput" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/SupplierResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/invoice": {
      "get": {
        "operationId": "listInvoices",
        "tags": ["Invoices"],
        "summary": "List invoices",
        "responses": {
          "200": { "$ref": "#/components/responses/InvoiceListResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "operationId": "createInvoice",
        "tags": ["Invoices"],
        "summary": "Create an invoice",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/InvoiceInput" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/InvoiceResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/inventory/trade-in": {
      "get": {
        "operationId": "listTradeIns",
        "tags": ["Trade-ins"],
        "summary": "Search trade-in inventory",
        "parameters": [
          { "$ref": "#/components/parameters/Query" },
          { "$ref": "#/components/parameters/Page" },
          { "$ref": "#/components/parameters/PageSize" }
        ],
        "responses": {
          "200": { "$ref": "#/components/responses/TradeInListResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "operationId": "createTradeIns",
        "tags": ["Trade-ins"],
        "summary": "Create or restock trade-in inventory",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "array",
                "items": { "$ref": "#/components/schemas/TradeInDeviceInput" }
              }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/TradeInCreateResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/checkin-ticket": {
      "get": {
        "operationId": "searchCheckinTickets",
        "tags": ["Check-in Tickets"],
        "summary": "Search check-in tickets",
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": { "type": "string", "minLength": 1 }
          },
          {
            "name": "closed",
            "in": "query",
            "schema": { "type": "boolean", "default": false }
          }
        ],
        "responses": {
          "200": { "$ref": "#/components/responses/CheckinSearchResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "operationId": "createCheckinTicket",
        "tags": ["Check-in Tickets"],
        "summary": "Create a sales or repair check-in ticket",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CheckinTicketInput" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/CheckinCreateResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/checkin-ticket/{ticketId}": {
      "parameters": [{ "$ref": "#/components/parameters/TicketId" }],
      "patch": {
        "operationId": "updateCheckinTicket",
        "tags": ["Check-in Tickets"],
        "summary": "Update a check-in ticket",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CheckinTicketUpdate" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/CheckinUpdateResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "delete": {
        "operationId": "deleteCheckinTicket",
        "tags": ["Check-in Tickets"],
        "summary": "Delete a check-in ticket",
        "responses": {
          "200": { "$ref": "#/components/responses/CheckinDeleteResponse" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/checkin-ticket/{ticketId}/note": {
      "parameters": [{ "$ref": "#/components/parameters/TicketId" }],
      "get": {
        "operationId": "listCheckinTicketNotes",
        "tags": ["Check-in Tickets"],
        "summary": "List notes for a check-in ticket",
        "responses": {
          "200": {
            "description": "Notes in newest-first order",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/CheckinNote" }
                }
              }
            }
          },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      },
      "post": {
        "operationId": "createCheckinTicketNote",
        "tags": ["Check-in Tickets"],
        "summary": "Add a note to a check-in ticket",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/CheckinNoteInput" }
            }
          }
        },
        "responses": {
          "200": { "$ref": "#/components/responses/CheckinNoteResponse" },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "404": { "$ref": "#/components/responses/NotFound" },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" }
        }
      }
    },
    "/sms/send": {
      "post": {
        "operationId": "sendSms",
        "tags": ["SMS"],
        "summary": "Send an SMS or MMS message",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/SendSmsInput" }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message accepted by the SMS provider",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["messageSid", "status"],
                  "properties": {
                    "messageSid": { "type": "string" },
                    "status": { "type": "string" }
                  }
                }
              }
            }
          },
          "400": { "$ref": "#/components/responses/BadRequest" },
          "401": { "$ref": "#/components/responses/Unauthorized" },
          "402": {
            "description": "SMS service is not available for the store",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          },
          "429": { "$ref": "#/components/responses/RateLimited" },
          "500": { "$ref": "#/components/responses/ServerError" },
          "502": {
            "description": "SMS provider failure",
            "content": {
              "application/json": {
                "schema": { "$ref": "#/components/schemas/Error" }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "Generate the store API key from the authenticated admin-only API Access page. Keep it secret."
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "Maximum authenticated requests in the rolling window.",
        "schema": { "type": "integer", "const": 60 }
      },
      "RateLimitRemaining": {
        "description": "Requests remaining in the current rolling window.",
        "schema": { "type": "integer", "minimum": 0 }
      },
      "RateLimitReset": {
        "description": "Unix timestamp in seconds when capacity becomes available.",
        "schema": { "type": "integer" }
      }
    },
    "parameters": {
      "CustomerId": {
        "name": "customerId",
        "in": "path",
        "required": true,
        "schema": { "type": "string" }
      },
      "ItemId": {
        "name": "itemId",
        "in": "path",
        "required": true,
        "schema": { "type": "string" }
      },
      "OrderId": {
        "name": "orderId",
        "in": "path",
        "required": true,
        "schema": { "type": "string" }
      },
      "TicketId": {
        "name": "ticketId",
        "in": "path",
        "required": true,
        "schema": { "type": "string" }
      },
      "Query": {
        "name": "query",
        "in": "query",
        "schema": { "type": "string" }
      },
      "Page": {
        "name": "page",
        "in": "query",
        "schema": { "type": "integer", "minimum": 1, "default": 1 }
      },
      "PageSize": {
        "name": "pageSize",
        "in": "query",
        "schema": { "type": "integer", "minimum": 1, "default": 50 }
      }
    },
    "responses": {
      "CustomerResponse": {
        "description": "Customer record.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Customer" }
          }
        }
      },
      "CustomerUpdateResponse": {
        "description": "Updated customer.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/CustomerUpdateResult" }
          }
        }
      },
      "SuccessFlagResponse": {
        "description": "The operation completed.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/SuccessFlag" }
          }
        }
      },
      "InventoryCreateResponse": {
        "description": "Inventory item creation result.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/InventoryCreateResult" }
          }
        }
      },
      "InventoryUpdateResponse": {
        "description": "Inventory item update result.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/InventoryUpdateResult" }
          }
        }
      },
      "PurchaseOrderListResponse": {
        "description": "Purchase orders.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/PurchaseOrderList" }
          }
        }
      },
      "PurchaseOrderCreateResponse": {
        "description": "Created draft purchase order.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PurchaseOrderCreateResult"
            }
          }
        }
      },
      "PurchaseOrderResponse": {
        "description": "Purchase order with its items.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/PurchaseOrderDetails" }
          }
        }
      },
      "PurchaseOrderUpdateResponse": {
        "description": "Updated purchase order.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PurchaseOrderUpdateResult"
            }
          }
        }
      },
      "InventoryTransferResponse": {
        "description": "Per-item inventory transfer results.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/InventoryTransferResult" }
          }
        }
      },
      "SupplierResponse": {
        "description": "Supplier record.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Supplier" }
          }
        }
      },
      "InvoiceListResponse": {
        "description": "Invoices.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/InvoiceList" }
          }
        }
      },
      "InvoiceResponse": {
        "description": "Invoice record.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/InvoiceResult" }
          }
        }
      },
      "TradeInListResponse": {
        "description": "Trade-in devices.",
        "content": {
          "application/json": {
            "schema": {
              "type": "array",
              "items": { "$ref": "#/components/schemas/TradeInDevice" }
            }
          }
        }
      },
      "TradeInCreateResponse": {
        "description": "Created trade-in inventory items and device links.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/TradeInCreateResult" }
          }
        }
      },
      "CheckinSearchResponse": {
        "description": "Matching check-in tickets.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/CheckinSearchResult" }
          }
        }
      },
      "CheckinCreateResponse": {
        "description": "Created check-in ticket.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/CheckinCreateResult" }
          }
        }
      },
      "CheckinUpdateResponse": {
        "description": "Updated check-in ticket.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/CheckinUpdateResult" }
          }
        }
      },
      "CheckinDeleteResponse": {
        "description": "Deleted check-in ticket.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/CheckinDeleteResult" }
          }
        }
      },
      "CheckinNoteResponse": {
        "description": "Created check-in ticket note.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/CheckinNote" }
          }
        }
      },
      "BadRequest": {
        "description": "Invalid query parameters or request body.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "Unauthorized": {
        "description": "The X-Api-Key header is missing or invalid.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" },
            "example": "Unauthorized"
          }
        }
      },
      "Forbidden": {
        "description": "The authenticated store cannot perform this operation.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "NotFound": {
        "description": "The requested store-scoped resource was not found.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with an existing resource.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      },
      "RateLimited": {
        "description": "The store has exceeded 60 authenticated public API requests in the rolling 60-second window.",
        "headers": {
          "Retry-After": {
            "description": "Seconds until another request should be attempted.",
            "schema": { "type": "integer", "minimum": 1 }
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "X-RateLimit-Reset": { "$ref": "#/components/headers/RateLimitReset" }
        },
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/RateLimitError" }
          }
        }
      },
      "ServerError": {
        "description": "Unexpected server error.",
        "content": {
          "application/json": {
            "schema": { "$ref": "#/components/schemas/Error" }
          }
        }
      }
    },
    "schemas": {
      "Error": {
        "description": "Public API errors may be a JSON string or an object, depending on the resource handler.",
        "oneOf": [
          { "type": "string" },
          {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "error": { "type": "string" },
              "message": { "type": "string" },
              "success": { "type": "boolean" }
            }
          }
        ]
      },
      "RateLimitError": {
        "type": "object",
        "required": ["error", "retryAfter"],
        "properties": {
          "error": {
            "type": "string",
            "const": "Too many requests. Please try again later."
          },
          "retryAfter": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "Store": {
        "type": "object",
        "required": ["id", "plan", "createdAt", "updatedAt"],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string" },
          "locationName": { "type": ["string", "null"] },
          "plan": { "type": "string" },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "CustomerInput": {
        "type": "object",
        "required": [
          "firstName",
          "lastName",
          "company",
          "primaryPhone",
          "contactPhone",
          "storeCredit",
          "preferredContactMethods",
          "billingAgent",
          "taxExempt",
          "postalCode",
          "street1",
          "street2",
          "country",
          "state",
          "city"
        ],
        "properties": {
          "firstName": { "type": "string" },
          "lastName": { "type": "string" },
          "company": { "type": "string" },
          "primaryPhone": {
            "type": "string",
            "description": "E.164 phone number."
          },
          "contactPhone": {
            "type": ["string", "null"],
            "description": "E.164 phone number."
          },
          "email": { "type": "string" },
          "driversLicense": { "type": "string" },
          "identificationType": { "type": ["string", "null"] },
          "identificationPhotoKey": { "type": ["string", "null"] },
          "identificationExpiresAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "storeCredit": { "type": "number", "description": "Dollars." },
          "preferredContactMethods": {
            "type": "array",
            "items": { "type": "string" }
          },
          "billingAgent": { "type": "string" },
          "netTerms": { "type": ["number", "null"] },
          "taxExempt": { "type": "boolean" },
          "postalCode": { "type": "string" },
          "referralSourceId": { "type": ["integer", "null"] },
          "street1": { "type": "string" },
          "street2": { "type": "string" },
          "country": { "type": "string" },
          "state": { "type": "string" },
          "city": { "type": "string" }
        }
      },
      "CustomerUpdate": {
        "allOf": [{ "$ref": "#/components/schemas/CustomerInput" }],
        "description": "Customer fields accepted by the update handler. Supply the complete customer representation used by the Customers documentation."
      },
      "Customer": {
        "allOf": [
          { "$ref": "#/components/schemas/CustomerInput" },
          {
            "type": "object",
            "required": ["id", "fullName"],
            "properties": {
              "id": { "type": "string" },
              "fullName": { "type": "string" }
            }
          }
        ]
      },
      "InventoryItemInput": {
        "type": "object",
        "required": [
          "sku",
          "manufacturer",
          "category",
          "type",
          "name",
          "cost",
          "inventoried",
          "serialized",
          "isRebate",
          "taxFree",
          "instock",
          "condition",
          "price"
        ],
        "properties": {
          "groupingId": { "type": "integer" },
          "sku": { "type": "string" },
          "manufacturer": { "type": "string" },
          "category": { "type": "string" },
          "type": { "type": "string" },
          "name": { "type": "string" },
          "cost": { "type": "number", "description": "Dollars." },
          "price": { "type": "number", "description": "Dollars." },
          "inventoried": { "type": "boolean" },
          "serialized": { "type": "boolean" },
          "isRebate": { "type": "boolean" },
          "taxFree": { "type": "boolean" },
          "instock": { "type": "number" },
          "condition": { "type": "string" },
          "supplierId": { "type": "string" },
          "serialNum": { "type": "string" },
          "allLocations": { "type": "boolean" },
          "billingCycleDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3650
          },
          "billingDayOfMonth": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31
          },
          "billingIntervalMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          },
          "color": { "type": "string" },
          "storage": { "type": "string" },
          "carrier": { "type": "string" }
        }
      },
      "InventoryItemUpdate": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "category": { "type": "string" },
          "type": { "type": "string" },
          "sku": { "type": "string" },
          "manufacturer": { "type": "string" },
          "name": { "type": "string" },
          "instock": { "type": "number" },
          "condition": { "type": "string" },
          "bin": { "type": "string" },
          "supplierId": { "type": ["string", "null"] },
          "price": { "type": "number", "description": "Dollars." },
          "cost": { "type": "number", "description": "Dollars." },
          "isRebate": { "type": "boolean" },
          "taxFree": { "type": "boolean" },
          "note": { "type": "string" },
          "serialNum": { "type": ["string", "null"] },
          "allLocations": { "type": "boolean" },
          "color": { "type": ["string", "null"] },
          "storage": { "type": ["string", "null"] },
          "carrier": { "type": ["string", "null"] },
          "billingCycleDays": {
            "type": ["integer", "null"],
            "minimum": 1,
            "maximum": 3650
          },
          "billingDayOfMonth": {
            "type": ["integer", "null"],
            "minimum": 1,
            "maximum": 31
          },
          "billingIntervalMonths": {
            "type": ["integer", "null"],
            "minimum": 1,
            "maximum": 12
          }
        }
      },
      "InventoryItem": {
        "allOf": [
          { "$ref": "#/components/schemas/InventoryItemUpdate" },
          {
            "type": "object",
            "required": ["id", "sku", "name", "storeId"],
            "additionalProperties": true,
            "properties": {
              "id": { "type": "string" },
              "storeId": { "type": "string" },
              "sku": { "type": "string" },
              "name": { "type": "string" }
            }
          }
        ]
      },
      "InventoryTransferInput": {
        "type": "object",
        "required": ["sourceLocation", "destinationLocation", "items"],
        "properties": {
          "sourceLocation": { "$ref": "#/components/schemas/StoreReference" },
          "destinationLocation": {
            "$ref": "#/components/schemas/StoreReference"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "transferQuantity", "price", "cost"],
              "properties": {
                "id": { "type": "string" },
                "transferQuantity": { "type": "number" },
                "price": { "type": "number", "description": "Dollars." },
                "cost": { "type": "number", "description": "Dollars." }
              }
            }
          }
        }
      },
      "StoreReference": {
        "type": "object",
        "required": ["id", "locationName"],
        "properties": {
          "id": { "type": "string" },
          "locationName": { "type": "string" }
        }
      },
      "PurchaseOrderUpdate": {
        "oneOf": [
          {
            "type": "object",
            "required": ["rush"],
            "properties": { "rush": { "type": "boolean" } }
          },
          {
            "type": "object",
            "required": ["status"],
            "properties": {
              "status": { "type": "string", "enum": ["Ordered", "Reconciled"] }
            }
          },
          {
            "type": "object",
            "properties": {
              "supplierId": { "type": "string" },
              "vendorOrderNumber": { "type": "string" },
              "shipper": { "type": "string" },
              "trackingNumber": { "type": "string" },
              "shippingCost": { "type": "number", "description": "Dollars." },
              "taxes": { "type": "number", "description": "Dollars." },
              "otherCostAdjustments": {
                "type": "number",
                "description": "Dollars."
              },
              "note": { "type": "string" }
            }
          }
        ]
      },
      "SupplierInput": {
        "type": "object",
        "required": ["name"],
        "properties": {
          "name": { "type": "string", "minLength": 1 }
        }
      },
      "Supplier": {
        "type": "object",
        "required": ["id", "name"],
        "properties": {
          "id": { "type": "string" },
          "name": { "type": "string" },
          "orgId": { "type": ["string", "null"] }
        }
      },
      "InvoiceInput": {
        "type": "object",
        "required": [
          "customerId",
          "tax",
          "surchargeAmount",
          "surchargeType",
          "description",
          "recurringType",
          "sendEmail"
        ],
        "properties": {
          "customerId": { "type": "string" },
          "amount": {
            "type": "number",
            "deprecated": true,
            "description": "Deprecated and ignored. The amount is calculated from invoiceItems."
          },
          "tax": { "type": "number", "description": "Dollars." },
          "surchargeAmount": {
            "type": "number",
            "description": "Dollars for FIXED; percentage for PERCENTAGE."
          },
          "surchargeType": {
            "type": "string",
            "enum": ["FIXED", "PERCENTAGE"]
          },
          "description": { "type": "string" },
          "recurringType": {
            "type": "string",
            "enum": [
              "MONTHLY",
              "BIWEEKLY",
              "WEEKLY",
              "ONETIME",
              "QUARTERLY",
              "ANNUALLY",
              "DAILY"
            ]
          },
          "descriptor": { "type": ["string", "null"] },
          "startsFrom": { "type": "string", "format": "date-time" },
          "chargeOn": { "type": "integer" },
          "chargeUntil": { "type": "integer" },
          "invoiceItems": {
            "type": "array",
            "items": { "type": "object", "additionalProperties": true }
          },
          "sendEmail": { "type": "boolean" },
          "shipstationShipmentId": { "type": ["string", "null"] },
          "shipper": { "type": ["string", "null"] },
          "trackingNumber": { "type": ["string", "null"] },
          "labelUrl": { "type": ["string", "null"] }
        }
      },
      "TradeInDeviceInput": {
        "type": "object",
        "required": [
          "item",
          "serialNumber",
          "password",
          "status",
          "deviceType"
        ],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string" },
          "item": { "type": "string" },
          "serialNumber": { "type": "string" },
          "password": { "type": "string" },
          "status": { "type": "string" },
          "deviceType": { "type": "string" },
          "model": { "type": "string" },
          "storage": { "type": "string" },
          "color": { "type": "string" },
          "carrier": { "type": "string" },
          "condition": { "type": ["string", "null"] },
          "note": { "type": ["string", "null"] },
          "quoteValue": {
            "type": ["number", "null"],
            "description": "Dollars."
          },
          "manufacturer": { "type": ["string", "null"] },
          "customName": { "type": ["string", "null"] },
          "customSku": { "type": ["string", "null"] },
          "tradeinQuote": {
            "type": ["object", "null"],
            "additionalProperties": true
          }
        }
      },
      "CheckinTicketInput": {
        "type": "object",
        "description": "Sales or Repair ticket payload. See the database-backed Check-in Ticket API document for the complete discriminator-specific fields.",
        "required": ["type"],
        "additionalProperties": true,
        "properties": {
          "type": { "type": "string", "enum": ["Sales", "Repair"] },
          "customerId": { "type": "string" },
          "checkinItems": {
            "type": "array",
            "items": { "type": "object", "additionalProperties": true }
          },
          "checkinPayments": {
            "type": "array",
            "items": { "type": "object", "additionalProperties": true }
          },
          "checkinDevices": {
            "type": "array",
            "items": { "type": "object", "additionalProperties": true }
          },
          "notToExceed": {
            "type": ["number", "null"],
            "description": "Dollars."
          }
        }
      },
      "CheckinTicketUpdate": {
        "type": "object",
        "minProperties": 1,
        "additionalProperties": true,
        "description": "Fields accepted by the status-change or field-edit modes documented in the Check-in Ticket API article."
      },
      "CheckinNoteInput": {
        "type": "object",
        "required": ["note", "displayOnInvoice"],
        "properties": {
          "note": { "type": "string" },
          "displayOnInvoice": { "type": "boolean" }
        }
      },
      "CheckinNote": {
        "type": "object",
        "required": [
          "id",
          "checkinTicketId",
          "note",
          "displayOnInvoice",
          "createdAt"
        ],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string" },
          "checkinTicketId": { "type": "string" },
          "note": { "type": "string" },
          "displayOnInvoice": { "type": "boolean" },
          "createdAt": { "type": "string", "format": "date-time" },
          "createdBy": {
            "type": ["object", "null"],
            "properties": {
              "name": { "type": ["string", "null"] },
              "email": { "type": ["string", "null"] }
            }
          }
        }
      },
      "SuccessFlag": {
        "type": "object",
        "required": ["success"],
        "properties": {
          "success": { "type": "boolean", "const": true }
        }
      },
      "CustomerUpdateResult": {
        "type": "object",
        "required": ["customer", "success"],
        "properties": {
          "customer": { "$ref": "#/components/schemas/Customer" },
          "success": { "type": "boolean", "const": true }
        }
      },
      "InventoryCreateResult": {
        "oneOf": [
          { "$ref": "#/components/schemas/SuccessFlag" },
          {
            "type": "object",
            "required": ["createdInventoryItem"],
            "properties": {
              "createdInventoryItem": {
                "$ref": "#/components/schemas/InventoryItem"
              }
            }
          }
        ]
      },
      "InventoryUpdateResult": {
        "type": "object",
        "required": [
          "updatedInventoryItem",
          "createdInventoryItem",
          "deletedInventoryItem",
          "revalidate"
        ],
        "properties": {
          "updatedInventoryItem": {
            "$ref": "#/components/schemas/InventoryItem"
          },
          "createdInventoryItem": {
            "oneOf": [
              { "$ref": "#/components/schemas/InventoryItem" },
              { "type": "null" }
            ]
          },
          "deletedInventoryItem": {
            "oneOf": [
              { "$ref": "#/components/schemas/InventoryItem" },
              { "type": "null" }
            ]
          },
          "revalidate": { "type": "boolean" }
        }
      },
      "PurchaseOrder": {
        "type": "object",
        "required": [
          "id",
          "storeId",
          "orderNumber",
          "shippingCost",
          "taxes",
          "otherCostAdjustments",
          "status",
          "createdAt"
        ],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string" },
          "storeId": { "type": "string" },
          "supplierId": { "type": ["string", "null"] },
          "orderNumber": { "type": "integer" },
          "vendorOrderNumber": { "type": "string" },
          "shipper": {
            "type": "string",
            "enum": ["DHL", "FedEx", "UPS", "USPS", "Other"]
          },
          "trackingNumber": { "type": "string" },
          "shippingCost": { "type": "number", "description": "Dollars." },
          "taxes": { "type": "number", "description": "Dollars." },
          "otherCostAdjustments": {
            "type": "number",
            "description": "Dollars."
          },
          "status": {
            "type": "string",
            "enum": ["Draft", "Ordered", "Reconciled"]
          },
          "rush": { "type": "boolean" },
          "note": { "type": "string" },
          "createdAt": { "type": "string", "format": "date-time" },
          "orderedAt": { "type": ["string", "null"], "format": "date-time" },
          "reconciledAt": {
            "type": ["string", "null"],
            "format": "date-time"
          }
        }
      },
      "PurchaseOrderItem": {
        "type": "object",
        "required": [
          "id",
          "inventoryPurchaseOrderId",
          "sku",
          "name",
          "cost",
          "quantity",
          "receivedQty",
          "price"
        ],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string" },
          "inventoryPurchaseOrderId": { "type": "string" },
          "sku": { "type": "string" },
          "name": { "type": "string" },
          "cost": { "type": "number", "description": "Dollars." },
          "quantity": { "type": "integer" },
          "receivedQty": { "type": "integer" },
          "price": { "type": "number", "description": "Dollars." }
        }
      },
      "PurchaseOrderDetails": {
        "allOf": [
          { "$ref": "#/components/schemas/PurchaseOrder" },
          {
            "type": "object",
            "required": ["items"],
            "properties": {
              "items": {
                "type": "array",
                "items": { "$ref": "#/components/schemas/PurchaseOrderItem" }
              }
            }
          }
        ]
      },
      "PurchaseOrderList": {
        "type": "object",
        "required": ["purchaseOrders"],
        "properties": {
          "purchaseOrders": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/PurchaseOrder" }
          }
        }
      },
      "PurchaseOrderCreateResult": {
        "type": "object",
        "required": ["inventoryPurchaseOrder"],
        "properties": {
          "inventoryPurchaseOrder": {
            "$ref": "#/components/schemas/PurchaseOrder"
          }
        }
      },
      "PurchaseOrderUpdateResult": {
        "type": "object",
        "required": ["updatedInventoryPurchaseOrder"],
        "properties": {
          "updatedInventoryPurchaseOrder": {
            "$ref": "#/components/schemas/PurchaseOrderDetails"
          }
        }
      },
      "InventoryTransferResult": {
        "type": "array",
        "items": {
          "type": "object",
          "required": ["id", "success", "errorMsg"],
          "properties": {
            "id": { "type": "string" },
            "success": { "type": "boolean" },
            "errorMsg": { "type": ["string", "null"] }
          }
        }
      },
      "Invoice": {
        "type": "object",
        "required": ["id", "customerId"],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string" },
          "customerId": { "type": "string" },
          "description": { "type": "string" },
          "status": { "type": "string" },
          "tax": { "type": "number", "description": "Dollars." },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "InvoiceList": {
        "type": "object",
        "required": ["success", "invoices"],
        "properties": {
          "success": { "type": "boolean", "const": true },
          "invoices": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/Invoice" }
          }
        }
      },
      "InvoiceResult": {
        "type": "object",
        "required": ["success", "invoice"],
        "properties": {
          "success": { "type": "boolean", "const": true },
          "invoice": { "$ref": "#/components/schemas/Invoice" },
          "emailSent": { "type": "boolean" },
          "emailError": { "type": "string" },
          "warning": {
            "type": "string",
            "description": "Returned when the deprecated amount field was supplied and ignored."
          }
        }
      },
      "TradeInDevice": {
        "allOf": [
          { "$ref": "#/components/schemas/InventoryItem" },
          {
            "type": "object",
            "required": ["model", "deviceType"],
            "properties": {
              "model": { "type": "string" },
              "deviceType": { "type": "string" }
            }
          }
        ]
      },
      "TradeInCreateResult": {
        "type": "object",
        "required": ["createdItems", "deviceInventoryLinks"],
        "properties": {
          "createdItems": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/InventoryItem" }
          },
          "deviceInventoryLinks": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "properties": {
                "inventoryItemId": { "type": "string" },
                "cost": { "type": "number", "description": "Dollars." },
                "salePrice": { "type": "number", "description": "Dollars." }
              }
            }
          }
        }
      },
      "CheckinTicket": {
        "type": "object",
        "required": ["id", "orgId", "ticketNumber", "type", "status"],
        "additionalProperties": true,
        "properties": {
          "id": { "type": "string" },
          "orgId": { "type": "string" },
          "ticketNumber": { "type": "integer" },
          "type": { "type": "string", "enum": ["Sales", "Repair"] },
          "status": { "type": "string" },
          "notToExceed": {
            "type": ["number", "null"],
            "description": "Dollars."
          },
          "createdAt": { "type": "string", "format": "date-time" },
          "updatedAt": { "type": "string", "format": "date-time" }
        }
      },
      "CheckinSearchResult": {
        "type": "object",
        "required": ["tickets"],
        "properties": {
          "tickets": {
            "type": "array",
            "items": { "$ref": "#/components/schemas/CheckinTicket" }
          }
        }
      },
      "CheckinCreateResult": {
        "type": "object",
        "required": ["createdTicket"],
        "properties": {
          "createdTicket": { "$ref": "#/components/schemas/CheckinTicket" }
        }
      },
      "CheckinUpdateResult": {
        "type": "object",
        "required": ["success"],
        "properties": {
          "success": { "type": "boolean", "const": true },
          "updatedTicket": {
            "oneOf": [
              { "$ref": "#/components/schemas/CheckinTicket" },
              { "type": "null" }
            ]
          }
        }
      },
      "CheckinDeleteResult": {
        "type": "object",
        "required": ["success", "deletedTicket"],
        "properties": {
          "success": { "type": "boolean", "const": true },
          "deletedTicket": { "$ref": "#/components/schemas/CheckinTicket" }
        }
      },
      "SendSmsInput": {
        "type": "object",
        "required": ["phone", "message"],
        "properties": {
          "phone": { "type": "string", "description": "E.164 phone number." },
          "message": { "type": "string", "minLength": 1, "maxLength": 1600 },
          "mediaUrls": {
            "type": "array",
            "maxItems": 10,
            "items": { "type": "string", "format": "uri" }
          }
        }
      }
    }
  }
}
